main
tamguo 7 years ago
parent f1bb51f251
commit 957dc48d0f

@ -1,11 +1,5 @@
package com.tamguo.config.shiro;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
@ -18,12 +12,8 @@ import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import com.tamguo.modules.sys.model.SysMenuEntity;
import com.tamguo.modules.sys.model.SysUserEntity;
import com.tamguo.modules.sys.model.enums.SysUserStatusEnum;
import com.tamguo.modules.sys.service.ISysMenuService;
import com.tamguo.modules.sys.service.ISysUserService;
/**
@ -31,8 +21,6 @@ import com.tamguo.modules.sys.service.ISysUserService;
*
*/
public class UserRealm extends AuthorizingRealm {
@Autowired
private ISysMenuService sysMenuService;
@Autowired
private ISysUserService sysUserService;
@ -42,27 +30,8 @@ public class UserRealm extends AuthorizingRealm {
*/
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
SysUserEntity user = (SysUserEntity)principals.getPrimaryPrincipal();
String userId = user.getId();
List<String> permsList = null;
List<SysMenuEntity> menuList = sysMenuService.getUserMenuList(userId);
permsList = new ArrayList<>();
for(SysMenuEntity menu : menuList){
permsList.add(menu.getPerms());
}
//用户权限列表
Set<String> permsSet = new HashSet<String>();
for(String perms : permsList){
if(StringUtils.isEmpty(perms)){
continue;
}
permsSet.addAll(Arrays.asList(perms.trim().split(",")));
}
SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
info.setStringPermissions(permsSet);
// info.setStringPermissions(permsSet);
return info;
}
@ -77,7 +46,7 @@ public class UserRealm extends AuthorizingRealm {
String password = new String((char[]) token.getCredentials());
//查询用户信息
SysUserEntity user = sysUserService.queryByUserName(username);
SysUserEntity user = sysUserService.queryByLoginCode(username);
//账号不存在
if(user == null) {

@ -11,7 +11,7 @@ import com.tamguo.modules.sys.model.condition.SysUserCondition;
public interface SysUserMapper extends SuperMapper<SysUserEntity>{
SysUserEntity queryByUserName(String username);
SysUserEntity queryByLoginCode(@Param(value="loginCode")String loginCode);
List<SysUserEntity> queryPage(@Param(value="userName")String userName , Page<SysUserEntity> page);

@ -1,13 +1,11 @@
package com.tamguo.modules.sys.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.tamguo.modules.sys.model.enums.SysCompanyStatusEnum;
/**
* The persistent class for the sys_company database table.
@ -17,90 +15,188 @@ import com.tamguo.modules.sys.model.enums.SysCompanyStatusEnum;
public class SysCompanyEntity implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String name;
private String companyCode;
private String areaCode;
private String companyName;
private String corpCode;
private String corpName;
private String createBy;
private Date createDate;
private String fullName;
private String type;
private String parentCode;
private String parentCodes;
private String remarks;
private String parentId;
private Boolean isLeaf;
private Integer treeLevel;
private String status;
private String treeLeaf;
private BigDecimal treeLevel;
private String treeNames;
private BigDecimal treeSort;
private String treeSorts;
private String updateBy;
private Date updateDate;
private String viewCode;
@JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
private SysCompanyStatusEnum status;
public SysCompanyEntity() {
}
@TableField(exist=false)
private String parentName;
public String getCompanyCode() {
return this.companyCode;
}
public String getName() {
return name;
public void setCompanyCode(String companyCode) {
this.companyCode = companyCode;
}
public void setName(String name) {
this.name = name;
public String getAreaCode() {
return this.areaCode;
}
public void setAreaCode(String areaCode) {
this.areaCode = areaCode;
}
public String getCompanyName() {
return this.companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getCorpCode() {
return this.corpCode;
}
public void setCorpCode(String corpCode) {
this.corpCode = corpCode;
}
public String getCorpName() {
return this.corpName;
}
public void setCorpName(String corpName) {
this.corpName = corpName;
}
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return this.createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getFullName() {
return fullName;
return this.fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getType() {
return type;
public String getParentCode() {
return this.parentCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public void setType(String type) {
this.type = type;
public String getParentCodes() {
return this.parentCodes;
}
public static long getSerialversionuid() {
return serialVersionUID;
public void setParentCodes(String parentCodes) {
this.parentCodes = parentCodes;
}
public String getRemarks() {
return remarks;
return this.remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public Integer getTreeLevel() {
return treeLevel;
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getTreeLeaf() {
return this.treeLeaf;
}
public void setTreeLeaf(String treeLeaf) {
this.treeLeaf = treeLeaf;
}
public BigDecimal getTreeLevel() {
return this.treeLevel;
}
public void setTreeLevel(Integer treeLevel) {
public void setTreeLevel(BigDecimal treeLevel) {
this.treeLevel = treeLevel;
}
public Boolean getIsLeaf() {
return isLeaf;
public String getTreeNames() {
return this.treeNames;
}
public void setIsLeaf(Boolean isLeaf) {
this.isLeaf = isLeaf;
public void setTreeNames(String treeNames) {
this.treeNames = treeNames;
}
public Date getUpdateDate() {
return updateDate;
public BigDecimal getTreeSort() {
return this.treeSort;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
public void setTreeSort(BigDecimal treeSort) {
this.treeSort = treeSort;
}
public SysCompanyStatusEnum getStatus() {
return status;
public String getTreeSorts() {
return this.treeSorts;
}
public void setStatus(SysCompanyStatusEnum status) {
this.status = status;
public void setTreeSorts(String treeSorts) {
this.treeSorts = treeSorts;
}
public String getParentName() {
return parentName;
public String getUpdateBy() {
return this.updateBy;
}
public void setParentName(String parentName) {
this.parentName = parentName;
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public String getId() {
return id;
public Date getUpdateDate() {
return this.updateDate;
}
public void setId(String id) {
this.id = id;
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public String getParentId() {
return parentId;
public String getViewCode() {
return this.viewCode;
}
public void setParentId(String parentId) {
this.parentId = parentId;
public void setViewCode(String viewCode) {
this.viewCode = viewCode;
}
}

@ -1,49 +1,182 @@
package com.tamguo.modules.sys.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.tamguo.config.dao.SuperEntity;
import com.tamguo.modules.sys.model.enums.SysUserStatusEnum;
/**
* The persistent class for the reaps_sys_user database table.
* The persistent class for the sys_user database table.
*
*/
@TableName(value="sys_user")
public class SysUserEntity extends SuperEntity<SysUserEntity> implements Serializable {
public class SysUserEntity implements Serializable {
private static final long serialVersionUID = 1L;
private String userName;
private String nickName;
private String name;
private String mobile;
private String userCode;
private String avatar;
private String corpCode;
private String corpName;
private String createBy;
private Date createDate;
private String email;
private String freezeCause;
private Date freezeDate;
private Date lastLoginDate;
private String lastLoginIp;
private String loginCode;
private String mgrType;
private String mobile;
private String mobileImei;
private String password;
private String roleIds;
private String companyId;
private String companyIds;
private Date createDate;
private String phone;
private Date pwdQuestUpdateDate;
private String pwdQuestion;
private String pwdQuestion2;
private String pwdQuestion3;
private String pwdQuestionAnswer;
private String pwdQuestionAnswer2;
private String pwdQuestionAnswer3;
private BigDecimal pwdSecurityLevel;
private Date pwdUpdateDate;
private String pwdUpdateRecord;
private String refCode;
private String refName;
private String remarks;
private String sex;
private String sign;
private SysUserStatusEnum status;
private String updateBy;
private Date updateDate;
private String userName;
private String userType;
private BigDecimal userWeight;
private String wxOpenid;
@JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
private SysUserStatusEnum status;
public SysUserEntity() {
}
private String safeKeyValue;
private Long createTime;
public String getUserCode() {
return this.userCode;
}
@TableField(exist=false)
private List<String> roleIdList;
public void setUserCode(String userCode) {
this.userCode = userCode;
}
@TableField(exist=false)
private String companyName;
public String getAvatar() {
return this.avatar;
}
public SysUserEntity() {
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public String getCorpCode() {
return this.corpCode;
}
public void setCorpCode(String corpCode) {
this.corpCode = corpCode;
}
public String getCorpName() {
return this.corpName;
}
public void setCorpName(String corpName) {
this.corpName = corpName;
}
public String getCreateBy() {
return this.createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateDate() {
return this.createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFreezeCause() {
return this.freezeCause;
}
public void setFreezeCause(String freezeCause) {
this.freezeCause = freezeCause;
}
public Date getFreezeDate() {
return this.freezeDate;
}
public void setFreezeDate(Date freezeDate) {
this.freezeDate = freezeDate;
}
public Date getLastLoginDate() {
return this.lastLoginDate;
}
public void setLastLoginDate(Date lastLoginDate) {
this.lastLoginDate = lastLoginDate;
}
public String getLastLoginIp() {
return this.lastLoginIp;
}
public void setLastLoginIp(String lastLoginIp) {
this.lastLoginIp = lastLoginIp;
}
public String getLoginCode() {
return this.loginCode;
}
public void setLoginCode(String loginCode) {
this.loginCode = loginCode;
}
public String getMgrType() {
return this.mgrType;
}
public void setMgrType(String mgrType) {
this.mgrType = mgrType;
}
public String getMobile() {
return this.mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getMobileImei() {
return this.mobileImei;
}
public void setMobileImei(String mobileImei) {
this.mobileImei = mobileImei;
}
public String getPassword() {
@ -54,125 +187,188 @@ public class SysUserEntity extends SuperEntity<SysUserEntity> implements Seriali
this.password = password;
}
public String getRoleIds() {
return this.roleIds;
public String getPhone() {
return this.phone;
}
public void setRoleIds(String roleIds) {
this.roleIds = roleIds;
public void setPhone(String phone) {
this.phone = phone;
}
public String getUserName() {
return userName;
public Date getPwdQuestUpdateDate() {
return this.pwdQuestUpdateDate;
}
public void setUserName(String userName) {
this.userName = userName;
public void setPwdQuestUpdateDate(Date pwdQuestUpdateDate) {
this.pwdQuestUpdateDate = pwdQuestUpdateDate;
}
public String getNickName() {
return nickName;
public String getPwdQuestion() {
return this.pwdQuestion;
}
public void setNickName(String nickName) {
this.nickName = nickName;
public void setPwdQuestion(String pwdQuestion) {
this.pwdQuestion = pwdQuestion;
}
public String getMobile() {
return mobile;
public String getPwdQuestion2() {
return this.pwdQuestion2;
}
public void setMobile(String mobile) {
this.mobile = mobile;
public void setPwdQuestion2(String pwdQuestion2) {
this.pwdQuestion2 = pwdQuestion2;
}
public String getEmail() {
return email;
public String getPwdQuestion3() {
return this.pwdQuestion3;
}
public void setEmail(String email) {
this.email = email;
public void setPwdQuestion3(String pwdQuestion3) {
this.pwdQuestion3 = pwdQuestion3;
}
public Long getCreateTime() {
return createTime;
public String getPwdQuestionAnswer() {
return this.pwdQuestionAnswer;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
public void setPwdQuestionAnswer(String pwdQuestionAnswer) {
this.pwdQuestionAnswer = pwdQuestionAnswer;
}
public List<String> getRoleIdList() {
return roleIdList;
public String getPwdQuestionAnswer2() {
return this.pwdQuestionAnswer2;
}
public void setRoleIdList(List<String> roleIdList) {
this.roleIdList = roleIdList;
public void setPwdQuestionAnswer2(String pwdQuestionAnswer2) {
this.pwdQuestionAnswer2 = pwdQuestionAnswer2;
}
public String getSafeKeyValue() {
return safeKeyValue;
public String getPwdQuestionAnswer3() {
return this.pwdQuestionAnswer3;
}
public void setSafeKeyValue(String safeKeyValue) {
this.safeKeyValue = safeKeyValue;
public void setPwdQuestionAnswer3(String pwdQuestionAnswer3) {
this.pwdQuestionAnswer3 = pwdQuestionAnswer3;
}
public SysUserStatusEnum getStatus() {
return status;
public BigDecimal getPwdSecurityLevel() {
return this.pwdSecurityLevel;
}
public void setStatus(SysUserStatusEnum status) {
this.status = status;
public void setPwdSecurityLevel(BigDecimal pwdSecurityLevel) {
this.pwdSecurityLevel = pwdSecurityLevel;
}
public Date getPwdUpdateDate() {
return this.pwdUpdateDate;
}
public void setPwdUpdateDate(Date pwdUpdateDate) {
this.pwdUpdateDate = pwdUpdateDate;
}
public String getPwdUpdateRecord() {
return this.pwdUpdateRecord;
}
public void setPwdUpdateRecord(String pwdUpdateRecord) {
this.pwdUpdateRecord = pwdUpdateRecord;
}
public String getName() {
return name;
public String getRefCode() {
return this.refCode;
}
public void setName(String name) {
this.name = name;
public void setRefCode(String refCode) {
this.refCode = refCode;
}
public String getCompanyName() {
return companyName;
public String getRefName() {
return this.refName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
public void setRefName(String refName) {
this.refName = refName;
}
public String getCompanyId() {
return companyId;
public String getRemarks() {
return this.remarks;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getSex() {
return this.sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getSign() {
return this.sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public SysUserStatusEnum getStatus() {
return this.status;
}
public void setStatus(SysUserStatusEnum status) {
this.status = status;
}
public String getUpdateBy() {
return this.updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateDate() {
return updateDate;
return this.updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
public Date getCreateDate() {
return createDate;
public String getUserName() {
return this.userName;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserType() {
return this.userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public BigDecimal getUserWeight() {
return this.userWeight;
}
public String getCompanyIds() {
return companyIds;
public void setUserWeight(BigDecimal userWeight) {
this.userWeight = userWeight;
}
public void setCompanyIds(String companyIds) {
this.companyIds = companyIds;
public String getWxOpenid() {
return this.wxOpenid;
}
public void setWxOpenid(String wxOpenid) {
this.wxOpenid = wxOpenid;
}
}

@ -2,6 +2,7 @@ package com.tamguo.modules.sys.service;
import java.util.List;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.service.IService;
import com.tamguo.modules.sys.model.SysCompanyEntity;
import com.tamguo.modules.sys.model.condition.SysCompanyCondition;
@ -9,7 +10,7 @@ import com.tamguo.modules.sys.model.condition.SysCompanyCondition;
public interface ISysCompanyService extends IService<SysCompanyEntity>{
/** 公司树形结构*/
List<SysCompanyEntity> treeData(String excludeId);
JSONArray treeData(String excludeId);
/** 查询公司列表*/
List<SysCompanyEntity> listData(SysCompanyCondition condition);

@ -1,65 +0,0 @@
package com.tamguo.modules.sys.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.plugins.Page;
import com.tamguo.modules.sys.model.SysMenuEntity;
public interface ISysMenuService {
/**
*
* @param userId
* @return
*/
List<SysMenuEntity> getUserMenuList(String userId);
/**
*
* @param menus
* @return
*/
List<SysMenuEntity> getUserMenuTree(List<SysMenuEntity> menus);
/**
*
* @param hashMap
* @param page
* @param limit
* @return
*/
Page<SysMenuEntity> queryList(Map<String, Object> hashMap, Page<SysMenuEntity> page);
/**
*
* @return
*/
List<SysMenuEntity> queryNotButtonList();
/**
*
* @param parentId
* @return
*/
SysMenuEntity select(String parentId);
/**
*
* @param menu
*/
void save(SysMenuEntity menu);
/**
*
* @param menu
*/
void update(SysMenuEntity menu);
/**
*
* @param menuIds
*/
void deleteBatch(String[] menuIds);
}

@ -6,7 +6,7 @@ import com.tamguo.modules.sys.model.condition.SysUserCondition;
public interface ISysUserService {
public SysUserEntity queryByUserName(String username);
public SysUserEntity queryByLoginCode(String loginCode);
public Page<SysUserEntity> listData(SysUserCondition condition);
}

@ -4,7 +4,10 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tamguo.modules.sys.dao.SysCompanyMapper;
@ -20,10 +23,14 @@ public class SysCompanyServiceImpl extends ServiceImpl<SysCompanyMapper, SysComp
@SuppressWarnings("unchecked")
@Override
public List<SysCompanyEntity> treeData(String excludeId) {
List<SysCompanyEntity> companyList = sysCompanyMapper.selectList(Condition.create().notLike("parent_ids", excludeId).ne("id", excludeId));
return companyList;
public JSONArray treeData(String excludeId) {
List<SysCompanyEntity> companyList = null;
if(StringUtils.isEmpty(excludeId)) {
companyList = sysCompanyMapper.selectList(Condition.EMPTY);
}else {
companyList = sysCompanyMapper.selectList(Condition.create().notLike("parent_codes", excludeId).ne("company_code", excludeId));
}
return turnZTreeData(companyList);
}
@Override
@ -36,4 +43,22 @@ public class SysCompanyServiceImpl extends ServiceImpl<SysCompanyMapper, SysComp
return sysCompanyMapper.selectByCode(code);
}
private JSONArray turnZTreeData(List<SysCompanyEntity> companyList) {
if(companyList != null) {
JSONArray nodes = new JSONArray();
for(int i=0 ; i<companyList.size() ; i++) {
JSONObject node = new JSONObject();
SysCompanyEntity company = companyList.get(i);
node.put("name", company.getCompanyName());
node.put("id", company.getCompanyCode());
node.put("pId", company.getParentCode());
node.put("title", company.getFullName());
nodes.add(node);
}
return nodes;
}
return null;
}
}

@ -1,117 +0,0 @@
package com.tamguo.modules.sys.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.tamguo.modules.sys.dao.SysMenuMapper;
import com.tamguo.modules.sys.dao.SysRoleMapper;
import com.tamguo.modules.sys.dao.SysUserMapper;
import com.tamguo.modules.sys.model.SysMenuEntity;
import com.tamguo.modules.sys.model.SysRoleEntity;
import com.tamguo.modules.sys.model.SysUserEntity;
import com.tamguo.modules.sys.service.ISysMenuService;
@Service
public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenuEntity> implements ISysMenuService {
@Autowired
private SysMenuMapper sysMenuMapper;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private SysRoleMapper sysRoleMapper;
@Override
public List<SysMenuEntity> getUserMenuList(String userId) {
SysUserEntity user = sysUserMapper.selectById(userId);
List<String> roleIds = Arrays.asList(user.getRoleIds().split(","));
// 获取用户角色
List<SysRoleEntity> roles = sysRoleMapper.selectBatchIds(roleIds);
// 有权限的菜单
List<String> menuIds = new ArrayList<>();
if(!CollectionUtils.isEmpty(roles)) {
for(int i=0 ; i<roles.size() ; i++) {
SysRoleEntity role = roles.get(i);
if(!StringUtils.isEmpty(role.getPerms())) {
List<String> mIds = Arrays.asList(role.getPerms().split(","));
menuIds.addAll(mIds);
}
}
}
List<SysMenuEntity> menuList = sysMenuMapper.selectBatchIds(menuIds);
return menuList;
}
public List<SysMenuEntity> getUserMenuTree(List<SysMenuEntity> menus){
List<SysMenuEntity> pMenuList = new ArrayList<>();
for(int i=0 ; i<menus.size() ; i++) {
SysMenuEntity menu = menus.get(i);
if(menu.getParentId().equals("0")) {
pMenuList.add(menu);
}
}
// 支持二级菜单
for(int i=0 ; i<pMenuList.size() ; i++) {
SysMenuEntity pMenu = pMenuList.get(i);
List<SysMenuEntity> childMenus = new ArrayList<>();
for(int k=0 ; k<menus.size() ; k++) {
SysMenuEntity cMenu = menus.get(k);
if(cMenu.getParentId().toString().equals(pMenu.getId())) {
childMenus.add(cMenu);
}
}
pMenu.setMenuList(childMenus);
}
return pMenuList;
}
@Transactional(readOnly=true)
@Override
public Page<SysMenuEntity> queryList(Map<String, Object> hashMap, Page<SysMenuEntity> page) {
List<SysMenuEntity> pageList = (List<SysMenuEntity>) sysMenuMapper.queryList(hashMap , page);
page.setRecords(pageList);
return page;
}
@Override
public List<SysMenuEntity> queryNotButtonList() {
return sysMenuMapper.queryNotButtonList();
}
@Override
public SysMenuEntity select(String parentId) {
return sysMenuMapper.queryByUid(parentId);
}
@Transactional(readOnly=false)
@Override
public void save(SysMenuEntity menu) {
sysMenuMapper.insert(menu);
}
@Transactional(readOnly=false)
@Override
public void update(SysMenuEntity menu) {
sysMenuMapper.updateById(menu);
}
@Transactional(readOnly=false)
@Override
public void deleteBatch(String[] menuIds) {
sysMenuMapper.deleteBatchIds(Arrays.asList(menuIds));
}
}

@ -19,8 +19,8 @@ public class SysUserServiceImpl implements ISysUserService{
@Transactional(readOnly=false)
@Override
public SysUserEntity queryByUserName(String username) {
return sysUserMapper.queryByUserName(username);
public SysUserEntity queryByLoginCode(String loginCode) {
return sysUserMapper.queryByLoginCode(loginCode);
}

@ -20,8 +20,8 @@ public class ShiroUtils {
return (SysUserEntity)SecurityUtils.getSubject().getPrincipal();
}
public static String getId() {
return getUser().getId();
public static String getUserCode() {
return getUser().getUserCode();
}
public static void setSessionAttribute(Object key, Object value) {

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSONArray;
import com.tamguo.modules.sys.model.SysCompanyEntity;
import com.tamguo.modules.sys.model.condition.SysCompanyCondition;
import com.tamguo.modules.sys.service.ISysCompanyService;
@ -50,7 +51,7 @@ public class CompanyController {
@RequestMapping(path="treeData")
@ResponseBody
public List<SysCompanyEntity> treeData(String excludeId) {
public JSONArray treeData(String excludeId) {
return iSysCompanyService.treeData(excludeId);
}
}

@ -4,23 +4,14 @@
<select id="listData" resultType="SysCompanyEntity">
SELECT
c.id,
c.parent_id,
c.is_leaf,
c.tree_level,
c.name,
c.full_name,
c.type,
c.remarks,
c.update_date,
c.status
c.*
FROM
sys_company c
<where>
1 = 1
<choose>
<when test="parentCode != null and parentCode != ''">
and c.parent_id = #{parentCode}
and c.parent_code = #{parentCode}
</when>
<otherwise>
and c.tree_level = 0
@ -31,21 +22,10 @@
<select id="selectByCode" resultType="SysCompanyEntity">
SELECT
c.id,
c.parent_id,
c.is_leaf,
c.tree_level,
c.name,
c.full_name,
c.type,
c.update_date,
c.create_date,
c.`status`,
cp.name as parent_name
c.*
FROM
sys_company c
LEFT JOIN sys_company cp on cp.id = c.parent_id
WHERE
c.id = #{id}
c.company_code = #{id}
</select>
</mapper>

@ -2,64 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tamguo.modules.sys.dao.SysUserMapper">
<select id="queryByUserName" resultType="SysUserEntity">
<select id="queryByLoginCode" resultType="SysUserEntity">
SELECT
u.id,
u.user_name,
u.role_ids,
u.password,
u.status,
u.nick_name,
u.mobile,
u.email
u.*
FROM
sys_user u
WHERE
u.user_name = #{username}
u.login_code = #{loginCode}
</select>
<select id="listData" resultType="SysUserEntity">
SELECT
u.id,
u.user_name,
u.name,
u.role_ids,
u.company_id,
c.name as company_name,
u.password,
u.status,
u.nick_name,
u.mobile,
u.email,
u.update_date,
u.create_date
u.*
FROM
sys_user u
LEFT JOIN sys_company c ON u.company_id = c.id
<where>
1 = 1
<if test="userName != null and userName != ''">
and u.user_name = #{userName}
</if>
<if test="nickName != null and nickName != ''">
and u.nick_name like #{nickName}
</if>
<if test="name != null and name != ''">
and u.nick_name like #{nickName}
</if>
<if test="companyCode != null and companyCode != ''">
and u.company_ids like #{companyCode}
</if>
<if test="email != null and email != ''">
and u.email = #{email}
</if>
<if test="mobile != null and mobile != ''">
and u.mobile = #{mobile}
</if>
<if test="status != null and status != ''">
and u.status = #{status}
</if>
</where>
</select>
</mapper>

@ -5,19 +5,19 @@ content="no-cache, no-store, must-revalidate"/><meta name="description" content=
content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/><meta
content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<title>用户管理 - JeeSite Demo</title>
<script src="http://localhost/global.min.js?ctx=/js/a"></script>
<script src="http://localhost/jquery/jquery-1.12.4.min.js"></script>
<script src="http://localhost/jquery/jquery-migrate-1.4.1.min.js"></script>
<script th:src="${setting.domain + 'global.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-1.12.4.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-migrate-1.4.1.min.js'}"></script>
<!--[if lt IE 9]><script src="http://localhost/common/h5fix.min.js"></script><![endif]-->
<link rel="stylesheet" href="http://localhost/fonts/font-icons.min.css">
<link rel="stylesheet" href="http://localhost/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="http://localhost/select2/4.0/select2.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/icheck/1.0/minimal/grey.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/jquery-ztree/3.5/css/metro/zTreeStyle.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/jquery-plugins/jquery.layout-latest.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/adminlte/css/AdminLTE.min.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/common/jeesite.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/common/common.css?V4.0-07201614">
<link rel="stylesheet" th:href="${setting.domain + 'fonts/font-icons.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'bootstrap/css/bootstrap.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'select2/4.0/select2.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'icheck/1.0/minimal/grey.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'jquery-ztree/3.5/css/metro/zTreeStyle.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'jquery-plugins/jquery.layout-latest.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'adminlte/css/AdminLTE.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/jeesite.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/common.css'}">
</head><body class="hold-transition ">
<div class="ui-layout-west">
<div class="main-content">
@ -45,18 +45,18 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
</div>
<a id="scroll-up" href="#" class="btn btn-sm"><i class="fa fa-angle-double-up"></i></a>
<script src="http://localhost/bootstrap/js/bootstrap.min.js"></script>
<script src="http://localhost/select2/4.0/select2.js?V4.0-07201614"></script>
<script src="http://localhost/select2/4.0/i18n/zh_CN.js?V4.0-07201614"></script>
<script src="http://localhost/layer/3.1/layer.js?V4.0-07201614"></script>
<script src="http://localhost/my97/WdatePicker.js?V4.0-07201614"></script>
<script src="http://localhost/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js?V4.0-07201614"></script>
<script src="http://localhost/jquery/jquery-ui-draggable-1.12.1.min.js?V4.0-07201614"></script>
<script src="http://localhost/jquery/jquery-ui-effect-1.12.1.min.js?V4.0-07201614"></script>
<script src="http://localhost/jquery-plugins/jquery.layout-latest.js?V4.0-07201614"></script>
<script src="http://localhost/common/jeesite.js?V4.0-07201614"></script>
<script src="http://localhost/common/i18n/jeesite_zh_CN.js?V4.0-07201614"></script>
<script src="http://localhost/common/common.js?V4.0-07201614"></script>
<script th:src="${setting.domain + 'bootstrap/js/bootstrap.min.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/select2.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/i18n/zh_CN.js'}"></script>
<script th:src="${setting.domain + 'layer/3.1/layer.js'}"></script>
<script th:src="${setting.domain + 'my97/WdatePicker.js'}"></script>
<script th:src="${setting.domain + 'jquery-ztree/3.5/js/jquery.ztree.all-3.5.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-ui-draggable-1.12.1.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-ui-effect-1.12.1.min.js'}"></script>
<script th:src="${setting.domain + 'jquery-plugins/jquery.layout-latest.js'}"></script>
<script th:src="${setting.domain + 'common/jeesite.js'}"></script>
<script th:src="${setting.domain + 'common/i18n/jeesite_zh_CN.js'}"></script>
<script th:src="${setting.domain + 'common/common.js'}"></script>
<script>
// 初始化布局
$('body').layout({
@ -65,7 +65,7 @@ $('body').layout({
// 主页框架
var win = $("#mainFrame")[0].contentWindow;
// 树结构初始化加载
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData: {enable: true,idKey: "id",pIdKey: "parentId",rootPId: "",enable:true},key: {url:"nourl"}},
var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData: {enable: true},key: {url:"nourl"}},
callback:{onClick:function(event, treeId, treeNode){
tree.expandNode(treeNode);
win.$('input[type=reset]').click();
@ -74,7 +74,7 @@ var setting = {view:{selectedMulti:false},data:{key:{title:"title"},simpleData:
win.page();
}}
}, tree, loadTree = function(){
js.ajaxSubmit("http://localhost/sys/company/treeData?___t=" + new Date().getTime(), {ctrlPermi:'2'/*1拥有的权限 2管理的权限*/}, function(data){
js.ajaxSubmit(ctx + "sys/company/treeData?___t=" + new Date().getTime(), {ctrlPermi:'2'/*1拥有的权限 2管理的权限*/}, function(data){
tree = $.fn.zTree.init($("#tree"), setting, data);//.expandAll(true);
// 展开第一级节点
var nodes = tree.getNodesByParam("level", 0);

@ -5,18 +5,18 @@ content="no-cache, no-store, must-revalidate"/><meta name="description" content=
content="no-cache" http-equiv="Pragma"/><meta http-equiv="Expires" content="0"/><meta
content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<title>用户管理 - JeeSite Demo</title>
<script src="/global.min.js?ctx=/js/a"></script>
<script src="http://localhost/jquery/jquery-1.12.4.min.js"></script>
<script src="http://localhost/jquery/jquery-migrate-1.4.1.min.js"></script>
<!--[if lt IE 9]><script src="http://localhost/common/h5fix.min.js"></script><![endif]-->
<link rel="stylesheet" href="http://localhost/fonts/font-icons.min.css">
<link rel="stylesheet" href="http://localhost/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="http://localhost/select2/4.0/select2.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/icheck/1.0/minimal/grey.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/jqGrid/4.7/css/ui.jqgrid.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/adminlte/css/AdminLTE.min.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/common/jeesite.css?V4.0-07201614">
<link rel="stylesheet" href="http://localhost/common/common.css?V4.0-07201614">
<script th:src="${setting.domain + 'global.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-1.12.4.min.js'}"></script>
<script th:src="${setting.domain + 'jquery/jquery-migrate-1.4.1.min.js'}"></script>
<!--[if lt IE 9]><script src="/js/static/common/h5fix.min.js"></script><![endif]-->
<link rel="stylesheet" th:href="${setting.domain + 'fonts/font-icons.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'bootstrap/css/bootstrap.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'select2/4.0/select2.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'icheck/1.0/minimal/grey.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'jqGrid/4.7/css/ui.jqgrid.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'adminlte/css/AdminLTE.min.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/jeesite.css'}">
<link rel="stylesheet" th:href="${setting.domain + 'common/common.css'}">
</head><body class="hold-transition ">
<div class="wrapper"><div class="main-content">
<div class="box box-main">
@ -43,13 +43,13 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<div class="form-group">
<label class="control-label">账号:</label>
<div class="control-inline">
<input type="text" id="userName" name="userName" value="" maxlength="100" class="form-control width-90"/>
<input type="text" id="loginCode" name="loginCode" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-group">
<label class="control-label">昵称:</label>
<div class="control-inline">
<input type="text" id="nickName" name="nickName" value="" maxlength="100" class="form-control width-90"/>
<input type="text" id="userName" name="userName" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-group">
@ -64,21 +64,114 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<input type="text" id="mobile" name="mobile" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-group">
<label class="control-label">电话:</label>
<div class="control-inline">
<input type="text" id="phone" name="phone" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-row"></div>
<div class="form-group">
<label class="control-label">姓名:</label>
<div class="control-inline">
<input type="text" id="name" name="name" value="" maxlength="100" class="form-control width-90"/>
<input type="text" id="refName" name="refName" value="" maxlength="100" class="form-control width-90"/>
</div>
</div>
<div class="form-group">
<label class="control-label">机构:</label>
<div class="control-inline width-90">
<div class="input-group treeselect" id="officeDiv" data-url="sys/office/treeData">
<input id="officeCode" type="hidden" name="employee.office.officeCode" value="" class="isReset"/>
<input id="officeName" type="text" name="employee.office.officeName" value=""
class="form-control " readonly="readonly"
/><span class="input-group-btn"><a id="officeButton" href="javascript:"
class="btn btn-default btn-sm"><i class="fa fa-search"></i></a>
</span>
</div>
<script>
$("#officeButton,#officeName").click(function(){
if ($("#officeButton").hasClass("disabled")){
return true;
}
var options = {
type: 2,
maxmin: true,
shadeClose: true,
title: '机构选择',
area: ['300px', '400px'],
content: 'sys/treeselect',
contentFormData: {
url: $('#officeDiv').attr('data-url'),
checkbox: 'false',
expandLevel: '-1',
selectCodes: $("#officeCode").val(),
isReturnValue: 'false'
},
success: function(layero, index){
if ($(js.layer.window).width() < 300
|| $(js.layer.window).height() < 400){
js.layer.full(index);
}
},
btn: ['<i class="fa fa-check"></i> 确定'],
btn1: function(index, layero){
var win = js.layer.iframeWindow(index);
win.$('#keyword').val('').change(); var codes = [], names = [], nodes;
if ("false" == "true"){
nodes = win.tree.getCheckedNodes(true);
}else{
nodes = win.tree.getSelectedNodes();
}
for(var i=0; i<nodes.length; i++) {
if (nodes[i].level == 0 && nodes[i].isParent){
js.showMessage("不能选择根节点("+nodes[i].name+")请重新选择。");
return false;
}
var code = nodes[i]['false'=='true'?'value':'id'], name = nodes[i]['name'];
codes.push(code.replace(/^u_/g,''));
names.push(name.replace(/\([0-9]*\)/g,''));
break;
}
if(typeof treeselectCheck == 'function'){
if (!treeselectCheck('office', nodes)){
return false;
}
}
$("#officeCode").val(codes.join(',')).change();
$("#officeName").val(names.join(',')).change();
try { $('#officeCode,#officeName').valid(); }catch(e){}
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'ok', index, layero, nodes);
}
}
};
options.btn.push('<i class="fa fa-eraser"></i> 清除');
options['btn'+options.btn.length] = function(index, layero){
$("#officeCode").val('').change();
$("#officeName").val('').change();
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'clear', index, layero);
}
};
options.btn.push('<i class="fa fa-close"></i> 关闭');
options['btn'+options.btn.length] = function(index, layero){
if(typeof treeselectCallback == 'function'){
treeselectCallback('office', 'cancel', index, layero);
}
};
js.layer.open(options);
});
</script> </div>
</div>
<div class="form-group">
<label class="control-label">公司:</label>
<div class="control-inline width-90">
<div class="input-group treeselect" id="companyDiv" data-url="sys/company/treeData?">
<input id="companyCode" type="hidden" name="companyCode" value="" class="isReset"/>
<input id="companyName" type="text" name="companyName" value="" class="form-control" readonly="readonly"/>
<span class="input-group-btn">
<a id="companyButton" href="javascript:" class="btn btn-default btn-sm"><i class="fa fa-search"></i></a>
<div class="input-group treeselect" id="companyDiv" data-url="sys/company/treeData">
<input id="companyCode" type="hidden" name="employee.company.companyCode" value="" class="isReset"/>
<input id="companyName" type="text" name="employee.company.companyName" value=""
class="form-control " readonly="readonly"
/><span class="input-group-btn"><a id="companyButton" href="javascript:"
class="btn btn-default btn-sm"><i class="fa fa-search"></i></a>
</span>
</div>
<script>
@ -92,7 +185,7 @@ $("#companyButton,#companyName").click(function(){
shadeClose: true,
title: '公司选择',
area: ['300px', '400px'],
content: ctx + 'sys/treeselect',
content: '/js/tags/treeselect',
contentFormData: {
url: $('#companyDiv').attr('data-url'),
checkbox: 'false',
@ -120,7 +213,7 @@ $("#companyButton,#companyName").click(function(){
js.showMessage("不能选择根节点("+nodes[i].name+")请重新选择。");
return false;
}
var code = nodes[i]['id'], name = nodes[i]['name'];
var code = nodes[i]['false'=='true'?'value':'id'], name = nodes[i]['name'];
codes.push(code.replace(/^u_/g,''));
names.push(name.replace(/\([0-9]*\)/g,''));
break;
@ -168,7 +261,7 @@ $("#companyButton,#companyName").click(function(){
<div class="control-inline width-90">
<select id="status" name="status" class="form-control">
<option value="">&nbsp;</option><option value="normal">正常</option><option value="disabled">停用</option><option value="locked">锁定</option></select> </div>
<option value="">&nbsp;</option><option value="0">正常</option><option value="2">停用</option><option value="3">冻结</option></select> </div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-sm">查询</button>
@ -183,41 +276,35 @@ $("#companyButton,#companyName").click(function(){
</div>
<a id="scroll-up" href="#" class="btn btn-sm"><i class="fa fa-angle-double-up"></i></a>
<script src="http://localhost/bootstrap/js/bootstrap.min.js"></script>
<script src="http://localhost/select2/4.0/select2.js?V4.0-07201614"></script>
<script src="http://localhost/select2/4.0/i18n/zh_CN.js?V4.0-07201614"></script>
<script src="http://localhost/layer/3.1/layer.js?V4.0-07201614"></script>
<script src="http://localhost/my97/WdatePicker.js?V4.0-07201614"></script>
<script src="http://localhost/jqGrid/4.7/js/jquery.jqGrid.js?V4.0-07201614"></script>
<script src="http://localhost/jqGrid/4.7/js/jquery.jqGrid.extend.js?V4.0-07201614"></script>
<script src="http://localhost/jqGrid/4.7/js/i18n/zh_CN.js?V4.0-07201614"></script>
<script src="http://localhost/common/jeesite.js?V4.0-07201614"></script>
<script src="http://localhost/common/i18n/jeesite_zh_CN.js?V4.0-07201614"></script>
<script src="http://localhost/common/common.js?V4.0-07201614"></script>
<script th:src="${setting.domain + 'bootstrap/js/bootstrap.min.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/select2.js'}"></script>
<script th:src="${setting.domain + 'select2/4.0/i18n/zh_CN.js'}"></script>
<script th:src="${setting.domain + 'layer/3.1/layer.js'}"></script>
<script th:src="${setting.domain + 'my97/WdatePicker.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/jquery.jqGrid.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/jquery.jqGrid.extend.js'}"></script>
<script th:src="${setting.domain + 'jqGrid/4.7/js/i18n/zh_CN.js'}"></script>
<script th:src="${setting.domain + 'common/jeesite.js'}"></script>
<script th:src="${setting.domain + 'common/i18n/jeesite_zh_CN.js'}"></script>
<script th:src="${setting.domain + 'common/common.js'}"></script>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
searchForm: $("#searchForm"),
columnModel: [
{header:'登录账号', name:'userName', index:'a.login_code', width:300, align:"center", frozen:true, formatter: function(val, obj, row, act){
{header:'登录账号', name:'loginCode', index:'a.login_code', width:200, align:"center", frozen:true, formatter: function(val, obj, row, act){
return '<a href="/js/a/sys/empUser/form?userCode='+row.userCode+'&op=edit" class="btnList" data-title="编辑用户">'+(val||row.id)+'</a>';
}},
{header:'用户昵称', name:'nickName', index:'a.user_name', width:200, align:"center"},
{header:'员工姓名', name:'name', index:'a.ref_name', width:200, align:"center"},
{header:'归属公司', name:'companyName', index:'c.company_name', width:200, align:"center"},
{header:'用户昵称', name:'userName', index:'a.user_name', width:200, align:"center"},
{header:'员工姓名', name:'refName', index:'a.ref_name', width:200, align:"center"},
{header:'归属机构', name:'employee.office.officeName', index:'o.office_name', width:200, align:"center"},
{header:'归属公司', name:'employee.company.companyName', index:'c.company_name', width:200, align:"center"},
{header:'电子邮箱', name:'email', index:'a.email', width:200, align:"center"},
{header:'手机号码', name:'mobile', index:'a.mobile', width:200, align:"center"},
{header:'办公电话', name:'phone', index:'a.phone', width:200, align:"center"},
{header:'更新时间', name:'updateDate', index:'a.update_date', width:200, align:"center"},
{header:'状态', name:'status', index:'a.status', width:140, align:"center", formatter: function(val, obj, row, act){
if(val == "normal"){
return '正常';
}else if(val == "locked"){
return '锁定';
}else if(val == "disable"){
return '禁用';
}else{
return '未知';
}
return js.getDictLabel([{"id":"1019065439174938624","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":20,"treeSorts":"0000000020,","treeNames":"正常","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065439174938624","dictLabelOrig":"正常","dictType":"sys_status","cssStyle":"","description":"","dictValue":"0","dictLabel":"正常","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065439330127872","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":30,"treeSorts":"0000000030,","treeNames":"删除","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065439330127872","dictLabelOrig":"删除","dictType":"sys_status","cssStyle":"color:#f00;","description":"","dictValue":"1","dictLabel":"删除","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065439481122816","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":40,"treeSorts":"0000000040,","treeNames":"停用","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065439481122816","dictLabelOrig":"停用","dictType":"sys_status","cssStyle":"color:#f00;","description":"","dictValue":"2","dictLabel":"停用","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065439699226624","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":50,"treeSorts":"0000000050,","treeNames":"冻结","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065439699226624","dictLabelOrig":"冻结","dictType":"sys_status","cssStyle":"color:#fa0;","description":"","dictValue":"3","dictLabel":"冻结","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065439875387392","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":60,"treeSorts":"0000000060,","treeNames":"待审","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065439875387392","dictLabelOrig":"待审","dictType":"sys_status","cssStyle":"","description":"","dictValue":"4","dictLabel":"待审","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065440022188032","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":70,"treeSorts":"0000000070,","treeNames":"驳回","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065440022188032","dictLabelOrig":"驳回","dictType":"sys_status","cssStyle":"","description":"","dictValue":"5","dictLabel":"驳回","parentCode":"0","isRoot":true,"isTreeLeaf":true},{"id":"1019065440210931712","status":"0","createBy":"system","createDate":"2018-07-17 11:45","updateDate":"2018-07-17 11:45","updateBy":"system","treeLevel":0,"parentCodes":"0,","treeSort":80,"treeSorts":"0000000080,","treeNames":"草稿","treeLeaf":"1","isSys":"1","cssClass":"","dictCode":"1019065440210931712","dictLabelOrig":"草稿","dictType":"sys_status","cssStyle":"color:#aaa;","description":"","dictValue":"9","dictLabel":"草稿","parentCode":"0","isRoot":true,"isTreeLeaf":true}], val, '未知', true);
}},
{header:'操作', name:'actions', width:260, sortable:false, title:false, formatter: function(val, obj, row, act){
var actions = [];

Loading…
Cancel
Save