Sfoglia il codice sorgente

修改专家详情获取

tags/24080901
WendyYang 1 anno fa
parent
commit
ce2228a830
4 ha cambiato i file con 31 aggiunte e 30 eliminazioni
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java
  2. +6
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java
  3. +22
    -22
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java
  4. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/RegionCacheHelper.java Vedi File

@@ -105,8 +105,8 @@ public interface RegionCacheHelper {
*
* @param code 区域编码
* @param level 区域层级
* @return
* @return \
*/
String getUnionPathStr(String code, Integer level);
String getUnionPath(String code, Integer level);

}

+ 6
- 5
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/RegionsCacheHelperImpl.java Vedi File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.common.helper.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.text.StrPool;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
@@ -197,15 +198,15 @@ public class RegionsCacheHelperImpl extends AbstractRegionCacheHelper implements


@Override
public String getUnionPathStr(String code, Integer level) {
if (StringUtils.isBlank(code) || Objects.isNull(level)) {
return null;
public String getUnionPath(String code, Integer level) {
if (StrUtils.isBlank(code) || Objects.isNull(level)) {
return StrUtils.EMPTY;
}
List<String> unionPathStrList = new ArrayList<>();
buildUnionPathStrList(code, level, unionPathStrList);
Collections.reverse(unionPathStrList);
if (CollectionUtils.isEmpty(unionPathStrList)) {
return null;
if (CollUtil.isEmpty(unionPathStrList)) {
return StrUtils.EMPTY;
}
return String.join("@@", unionPathStrList);
}


+ 22
- 22
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java Vedi File

@@ -44,43 +44,43 @@ public class ExpertUserInfoAssembler {
private final DictionaryCache dictionaryCache;
private final RegionCacheHelper regionCacheHelper;

public ExpertFullInfoVO buildExpertFullInfoVO(List<AttachFileVo> attachFiles, ExpertFullInfoAllDTO expertFullInfoAll) {
public ExpertFullInfoVO buildExpertFullInfo(List<AttachFileVo> attachFiles, ExpertFullInfoAllDTO expertFullInfoAll) {
ExpertUserFullInfoDTO expertUserInfo = expertFullInfoAll.getExpertUserInfoDTO();
// 字典字典段map
Map<String, List<DictionaryFieldInfo>> dictInfoMap = buildDictInfoMap(expertFullInfoAll.getExpertDictionaryList());
Map<String, List<DictionaryFieldInfo>> dictMap = buildDictInfoMap(expertFullInfoAll.getExpertDictionaryList());
// 专家文件资料map
Map<Long, FileBasicInfo> fileInfoMap = buildFileBasicInfoMap(attachFiles);
Map<Long, FileBasicInfo> fileMap = buildFileBasicInfoMap(attachFiles);
// 专家标签字段map
Map<String, List<TagFieldInfo>> tagInfoMap = buildTagFieldInfoMap(expertFullInfoAll.getExpertTagList());
Map<String, List<TagFieldInfo>> tagMap = buildTagFieldInfoMap(expertFullInfoAll.getExpertTagList());
// 专家履职意向地
List<ExpertRegionDTO> intentionWorkRegion = expertFullInfoAll.getExpertIntentionWorkRegionInfo();
List<ExpertRegionDTO> intentionWorkRegions = expertFullInfoAll.getExpertIntentionWorkRegionInfo();
// 专家回避单位列表
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList = expertFullInfoAll.getExpertAvoidCompanyList();
List<ExpertAvoidCompanyDTO> avoidCompanies = expertFullInfoAll.getExpertAvoidCompanyList();
// 基本信息
ExpertBasicInfo basicInfo = buildExpertBasicInfo(expertUserInfo, dictInfoMap, tagInfoMap, intentionWorkRegion, fileInfoMap);
ExpertBasicInfo basicInfo = buildExpertBasicInfo(expertUserInfo, dictMap, tagMap, intentionWorkRegions, fileMap);
// 学历信息
ExpertEduInfo eduInfo = buildExpertEduInfo(expertUserInfo, dictInfoMap, fileInfoMap);
ExpertEduInfo eduInfo = buildExpertEduInfo(expertUserInfo, dictMap, fileMap);
// 职业信息
ExpertJobInfo jobInfo = buildExpertJobInfo(expertUserInfo, dictInfoMap);
ExpertJobInfo jobInfo = buildExpertJobInfo(expertUserInfo, dictMap);
jobInfo.setBusinessStrips(expertFullInfoAll.getBusinessStrips());
// 专业信息
ExpertProfessionalInfo professionalInfo = buildExpertProfessionalInfo(expertUserInfo, dictInfoMap
, tagInfoMap, fileInfoMap, expertAvoidCompanyList);
ExpertProfessionalInfo profession = buildExpertProfessionalInfo(expertUserInfo, dictMap, tagMap, fileMap, avoidCompanies);
// 推荐信息
ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo();
recommendInfo.setRecommendedWay(dictInfoMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()));
recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileInfoMap, expertUserInfo.getRecommendationProofFileIdList()));
recommendInfo.setRecommendedWay(dictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()));
recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileMap, expertUserInfo.getRecommendationProofFileIdList()));
// 其他信息
ExpertOtherInfo otherInfo = new ExpertOtherInfo();
otherInfo.setOther(tagInfoMap.get(ExpertTagEnum.OTHER.getKey()));
otherInfo.setOther(tagMap.get(ExpertTagEnum.OTHER.getKey()));
otherInfo.setRemark(expertUserInfo.getRemark());

// 专家申请履职意向展示列表
List<ExpertRegionInfo> applyIntentionWorkRegions = expertFullInfoAll.getExpertApplyIntentionWorkRegionInfo().stream().map(r -> {
ExpertRegionInfo expertApplyIntentionWorkRegion = new ExpertRegionInfo();
expertApplyIntentionWorkRegion.setRegionLevel(r.getRegionLevel());
expertApplyIntentionWorkRegion.setRegionCode(r.getRegionCode());
expertApplyIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPathStr(r.getRegionCode(), r.getRegionLevel()));
return expertApplyIntentionWorkRegion;
ExpertRegionInfo intentionWorkRegion = new ExpertRegionInfo();
intentionWorkRegion.setRegionLevel(r.getRegionLevel());
intentionWorkRegion.setRegionCode(r.getRegionCode());
intentionWorkRegion.setRegionName(regionCacheHelper.getUnionPath(r.getRegionCode(), r.getRegionLevel()));
return intentionWorkRegion;
}).collect(Collectors.toList());

if (CollUtil.isEmpty(basicInfo.getExpertIntentionWorkRegions())) {
@@ -91,7 +91,7 @@ public class ExpertUserInfoAssembler {
resExpertFullInfo.setBasicInfo(basicInfo);
resExpertFullInfo.setEduInfo(eduInfo);
resExpertFullInfo.setJobInfo(jobInfo);
resExpertFullInfo.setProfessionalInfo(professionalInfo);
resExpertFullInfo.setProfessionalInfo(profession);
resExpertFullInfo.setRecommendInfo(recommendInfo);
resExpertFullInfo.setExpertOtherInfo(otherInfo);
resExpertFullInfo.setExpertApplyIntentionWorkRegions(applyIntentionWorkRegions);
@@ -236,14 +236,14 @@ public class ExpertUserInfoAssembler {
basicInfo.setHometown(expertUserInfoDTO.getHometown());
basicInfo.setNationality(expertUserInfoDTO.getNationality());
basicInfo.setExpertSource(tagFieldInfoMap.get(ExpertTagEnum.EXPERT_SOURCE.getKey()));
expertRegionInfo.setRegionName(regionCacheHelper.getUnionPathStr(expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel()));
expertRegionInfo.setRegionName(regionCacheHelper.getUnionPath(expertRegionInfo.getRegionCode(), expertRegionInfo.getRegionLevel()));
basicInfo.setExpertRegionInfo(expertRegionInfo);

basicInfo.setExpertIntentionWorkRegions(expertIntentionWorkRegionInfo.stream().map(r -> {
ExpertRegionInfo expertIntentionWorkRegion = new ExpertRegionInfo();
expertIntentionWorkRegion.setRegionCode(r.getRegionCode());
expertIntentionWorkRegion.setRegionLevel(r.getRegionLevel());
expertIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPathStr(r.getRegionCode(), r.getRegionLevel()));
expertIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPath(r.getRegionCode(), r.getRegionLevel()));
return expertIntentionWorkRegion;
}).collect(Collectors.toList()));
basicInfo.setExpertType(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()));


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java Vedi File

@@ -135,7 +135,7 @@ public class ExpertManage {
}
List<Long> fileIdList = expertInfoCommonHelper.getExpertFileIdList(expertUserFullInfoAll);
List<AttachFileVo> attachFiles = fileService.getByIds(fileIdList);
return expertUserInfoAssembler.buildExpertFullInfoVO(attachFiles, expertUserFullInfoAll);
return expertUserInfoAssembler.buildExpertFullInfo(attachFiles, expertUserFullInfoAll);
}

@Transactional(rollbackFor = Exception.class)


Loading…
Annulla
Salva