Browse Source

居民画像列表学历sql判断写死

dev
yinzuomei 2 years ago
parent
commit
1f675bf4c4
  1. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  2. 12
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

32
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -4046,13 +4046,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String codeType, String codeType,
String code) { String code) {
// 获取文化程度字典 // 获取文化程度字典
DictListFormDTO dictFormDTO = new DictListFormDTO(); // DictListFormDTO dictFormDTO = new DictListFormDTO();
dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); // dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode());
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); // Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO);
if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) { // if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败"); // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败");
} // }
Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); // Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel));
if (StringUtils.isBlank(orgId)) { if (StringUtils.isBlank(orgId)) {
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
@ -4073,7 +4073,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
list.forEach(resi -> { list.forEach(resi -> {
// 学历名称 // 学历名称
resi.setEducationName(educationMap.get(resi.getEducationCode())); // resi.setEducationName(educationMap.get(resi.getEducationCode()));
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(resi.getGridId()); GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(resi.getGridId());
if (null != gridInfoCache) { if (null != gridInfoCache) {
resi.setGridName(gridInfoCache.getGridNamePath()); resi.setGridName(gridInfoCache.getGridNamePath());
@ -4106,13 +4106,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
String codeType, String codeType,
String code) { String code) {
// 获取文化程度字典 // 获取文化程度字典
DictListFormDTO dictFormDTO = new DictListFormDTO(); /* DictListFormDTO dictFormDTO = new DictListFormDTO();
dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode());
Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); Result<List<DictListResultDTO>> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO);
if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) { if (!dictResult.success() || CollectionUtils.isEmpty(dictResult.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "学历字典获取失败", "学历字典获取失败");
} }
Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel)); Map<String, String> educationMap = dictResult.getData().stream().collect(Collectors.toMap(DictListResultDTO::getValue, DictListResultDTO::getLabel));*/
if (StringUtils.isBlank(orgId)) { if (StringUtils.isBlank(orgId)) {
orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId(); orgId = CustomerStaffRedis.getStaffInfo(customerId, staffId).getAgencyId();
@ -4124,12 +4124,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
} }
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code); List<ResiPortrayalDetailDTO> list = baseDao.selectPortrayalResiList(customerId, orgId, orgType,orgIdPath,codeType, code);
if(CollectionUtils.isNotEmpty(list)){ // if(CollectionUtils.isNotEmpty(list)){
list.forEach(resi -> { // list.forEach(resi -> {
// 学历名称 // // 学历名称
resi.setEducationName(educationMap.get(resi.getEducationCode())); // resi.setEducationName(educationMap.get(resi.getEducationCode()));
}); // });
} // }
PageInfo<ResiPortrayalDetailDTO> pageInfo = new PageInfo<>(list); PageInfo<ResiPortrayalDetailDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal(), pageSize); return new PageData<>(list, pageInfo.getTotal(), pageSize);
} }

12
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -1673,6 +1673,18 @@
( CASE WHEN u.GENDER = '1' THEN '男' WHEN u.GENDER = '2' THEN '女' ELSE '未知' END ) AS genderName, ( CASE WHEN u.GENDER = '1' THEN '男' WHEN u.GENDER = '2' THEN '女' ELSE '未知' END ) AS genderName,
YEAR (NOW())- SUBSTR( u.BIRTHDAY, 1, 4 ) AS age, YEAR (NOW())- SUBSTR( u.BIRTHDAY, 1, 4 ) AS age,
u.CULTURE AS educationCode, u.CULTURE AS educationCode,
(
case when u.CULTURE='0' then '小学及文盲'
when u.CULTURE='1' then '初中'
when u.CULTURE='2' then '高中'
when u.CULTURE='3' then '大专'
when u.CULTURE='4' then '本科'
when u.CULTURE='5' then '硕士'
when u.CULTURE='6' then '博士'
when u.CULTURE='7' then '中专'
else ''
end
)as educationName,
'' AS educationName, '' AS educationName,
IFNULL(u.CULTURE,'')AS educationCode, IFNULL(u.CULTURE,'')AS educationCode,
u.BIRTHDAY AS birthday u.BIRTHDAY AS birthday

Loading…
Cancel
Save