Commit 5597883b authored by yangyang's avatar yangyang

fix(编辑企业信息): 新增手动刷新用户组的接口

parent 49632525
......@@ -2419,6 +2419,9 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
List<RegUnitInfo> regUnitInfos = regUnitInfoService.lambdaQuery().in(RegUnitInfo::getAdminUserId, adminUserIdList).list();
List<TzBaseEnterpriseInfo> enterpriseInfos = baseEnterpriseInfoService.lambdaQuery().in(TzBaseEnterpriseInfo::getUseUnitCode, adminUserIdList).list();
Map<String, TzBaseEnterpriseInfo> enterpriseInfoMap = enterpriseInfos.stream().collect(Collectors.toMap(TzBaseEnterpriseInfo::getUseUnitCode, x -> x, (oldValue, newValue) -> newValue));
for (RegUnitInfo regUnitInfo : regUnitInfos) {
String useCode = regUnitInfo.getUnitCode();
CompanyModel companyInfo = Privilege.companyClient.queryByCompanyCode(useCode).getResult();
......@@ -2427,20 +2430,19 @@ public class TzsUserInfoServiceImpl extends BaseService<TzsUserInfoDto, TzsUserI
Map<Long, List<RoleModel>> orgRoles = new HashMap<>();
List<RoleModel> userRoleList = new ArrayList<>();
List<Long> roleIds = new ArrayList<>();
Set<String> roleNameSet = new HashSet<>();
FeignClientResult<List<RoleModel>> roleListResult = Privilege.roleClient.queryRoleList(null, null);
List<RoleModel> roleModels = roleListResult.getResult();
List<DataDictionary> unitTypeList = regUnitInfoService.setAndGetUnitTypeList();
String[] unitTypeCodes = regUnitInfo.getUnitTypeCode().split(",");
TzBaseEnterpriseInfo baseEnterpriseInfo = enterpriseInfoMap.get(regUnitInfo.getUnitCode());
String[] unitTypes = baseEnterpriseInfo.getUnitType().split("#");
FeignClientResult<AgencyUserModel> userResult = Privilege.agencyUserClient.queryByUserId(regUnitInfo.getAdminUserId());
AgencyUserModel agencyUserModel = userResult.getResult();
Map<String, DataDictionary> dataDictionaryMap = unitTypeList.stream().collect(Collectors.toMap(DataDictionary::getCode, Function.identity(), (k1, k2) -> k1));
for (String typeCode : unitTypeCodes) {
DataDictionary unitType = dataDictionaryMap.get(typeCode);
Map<String, DataDictionary> dataDictionaryMap = unitTypeList.stream().collect(Collectors.toMap(DataDictionary::getName, Function.identity(), (k1, k2) -> k1));
for (String type : unitTypes) {
DataDictionary unitType = dataDictionaryMap.get(type);
String appCode = unitType.getTypeDesc() != null ? unitType.getTypeDesc() : "";
String[] appCodes = appCode.split(",");
Collections.addAll(appCodesSet, appCodes);
roleNameSet.add(unitType.getName());
userRoleList.addAll(roleModels.stream()
.filter(r -> unitType.getExtend().contains(r.getSequenceNbr().toString())).collect(Collectors.toList()));
userRoleList.forEach(r -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment