Browse Source

listresi修改

dev_shibei_match
yinzuomei 4 years ago
parent
commit
c02d22664a
  1. 37
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java

37
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/IcResiUserServiceImpl.java

@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.epmetuser.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetuser.IcResiUserDao;
@ -118,11 +119,11 @@ public class IcResiUserServiceImpl implements IcResiUserService {
log.warn("没有配置列表展示列");
return new PageData(new ArrayList(), NumConstant.ZERO);
}
log.warn("列表展示项:"+JSON.toJSONString(resultColumns));
//log.warn("列表展示项:" + JSON.toJSONString(resultColumns));
// 查询列表展示项需要用到哪些子表
// 拼接好的left join table_name on (ic_resi_user.ID=table_name.IC_RESI_USER AND table_name.del_flag='0')
List<String> subTables = customerFootBarService.querySubTables(formDTO.getCustomerId(), formDTO.getFormCode());
log.info("子表:"+JSON.toJSONString(subTables));
//log.info("子表:" + JSON.toJSONString(subTables));
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> icResiUserDao.selectListResiMap(formDTO.getCustomerId(),
formDTO.getFormCode(),
@ -136,14 +137,14 @@ public class IcResiUserServiceImpl implements IcResiUserService {
Set<String> houseIds = new HashSet<>();
for (Map<String, Object> map : list) {
log.warn(JSON.toJSONString(map));
if(map.containsKey("GRID_ID")&& StringUtils.isNotBlank(map.get("GRID_ID").toString())){
if (map.containsKey("GRID_ID") && null != map.get("GRID_ID") && StringUtils.isNotBlank(map.get("GRID_ID").toString())) {
gridIds.add(map.get("GRID_ID").toString());
}
if(map.containsKey("HOME_ID")&& StringUtils.isNotBlank(map.get("HOME_ID").toString())){
if (map.containsKey("HOME_ID") && null != map.get("HOME_ID") && StringUtils.isNotBlank(map.get("HOME_ID").toString())) {
houseIds.add(map.get("HOME_ID").toString());
}
}
log.warn("gridIds:"+JSON.toJSONString(gridIds));
//log.warn("gridIds:" + JSON.toJSONString(gridIds));
List<GridsInfoListResultDTO> gridInfoList = govOrgService.gridListByIds(gridIds);
//log.warn(JSON.toJSONString(gridInfoList));
@ -154,28 +155,30 @@ public class IcResiUserServiceImpl implements IcResiUserService {
List<HouseInfoDTO> houseInfoDTOList = govOrgService.queryHouseInfo(houseIds);
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
for (Map<String, Object> resultMap : list) {
if (null != gridInfoMap && gridInfoMap.containsKey(resultMap.get("GRID_ID").toString())) {
resultMap.put("GRID_ID_VALUE",resultMap.get("GRID_ID").toString());
String gridIdValue = null != resultMap.get("GRID_ID") ? resultMap.get("GRID_ID").toString() : StrConstant.EPMETY_STR;
resultMap.put("GRID_ID_VALUE", gridIdValue);
if (null != gridInfoMap && gridInfoMap.containsKey(gridIdValue) && null != gridInfoMap.get(gridIdValue)) {
//GRID_NAME
resultMap.put("GRID_ID",gridInfoMap.get(resultMap.get("GRID_ID")).getGridName());
resultMap.put("GRID_ID", gridInfoMap.get(gridIdValue).getGridName());
}
if(null !=houseInfoMap &&houseInfoMap.containsKey(resultMap.get("HOME_ID"))){
String homeId=resultMap.get("HOME_ID").toString();
resultMap.put("HOME_ID_VALUE",homeId);
String buildName=houseInfoMap.get(resultMap.get("HOME_ID")).getBuildingName();
String homeId = null != resultMap.get("HOME_ID") ? resultMap.get("HOME_ID").toString() : StrConstant.EPMETY_STR;
resultMap.put("HOME_ID_VALUE", homeId);
if (null != houseInfoMap && houseInfoMap.containsKey(homeId) && null != houseInfoMap.get(homeId)) {
HouseInfoDTO houseInfoDTO = houseInfoMap.get(homeId);
String buildName = StringUtils.isNotBlank(houseInfoDTO.getBuildingName()) ? houseInfoDTO.getBuildingName() : StrConstant.EPMETY_STR;
resultMap.put("BUILD_NAME", buildName);
String neighBorName=houseInfoMap.get(resultMap.get("HOME_ID")).getNeighborHoodName();
String neighBorName = StringUtils.isNotBlank(houseInfoDTO.getNeighborHoodName()) ? houseInfoDTO.getNeighborHoodName() : StrConstant.EPMETY_STR;
resultMap.put("VILLAGE_NAME", neighBorName);
String unitName=houseInfoMap.get(resultMap.get("HOME_ID")).getUnitName();
String unitName = StringUtils.isNotBlank(houseInfoDTO.getUnitName()) ? houseInfoDTO.getUnitName() : StrConstant.EPMETY_STR;
resultMap.put("UNIT_NAME", unitName);
String doorName=houseInfoMap.get(resultMap.get("HOME_ID")).getDoorName();
String doorName = StringUtils.isNotBlank(houseInfoDTO.getDoorName()) ? houseInfoDTO.getDoorName() : StrConstant.EPMETY_STR;
resultMap.put("DOOR_NAME", doorName);
String houseType=houseInfoMap.get(resultMap.get("HOME_ID")).getHouseType();
String houseType = StringUtils.isNotBlank(houseInfoDTO.getHouseType()) ? houseInfoDTO.getHouseType() : StrConstant.EPMETY_STR;
//房屋类型,1楼房,2平房,3别墅
resultMap.put("HOUSE_TYPE", "");
if ("1".equals(houseType)) {
@ -189,7 +192,7 @@ public class IcResiUserServiceImpl implements IcResiUserService {
resultMap.put("HOME_ID", neighBorName.concat(buildName).concat(unitName).concat(doorName));
}
if (resultMap.containsKey("GENDER")) {
String genderValue=resultMap.get("GENDER").toString();
String genderValue = null != resultMap.get("GENDER") ? resultMap.get("GENDER").toString() : StrConstant.EPMETY_STR;
if ("1".equals(genderValue)) {
resultMap.put("GENDER", "男");
} else if ("2".equals(genderValue)) {

Loading…
Cancel
Save