|
|
@ -54,6 +54,7 @@ import com.epmet.dto.*; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.dto.result.demand.IcResiDemandDictDTO; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.entity.IcUserChangeDetailedEntity; |
|
|
|
import com.epmet.entity.IcUserChangeRecordEntity; |
|
|
@ -499,14 +500,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
// 查询列表展示项需要用到哪些子表
|
|
|
|
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1); |
|
|
|
List<SubTableJoinDTO> subTables =subTablesRes.getData(); |
|
|
|
log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true)); |
|
|
|
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
|
|
|
|
|
|
|
|
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
|
|
|
|
Set<String> whereConditionTables=formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet()); |
|
|
|
Set<String> tables=new HashSet<>(); |
|
|
|
tables.addAll(whereConditionTables); |
|
|
|
tables.addAll(resultColumnTables); |
|
|
|
log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true)); |
|
|
|
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
|
|
|
|
//最终关联的子表对应的sql:
|
|
|
|
List<String> finalSubTables =new ArrayList<>(); |
|
|
|
subTables.forEach(subTable->{ |
|
|
@ -560,6 +561,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId()); |
|
|
|
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>(); |
|
|
|
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity())); |
|
|
|
|
|
|
|
//查询需求分类字典
|
|
|
|
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO(); |
|
|
|
userDemandNameQueryFormDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
Result<List<IcResiDemandDictDTO>> demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO); |
|
|
|
if(!demandNameRes.success()||CollectionUtils.isEmpty(demandNameRes.getData())){ |
|
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"获取需求分类字典表数据异常",EpmetErrorCode.SERVER_ERROR.getMsg()); |
|
|
|
} |
|
|
|
Map<String,IcResiDemandDictDTO> demandDictMap=demandNameRes.getData().stream().collect(Collectors.toMap(IcResiDemandDictDTO::getCategoryCode,Function.identity())); |
|
|
|
|
|
|
|
for (Map<String, Object> resultMap : list) { |
|
|
|
String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR; |
|
|
|
resultMap.put("GRID_ID_VALUE", gridIdValue); |
|
|
@ -596,7 +607,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
} |
|
|
|
resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName)); |
|
|
|
|
|
|
|
resultMap.put("CATEGORY_NAME",queryUserDemandName(formDTO.getCustomerId(),(String) resultMap.get("icResiUserId"))); |
|
|
|
resultMap.put("CATEGORY_NAME",queryUserDemandName((String) resultMap.get("icResiUserId"),demandDictMap)); |
|
|
|
} |
|
|
|
|
|
|
|
if (resultMap.containsKey(UserConstant.GENDER)) { |
|
|
@ -614,32 +625,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi |
|
|
|
return new PageData<>(pageInfo.getList(), pageInfo.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
private String queryUserDemandName(String customerId,String icResiUserId) { |
|
|
|
private String queryUserDemandName(String icResiUserId,Map<String,IcResiDemandDictDTO> demandDictMap) { |
|
|
|
// epmet_user.ic_resi_demand.category_code存储的值为 分类编码的全路径,eg:
|
|
|
|
// 1003,10030002
|
|
|
|
// 1012,10120003
|
|
|
|
// 1016,10160003
|
|
|
|
Set<String> demandCodePath=baseDao.selectUserDemandCode(icResiUserId); |
|
|
|
if(CollectionUtils.isEmpty(demandCodePath)){ |
|
|
|
return StrConstant.EPMETY_STR; |
|
|
|
} |
|
|
|
Set<String> codeSet=new HashSet<>(); |
|
|
|
List<String> nameList=new ArrayList<>(); |
|
|
|
for(String codePath:demandCodePath){ |
|
|
|
if(codePath.contains(StrConstant.COMMA)){ |
|
|
|
String[] codeAtt=codePath.split(StrConstant.COMMA); |
|
|
|
codeSet.add(codeAtt[codeAtt.length-1]); |
|
|
|
String code=codeAtt[codeAtt.length-1]; |
|
|
|
if(StringUtils.isNotBlank(code)&&demandDictMap.containsKey(code)){ |
|
|
|
nameList.add(demandDictMap.get(code).getParentName()); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
codeSet.add(codePath); |
|
|
|
if(StringUtils.isNotBlank(codePath)&&demandDictMap.containsKey(codePath)){ |
|
|
|
nameList.add(demandDictMap.get(codePath).getParentName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String demandName=""; |
|
|
|
// String demandName=baseDao.selectCategoryNames(customerId,codeSet);
|
|
|
|
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO(); |
|
|
|
userDemandNameQueryFormDTO.setCustomerId(customerId); |
|
|
|
userDemandNameQueryFormDTO.setCodeSet(codeSet); |
|
|
|
Result<String> demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO); |
|
|
|
if(demandNameRes.success()){ |
|
|
|
demandName=demandNameRes.getData(); |
|
|
|
} |
|
|
|
String demandName=String.join(StrConstant.COMMA_ZH,nameList); |
|
|
|
return demandName; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 编辑页面,显示居民信息详情 |
|
|
|
* |
|
|
|