diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java new file mode 100644 index 0000000000..20fa5e4539 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ServiceQueryFormDTO implements Serializable { + private static final long serialVersionUID = -2738313255838176318L; + private String serviceName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 63515d7cb5..e144e9c11f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; +import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -121,7 +122,7 @@ public class ResiVolunteerController { * @return */ @PostMapping("listprofile") - public Result> queryListVolunteer(@LoginUser TokenDto tokenDto){ - return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId())); + public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 356bb04154..850c4367de 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -93,5 +93,5 @@ public interface VolunteerInfoService extends BaseService { * @param customerId * @return */ - List queryListVolunteer(String customerId); + List queryListVolunteer(String customerId,String userRealName); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index c1fa369d7b..a0ac541131 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -51,6 +51,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -228,7 +229,7 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryListVolunteer(String customerId) { + public List queryListVolunteer(String customerId, String userRealName) { List resultList = new ArrayList<>(); List userIds = baseDao.selectVolunteerIds(customerId); if (CollectionUtils.isEmpty(userIds)) { @@ -239,10 +240,19 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity())); for (String userId : userIds) { if (userMap.containsKey(userId)) { - OptionDTO optionDTO = new OptionDTO(); - optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); - optionDTO.setValue(userId); - resultList.add(optionDTO); + if (StringUtils.isNoneBlank(userRealName)) { + if (userMap.get(userId).getRealName().contains(userRealName)) { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } + } else { + OptionDTO optionDTO = new OptionDTO(); + optionDTO.setLabel(userMap.get(userId).getRealName().concat("(").concat(userMap.get(userId).getMobile().concat(")"))); + optionDTO.setValue(userId); + resultList.add(optionDTO); + } } } }