|
|
@ -75,18 +75,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PageUtils queryPage(Map<String, Object> params) { |
|
|
|
public PageUtils queryPage(Map<String, Object> params) { |
|
|
|
DynamicContextHolder.push(DbConstant.BASICS_READ); |
|
|
|
DynamicContextHolder.push(DbConstant.BASICS_READ); |
|
|
|
String username = (String)params.get("username"); |
|
|
|
String username = (String) params.get("username"); |
|
|
|
String company = (String)params.get("company"); |
|
|
|
String company = (String) params.get("company"); |
|
|
|
String deptId = (String)params.get("deptId"); |
|
|
|
String deptId = (String) params.get("deptId"); |
|
|
|
String taxno = (String)params.get("taxno"); |
|
|
|
String taxno = (String) params.get("taxno"); |
|
|
|
Integer userType = (Integer)params.get("userType"); |
|
|
|
Integer userType = (Integer) params.get("userType"); |
|
|
|
IPage<SysUserEntity> page = this.page(new Query<SysUserEntity>().getPage(params), |
|
|
|
IPage<SysUserEntity> page = this.page(new Query<SysUserEntity>().getPage(params), |
|
|
|
new QueryWrapper<SysUserEntity>().like(StringUtils.isNotBlank(username), "username", username) |
|
|
|
new QueryWrapper<SysUserEntity>().like(StringUtils.isNotBlank(username), "username", username) |
|
|
|
.eq(StringUtils.isNotBlank(deptId), "dept_id", deptId) |
|
|
|
.eq(StringUtils.isNotBlank(deptId), "dept_id", deptId) |
|
|
|
.eq(StringUtils.isNotBlank(company), "company", company) |
|
|
|
.eq(StringUtils.isNotBlank(company), "company", company) |
|
|
|
.eq(StringUtils.isNotBlank(taxno), "taxno", taxno) |
|
|
|
.eq(StringUtils.isNotBlank(taxno), "taxno", taxno) |
|
|
|
.eq(StringUtils.isNotBlank(taxno), "user_type", userType) |
|
|
|
.eq(StringUtils.isNotBlank(taxno), "user_type", userType) |
|
|
|
.apply(params.get(Constant.SQL_FILTER) != null, (String)params.get(Constant.SQL_FILTER))); |
|
|
|
.apply(params.get(Constant.SQL_FILTER) != null, (String) params.get(Constant.SQL_FILTER))); |
|
|
|
|
|
|
|
|
|
|
|
List<SysUserEntity> records = page.getRecords(); |
|
|
|
List<SysUserEntity> records = page.getRecords(); |
|
|
|
if (records != null && records.size() > 0) { |
|
|
|
if (records != null && records.size() > 0) { |
|
|
@ -285,11 +285,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
} |
|
|
|
} |
|
|
|
//获取组织编码
|
|
|
|
//获取组织编码
|
|
|
|
List<SysCompanyEntity> companyEntitys = sysUserOrgService.getOrgsByUserId(userEntity.getUserId()); |
|
|
|
List<SysCompanyEntity> companyEntitys = sysUserOrgService.getOrgsByUserId(userEntity.getUserId()); |
|
|
|
if (companyEntitys != null && companyEntitys.size() > 0){ |
|
|
|
if (companyEntitys != null && companyEntitys.size() > 0) { |
|
|
|
for (SysCompanyEntity companyEntity : companyEntitys) { |
|
|
|
for (SysCompanyEntity companyEntity : companyEntitys) { |
|
|
|
if (companyEntity != null) { |
|
|
|
if (companyEntity != null) { |
|
|
|
if (StringHelper.isNotBlank(companyEntity.getCompanyCode()) && StringHelper.isNotBlank(companyEntity.getCompanyName())){ |
|
|
|
if (StringHelper.isNotBlank(companyEntity.getCompanyCode()) && StringHelper.isNotBlank(companyEntity.getCompanyName())) { |
|
|
|
String companyName ="("+companyEntity.getCompanyCode()+")"+companyEntity.getCompanyName(); |
|
|
|
String companyName = "(" + companyEntity.getCompanyCode() + ")" + companyEntity.getCompanyName(); |
|
|
|
companyEntity.setCompanyName(companyName); |
|
|
|
companyEntity.setCompanyName(companyName); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -357,8 +357,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 菜单路由转换 |
|
|
|
* 菜单路由转换 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param childPerms |
|
|
|
* @param childPerms 树状菜单信息 |
|
|
|
* 树状菜单信息 |
|
|
|
|
|
|
|
* @return 转换后路由信息 |
|
|
|
* @return 转换后路由信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private List<RouterVo> toRouter(List<SysMenuEntity> childPerms) { |
|
|
|
private List<RouterVo> toRouter(List<SysMenuEntity> childPerms) { |
|
|
@ -454,7 +453,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void toDeptOrgCode(User user, List<TaxOrgCode> orgCodeList, List<SysDeptEntity> queryDept) { |
|
|
|
private void toDeptOrgCode(User user, List<TaxOrgCode> orgCodeList, List<SysDeptEntity> queryDept) { |
|
|
|
log.info("查询到的企业列表为:{}",queryDept); |
|
|
|
log.info("查询到的企业列表为:{}", queryDept); |
|
|
|
String qsStatus = "0"; |
|
|
|
String qsStatus = "0"; |
|
|
|
String productType = "0"; |
|
|
|
String productType = "0"; |
|
|
|
if (queryDept.size() > 0) { |
|
|
|
if (queryDept.size() > 0) { |
|
|
@ -462,15 +461,21 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
for (SysDeptEntity sysDeptEntity : queryDept) { |
|
|
|
for (SysDeptEntity sysDeptEntity : queryDept) { |
|
|
|
String orgCode = sysDeptEntity.getOrgCode(); |
|
|
|
String orgCode = sysDeptEntity.getOrgCode(); |
|
|
|
if (StringUtils.isNotBlank(orgCode) && orgCode.contains("旧")) { |
|
|
|
if (StringUtils.isNotBlank(orgCode) && orgCode.contains("旧")) { |
|
|
|
oldTaxOrgCode.add(toTaxOrgCode(sysDeptEntity)); |
|
|
|
TaxOrgCode taxOrgCode = toTaxOrgCode(sysDeptEntity); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(taxOrgCode.getTaxno())) { |
|
|
|
|
|
|
|
oldTaxOrgCode.add(taxOrgCode); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
TaxOrgCode taxOrgCode = toTaxOrgCode(sysDeptEntity); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(taxOrgCode.getTaxno())) { |
|
|
|
orgCodeList.add(toTaxOrgCode(sysDeptEntity)); |
|
|
|
orgCodeList.add(toTaxOrgCode(sysDeptEntity)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
orgCodeList.addAll(oldTaxOrgCode); |
|
|
|
orgCodeList.addAll(oldTaxOrgCode); |
|
|
|
qsStatus = queryDept.get(0).getQsStatus(); |
|
|
|
qsStatus = queryDept.get(0).getQsStatus(); |
|
|
|
productType = queryDept.get(0).getProductType(); |
|
|
|
productType = queryDept.get(0).getProductType(); |
|
|
|
log.info("orgCodeList:{}",orgCodeList); |
|
|
|
log.info("orgCodeList:{}", orgCodeList); |
|
|
|
user.setOrgCodes(orgCodeList); |
|
|
|
user.setOrgCodes(orgCodeList); |
|
|
|
user.setQsStatus(qsStatus); |
|
|
|
user.setQsStatus(qsStatus); |
|
|
|
user.setProductType(productType); |
|
|
|
user.setProductType(productType); |
|
|
@ -479,12 +484,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
|
|
|
|
|
|
|
|
private TaxOrgCode toTaxOrgCode(SysDeptEntity sysDeptEntity) { |
|
|
|
private TaxOrgCode toTaxOrgCode(SysDeptEntity sysDeptEntity) { |
|
|
|
TaxOrgCode orgCode = new TaxOrgCode(); |
|
|
|
TaxOrgCode orgCode = new TaxOrgCode(); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(sysDeptEntity.getTaxno())) { |
|
|
|
orgCode.setTaxno(sysDeptEntity.getTaxno()); |
|
|
|
orgCode.setTaxno(sysDeptEntity.getTaxno()); |
|
|
|
orgCode.setTaxname(sysDeptEntity.getTaxname()); |
|
|
|
orgCode.setTaxname(sysDeptEntity.getTaxname()); |
|
|
|
orgCode.setOrgCode(sysDeptEntity.getOrgCode()); |
|
|
|
orgCode.setOrgCode(sysDeptEntity.getOrgCode()); |
|
|
|
orgCode.setCompany(sysDeptEntity.getCompany()); |
|
|
|
orgCode.setCompany(sysDeptEntity.getCompany()); |
|
|
|
orgCode.setAreaCode(sysDeptEntity.getAreaCode()); |
|
|
|
orgCode.setAreaCode(sysDeptEntity.getAreaCode()); |
|
|
|
orgCode.setIsPassword(sysDeptEntity.getIsPassword()); |
|
|
|
orgCode.setIsPassword(sysDeptEntity.getIsPassword()); |
|
|
|
|
|
|
|
} |
|
|
|
return orgCode; |
|
|
|
return orgCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -649,8 +656,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建前端路由所需要的菜单 |
|
|
|
* 构建前端路由所需要的菜单 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param menus |
|
|
|
* @param menus 菜单列表 |
|
|
|
* 菜单列表 |
|
|
|
|
|
|
|
* @return 路由列表 |
|
|
|
* @return 路由列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<RouterVo> buildMenus(List<SysMenuEntity> menus) { |
|
|
|
public List<RouterVo> buildMenus(List<SysMenuEntity> menus) { |
|
|
@ -700,8 +706,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 构建前端路由所需要的菜单 |
|
|
|
* 构建前端路由所需要的菜单 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param menus |
|
|
|
* @param menus 菜单列表 |
|
|
|
* 菜单列表 |
|
|
|
|
|
|
|
* @return 路由列表 |
|
|
|
* @return 路由列表 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public List<RouterVo> buildMenusSystem(List<SysMenuEntity> menus) { |
|
|
|
public List<RouterVo> buildMenusSystem(List<SysMenuEntity> menus) { |
|
|
@ -754,8 +759,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 转换按钮信息 |
|
|
|
* 转换按钮信息 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param sysMenuEntity |
|
|
|
* @param sysMenuEntity 菜单信息 |
|
|
|
* 菜单信息 |
|
|
|
|
|
|
|
* @return 按钮信息 |
|
|
|
* @return 按钮信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ButtonQueryVo toButtonQuery(SysMenuEntity sysMenuEntity) { |
|
|
|
public ButtonQueryVo toButtonQuery(SysMenuEntity sysMenuEntity) { |
|
|
@ -782,10 +786,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据父节点的ID获取所有子节点 |
|
|
|
* 根据父节点的ID获取所有子节点 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param list 分类表 |
|
|
|
* 分类表 |
|
|
|
* @param parentId 传入的父节点ID |
|
|
|
* @param parentId |
|
|
|
|
|
|
|
* 传入的父节点ID |
|
|
|
|
|
|
|
* @return String |
|
|
|
* @return String |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -812,10 +814,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 递归列表 |
|
|
|
* 递归列表 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param list |
|
|
|
* @param list 菜单列 |
|
|
|
* 菜单列 |
|
|
|
* @param t 菜单信息 |
|
|
|
* @param t |
|
|
|
|
|
|
|
* 菜单信息 |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void recursionFn(List<SysMenuEntity> list, SysMenuEntity t) { |
|
|
|
private void recursionFn(List<SysMenuEntity> list, SysMenuEntity t) { |
|
|
|
// 得到子节点列表
|
|
|
|
// 得到子节点列表
|
|
|
@ -854,8 +854,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否为系统信息 |
|
|
|
* 是否为系统信息 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param menu |
|
|
|
* @param menu 菜单信息 |
|
|
|
* 菜单信息 |
|
|
|
|
|
|
|
* @return 结果 |
|
|
|
* @return 结果 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isMeunFrame(SysMenuEntity menu) { |
|
|
|
public boolean isMeunFrame(SysMenuEntity menu) { |
|
|
@ -865,8 +864,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 菜单信息 |
|
|
|
* 菜单信息 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param menuEntities |
|
|
|
* @param menuEntities 菜单信息 |
|
|
|
* 菜单信息 |
|
|
|
|
|
|
|
* @return 菜单信息 |
|
|
|
* @return 菜单信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Map<String, SysMenuEntity> toMenuList(List<SysMenuEntity> menuEntities) { |
|
|
|
public Map<String, SysMenuEntity> toMenuList(List<SysMenuEntity> menuEntities) { |
|
|
|