Browse Source

Merge remote-tracking branch 'origin/dev_ic_mp' into develop

dev
yinzuomei 4 years ago
parent
commit
aa1df89c67
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  2. 122
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -161,7 +161,7 @@ public class ResiDemandController {
* @return * @return
*/ */
@PostMapping("mydemand") @PostMapping("mydemand")
public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto, @RequestBody ResiClientMyDemandFormDTO formDTO){ public Result<List<ResiClientMyDemandResDTO>> queryMyDemand(@LoginUser TokenDto tokenDto,@RequestBody ResiClientMyDemandFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId()); formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class); ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class,ResiClientMyDemandFormDTO.AddUserInternalGroup.class);

122
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -266,7 +266,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者 //3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>(); Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -734,7 +734,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//3、查询志愿者 //3、查询志愿者
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
Map<String,String> userInfoMap=new HashMap<>(); Map<String,String> userInfoMap=new HashMap<>();
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet());
if(CollectionUtils.isNotEmpty(userIdList)){ if(CollectionUtils.isNotEmpty(userIdList)){
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList));
if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){
@ -1091,48 +1091,50 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
List<ResiClientMyDemandResDTO> list=result.getList(); List<ResiClientMyDemandResDTO> list=result.getList();
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
//1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号 //1、服务方(社会组织、社区自组织、区域化党建单位)单位名称,负责人姓名,负责人手机号
List<String> partyUnitIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); List<String> partyUnitIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.PARTY_UNIT)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcPartyUnitEntity> partyUnitMap =getPartyUnitMap(partyUnitIds); Map<String, IcPartyUnitEntity> partyUnitMap =getPartyUnitMap(partyUnitIds);
List<String> socialOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); List<String> socialOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.SOCIAL_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcSocietyOrgEntity> socialOrgMap=getSocialOrgMap(socialOrgIds); Map<String, IcSocietyOrgEntity> socialOrgMap=getSocialOrgMap(socialOrgIds);
List<String> communityOrgIds = result.getList().stream().filter(l -> l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList()); List<String> communityOrgIds = result.getList().stream().filter(l -> null != l.getServiceType() && l.getServiceType().equals(UserDemandConstant.COMMUNITY_ORG)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toList());
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds); Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap=getCommunityOrgMap(communityOrgIds);
//2、志愿者姓名、手机号 //2、志愿者姓名、手机号
Set<String> userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); Set<String> userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet());
Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList); Map<String,UserBaseInfoResultDTO> userInfoMap=getVolunteerMap(userIdList);
for (ResiClientMyDemandResDTO resDto : list) { for (ResiClientMyDemandResDTO resDto : list) {
//3、查询分类名称 //3、查询分类名称
IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode()); IcResiDemandDictEntity demandDict = demandDictService.getByCode(formDTO.getCustomerId(), resDto.getCategoryCode());
resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR); resDto.setCategoryName(null != demandDict ? demandDict.getCategoryName() : StrConstant.EPMETY_STR);
switch (resDto.getServiceType()) if(StringUtils.isNotBlank(resDto.getServiceType())){
{ switch (resDto.getServiceType())
case UserDemandConstant.PARTY_UNIT: {
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
break; resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
case UserDemandConstant.SOCIAL_ORG: break;
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
break; resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
case UserDemandConstant.COMMUNITY_ORG: break;
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
break; resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
case UserDemandConstant.VOLUNTEER: break;
resDto.setServiceUnitName(StrConstant.EPMETY_STR); case UserDemandConstant.VOLUNTEER:
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
break; resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
default: break;
log.warn("serviceType 错误"); default:
break; log.warn("serviceType 错误");
break;
}
} }
} }
} }
@ -1208,34 +1210,36 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
//2、志愿者(姓名、手机号 //2、志愿者(姓名、手机号
//3、区域化党建单位、社会组织、社区自组织 设置负责人和手机 //3、区域化党建单位、社会组织、社区自组织 设置负责人和手机
switch (resDto.getServiceType()) { if(StringUtils.isNotBlank(resDto.getServiceType())){
case UserDemandConstant.PARTY_UNIT: switch (resDto.getServiceType()) {
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.PARTY_UNIT:
resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName()); Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact()); resDto.setServiceUnitName(partyUnitMap.get(resDto.getServerId()).getUnitName());
resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile()); resDto.setServiceUserName(partyUnitMap.get(resDto.getServerId()).getContact());
break; resDto.setServiceUserMobile(partyUnitMap.get(resDto.getServerId()).getContactMobile());
case UserDemandConstant.SOCIAL_ORG: break;
Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.SOCIAL_ORG:
resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName()); Map<String, IcSocietyOrgEntity> socialOrgMap = getSocialOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge()); resDto.setServiceUnitName(socialOrgMap.get(resDto.getServerId()).getSocietyName());
resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(socialOrgMap.get(resDto.getServerId()).getPersonInCharge());
break; resDto.setServiceUserMobile(socialOrgMap.get(resDto.getServerId()).getMobile());
case UserDemandConstant.COMMUNITY_ORG: break;
Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId())); case UserDemandConstant.COMMUNITY_ORG:
resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName()); Map<String, IcCommunitySelfOrganizationEntity> communityOrgMap = getCommunityOrgMap(Arrays.asList(resDto.getServerId()));
resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName()); resDto.setServiceUnitName(communityOrgMap.get(resDto.getServerId()).getOrganizationName());
resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone()); resDto.setServiceUserName(communityOrgMap.get(resDto.getServerId()).getPrincipalName());
break; resDto.setServiceUserMobile(communityOrgMap.get(resDto.getServerId()).getPrincipalPhone());
case UserDemandConstant.VOLUNTEER: break;
Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); case UserDemandConstant.VOLUNTEER:
resDto.setServiceUnitName(StrConstant.EPMETY_STR); Map<String, UserBaseInfoResultDTO> userInfoMap = getVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId())));
resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName()); resDto.setServiceUnitName(StrConstant.EPMETY_STR);
resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile()); resDto.setServiceUserName(userInfoMap.get(resDto.getServerId()).getRealName());
break; resDto.setServiceUserMobile(userInfoMap.get(resDto.getServerId()).getMobile());
default: break;
log.warn("serviceType 错误"); default:
break; log.warn("serviceType 错误");
break;
}
} }
return resDto; return resDto;
} }

Loading…
Cancel
Save