|
|
@@ -13,6 +13,7 @@ import com.hz.pm.api.sys.model.entity.Role; |
|
|
|
import com.hz.pm.api.sys.model.entity.UserRole; |
|
|
|
import com.hz.pm.api.sys.service.IUserRoleService; |
|
|
|
import com.hz.pm.api.user.helper.MhUnitCache; |
|
|
|
import com.hz.pm.api.user.model.dto.UnitDTO; |
|
|
|
import com.hz.pm.api.user.model.entity.UserInfo; |
|
|
|
import com.hz.pm.api.user.model.enumeration.RoleEnum; |
|
|
|
import com.hz.pm.api.user.model.enumeration.UserAvailableEnum; |
|
|
@@ -76,8 +77,29 @@ public class UserInfoHelperImpl implements UserInfoHelper { |
|
|
|
.collect(Collectors.toList()); |
|
|
|
userFullInfo.setUserRoleList(roleMapper.selectBatchIds(roleIdList)); |
|
|
|
} |
|
|
|
List<Long> viewUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.COUNTY_PARENT_UNIT_ID); |
|
|
|
userFullInfo.setIsCountyUser(viewUnitIds.contains(userInfo.getMhUnitId())); |
|
|
|
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 (!userFullInfo.getIsCitySoeUser()) { |
|
|
|
// 是否关键行业部门下用户 |
|
|
|
List<Long> keyIndustryUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.KEY_INDUSTRY_UNIT_ID); |
|
|
|
userFullInfo.setIsKeyIndustryUser(keyIndustryUnitIds.contains(userInfo.getMhUnitId())); |
|
|
|
if (!userFullInfo.getIsKeyIndustryUser()) { |
|
|
|
// 是否区县部门下用户 |
|
|
|
List<Long> countyUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.COUNTY_PARENT_UNIT_ID); |
|
|
|
userFullInfo.setIsCountyUser(countyUnitIds.contains(userInfo.getMhUnitId())); |
|
|
|
if (!userFullInfo.getIsCountyUser()) { |
|
|
|
// 是否市本级用户 |
|
|
|
List<Long> cityDistrictUnitIds = mhUnitCache.getViewChildIdsRecursion(MhUnitConst.CITY_DISTRICT_UNIT_ID); |
|
|
|
userFullInfo.setIsCityDistrictUser(cityDistrictUnitIds.contains(userInfo.getMhUnitId())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 装配返回 |
|
|
|
userFullInfo.setUserId(userInfo.getId()); |
|
|
|
userFullInfo.setMhUserId(userInfo.getMhUserId()); |
|
|
@@ -109,7 +131,7 @@ public class UserInfoHelperImpl implements UserInfoHelper { |
|
|
|
return userInfos.stream().map(this::convert).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
private UserFullInfoDTO convert(UserInfo userInfo){ |
|
|
|
private UserFullInfoDTO convert(UserInfo userInfo) { |
|
|
|
UserFullInfoDTO userFullInfo = new UserFullInfoDTO(); |
|
|
|
// 装配返回 |
|
|
|
userFullInfo.setMhUnitName(userInfo.getMhUnitName()); |
|
|
@@ -168,7 +190,7 @@ public class UserInfoHelperImpl implements UserInfoHelper { |
|
|
|
.exists("select 1 from nd_user_role nur where nur.user_id = nd_user_info.id" + |
|
|
|
" and nur.role_id = {0}", role.getId()); |
|
|
|
List<UserInfo> userInfos = userInfoService.list(query); |
|
|
|
return CollUtils.convert(userInfos,this::convert); |
|
|
|
return CollUtils.convert(userInfos, this::convert); |
|
|
|
} |
|
|
|
|
|
|
|
} |