|
|
@ -63,6 +63,7 @@ import com.epmet.dto.result.demand.IcResiDemandDictDTO; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.dto.result.resi.IcResiNonDynamicResultDTO; |
|
|
|
import com.epmet.dto.result.resi.ResiPortrayalDetailDTO; |
|
|
|
import com.epmet.dto.result.resi.ResiPortrayalResult; |
|
|
|
import com.epmet.dto.result.resi.ResiPortrayalResultDTO; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.enums.RenHuConditionEnum; |
|
|
@ -3914,7 +3915,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ResiPortrayalResultDTO> queryAgeDistribute(String customerId,String staffId,String orgId, String orgType) { |
|
|
|
public ResiPortrayalResult queryAgeDistribute(String customerId, String staffId, String orgId, String orgType) { |
|
|
|
ResiPortrayalResult result=new ResiPortrayalResult(); |
|
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
|
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); |
|
|
|
orgType = OrgTypeEnum.AGENCY.getCode(); |
|
|
@ -3926,15 +3928,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
List<ResiPortrayalResultDTO> resultList=getDefaultAgeDistribute(); |
|
|
|
List<ResiPortrayalResultDTO> list=baseDao.selectAgeAgeDistribute(customerId,orgId,orgType,orgIdPath); |
|
|
|
if(CollectionUtils.isEmpty(list)){ |
|
|
|
return resultList; |
|
|
|
result.setTotal(NumConstant.ZERO); |
|
|
|
result.setList(resultList); |
|
|
|
return result; |
|
|
|
} |
|
|
|
Map<String,Integer> resultMap = list.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi)); |
|
|
|
resultList.forEach(result->{ |
|
|
|
if (MapUtils.isNotEmpty(resultMap) && resultMap.containsKey(result.getCode())) { |
|
|
|
result.setTotalResi(resultMap.get(result.getCode())); |
|
|
|
int total=NumConstant.ZERO; |
|
|
|
for(ResiPortrayalResultDTO resultDto:resultList){ |
|
|
|
if (MapUtils.isNotEmpty(resultMap) && resultMap.containsKey(resultDto.getCode())) { |
|
|
|
resultDto.setTotalResi(resultMap.get(resultDto.getCode())); |
|
|
|
} |
|
|
|
}); |
|
|
|
return resultList; |
|
|
|
total+=resultDto.getTotalResi(); |
|
|
|
} |
|
|
|
result.setTotal(total); |
|
|
|
result.setList(resultList); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
private List<ResiPortrayalResultDTO> getDefaultAgeDistribute() { |
|
|
@ -3978,7 +3986,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ResiPortrayalResultDTO> queryEducationDistribute(String customerId, String staffId, String orgId, String orgType) { |
|
|
|
public ResiPortrayalResult queryEducationDistribute(String customerId, String staffId, String orgId, String orgType) { |
|
|
|
ResiPortrayalResult result=new ResiPortrayalResult(); |
|
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
|
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); |
|
|
|
orgType = OrgTypeEnum.AGENCY.getCode(); |
|
|
@ -3998,7 +4007,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
List<ResiPortrayalResultDTO> totalList = baseDao.queryEducationDistribute(customerId, orgId, orgType,orgIdPath); |
|
|
|
Map<String,Integer> map = totalList.stream().collect(Collectors.toMap(ResiPortrayalResultDTO::getCode,ResiPortrayalResultDTO::getTotalResi)); |
|
|
|
List<ResiPortrayalResultDTO> resultDTOList = new ArrayList<>(); |
|
|
|
dictResult.getData().forEach(dict -> { |
|
|
|
int total=NumConstant.ZERO; |
|
|
|
for (DictListResultDTO dict : dictResult.getData()) { |
|
|
|
ResiPortrayalResultDTO resultDTO = new ResiPortrayalResultDTO(); |
|
|
|
resultDTO.setCode(dict.getValue()); |
|
|
|
resultDTO.setCodeName(dict.getLabel()); |
|
|
@ -4007,8 +4017,11 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
resultDTO.setTotalResi(map.get(dict.getValue())); |
|
|
|
} |
|
|
|
resultDTOList.add(resultDTO); |
|
|
|
}); |
|
|
|
return resultDTOList; |
|
|
|
total += resultDTO.getTotalResi(); |
|
|
|
} |
|
|
|
result.setTotal(total); |
|
|
|
result.setList(resultDTOList); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -4086,5 +4099,38 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<ResiPortrayalDetailDTO> queryPortrayalResiListForExport(String customerId, String staffId, |
|
|
|
Integer pageNo, Integer pageSize, |
|
|
|
String orgId, String orgType, |
|
|
|
String codeType, |
|
|
|
String code) { |
|
|
|
// 获取文化程度字典
|
|
|
|
DictListFormDTO dictFormDTO = new DictListFormDTO(); |
|
|
|
dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); |
|
|
|
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); |
|
|
|
if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败"); |
|
|
|
} |
|
|
|
Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(orgId)) { |
|
|
|
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); |
|
|
|
orgType = OrgTypeEnum.AGENCY.getCode(); |
|
|
|
} |
|
|
|
String orgIdPath=StrConstant.EPMETY_STR; |
|
|
|
if(OrgTypeEnum.AGENCY.getCode().equals(orgType)){ |
|
|
|
orgIdPath=CustomerOrgRedis.getOrgIdPath(orgId,orgType); |
|
|
|
} |
|
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
|
List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code); |
|
|
|
if(CollectionUtils.isNotEmpty(list)){ |
|
|
|
list.forEach(resi -> { |
|
|
|
// 学历名称
|
|
|
|
resi.setEducationName(educationMap.get(resi.getEducationCode())); |
|
|
|
}); |
|
|
|
} |
|
|
|
PageInfo<ResiPortrayalDetailDTO> pageInfo = new PageInfo<>(list); |
|
|
|
return new PageData<>(list, pageInfo.getTotal(), pageSize); |
|
|
|
} |
|
|
|
} |
|
|
|