Browse Source

志愿者列表

dev
yinzuomei 4 years ago
parent
commit
93d1e3d8db
  1. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  3. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  4. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

11
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;
}

5
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<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto){
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId()));
public Result<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName()));
}
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java

@ -93,5 +93,5 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @param customerId
* @return
*/
List<OptionDTO> queryListVolunteer(String customerId);
List<OptionDTO> queryListVolunteer(String customerId,String userRealName);
}

20
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<VolunteerInfoDao,
}
@Override
public List<OptionDTO> queryListVolunteer(String customerId) {
public List<OptionDTO> queryListVolunteer(String customerId, String userRealName) {
List<OptionDTO> resultList = new ArrayList<>();
List<String> userIds = baseDao.selectVolunteerIds(customerId);
if (CollectionUtils.isEmpty(userIds)) {
@ -239,10 +240,19 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
Map<String, UserBaseInfoResultDTO> 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);
}
}
}
}

Loading…
Cancel
Save