diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java index d40ed7cb8a..ea3f8bcdcd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java @@ -23,7 +23,7 @@ public class DemandResearchAnalysisFormDTO implements Serializable { @NotBlank(message = "firstCategoryCode不能为空",groups = AddUserInternalGroup.class) private String firstCategoryCode; - @NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class) + //@NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class) private String icResiUserId; private List epmetUserIdList; @@ -31,4 +31,11 @@ public class DemandResearchAnalysisFormDTO implements Serializable { @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) private String customerId; + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + @NotBlank(message = "个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) + private String queryOrigin; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index feb5c70b84..06052f22cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -114,4 +114,7 @@ public class DemandRecResultDTO implements Serializable { * 完成情况 */ private String finishDesc; + + private String icResiUserId; + private String epmetUserId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java index c28768b30f..85168b8a32 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -50,4 +50,12 @@ public interface UserDemandConstant { String SOCIAL_ORG="social_org"; String COMMUNITY_ORG="community_org"; String PARTY_UNIT="party_unit"; + + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + String PERSONAL_DATA="personal-data"; + String DEMAND_ANALYSIS="demand-analysis"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index b968fe4017..1edd9d20d5 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -42,9 +42,11 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.ResiUserFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.IcResiUserBriefDTO; +import com.epmet.dto.result.ResiUserResDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; @@ -583,7 +585,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandData=new ArrayList<>(); @@ -593,12 +595,34 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl()); demandData.add(demandDataDTO); + //如果是服务措施分析来的,并且是pc录入的需求,需要先去找epmetUserIdList + if(UserDemandConstant.DEMAND_ANALYSIS.equals(formDTO.getQueryOrigin()) + &&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); + resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); + resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId()); + Result resiRes=epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); + if(!resiRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); + } + if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { + formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); + } + } //获取当前需求人,相同分类的需求列表。不分页,直接返回所有 List userIds=new ArrayList<>(); - userIds.add(formDTO.getIcResiUserId()); + if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ + userIds.add(formDTO.getIcResiUserId()); + } if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ userIds.addAll(formDTO.getEpmetUserIdList()); } + if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //需求人不能为空 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); + } + + IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO(); icResiUserDemandFromDTO.setUserIds(userIds); icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); @@ -625,6 +649,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl