|
|
|
@ -42,8 +42,10 @@ import com.epmet.dto.IcUserDemandRecDTO; |
|
|
|
import com.epmet.dto.form.CustomerGridFormDTO; |
|
|
|
import com.epmet.dto.form.demand.*; |
|
|
|
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|
|
|
import com.epmet.dto.result.IcResiUserBriefDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.demand.DemandRecResultDTO; |
|
|
|
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; |
|
|
|
import com.epmet.dto.result.demand.IcResiUserReportDemandRes; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
@ -554,7 +556,56 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 数据分析-个人档案-需求详情,研判分析 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public DemandResearchAnalysisResultDTO queryDemandResearchAnalysis(DemandResearchAnalysisFormDTO formDTO) { |
|
|
|
//获取案件居民和及家属列表
|
|
|
|
Result<IcResiUserBriefDTO> userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIsResiUserId()); |
|
|
|
if (userRes.success() || null == userRes.getData()) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息及技术接口异常"); |
|
|
|
} |
|
|
|
IcResiUserBriefDTO icResiUserDTO = userRes.getData(); |
|
|
|
DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class); |
|
|
|
resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList()); |
|
|
|
//获取当前需求人,相同分类的需求列表。不分页,直接返回所有
|
|
|
|
List<String> userIds=new ArrayList<>(); |
|
|
|
userIds.add(formDTO.getIsResiUserId()); |
|
|
|
if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ |
|
|
|
userIds.addAll(formDTO.getEpmetUserIdList()); |
|
|
|
} |
|
|
|
IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO(); |
|
|
|
icResiUserDemandFromDTO.setUserIds(userIds); |
|
|
|
icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); |
|
|
|
List<IcResiUserReportDemandRes> demandList = baseDao.selectUserDemand(icResiUserDemandFromDTO); |
|
|
|
|
|
|
|
if(CollectionUtils.isNotEmpty(demandList)){ |
|
|
|
// 1、状态字典
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
//2、查询分类名称
|
|
|
|
List<String> categoryCodes = demandList.stream().map(IcResiUserReportDemandRes::getCategoryCode).collect(Collectors.toList()); |
|
|
|
List<IcResiDemandDictEntity> dictList = demandDictService.listByCodes(formDTO.getCustomerId(), categoryCodes); |
|
|
|
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); |
|
|
|
|
|
|
|
for (IcResiUserReportDemandRes resDto : demandList) { |
|
|
|
//状态赋值
|
|
|
|
resDto.setStatusName(statusMap.containsKey(resDto.getStatus()) ? statusMap.get(resDto.getStatus()) : StrConstant.EPMETY_STR); |
|
|
|
if (null != dictMap && dictMap.containsKey(resDto.getCategoryCode())) { |
|
|
|
//分类名称XXX-XX 或者XXX
|
|
|
|
resDto.setCategoryName(dictMap.get(resDto.getCategoryCode())); |
|
|
|
} |
|
|
|
//一级分类名称
|
|
|
|
resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode())); |
|
|
|
} |
|
|
|
resultDTO.setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList()); |
|
|
|
} |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|