|
|
@ -3,7 +3,9 @@ package com.epmet.dataaggre.service.epmetuser.impl; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
|
|
import com.epmet.commons.tools.dto.form.IdAndNameDTO; |
|
|
|
|
|
import com.epmet.commons.tools.enums.OrgTypeEnum; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.constant.BadgeConstant; |
|
|
import com.epmet.constant.BadgeConstant; |
|
|
@ -19,6 +21,7 @@ import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; |
|
|
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO; |
|
|
|
|
|
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO; |
|
|
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; |
|
|
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; |
|
|
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; |
|
|
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; |
|
|
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; |
|
|
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; |
|
|
@ -531,8 +534,26 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
result.setAgencyName(agencyDTO.getOrganizationName()); |
|
|
result.setAgencyName(agencyDTO.getOrganizationName()); |
|
|
String fromOrgType = govOrgService.getStaffFromOrgType(staffId); |
|
|
StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId); |
|
|
|
|
|
String fromOrgType = OrgTypeEnum.AGENCY.getCode(); |
|
|
|
|
|
if (fromOrgTypeDto != null){ |
|
|
|
|
|
fromOrgType = fromOrgTypeDto.getOrgType(); |
|
|
|
|
|
result.setFromOrgId(fromOrgTypeDto.getOrgId()); |
|
|
|
|
|
} |
|
|
result.setFromOrgType(fromOrgType); |
|
|
result.setFromOrgType(fromOrgType); |
|
|
|
|
|
boolean isContinueMkName = true; |
|
|
|
|
|
StringBuilder showNameBuilder = new StringBuilder(16); |
|
|
|
|
|
if (OrgTypeEnum.AGENCY.getCode().equals(fromOrgType)){ |
|
|
|
|
|
String allParentName = agencyDTO.getAllParentName(); |
|
|
|
|
|
if (StringUtils.isNotBlank(allParentName)){ |
|
|
|
|
|
showNameBuilder.append(allParentName.substring(allParentName.lastIndexOf(StrConstant.HYPHEN)+NumConstant.ONE)); |
|
|
|
|
|
showNameBuilder.append(StrConstant.HYPHEN); |
|
|
|
|
|
showNameBuilder.append(agencyDTO.getOrganizationName()); |
|
|
|
|
|
isContinueMkName = false; |
|
|
|
|
|
}else{ |
|
|
|
|
|
showNameBuilder.append(agencyDTO.getOrganizationName()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
List<StaffRoleResultDTO> roleList = govStaffRoleDao.getStaffRoleList(staffId); |
|
|
List<StaffRoleResultDTO> roleList = govStaffRoleDao.getStaffRoleList(staffId); |
|
|
Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName)); |
|
|
Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName)); |
|
|
@ -543,6 +564,9 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
List<IdAndNameDTO> idAndNameList = new ArrayList<>(); |
|
|
List<IdAndNameDTO> idAndNameList = new ArrayList<>(); |
|
|
for (CustomerGridDTO customerGridDTO : list) { |
|
|
for (CustomerGridDTO customerGridDTO : list) { |
|
|
IdAndNameDTO grid = new IdAndNameDTO(); |
|
|
IdAndNameDTO grid = new IdAndNameDTO(); |
|
|
|
|
|
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&grid.getId().equals(result.getFromOrgId())){ |
|
|
|
|
|
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(grid.getName()); |
|
|
|
|
|
} |
|
|
grid.setId(customerGridDTO.getId()); |
|
|
grid.setId(customerGridDTO.getId()); |
|
|
grid.setName(customerGridDTO.getGridName()); |
|
|
grid.setName(customerGridDTO.getGridName()); |
|
|
idAndNameList.add(grid); |
|
|
idAndNameList.add(grid); |
|
|
@ -552,14 +576,17 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId); |
|
|
List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId); |
|
|
idAndNameList = new ArrayList<>(); |
|
|
idAndNameList = new ArrayList<>(); |
|
|
for (CustomerDepartmentDTO org : deptList) { |
|
|
for (CustomerDepartmentDTO org : deptList) { |
|
|
IdAndNameDTO grid = new IdAndNameDTO(); |
|
|
IdAndNameDTO dept = new IdAndNameDTO(); |
|
|
grid.setId(org.getId()); |
|
|
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){ |
|
|
grid.setName(org.getDepartmentName()); |
|
|
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName()); |
|
|
idAndNameList.add(grid); |
|
|
} |
|
|
|
|
|
dept.setId(org.getId()); |
|
|
|
|
|
dept.setName(org.getDepartmentName()); |
|
|
|
|
|
idAndNameList.add(dept); |
|
|
} |
|
|
} |
|
|
result.setDeptList(idAndNameList); |
|
|
result.setDeptList(idAndNameList); |
|
|
|
|
|
//特殊处理 显示的名字
|
|
|
|
|
|
result.setTwoOrgName(showNameBuilder.toString()); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|