|
|
@@ -14,7 +14,6 @@ import com.ningdatech.pmapi.common.helper.RegionCacheHelper; |
|
|
|
import com.ningdatech.pmapi.common.helper.RegionLimitHelper; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.common.util.BizUtils; |
|
|
|
import com.ningdatech.pmapi.expert.assembler.RegionWrapperAssembler; |
|
|
|
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; |
|
|
|
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; |
|
|
|
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum; |
|
|
@@ -82,18 +81,40 @@ public class ExpertMetaApplyManage { |
|
|
|
|
|
|
|
private final ExpertAdminManageService expertAdminManageService; |
|
|
|
|
|
|
|
private final IExpertDictionaryService iExpertDictionaryService; |
|
|
|
|
|
|
|
|
|
|
|
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) { |
|
|
|
Long expertAdminUserId = LoginUserUtil.getUserId(); |
|
|
|
// 筛选符合专家类型的用户id |
|
|
|
List<Long> filterExpertTypeUserIdList = null; |
|
|
|
DictionaryFieldInfo expertType = req.getExpertType(); |
|
|
|
if (Objects.nonNull(expertType) && StringUtils.isNotBlank(expertType.getDictionaryCode())) { |
|
|
|
List<ExpertDictionary> expertTypeDictionaryList = iExpertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) |
|
|
|
.eq(ExpertDictionary::getDictionaryCode, expertType.getDictionaryCode())); |
|
|
|
filterExpertTypeUserIdList = expertTypeDictionaryList.stream().map(ExpertDictionary::getUserId).distinct().collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
// 查找符合专家条件的用户id |
|
|
|
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req); |
|
|
|
List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); |
|
|
|
if (CollUtil.isEmpty(filterExpertUserIdList)) { |
|
|
|
|
|
|
|
// 取交集 |
|
|
|
List<Long> finalFilterExpertUserIdList = new ArrayList<>(); |
|
|
|
if (Objects.nonNull(filterExpertTypeUserIdList)) { |
|
|
|
for (Long userId : filterExpertUserIdList) { |
|
|
|
if (filterExpertTypeUserIdList.contains(userId)) { |
|
|
|
finalFilterExpertUserIdList.add(userId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (CollUtil.isEmpty(finalFilterExpertUserIdList)) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = |
|
|
|
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList); |
|
|
|
buildMetaApplyListQueryWrapper(req, finalFilterExpertUserIdList); |
|
|
|
Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); |
|
|
|
PageVo<ExpertApplyMetaVO> result = new PageVo<>(); |
|
|
|
result.setTotal(pageResult.getTotal()); |
|
|
@@ -102,9 +123,12 @@ public class ExpertMetaApplyManage { |
|
|
|
// 根据用户id 获取专家基本信息 |
|
|
|
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds); |
|
|
|
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); |
|
|
|
List<ExpertDictionary> expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); |
|
|
|
Map<Long, List<ExpertDictionary>> dictMap = CollUtils.group(expertDictList, ExpertDictionary::getUserId); |
|
|
|
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, dictMap)); |
|
|
|
List<ExpertDictionary> titleLevelDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); |
|
|
|
Map<Long, List<ExpertDictionary>> titleLevelDictMap = CollUtils.group(titleLevelDictList, ExpertDictionary::getUserId); |
|
|
|
|
|
|
|
List<ExpertDictionary> expertTypeDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.EXPERT_TYPE); |
|
|
|
Map<Long, List<ExpertDictionary>> expertTypeDictMap = CollUtils.group(expertTypeDictList, ExpertDictionary::getUserId); |
|
|
|
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, titleLevelDictMap, expertTypeDictMap)); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
@@ -398,18 +422,19 @@ public class ExpertMetaApplyManage { |
|
|
|
return expertAdminExpertManageQueryCmd; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 装配 专家审核列表筛选返回VO |
|
|
|
* |
|
|
|
* @param expertMetaApplyList / |
|
|
|
* @param expertUserFullInfoMap / |
|
|
|
* @param expertDictionaryListMap / |
|
|
|
* @return / |
|
|
|
* @param expertMetaApplyList |
|
|
|
* @param expertUserFullInfoMap |
|
|
|
* @param titleLevelDictMap |
|
|
|
* @param expertTypeDictMap |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private List<ExpertApplyMetaVO> buildExpertApplyMetaVOList(List<ExpertMetaApply> expertMetaApplyList |
|
|
|
, Map<Long, ExpertUserFullInfo> expertUserFullInfoMap |
|
|
|
, Map<Long, List<ExpertDictionary>> expertDictionaryListMap) { |
|
|
|
, Map<Long, List<ExpertDictionary>> titleLevelDictMap |
|
|
|
, Map<Long, List<ExpertDictionary>> expertTypeDictMap) { |
|
|
|
List<ExpertApplyMetaVO> expertApplyMetaVOList = new ArrayList<>(); |
|
|
|
for (ExpertMetaApply expertMetaApply : expertMetaApplyList) { |
|
|
|
ExpertApplyMetaVO expertApplyMetaVO = new ExpertApplyMetaVO(); |
|
|
@@ -435,9 +460,24 @@ public class ExpertMetaApplyManage { |
|
|
|
expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo); |
|
|
|
} |
|
|
|
|
|
|
|
List<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId); |
|
|
|
if (CollectionUtils.isNotEmpty(expertDictionaryList)) { |
|
|
|
expertApplyMetaVO.setTitleLevel(expertDictionaryList.stream().map(r -> { |
|
|
|
List<ExpertDictionary> titleLevelDictionaryList = titleLevelDictMap.get(userId); |
|
|
|
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { |
|
|
|
expertApplyMetaVO.setTitleLevel(titleLevelDictionaryList.stream().map(r -> { |
|
|
|
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); |
|
|
|
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); |
|
|
|
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); |
|
|
|
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); |
|
|
|
if (Objects.nonNull(dictionaryDTO)) { |
|
|
|
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); |
|
|
|
} |
|
|
|
return dictionaryFieldInfo; |
|
|
|
}).collect(Collectors.toList())); |
|
|
|
} |
|
|
|
|
|
|
|
// 装配专家类型 |
|
|
|
List<ExpertDictionary> expertTypeDictionaryList = expertTypeDictMap.get(userId); |
|
|
|
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { |
|
|
|
expertApplyMetaVO.setExpertType(expertTypeDictionaryList.stream().map(r -> { |
|
|
|
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); |
|
|
|
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); |
|
|
|
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); |
|
|
|