diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java index adf8c27..01824d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java @@ -25,7 +25,6 @@ import com.ningdatech.pmapi.meta.model.dto.TagDTO; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.model.entity.ExpertTag; import lombok.RequiredArgsConstructor; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; @@ -48,31 +47,31 @@ public class ExpertUserInfoAssembler { public ExpertFullInfoVO buildExpertFullInfoVO(List attachFiles, ExpertFullInfoAllDTO expertFullInfoAll) { ExpertUserFullInfoDTO expertUserInfo = expertFullInfoAll.getExpertUserInfoDTO(); // 字典字典段map - Map> dictFieldInfoMap = buildDictionaryFieldInfoMap(expertFullInfoAll.getExpertDictionaryList()); + Map> dictInfoMap = buildDictInfoMap(expertFullInfoAll.getExpertDictionaryList()); // 专家文件资料map - Map fileBasicInfoMap = buildFileBasicInfoMap(attachFiles); + Map fileInfoMap = buildFileBasicInfoMap(attachFiles); // 专家标签字段map - Map> tagFieldInfoMap = buildTagFieldInfoMap(expertFullInfoAll.getExpertTagList()); + Map> tagInfoMap = buildTagFieldInfoMap(expertFullInfoAll.getExpertTagList()); // 专家履职意向地 - List expertIntentionWorkRegionInfo = expertFullInfoAll.getExpertIntentionWorkRegionInfo(); + List intentionWorkRegion = expertFullInfoAll.getExpertIntentionWorkRegionInfo(); // 专家回避单位列表 List expertAvoidCompanyList = expertFullInfoAll.getExpertAvoidCompanyList(); // 基本信息 - ExpertBasicInfo basicInfo = buildExpertBasicInfo(expertUserInfo, dictFieldInfoMap, tagFieldInfoMap, expertIntentionWorkRegionInfo, fileBasicInfoMap); + ExpertBasicInfo basicInfo = buildExpertBasicInfo(expertUserInfo, dictInfoMap, tagInfoMap, intentionWorkRegion, fileInfoMap); // 学历信息 - ExpertEduInfo eduInfo = buildExpertEduInfo(expertUserInfo, dictFieldInfoMap, fileBasicInfoMap); + ExpertEduInfo eduInfo = buildExpertEduInfo(expertUserInfo, dictInfoMap, fileInfoMap); // 职业信息 - ExpertJobInfo jobInfo = buildExpertJobInfo(expertUserInfo, dictFieldInfoMap); + ExpertJobInfo jobInfo = buildExpertJobInfo(expertUserInfo, dictInfoMap); // 专业信息 - ExpertProfessionalInfo professionalInfo = buildExpertProfessionalInfo(expertUserInfo, dictFieldInfoMap - , tagFieldInfoMap, fileBasicInfoMap, expertAvoidCompanyList); + ExpertProfessionalInfo professionalInfo = buildExpertProfessionalInfo(expertUserInfo, dictInfoMap + , tagInfoMap, fileInfoMap, expertAvoidCompanyList); // 推荐信息 ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo(); - recommendInfo.setRecommendedWay(dictFieldInfoMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())); - recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfo.getRecommendationProofFileIdList())); + recommendInfo.setRecommendedWay(dictInfoMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())); + recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileInfoMap, expertUserInfo.getRecommendationProofFileIdList())); // 其他信息 ExpertOtherInfo otherInfo = new ExpertOtherInfo(); - otherInfo.setOther(tagFieldInfoMap.get(ExpertTagEnum.OTHER.getKey())); + otherInfo.setOther(tagInfoMap.get(ExpertTagEnum.OTHER.getKey())); otherInfo.setRemark(expertUserInfo.getRemark()); // 专家申请履职意向展示列表 @@ -121,8 +120,8 @@ public class ExpertUserInfoAssembler { }).collect(Collectors.groupingBy(TagFieldInfo::getTagFieldName)); } - public Map> buildDictionaryFieldInfoMap(List expertDictionaryList) { - return expertDictionaryList.stream().map(r -> { + public Map> buildDictInfoMap(List expertDictList) { + return expertDictList.stream().map(r -> { DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); @@ -134,61 +133,63 @@ public class ExpertUserInfoAssembler { }).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName)); } - public static ExpertProfessionalInfo buildExpertProfessionalInfo(ExpertUserFullInfoDTO expertUserInfoDTO - , Map> dictionaryFieldInfoMap, Map> tagFieldInfoMap - , Map fileBasicInfoMap, List expertAvoidCompanyList) { + public static ExpertProfessionalInfo buildExpertProfessionalInfo(ExpertUserFullInfoDTO expertUserInfoDTO, + Map> dictInfoMap, + Map> tagFieldInfoMap, + Map fileInfoMap, + List expertAvoidCompanyList) { ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo(); professionalInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles()); - professionalInfo.setTitleLevel(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())); - professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList())); + professionalInfo.setTitleLevel(dictInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())); + professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList())); professionalInfo.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey())); professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey())); professionalInfo.setAwards(expertUserInfoDTO.getAwards()); professionalInfo.setIndustrySector(tagFieldInfoMap.get(ExpertTagEnum.INDUSTRY_SECTOR.getKey())); professionalInfo.setRecognitionReward(expertUserInfoDTO.getRecognitionReward()); professionalInfo.setAvoidCompanyList(expertAvoidCompanyList.stream().map(r -> { - ExpertAvoidCompanyInfo expertAvoidCompanyInfo = new ExpertAvoidCompanyInfo(); - expertAvoidCompanyInfo.setCompanyName(r.getCompanyName()); - expertAvoidCompanyInfo.setCompanyUniqCode(r.getCompanyUniqCode()); - return expertAvoidCompanyInfo; + ExpertAvoidCompanyInfo avoidCompanyInfo = new ExpertAvoidCompanyInfo(); + avoidCompanyInfo.setCompanyName(r.getCompanyName()); + avoidCompanyInfo.setCompanyUniqCode(r.getCompanyUniqCode()); + return avoidCompanyInfo; }).collect(Collectors.toList())); return professionalInfo; } - public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO - , Map> dictionaryFieldInfoMap) { + public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO, + Map> dictInfoMap) { ExpertJobInfo jobInfo = new ExpertJobInfo(); - jobInfo.setJobStatus(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey())); + jobInfo.setJobStatus(dictInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey())); jobInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt()); jobInfo.setCompany(expertUserInfoDTO.getCompany()); jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode()); jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode()); jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties()); jobInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt()); - jobInfo.setAdministrativeRank(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey())); - jobInfo.setCompanyAttribute(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())); + jobInfo.setAdministrativeRank(dictInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey())); + jobInfo.setCompanyAttribute(dictInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())); jobInfo.setAddress(expertUserInfoDTO.getAddress()); jobInfo.setExperience(expertUserInfoDTO.getExperience()); return jobInfo; } - public static ExpertEduInfo buildExpertEduInfo(ExpertUserFullInfoDTO expertUserInfoDTO - , Map> dictionaryFieldInfoMap, Map fileBasicInfoMap) { + public static ExpertEduInfo buildExpertEduInfo(ExpertUserFullInfoDTO expertFullInfo, + Map> dictInfoMap, + Map fileInfoMap) { // 学历信息 ExpertEduInfo eduInfo = new ExpertEduInfo(); - eduInfo.setSchool(expertUserInfoDTO.getSchool()); - eduInfo.setGraduatedAt(expertUserInfoDTO.getGraduatedAt()); - eduInfo.setAcademicTitle(expertUserInfoDTO.getAcademicTitle()); - eduInfo.setEdu(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey())); - eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileBasicInfoMap - , expertUserInfoDTO.getGraduationCertificateFileIdList())); - eduInfo.setDegree(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey())); - eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getDegreeCertificateFileIdList())); + eduInfo.setSchool(expertFullInfo.getSchool()); + eduInfo.setGraduatedAt(expertFullInfo.getGraduatedAt()); + eduInfo.setAcademicTitle(expertFullInfo.getAcademicTitle()); + eduInfo.setEdu(dictInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey())); + eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getGraduationCertificateFileIdList())); + eduInfo.setDegree(dictInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey())); + eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getDegreeCertificateFileIdList())); return eduInfo; } - public static List getFileBasicInfoList(Map fileBasicInfoMap, List fileIdList) { - if (CollectionUtils.isEmpty(fileIdList)) { + private static List getFileBasicInfoList(Map fileBasicInfoMap, List fileIdList) { + if (CollUtil.isEmpty(fileIdList)) { return new ArrayList<>(); } List fileBasicInfoList = new ArrayList<>(); @@ -249,33 +250,33 @@ public class ExpertUserInfoAssembler { return basicInfo; } - public static ExpertFullInfoAllDTO buildExpertFullInfoAllDTO(ExpertUserFullInfo expertUserFullInfo - , List expertTagList - , List expertDictionaryList - , List expertIntentionWorkRegionList - , List expertMetaApplyList - , List expertAvoidCompanyList) { - ExpertUserFullInfoDTO expertUserFullInfoDTO = buildExpertUserFullInfoDTO(expertUserFullInfo); - List expertDictionaryDTOList = buildExpertDictionaryDTOList(expertDictionaryList); - List expertTagDTOList = buildExpertTagDTOList(expertTagList); - List expertIntentionWorkRegionInfo = buildExpertIntentionWorkRegionInfo(expertIntentionWorkRegionList); + public static ExpertFullInfoAllDTO buildExpertFullInfoAllDTO(ExpertUserFullInfo expertUserFullInfo, + List expertTagList, + List expertDictionaryList, + List intentionWorkRegionList, + List expertMetaApplyList, + List expertAvoidCompanyList) { + ExpertUserFullInfoDTO expertFullInfoDto = buildExpertUserFullInfoDTO(expertUserFullInfo); + List expertDicts = buildExpertDictionaryDTOList(expertDictionaryList); + List expertTags = buildExpertTagDTOList(expertTagList); + List intentionWorkRegions = buildExpertIntentionWorkRegionInfo(intentionWorkRegionList); // 专家申请履职意向展示列表 - List expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList); + List applyIntentionWorkRegions = buildExpertApplyIntentionWorkRegionInfo(intentionWorkRegionList, expertMetaApplyList); List expertAvoidCompanyDTOList = buildExpertAvoidCompanyDTOList(expertAvoidCompanyList); - ExpertFullInfoAllDTO expertFullInfoAllDTO = new ExpertFullInfoAllDTO(); - expertFullInfoAllDTO.setUserId(expertUserFullInfo.getUserId()); - expertFullInfoAllDTO.setExpertUserInfoDTO(expertUserFullInfoDTO); - expertFullInfoAllDTO.setExpertDictionaryList(expertDictionaryDTOList); - expertFullInfoAllDTO.setExpertTagList(expertTagDTOList); - expertFullInfoAllDTO.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo); - expertFullInfoAllDTO.setExpertApplyIntentionWorkRegionInfo(expertApplyIntentionWorkRegionInfo); - expertFullInfoAllDTO.setExpertAvoidCompanyList(expertAvoidCompanyDTOList); - return expertFullInfoAllDTO; + ExpertFullInfoAllDTO expertFullInfoAll = new ExpertFullInfoAllDTO(); + expertFullInfoAll.setUserId(expertUserFullInfo.getUserId()); + expertFullInfoAll.setExpertUserInfoDTO(expertFullInfoDto); + expertFullInfoAll.setExpertDictionaryList(expertDicts); + expertFullInfoAll.setExpertTagList(expertTags); + expertFullInfoAll.setExpertIntentionWorkRegionInfo(intentionWorkRegions); + expertFullInfoAll.setExpertApplyIntentionWorkRegionInfo(applyIntentionWorkRegions); + expertFullInfoAll.setExpertAvoidCompanyList(expertAvoidCompanyDTOList); + return expertFullInfoAll; } - private static List buildExpertApplyIntentionWorkRegionInfo(List expertIntentionWorkRegionList - , List expertMetaApplyList) { + private static List buildExpertApplyIntentionWorkRegionInfo(List expertIntentionWorkRegionList, + List expertMetaApplyList) { Set set = new HashSet<>(); for (ExpertIntentionWorkRegion expertIntentionWorkRegion : expertIntentionWorkRegionList) { RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); @@ -453,7 +454,6 @@ public class ExpertUserInfoAssembler { expertAdminExpertManageListDTO.setCreateTime(expertUserFullInfo.getCreateOn()); return expertAdminExpertManageListDTO; - } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java index 48f6466..0acba3d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java @@ -53,7 +53,7 @@ public class ExpertInfoSensitiveFieldModifyCheckHelper { ExpertUserFullInfoDTO expertUserInfoDTO = expertUserFullInfoAll.getExpertUserInfoDTO(); // 字典字典段map Map> dictionaryFieldInfoMap = - expertUserInfoAssembler.buildDictionaryFieldInfoMap(expertUserFullInfoAll.getExpertDictionaryList()); + expertUserInfoAssembler.buildDictInfoMap(expertUserFullInfoAll.getExpertDictionaryList()); // 专家文件资料map Map fileBasicInfoMap = ExpertUserInfoAssembler.buildFileBasicInfoMap(attachFiles); // 专家标签字段map