|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.ningdatech.basic.util.CollUtils; |
|
|
|
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum; |
|
|
|
import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; |
|
|
|
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; |
|
|
@@ -30,10 +31,7 @@ import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@@ -371,5 +369,39 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public List<ExpertFullInfoAllDTO> listExpertUserFullInfoAll(List<Long> userIds) { |
|
|
|
List<ExpertUserFullInfo> expertUserFullInfos = iExpertUserFullInfoService.listByUserIds(userIds); |
|
|
|
// 所有专家标签字段 |
|
|
|
List<ExpertTag> expertTagList = iExpertTagService.list(Wrappers.lambdaQuery(ExpertTag.class) |
|
|
|
.in(ExpertTag::getUserId, userIds)); |
|
|
|
Map<Long, List<ExpertTag>> expertTagListMap = CollUtils.group(expertTagList, ExpertTag::getUserId); |
|
|
|
// 所有专家字典字段 |
|
|
|
List<ExpertDictionary> expertDictionaryList = iExpertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) |
|
|
|
.in(ExpertDictionary::getUserId, userIds)); |
|
|
|
Map<Long, List<ExpertDictionary>> expertDictMap = CollUtils.group(expertDictionaryList, ExpertDictionary::getUserId); |
|
|
|
// 专家履职意向列表 |
|
|
|
List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList = iExpertIntentionWorkRegionService |
|
|
|
.list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class) |
|
|
|
.in(ExpertIntentionWorkRegion::getUserId, userIds)); |
|
|
|
Map<Long, List<ExpertIntentionWorkRegion>> intentionRegionMap = CollUtils.group(expertIntentionWorkRegionList, ExpertIntentionWorkRegion::getUserId); |
|
|
|
// 专家履职意向申请列表 |
|
|
|
List<ExpertMetaApply> expertMetaApplyList = iExpertMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) |
|
|
|
.in(ExpertMetaApply::getUserId, userIds) |
|
|
|
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) |
|
|
|
.in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey())); |
|
|
|
Map<Long, List<ExpertMetaApply>> metaApplyMap = CollUtils.group(expertMetaApplyList, ExpertMetaApply::getUserId); |
|
|
|
// 所有专家回避单位 |
|
|
|
List<ExpertAvoidCompany> expertAvoidCompanyList = iExpertAvoidCompanyService.list(Wrappers.lambdaQuery(ExpertAvoidCompany.class) |
|
|
|
.in(ExpertAvoidCompany::getUserId, userIds)); |
|
|
|
Map<Long, List<ExpertAvoidCompany>> avoidInfoMap = CollUtils.group(expertAvoidCompanyList, ExpertAvoidCompany::getUserId); |
|
|
|
return expertUserFullInfos.stream().map(w -> ExpertUserInfoAssembler.buildExpertFullInfoAllDTO(w, |
|
|
|
expertTagListMap.getOrDefault(w.getUserId(), Collections.emptyList()), |
|
|
|
expertDictMap.getOrDefault(w.getUserId(), Collections.emptyList()), |
|
|
|
intentionRegionMap.getOrDefault(w.getUserId(), Collections.emptyList()), |
|
|
|
metaApplyMap.getOrDefault(w.getUserId(), Collections.emptyList()), |
|
|
|
avoidInfoMap.getOrDefault(w.getUserId(), Collections.emptyList()))) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
} |