Browse Source

modify:

1. 用户单位查询报错修改;
tags/24110101
WendyYang 1 month ago
parent
commit
89256f149d
1 changed files with 22 additions and 20 deletions
  1. +22
    -20
      hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java

+ 22
- 20
hz-pm-api/src/main/java/com/hz/pm/api/common/helper/impl/UserInfoHelperImpl.java View File

@@ -78,26 +78,28 @@ public class UserInfoHelperImpl implements UserInfoHelper {
.collect(Collectors.toList());
userFullInfo.setUserRoleList(roleMapper.selectBatchIds(roleIdList));
}
UnitDTO unit = mhUnitCache.getById(userInfo.getMhUnitId());
if (unit != null && unit.getType() != null) {
userFullInfo.setUnitStrip(unit.getType().getStrip().getCode());
// 是否市属国有企业下用户
List<Long> citySoeUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.CITY_SOE_UNIT_ID);
userFullInfo.setIsCitySoeUser(citySoeUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsCitySoeUser())) {
// 是否关键行业部门下用户
List<Long> keyIndustryUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.KEY_INDUSTRY_UNIT_ID);
userFullInfo.setIsKeyIndustryUser(keyIndustryUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsKeyIndustryUser())) {
// 是否区县部门下用户
List<Long> countyUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.COUNTY_PARENT_UNIT_ID);
userFullInfo.setIsCountyUser(countyUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsCountyUser())) {
// 是否市本级用户
List<Long> cityDistrictUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.CITY_DISTRICT_UNIT_ID);
userFullInfo.setIsCityDistrictUser(cityDistrictUnitIds.contains(userInfo.getMhUnitId()));
} else {
userFullInfo.setIsCountyXcbUser(unit.getName().contains(MhUnitConst.UNIT_XCB));
if (userInfo.getMhUnitId() != null) {
UnitDTO unit = mhUnitCache.getById(userInfo.getMhUnitId());
if (unit != null && unit.getType() != null) {
userFullInfo.setUnitStrip(unit.getType().getStrip().getCode());
// 是否市属国有企业下用户
List<Long> citySoeUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.CITY_SOE_UNIT_ID);
userFullInfo.setIsCitySoeUser(citySoeUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsCitySoeUser())) {
// 是否关键行业部门下用户
List<Long> keyIndustryUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.KEY_INDUSTRY_UNIT_ID);
userFullInfo.setIsKeyIndustryUser(keyIndustryUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsKeyIndustryUser())) {
// 是否区县部门下用户
List<Long> countyUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.COUNTY_PARENT_UNIT_ID);
userFullInfo.setIsCountyUser(countyUnitIds.contains(userInfo.getMhUnitId()));
if (Boolean.FALSE.equals(userFullInfo.getIsCountyUser())) {
// 是否市本级用户
List<Long> cityDistrictUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.CITY_DISTRICT_UNIT_ID);
userFullInfo.setIsCityDistrictUser(cityDistrictUnitIds.contains(userInfo.getMhUnitId()));
} else {
userFullInfo.setIsCountyXcbUser(unit.getName().contains(MhUnitConst.UNIT_XCB));
}
}
}
}


Loading…
Cancel
Save