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. 16
      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);

16
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,23 +1091,24 @@ 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);
if(StringUtils.isNotBlank(resDto.getServiceType())){
switch (resDto.getServiceType()) switch (resDto.getServiceType())
{ {
case UserDemandConstant.PARTY_UNIT: case UserDemandConstant.PARTY_UNIT:
@ -1136,6 +1137,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
} }
} }
}
return list; return list;
} }
@ -1208,6 +1210,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
} }
//2、志愿者(姓名、手机号 //2、志愿者(姓名、手机号
//3、区域化党建单位、社会组织、社区自组织 设置负责人和手机 //3、区域化党建单位、社会组织、社区自组织 设置负责人和手机
if(StringUtils.isNotBlank(resDto.getServiceType())){
switch (resDto.getServiceType()) { switch (resDto.getServiceType()) {
case UserDemandConstant.PARTY_UNIT: case UserDemandConstant.PARTY_UNIT:
Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId())); Map<String, IcPartyUnitEntity> partyUnitMap = getPartyUnitMap(Arrays.asList(resDto.getServerId()));
@ -1237,6 +1240,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
log.warn("serviceType 错误"); log.warn("serviceType 错误");
break; break;
} }
}
return resDto; return resDto;
} }
return null; return null;

Loading…
Cancel
Save