ariesy 修改分页参数 v2

release
yefei 2 years ago
parent 5f09d6763f
commit 2fc056abae
  1. 102
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java

@ -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) {
@ -397,7 +396,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
router.setComponent(sysMenuEntity.getComponent()); router.setComponent(sysMenuEntity.getComponent());
router.setPath(sysMenuEntity.getUrl()); router.setPath(sysMenuEntity.getUrl());
router.setMeta(new MetaVo(sysMenuEntity.getName(), sysMenuEntity.getIcon(), null, router.setMeta(new MetaVo(sysMenuEntity.getName(), sysMenuEntity.getIcon(), null,
sysMenuEntity.isNoCache(), null)); sysMenuEntity.isNoCache(), null));
router.setName(StringUtils.capitalize(sysMenuEntity.getUrl().replaceAll("/", ""))); router.setName(StringUtils.capitalize(sysMenuEntity.getUrl().replaceAll("/", "")));
router.setMenuId(String.valueOf(sysMenuEntity.getMenuId())); router.setMenuId(String.valueOf(sysMenuEntity.getMenuId()));
childrenList.add(router); childrenList.add(router);
@ -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 {
orgCodeList.add(toTaxOrgCode(sysDeptEntity)); TaxOrgCode taxOrgCode = toTaxOrgCode(sysDeptEntity);
if (StringUtils.isNotEmpty(taxOrgCode.getTaxno())) {
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();
orgCode.setTaxno(sysDeptEntity.getTaxno()); if (StringUtils.isNotEmpty(sysDeptEntity.getTaxno())) {
orgCode.setTaxname(sysDeptEntity.getTaxname()); orgCode.setTaxno(sysDeptEntity.getTaxno());
orgCode.setOrgCode(sysDeptEntity.getOrgCode()); orgCode.setTaxname(sysDeptEntity.getTaxname());
orgCode.setCompany(sysDeptEntity.getCompany()); orgCode.setOrgCode(sysDeptEntity.getOrgCode());
orgCode.setAreaCode(sysDeptEntity.getAreaCode()); orgCode.setCompany(sysDeptEntity.getCompany());
orgCode.setIsPassword(sysDeptEntity.getIsPassword()); orgCode.setAreaCode(sysDeptEntity.getAreaCode());
orgCode.setIsPassword(sysDeptEntity.getIsPassword());
}
return orgCode; return orgCode;
} }
@ -562,7 +569,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
public void uploadUser(SysUserEntity user) { public void uploadUser(SysUserEntity user) {
if (SysConfig.ITAX_SWITCH.equals(AdminConfig.itaxSwitch) if (SysConfig.ITAX_SWITCH.equals(AdminConfig.itaxSwitch)
&& SysConfig.UserType.USET_TYPE_2.getCode().equals(user.getUserType())) { && SysConfig.UserType.USET_TYPE_2.getCode().equals(user.getUserType())) {
// 获取部门信息 // 获取部门信息
SysDeptEntity sysDeptEntity = sysDeptService.getById(user.getDeptId()); SysDeptEntity sysDeptEntity = sysDeptService.getById(user.getDeptId());
Map<String, Object> map = new HashMap<>(9); Map<String, Object> map = new HashMap<>(9);
@ -607,9 +614,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
for (SysUserEntity sysUserEntity : userList) { for (SysUserEntity sysUserEntity : userList) {
// 保存用户信息到redis // 保存用户信息到redis
redisUtils.set(RedisConstant.KEY_USER_MENU + sysUserEntity.getLoginname(), redisUtils.set(RedisConstant.KEY_USER_MENU + sysUserEntity.getLoginname(),
this.getUserInfo(sysUserEntity), -1); this.getUserInfo(sysUserEntity), -1);
redisUtils.set(RedisConstant.KEY_USER_TOKEN + sysUserEntity.getLoginname(), redisUtils.set(RedisConstant.KEY_USER_TOKEN + sysUserEntity.getLoginname(),
loginService.infoListRedis(sysUserEntity.getLoginname()), RedisUtils.NOT_EXPIRE); loginService.infoListRedis(sysUserEntity.getLoginname()), RedisUtils.NOT_EXPIRE);
} }
} }
// 刷新显示列表缓存、只刷新中心企业 // 刷新显示列表缓存、只刷新中心企业
@ -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) {
@ -874,20 +872,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
if (menuEntities.size() > 0) { if (menuEntities.size() > 0) {
for (SysMenuEntity sysMenuEntity : menuEntities) { for (SysMenuEntity sysMenuEntity : menuEntities) {
if (0 == sysMenuEntity.getType() if (0 == sysMenuEntity.getType()
&& (sysMenuEntity.getChildren() != null && sysMenuEntity.getChildren().size() > 0)) { && (sysMenuEntity.getChildren() != null && sysMenuEntity.getChildren().size() > 0)) {
List<SysMenuEntity> childrenDirList = sysMenuEntity.getChildren(); List<SysMenuEntity> childrenDirList = sysMenuEntity.getChildren();
if (childrenDirList.size() > 0) { if (childrenDirList.size() > 0) {
for (SysMenuEntity childrenDir : childrenDirList) { for (SysMenuEntity childrenDir : childrenDirList) {
List<SysMenuEntity> childrenMenuList = childrenDir.getChildren(); List<SysMenuEntity> childrenMenuList = childrenDir.getChildren();
if (1 == childrenDir.getType() if (1 == childrenDir.getType()
&& (childrenMenuList != null && childrenMenuList.size() > 0)) { && (childrenMenuList != null && childrenMenuList.size() > 0)) {
for (SysMenuEntity childrenMenu : childrenMenuList) { for (SysMenuEntity childrenMenu : childrenMenuList) {
if (2 == childrenMenu.getType()) { if (2 == childrenMenu.getType()) {
ButtonQueryVo buttonQueryVo = this.toButtonQuery(childrenMenu); ButtonQueryVo buttonQueryVo = this.toButtonQuery(childrenMenu);
childrenMenu.setMeta( childrenMenu.setMeta(
new MetaVo(childrenMenu.getName(), "", buttonQueryVo.getButtonVos(), new MetaVo(childrenMenu.getName(), "", buttonQueryVo.getButtonVos(),
childrenMenu.isNoCache(), buttonQueryVo.getQueryVos())); childrenMenu.isNoCache(), buttonQueryVo.getQueryVos()));
map.put(childrenMenu.getUrl().replaceAll("/", ""), childrenMenu); map.put(childrenMenu.getUrl().replaceAll("/", ""), childrenMenu);
} }

Loading…
Cancel
Save