|
|
@ -42,12 +42,15 @@ import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; |
|
|
|
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; |
|
|
|
import com.epmet.dto.result.ResiUserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.SendVerificationCodeResultDTO; |
|
|
|
import com.epmet.dto.result.UserBaseInfoResultDTO; |
|
|
|
import com.epmet.dto.result.demand.OptionDTO; |
|
|
|
import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; |
|
|
|
import com.epmet.entity.VolunteerInfoEntity; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.service.HeartUserInfoService; |
|
|
|
import com.epmet.service.VolunteerInfoService; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -56,6 +59,9 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.Function; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 志愿者信息 |
|
|
@ -220,4 +226,26 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, |
|
|
|
VolunteerInfoDTO volunteerInfoDTO=baseDao.selectVolunteerInfoByUserId(userId); |
|
|
|
return volunteerInfoDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<OptionDTO> queryListVolunteer(String customerId) { |
|
|
|
List<OptionDTO> resultList = new ArrayList<>(); |
|
|
|
List<String> userIds = baseDao.selectVolunteerIds(customerId); |
|
|
|
if (CollectionUtils.isEmpty(userIds)) { |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); |
|
|
|
if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) { |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
} |
|
|
|