@@ -10,12 +10,12 @@ import com.hz.pm.api.common.helper.RegionCacheHelper; | |||||
import com.hz.pm.api.expert.controller.ExpertController; | import com.hz.pm.api.expert.controller.ExpertController; | ||||
import com.hz.pm.api.expert.model.*; | import com.hz.pm.api.expert.model.*; | ||||
import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest; | import com.hz.pm.api.expert.model.req.ExpertRegistrationRequest; | ||||
import com.hz.pm.api.meta.constant.DictAllTypeEnum; | |||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | import com.hz.pm.api.meta.constant.ExpertTagEnum; | ||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.TagCache; | import com.hz.pm.api.meta.helper.TagCache; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | import com.hz.pm.api.meta.model.dto.TagDTO; | ||||
import com.hz.pm.api.organization.model.entity.DingOrganization; | import com.hz.pm.api.organization.model.entity.DingOrganization; | ||||
import com.hz.pm.api.organization.service.IDingOrganizationService; | import com.hz.pm.api.organization.service.IDingOrganizationService; | ||||
@@ -62,7 +62,7 @@ public class ExpertRegisterUtil { | |||||
// 政治面貌 | // 政治面貌 | ||||
basic.setPolitical(new ArrayList<>()); | basic.setPolitical(new ArrayList<>()); | ||||
String political = MapUtil.getStr(w, "政治面貌"); | String political = MapUtil.getStr(w, "政治面貌"); | ||||
List<DictionaryDTO> politicalDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.POLITICAL.getKey()); | |||||
List<DictDTO> politicalDicts = dictionaryCache.listDictByDictType(DictTypeEnum.POLITICAL.getKey()); | |||||
if (!politicalDicts.isEmpty()) { | if (!politicalDicts.isEmpty()) { | ||||
politicalDicts.stream() | politicalDicts.stream() | ||||
.filter(dict -> dict.getName().equals(political)) | .filter(dict -> dict.getName().equals(political)) | ||||
@@ -82,7 +82,7 @@ public class ExpertRegisterUtil { | |||||
eduInfo.setDegree(new ArrayList<>()); | eduInfo.setDegree(new ArrayList<>()); | ||||
// 学历 | // 学历 | ||||
String eduStr = MapUtil.getStr(w, "学历"); | String eduStr = MapUtil.getStr(w, "学历"); | ||||
List<DictionaryDTO> eduDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.EDU.getKey()); | |||||
List<DictDTO> eduDicts = dictionaryCache.listDictByDictType(DictTypeEnum.EDU.getKey()); | |||||
if (!eduDicts.isEmpty()) { | if (!eduDicts.isEmpty()) { | ||||
eduDicts.stream() | eduDicts.stream() | ||||
.filter(dict -> dict.getName().equals(eduStr)) | .filter(dict -> dict.getName().equals(eduStr)) | ||||
@@ -96,7 +96,7 @@ public class ExpertRegisterUtil { | |||||
} | } | ||||
// 学位 | // 学位 | ||||
String degreeStr = MapUtil.getStr(w, "学位"); | String degreeStr = MapUtil.getStr(w, "学位"); | ||||
List<DictionaryDTO> degreeDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.DEGREE.getKey()); | |||||
List<DictDTO> degreeDicts = dictionaryCache.listDictByDictType(DictTypeEnum.DEGREE.getKey()); | |||||
if (!degreeDicts.isEmpty()) { | if (!degreeDicts.isEmpty()) { | ||||
degreeDicts.stream() | degreeDicts.stream() | ||||
.filter(dict -> dict.getName().equals(degreeStr)) | .filter(dict -> dict.getName().equals(degreeStr)) | ||||
@@ -139,7 +139,7 @@ public class ExpertRegisterUtil { | |||||
jobInfo.setAdministrativeDuties(MapUtil.getStr(w, "行政职务")); | jobInfo.setAdministrativeDuties(MapUtil.getStr(w, "行政职务")); | ||||
jobInfo.setAdministrativeRank(new ArrayList<>()); | jobInfo.setAdministrativeRank(new ArrayList<>()); | ||||
String administrativeRankStr = MapUtil.getStr(w, "行政职级"); | String administrativeRankStr = MapUtil.getStr(w, "行政职级"); | ||||
List<DictionaryDTO> administrativeRankDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.ADMINISTRATIVE_RANK.getKey()); | |||||
List<DictDTO> administrativeRankDicts = dictionaryCache.listDictByDictType(DictTypeEnum.ADMINISTRATIVE_RANK.getKey()); | |||||
if (!administrativeRankDicts.isEmpty()) { | if (!administrativeRankDicts.isEmpty()) { | ||||
administrativeRankDicts.stream() | administrativeRankDicts.stream() | ||||
.filter(dict -> dict.getName().equals(administrativeRankStr)) | .filter(dict -> dict.getName().equals(administrativeRankStr)) | ||||
@@ -153,7 +153,7 @@ public class ExpertRegisterUtil { | |||||
} | } | ||||
jobInfo.setCompanyAttribute(new ArrayList<>()); | jobInfo.setCompanyAttribute(new ArrayList<>()); | ||||
String companyTypeStr = MapUtil.getStr(w, "*单位类型"); | String companyTypeStr = MapUtil.getStr(w, "*单位类型"); | ||||
List<DictionaryDTO> companyTypeDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.COMPANY_ATTRIBUTE.getKey()); | |||||
List<DictDTO> companyTypeDicts = dictionaryCache.listDictByDictType(DictTypeEnum.COMPANY_ATTRIBUTE.getKey()); | |||||
if (!companyTypeDicts.isEmpty()) { | if (!companyTypeDicts.isEmpty()) { | ||||
companyTypeDicts.stream() | companyTypeDicts.stream() | ||||
.filter(dict -> dict.getName().equals(companyTypeStr)) | .filter(dict -> dict.getName().equals(companyTypeStr)) | ||||
@@ -240,7 +240,7 @@ public class ExpertRegisterUtil { | |||||
} | } | ||||
professionalInfo.setTitleLevel(new ArrayList<>()); | professionalInfo.setTitleLevel(new ArrayList<>()); | ||||
String titleLevel = MapUtil.getStr(w, "*职称级别"); | String titleLevel = MapUtil.getStr(w, "*职称级别"); | ||||
List<DictionaryDTO> titleLevelDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.TITLE_LEVEL.getKey()); | |||||
List<DictDTO> titleLevelDicts = dictionaryCache.listDictByDictType(DictTypeEnum.TITLE_LEVEL.getKey()); | |||||
if (!titleLevelDicts.isEmpty()) { | if (!titleLevelDicts.isEmpty()) { | ||||
titleLevelDicts.stream() | titleLevelDicts.stream() | ||||
.filter(dict -> dict.getName().equals(titleLevel)) | .filter(dict -> dict.getName().equals(titleLevel)) | ||||
@@ -114,7 +114,7 @@ public class DashboardChartAssembler { | |||||
for (String dictionaryCode : dictionaryCodeIdMap.keySet()) { | for (String dictionaryCode : dictionaryCodeIdMap.keySet()) { | ||||
AnalysisData analysisData = new AnalysisData(); | AnalysisData analysisData = new AnalysisData(); | ||||
analysisData.setKey(dictionaryCache.getByCode(dictionaryCode).getName()); | |||||
analysisData.setKey(dictionaryCache.getByCode(dictionaryCode).get().getName()); | |||||
analysisData.setValue(dictionaryCodeIdMap.get(dictionaryCode).size()); | analysisData.setValue(dictionaryCodeIdMap.get(dictionaryCode).size()); | ||||
dataList.add(analysisData); | dataList.add(analysisData); | ||||
} | } | ||||
@@ -19,7 +19,7 @@ import com.hz.pm.api.meeting.entity.domain.MeetingExpertJudge; | |||||
import com.hz.pm.api.meeting.entity.enumeration.MeetingStatusEnum; | import com.hz.pm.api.meeting.entity.enumeration.MeetingStatusEnum; | ||||
import com.hz.pm.api.meeting.service.IMeetingExpertJudgeService; | import com.hz.pm.api.meeting.service.IMeetingExpertJudgeService; | ||||
import com.hz.pm.api.meeting.service.IMeetingService; | import com.hz.pm.api.meeting.service.IMeetingService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | import com.hz.pm.api.meta.service.IExpertDictionaryService; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -98,7 +98,7 @@ public class DashboardExpertManage { | |||||
if (CollectionUtil.isNotEmpty(regionDegreeExpertIdList)) { | if (CollectionUtil.isNotEmpty(regionDegreeExpertIdList)) { | ||||
// 区域学历分布 | // 区域学历分布 | ||||
List<ExpertDictionary> degreeExpertDictionaryList = iExpertDictionaryService | List<ExpertDictionary> degreeExpertDictionaryList = iExpertDictionaryService | ||||
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.DEGREE); | |||||
.listByUserId(regionDegreeExpertIdList, ExpertDictTypeEnum.DEGREE); | |||||
Map<String, List<String>> degreeCodeMap = degreeExpertDictionaryList.stream() | Map<String, List<String>> degreeCodeMap = degreeExpertDictionaryList.stream() | ||||
.map(ExpertDictionary::getDictionaryCode) | .map(ExpertDictionary::getDictionaryCode) | ||||
.collect(Collectors.groupingBy(Function.identity())); | .collect(Collectors.groupingBy(Function.identity())); | ||||
@@ -108,7 +108,7 @@ public class DashboardExpertManage { | |||||
// 区域职称级别分布 | // 区域职称级别分布 | ||||
List<ExpertDictionary> titleLevelExpertDictionaryList = iExpertDictionaryService | List<ExpertDictionary> titleLevelExpertDictionaryList = iExpertDictionaryService | ||||
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.TITLE_LEVEL); | |||||
.listByUserId(regionDegreeExpertIdList, ExpertDictTypeEnum.TITLE_LEVEL); | |||||
Map<String, List<ExpertDictionary>> titleLevelCodeMap = titleLevelExpertDictionaryList.stream() | Map<String, List<ExpertDictionary>> titleLevelCodeMap = titleLevelExpertDictionaryList.stream() | ||||
.collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode)); | .collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode)); | ||||
AnalysisChart regionExpertTitleLevelChartAnalysisChart = | AnalysisChart regionExpertTitleLevelChartAnalysisChart = | ||||
@@ -14,7 +14,7 @@ import com.hz.pm.api.expert.entity.ExpertIntentionWorkRegion; | |||||
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | import com.hz.pm.api.expert.entity.ExpertUserFullInfo; | ||||
import com.hz.pm.api.expert.service.IExpertIntentionWorkRegionService; | import com.hz.pm.api.expert.service.IExpertIntentionWorkRegionService; | ||||
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | import com.hz.pm.api.meta.model.dto.TagDTO; | ||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.model.entity.ExpertTag; | import com.hz.pm.api.meta.model.entity.ExpertTag; | ||||
@@ -96,10 +96,10 @@ public class ExpertStatisticsManage { | |||||
List<TagDTO> tags = metaTagService.queryAll(); | List<TagDTO> tags = metaTagService.queryAll(); | ||||
List<DictionaryDTO> dictionaries = metaDictionaryService.queryAll(); | |||||
List<DictDTO> dictionaries = metaDictionaryService.queryAll(); | |||||
Set<String> code = Sets.newHashSet(); | Set<String> code = Sets.newHashSet(); | ||||
Map<String, String> dictionMap = dictionaries.stream().filter(d -> code.add(d.getDictionaryCode())) | Map<String, String> dictionMap = dictionaries.stream().filter(d -> code.add(d.getDictionaryCode())) | ||||
.collect(Collectors.toMap(DictionaryDTO::getDictionaryCode, DictionaryDTO::getName)); | |||||
.collect(Collectors.toMap(DictDTO::getDictionaryCode, DictDTO::getName)); | |||||
List<ExpertDictionary> expertDictionaries = expertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) | List<ExpertDictionary> expertDictionaries = expertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) | ||||
.eq(ExpertDictionary::getExpertInfoField, DashboardConstant.Expert.EXPERT_TYPE)); | .eq(ExpertDictionary::getExpertInfoField, DashboardConstant.Expert.EXPERT_TYPE)); | ||||
@@ -11,7 +11,7 @@ import com.hz.pm.api.expert.model.vo.ExpertLibraryListItemVO; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.impl.TagsCacheImpl; | import com.hz.pm.api.meta.helper.impl.TagsCacheImpl; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | import com.hz.pm.api.meta.model.dto.TagDTO; | ||||
import com.hz.pm.api.sys.model.dto.RegionDTO; | import com.hz.pm.api.sys.model.dto.RegionDTO; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -19,9 +19,7 @@ import org.apache.commons.collections4.CollectionUtils; | |||||
import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.Objects; | |||||
import java.util.*; | |||||
import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
/** | /** | ||||
@@ -104,13 +102,11 @@ public class ExpertAdminExpertManageAssembler { | |||||
public List<DictionaryFieldInfo> assembleDictionaryName(List<DictionaryFieldInfo> collect) { | public List<DictionaryFieldInfo> assembleDictionaryName(List<DictionaryFieldInfo> collect) { | ||||
if (CollectionUtil.isEmpty(collect)){ | if (CollectionUtil.isEmpty(collect)){ | ||||
return new ArrayList<>(); | |||||
return Collections.emptyList(); | |||||
} | } | ||||
return collect.stream().peek(r -> { | return collect.stream().peek(r -> { | ||||
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
if (Objects.nonNull(dictionaryDTO)) { | |||||
r.setDictionaryName(dictionaryDTO.getName()); | |||||
} | |||||
Optional<DictDTO> dict = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
dict.ifPresent(dictDTO -> r.setDictionaryName(dictDTO.getName())); | |||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
@@ -9,7 +9,7 @@ import com.hz.pm.api.expert.model.bo.ExpertInfoSensitiveFieldCheckBO; | |||||
import com.hz.pm.api.expert.model.cmd.ExpertFullInfoSaveCmd; | import com.hz.pm.api.expert.model.cmd.ExpertFullInfoSaveCmd; | ||||
import com.hz.pm.api.expert.model.cmd.ExpertInfoModifyCmd; | import com.hz.pm.api.expert.model.cmd.ExpertInfoModifyCmd; | ||||
import com.hz.pm.api.expert.model.dto.*; | import com.hz.pm.api.expert.model.dto.*; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | import com.hz.pm.api.meta.constant.ExpertTagEnum; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
@@ -133,15 +133,15 @@ public class ExpertInfoCmdAssembler { | |||||
recommendedWay = recommendInfo.getRecommendedWay(); | recommendedWay = recommendInfo.getRecommendedWay(); | ||||
} | } | ||||
List<DictionaryFieldInfo> dictionaryFieldInfoList = new ArrayList<>(); | List<DictionaryFieldInfo> dictionaryFieldInfoList = new ArrayList<>(); | ||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, political, DictExpertInfoTypeEnum.POLITICAL); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, expertType, DictExpertInfoTypeEnum.EXPERT_TYPE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, edu, DictExpertInfoTypeEnum.EDU); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, degree, DictExpertInfoTypeEnum.DEGREE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, jobStatus, DictExpertInfoTypeEnum.JOB_STATUS); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, companyAttribute, DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, administrativeRank, DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, titleLevel, DictExpertInfoTypeEnum.TITLE_LEVEL); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, recommendedWay, DictExpertInfoTypeEnum.RECOMMENDED_WAY); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, political, ExpertDictTypeEnum.POLITICAL); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, expertType, ExpertDictTypeEnum.EXPERT_TYPE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, edu, ExpertDictTypeEnum.EDU); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, degree, ExpertDictTypeEnum.DEGREE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, jobStatus, ExpertDictTypeEnum.JOB_STATUS); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, companyAttribute, ExpertDictTypeEnum.COMPANY_ATTRIBUTE); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, administrativeRank, ExpertDictTypeEnum.ADMINISTRATIVE_RANK); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, titleLevel, ExpertDictTypeEnum.TITLE_LEVEL); | |||||
assemblerDictionaryFieldName(dictionaryFieldInfoList, recommendedWay, ExpertDictTypeEnum.RECOMMENDED_WAY); | |||||
return dictionaryFieldInfoList.stream().map(r -> { | return dictionaryFieldInfoList.stream().map(r -> { | ||||
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); | ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); | ||||
@@ -153,7 +153,7 @@ public class ExpertInfoCmdAssembler { | |||||
private static void assemblerDictionaryFieldName( | private static void assemblerDictionaryFieldName( | ||||
List<DictionaryFieldInfo> allDictionaryFieldInfoList, List<DictionaryFieldInfo> originalDictionaryFieldInfoList | List<DictionaryFieldInfo> allDictionaryFieldInfoList, List<DictionaryFieldInfo> originalDictionaryFieldInfoList | ||||
, DictExpertInfoTypeEnum dictExpertInfoTypeEnum) { | |||||
, ExpertDictTypeEnum dictExpertInfoTypeEnum) { | |||||
if (CollectionUtils.isNotEmpty(originalDictionaryFieldInfoList)) { | if (CollectionUtils.isNotEmpty(originalDictionaryFieldInfoList)) { | ||||
originalDictionaryFieldInfoList = originalDictionaryFieldInfoList.stream().map(r -> { | originalDictionaryFieldInfoList = originalDictionaryFieldInfoList.stream().map(r -> { | ||||
r.setDictionaryFieldName(dictExpertInfoTypeEnum.getKey()); | r.setDictionaryFieldName(dictExpertInfoTypeEnum.getKey()); | ||||
@@ -15,12 +15,12 @@ import com.hz.pm.api.expert.model.*; | |||||
import com.hz.pm.api.expert.model.dto.*; | import com.hz.pm.api.expert.model.dto.*; | ||||
import com.hz.pm.api.expert.model.vo.ExpertFullInfoVO; | import com.hz.pm.api.expert.model.vo.ExpertFullInfoVO; | ||||
import com.hz.pm.api.gov.model.vo.GovBusinessStripVO; | import com.hz.pm.api.gov.model.vo.GovBusinessStripVO; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | import com.hz.pm.api.meta.constant.ExpertTagEnum; | ||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.TagCache; | import com.hz.pm.api.meta.helper.TagCache; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | import com.hz.pm.api.meta.model.dto.TagDTO; | ||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.model.entity.ExpertTag; | import com.hz.pm.api.meta.model.entity.ExpertTag; | ||||
@@ -67,7 +67,7 @@ public class ExpertUserInfoAssembler { | |||||
ExpertProfessionalInfo profession = buildExpertProfessionalInfo(expertUserInfo, dictMap, tagMap, fileMap, avoidCompanies); | ExpertProfessionalInfo profession = buildExpertProfessionalInfo(expertUserInfo, dictMap, tagMap, fileMap, avoidCompanies); | ||||
// 推荐信息 | // 推荐信息 | ||||
ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo(); | ExpertRecommendInfo recommendInfo = new ExpertRecommendInfo(); | ||||
recommendInfo.setRecommendedWay(dictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())); | |||||
recommendInfo.setRecommendedWay(dictMap.get(ExpertDictTypeEnum.RECOMMENDED_WAY.getKey())); | |||||
recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileMap, expertUserInfo.getRecommendationProofFileIdList())); | recommendInfo.setRecommendationProofFile(getFileBasicInfoList(fileMap, expertUserInfo.getRecommendationProofFileIdList())); | ||||
// 其他信息 | // 其他信息 | ||||
ExpertOtherInfo otherInfo = new ExpertOtherInfo(); | ExpertOtherInfo otherInfo = new ExpertOtherInfo(); | ||||
@@ -125,10 +125,8 @@ public class ExpertUserInfoAssembler { | |||||
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | ||||
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | ||||
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | ||||
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
if (Objects.nonNull(dictionaryDTO)) { | |||||
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); | |||||
} | |||||
Optional<DictDTO> dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName())); | |||||
return dictionaryFieldInfo; | return dictionaryFieldInfo; | ||||
}).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName)); | }).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName)); | ||||
} | } | ||||
@@ -140,7 +138,7 @@ public class ExpertUserInfoAssembler { | |||||
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) { | List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) { | ||||
ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo(); | ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo(); | ||||
professionalInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles()); | professionalInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles()); | ||||
professionalInfo.setTitleLevel(dictInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())); | |||||
professionalInfo.setTitleLevel(dictInfoMap.get(ExpertDictTypeEnum.TITLE_LEVEL.getKey())); | |||||
professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList())); | professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList())); | ||||
professionalInfo.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey())); | professionalInfo.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey())); | ||||
professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey())); | professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey())); | ||||
@@ -159,15 +157,15 @@ public class ExpertUserInfoAssembler { | |||||
public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO, | public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO, | ||||
Map<String, List<DictionaryFieldInfo>> dictInfoMap) { | Map<String, List<DictionaryFieldInfo>> dictInfoMap) { | ||||
ExpertJobInfo jobInfo = new ExpertJobInfo(); | ExpertJobInfo jobInfo = new ExpertJobInfo(); | ||||
jobInfo.setJobStatus(dictInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey())); | |||||
jobInfo.setJobStatus(dictInfoMap.get(ExpertDictTypeEnum.JOB_STATUS.getKey())); | |||||
jobInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt()); | jobInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt()); | ||||
jobInfo.setCompany(expertUserInfoDTO.getCompany()); | jobInfo.setCompany(expertUserInfoDTO.getCompany()); | ||||
jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode()); | jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode()); | ||||
jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode()); | jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode()); | ||||
jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties()); | jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties()); | ||||
jobInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt()); | jobInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt()); | ||||
jobInfo.setAdministrativeRank(dictInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey())); | |||||
jobInfo.setCompanyAttribute(dictInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())); | |||||
jobInfo.setAdministrativeRank(dictInfoMap.get(ExpertDictTypeEnum.ADMINISTRATIVE_RANK.getKey())); | |||||
jobInfo.setCompanyAttribute(dictInfoMap.get(ExpertDictTypeEnum.COMPANY_ATTRIBUTE.getKey())); | |||||
jobInfo.setAddress(expertUserInfoDTO.getAddress()); | jobInfo.setAddress(expertUserInfoDTO.getAddress()); | ||||
jobInfo.setExperience(expertUserInfoDTO.getExperience()); | jobInfo.setExperience(expertUserInfoDTO.getExperience()); | ||||
return jobInfo; | return jobInfo; | ||||
@@ -181,9 +179,9 @@ public class ExpertUserInfoAssembler { | |||||
eduInfo.setSchool(expertFullInfo.getSchool()); | eduInfo.setSchool(expertFullInfo.getSchool()); | ||||
eduInfo.setGraduatedAt(expertFullInfo.getGraduatedAt()); | eduInfo.setGraduatedAt(expertFullInfo.getGraduatedAt()); | ||||
eduInfo.setAcademicTitle(expertFullInfo.getAcademicTitle()); | eduInfo.setAcademicTitle(expertFullInfo.getAcademicTitle()); | ||||
eduInfo.setEdu(dictInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey())); | |||||
eduInfo.setEdu(dictInfoMap.get(ExpertDictTypeEnum.EDU.getKey())); | |||||
eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getGraduationCertificateFileIdList())); | eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getGraduationCertificateFileIdList())); | ||||
eduInfo.setDegree(dictInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey())); | |||||
eduInfo.setDegree(dictInfoMap.get(ExpertDictTypeEnum.DEGREE.getKey())); | |||||
eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getDegreeCertificateFileIdList())); | eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getDegreeCertificateFileIdList())); | ||||
return eduInfo; | return eduInfo; | ||||
} | } | ||||
@@ -226,7 +224,7 @@ public class ExpertUserInfoAssembler { | |||||
basicInfo.setName(expertUserInfoDTO.getName()); | basicInfo.setName(expertUserInfoDTO.getName()); | ||||
basicInfo.setAvatarFile(getFileBasicInfo(fileBasicInfoMap, expertUserInfoDTO.getAvatarFileId())); | basicInfo.setAvatarFile(getFileBasicInfo(fileBasicInfoMap, expertUserInfoDTO.getAvatarFileId())); | ||||
basicInfo.setGender(expertUserInfoDTO.getGender()); | basicInfo.setGender(expertUserInfoDTO.getGender()); | ||||
basicInfo.setPolitical(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())); | |||||
basicInfo.setPolitical(dictionaryFieldInfoMap.get(ExpertDictTypeEnum.POLITICAL.getKey())); | |||||
basicInfo.setIdCard(expertUserInfoDTO.getIdCard()); | basicInfo.setIdCard(expertUserInfoDTO.getIdCard()); | ||||
basicInfo.setOfficePhone(expertUserInfoDTO.getPhoneNo()); | basicInfo.setOfficePhone(expertUserInfoDTO.getPhoneNo()); | ||||
basicInfo.setBirth(expertUserInfoDTO.getBirth()); | basicInfo.setBirth(expertUserInfoDTO.getBirth()); | ||||
@@ -246,7 +244,7 @@ public class ExpertUserInfoAssembler { | |||||
expertIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPath(r.getRegionCode(), r.getRegionLevel())); | expertIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPath(r.getRegionCode(), r.getRegionLevel())); | ||||
return expertIntentionWorkRegion; | return expertIntentionWorkRegion; | ||||
}).collect(Collectors.toList())); | }).collect(Collectors.toList())); | ||||
basicInfo.setExpertType(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())); | |||||
basicInfo.setExpertType(dictionaryFieldInfoMap.get(ExpertDictTypeEnum.EXPERT_TYPE.getKey())); | |||||
return basicInfo; | return basicInfo; | ||||
} | } | ||||
@@ -423,11 +421,11 @@ public class ExpertUserInfoAssembler { | |||||
List<ExpertDictionary> userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList()); | List<ExpertDictionary> userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList()); | ||||
Map<String, List<ExpertDictionary>> fieldExpertDictMap = userExpertDictList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField)); | Map<String, List<ExpertDictionary>> fieldExpertDictMap = userExpertDictList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField)); | ||||
adminManageExpertListItem.setExpertType( | adminManageExpertListItem.setExpertType( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.EXPERT_TYPE.getKey()))); | |||||
adminManageExpertListItem.setCompanyAttribute( | adminManageExpertListItem.setCompanyAttribute( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.COMPANY_ATTRIBUTE.getKey()))); | |||||
adminManageExpertListItem.setTitleLevel( | adminManageExpertListItem.setTitleLevel( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.TITLE_LEVEL.getKey()))); | |||||
// 装配标签数据 | // 装配标签数据 | ||||
List<ExpertTag> expertTagList = Objects.isNull(expertTagMap.get(userId)) ? new ArrayList<>() : expertTagMap.get(userId); | List<ExpertTag> expertTagList = Objects.isNull(expertTagMap.get(userId)) ? new ArrayList<>() : expertTagMap.get(userId); | ||||
Map<String, List<ExpertTag>> fieldExpertTagMap = expertTagList.stream().collect(Collectors.groupingBy(ExpertTag::getExpertInfoField)); | Map<String, List<ExpertTag>> fieldExpertTagMap = expertTagList.stream().collect(Collectors.groupingBy(ExpertTag::getExpertInfoField)); | ||||
@@ -446,13 +444,13 @@ public class ExpertUserInfoAssembler { | |||||
adminManageExpertListItem.setHometown(expertUserFullInfo.getHometown()); | adminManageExpertListItem.setHometown(expertUserFullInfo.getHometown()); | ||||
adminManageExpertListItem.setNationality(expertUserFullInfo.getNationality()); | adminManageExpertListItem.setNationality(expertUserFullInfo.getNationality()); | ||||
adminManageExpertListItem.setPolitical( | adminManageExpertListItem.setPolitical( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.POLITICAL.getKey()))); | |||||
adminManageExpertListItem.setIdCard(expertUserFullInfo.getIdCard()); | adminManageExpertListItem.setIdCard(expertUserFullInfo.getIdCard()); | ||||
adminManageExpertListItem.setBankNo(expertUserFullInfo.getBankNo()); | adminManageExpertListItem.setBankNo(expertUserFullInfo.getBankNo()); | ||||
adminManageExpertListItem.setEdu( | adminManageExpertListItem.setEdu( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EDU.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.EDU.getKey()))); | |||||
adminManageExpertListItem.setRecommendedWay( | adminManageExpertListItem.setRecommendedWay( | ||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()))); | |||||
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.RECOMMENDED_WAY.getKey()))); | |||||
adminManageExpertListItem.setCreateTime(expertUserFullInfo.getCreateOn()); | adminManageExpertListItem.setCreateTime(expertUserFullInfo.getCreateOn()); | ||||
return adminManageExpertListItem; | return adminManageExpertListItem; | ||||
@@ -19,7 +19,7 @@ import java.time.LocalDateTime; | |||||
*/ | */ | ||||
@Data | @Data | ||||
@TableName("nd_expert_user_full_info") | @TableName("nd_expert_user_full_info") | ||||
@ApiModel(value = "NdExpertUserFullInfo对象", description = "") | |||||
@ApiModel(value = "NdExpertUserFullInfo对象") | |||||
public class ExpertUserFullInfo implements Serializable { | public class ExpertUserFullInfo implements Serializable { | ||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -5,7 +5,7 @@ import com.hz.pm.api.expert.model.*; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.TagCache; | import com.hz.pm.api.meta.helper.TagCache; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagDTO; | import com.hz.pm.api.meta.model.dto.TagDTO; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.Optional; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
@@ -76,33 +77,32 @@ public class ExpertManageHelper { | |||||
/** | /** | ||||
* 校验字典code是否合法 | * 校验字典code是否合法 | ||||
* | * | ||||
* @param expertBasicInfo \ | |||||
* @param expertEduInfo \ | |||||
* @param expertJobInfo \ | |||||
* @param basicInfo \ | |||||
* @param eduInfo \ | |||||
* @param jobInfo \ | |||||
*/ | */ | ||||
public void dictionaryFieldCheck(ExpertBasicInfo expertBasicInfo, ExpertEduInfo expertEduInfo | |||||
, ExpertJobInfo expertJobInfo) { | |||||
List<DictionaryFieldInfo> political = expertBasicInfo.getPolitical(); | |||||
List<DictionaryFieldInfo> edu = expertEduInfo.getEdu(); | |||||
List<DictionaryFieldInfo> degree = expertEduInfo.getDegree(); | |||||
List<DictionaryFieldInfo> jobStatus = expertJobInfo.getJobStatus(); | |||||
List<DictionaryFieldInfo> companyAttribute = expertJobInfo.getCompanyAttribute(); | |||||
List<DictionaryFieldInfo> administrativeRank = expertJobInfo.getAdministrativeRank(); | |||||
public void dictionaryFieldCheck(ExpertBasicInfo basicInfo, ExpertEduInfo eduInfo, ExpertJobInfo jobInfo) { | |||||
List<DictionaryFieldInfo> political = basicInfo.getPolitical(); | |||||
List<DictionaryFieldInfo> edu = eduInfo.getEdu(); | |||||
List<DictionaryFieldInfo> degree = eduInfo.getDegree(); | |||||
List<DictionaryFieldInfo> jobStatus = jobInfo.getJobStatus(); | |||||
List<DictionaryFieldInfo> companyAttribute = jobInfo.getCompanyAttribute(); | |||||
List<DictionaryFieldInfo> administrativeRank = jobInfo.getAdministrativeRank(); | |||||
List<DictionaryFieldInfo> dictionaryFieldInfoList = new ArrayList<>(); | |||||
dictionaryFieldInfoList.addAll(political); | |||||
dictionaryFieldInfoList.addAll(edu); | |||||
dictionaryFieldInfoList.addAll(degree); | |||||
dictionaryFieldInfoList.addAll(jobStatus); | |||||
dictionaryFieldInfoList.addAll(companyAttribute); | |||||
dictionaryFieldInfoList.addAll(administrativeRank); | |||||
List<DictionaryFieldInfo> dictFieldList = new ArrayList<>(); | |||||
dictFieldList.addAll(political); | |||||
dictFieldList.addAll(edu); | |||||
dictFieldList.addAll(degree); | |||||
dictFieldList.addAll(jobStatus); | |||||
dictFieldList.addAll(companyAttribute); | |||||
dictFieldList.addAll(administrativeRank); | |||||
for (DictionaryFieldInfo dictionaryFieldInfo : dictionaryFieldInfoList) { | |||||
String dictionaryFieldName = dictionaryFieldInfo.getDictionaryFieldName(); | |||||
String dictionaryCode = dictionaryFieldInfo.getDictionaryCode(); | |||||
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(dictionaryCode); | |||||
if (Objects.isNull(dictionaryDTO)) { | |||||
throw new BizException("illegal dictionaryCode: dictionaryFieldName=" + dictionaryFieldName + ",dictionaryCode=" + dictionaryCode); | |||||
for (DictionaryFieldInfo dictField : dictFieldList) { | |||||
String dictCode = dictField.getDictionaryCode(); | |||||
Optional<DictDTO> dict = dictionaryCache.getByCode(dictCode); | |||||
if (!dict.isPresent()) { | |||||
String dictFieldName = dictField.getDictionaryFieldName(); | |||||
throw BizException.wrap("字典数据无效:%s=%s", dictFieldName, dictCode); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -35,7 +35,7 @@ import com.hz.pm.api.expert.model.vo.ZzdInfoByMobileVO; | |||||
import com.hz.pm.api.expert.service.ExpertAdminManageService; | import com.hz.pm.api.expert.service.ExpertAdminManageService; | ||||
import com.hz.pm.api.expert.service.ExpertInfoService; | import com.hz.pm.api.expert.service.ExpertInfoService; | ||||
import com.hz.pm.api.expert.service.IExpertMetaApplyService; | import com.hz.pm.api.expert.service.IExpertMetaApplyService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | import com.hz.pm.api.meta.constant.ExpertTagEnum; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.bo.RegionContainsBO; | import com.hz.pm.api.meta.model.bo.RegionContainsBO; | ||||
@@ -105,19 +105,19 @@ public class ExpertAdminManage { | |||||
List<ExpertDictionaryQuery> expertDictQueryList = new ArrayList<>(); | List<ExpertDictionaryQuery> expertDictQueryList = new ArrayList<>(); | ||||
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { | if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { | ||||
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ||||
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); | |||||
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.TITLE_LEVEL.getKey()); | |||||
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); | expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); | ||||
expertDictQueryList.add(expertDictQuery); | expertDictQueryList.add(expertDictQuery); | ||||
} | } | ||||
if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) { | if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) { | ||||
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ||||
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()); | |||||
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.COMPANY_ATTRIBUTE.getKey()); | |||||
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode())); | expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode())); | ||||
expertDictQueryList.add(expertDictQuery); | expertDictQueryList.add(expertDictQuery); | ||||
} | } | ||||
if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) { | if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) { | ||||
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery(); | ||||
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()); | |||||
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.EXPERT_TYPE.getKey()); | |||||
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode())); | expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode())); | ||||
expertDictQueryList.add(expertDictQuery); | expertDictQueryList.add(expertDictQuery); | ||||
} | } | ||||
@@ -33,7 +33,7 @@ import com.hz.pm.api.meeting.entity.enumeration.ExpertJudgeEnum.AttendStatus; | |||||
import com.hz.pm.api.meeting.entity.enumeration.ExpertJudgeEnum.Performance; | import com.hz.pm.api.meeting.entity.enumeration.ExpertJudgeEnum.Performance; | ||||
import com.hz.pm.api.meeting.service.IMeetingExpertJudgeService; | import com.hz.pm.api.meeting.service.IMeetingExpertJudgeService; | ||||
import com.hz.pm.api.meeting.service.IMeetingExpertService; | import com.hz.pm.api.meeting.service.IMeetingExpertService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.sms.constant.VerificationCodeType; | import com.hz.pm.api.sms.constant.VerificationCodeType; | ||||
import com.hz.pm.api.sms.helper.VerifyCodeCheckHelper; | import com.hz.pm.api.sms.helper.VerifyCodeCheckHelper; | ||||
@@ -185,7 +185,7 @@ public class ExpertManage { | |||||
recommendedWay.forEach(r -> { | recommendedWay.forEach(r -> { | ||||
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); | ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); | ||||
expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); | expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); | ||||
expertDictionaryDTO.setExpertInfoField(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey()); | |||||
expertDictionaryDTO.setExpertInfoField(ExpertDictTypeEnum.RECOMMENDED_WAY.getKey()); | |||||
recommendedWayDictionaryDTOList.add(expertDictionaryDTO); | recommendedWayDictionaryDTOList.add(expertDictionaryDTO); | ||||
}); | }); | ||||
} | } | ||||
@@ -30,12 +30,12 @@ import com.hz.pm.api.expert.service.ExpertAdminManageService; | |||||
import com.hz.pm.api.expert.service.ExpertInfoService; | import com.hz.pm.api.expert.service.ExpertInfoService; | ||||
import com.hz.pm.api.expert.service.IExpertMetaApplyService; | import com.hz.pm.api.expert.service.IExpertMetaApplyService; | ||||
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | import com.hz.pm.api.expert.service.IExpertUserFullInfoService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.ExpertUserInfoHelper; | import com.hz.pm.api.meta.helper.ExpertUserInfoHelper; | ||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.bo.RegionContainsBO; | import com.hz.pm.api.meta.model.bo.RegionContainsBO; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | import com.hz.pm.api.meta.service.IExpertDictionaryService; | ||||
import com.hz.pm.api.sys.model.dto.RegionDTO; | import com.hz.pm.api.sys.model.dto.RegionDTO; | ||||
@@ -113,10 +113,10 @@ public class ExpertMetaApplyManage { | |||||
// 根据用户id 获取专家基本信息 | // 根据用户id 获取专家基本信息 | ||||
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds); | List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds); | ||||
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); | Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); | ||||
List<ExpertDictionary> titleLevelDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); | |||||
List<ExpertDictionary> titleLevelDictList = expertDictionaryService.listByUserId(expertIds, ExpertDictTypeEnum.TITLE_LEVEL); | |||||
Map<Long, List<ExpertDictionary>> titleLevelDictMap = CollUtils.group(titleLevelDictList, ExpertDictionary::getUserId); | Map<Long, List<ExpertDictionary>> titleLevelDictMap = CollUtils.group(titleLevelDictList, ExpertDictionary::getUserId); | ||||
List<ExpertDictionary> expertTypeDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.EXPERT_TYPE); | |||||
List<ExpertDictionary> expertTypeDictList = expertDictionaryService.listByUserId(expertIds, ExpertDictTypeEnum.EXPERT_TYPE); | |||||
Map<Long, List<ExpertDictionary>> expertTypeDictMap = CollUtils.group(expertTypeDictList, ExpertDictionary::getUserId); | Map<Long, List<ExpertDictionary>> expertTypeDictMap = CollUtils.group(expertTypeDictList, ExpertDictionary::getUserId); | ||||
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, titleLevelDictMap, expertTypeDictMap)); | result.setRecords(buildExpertApplyMetaVOList(records, expertMap, titleLevelDictMap, expertTypeDictMap)); | ||||
}); | }); | ||||
@@ -359,7 +359,7 @@ public class ExpertMetaApplyManage { | |||||
List<ExpertDictionaryQuery> expertDictionaryQueryList = new ArrayList<>(); | List<ExpertDictionaryQuery> expertDictionaryQueryList = new ArrayList<>(); | ||||
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { | if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) { | ||||
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); | ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery(); | ||||
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()); | |||||
expertDictionaryQuery.setExpertInfoField(ExpertDictTypeEnum.TITLE_LEVEL.getKey()); | |||||
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); | expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode())); | ||||
expertDictionaryQueryList.add(expertDictionaryQuery); | expertDictionaryQueryList.add(expertDictionaryQuery); | ||||
} | } | ||||
@@ -419,13 +419,11 @@ public class ExpertMetaApplyManage { | |||||
List<ExpertDictionary> titleLevelDictionaryList = titleLevelDictMap.get(userId); | List<ExpertDictionary> titleLevelDictionaryList = titleLevelDictMap.get(userId); | ||||
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { | if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { | ||||
expertApplyMetaVO.setTitleLevel(titleLevelDictionaryList.stream().map(r -> { | expertApplyMetaVO.setTitleLevel(titleLevelDictionaryList.stream().map(r -> { | ||||
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
Optional<DictDTO> dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | ||||
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | ||||
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | ||||
if (Objects.nonNull(dictionaryDTO)) { | |||||
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); | |||||
} | |||||
dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName())); | |||||
return dictionaryFieldInfo; | return dictionaryFieldInfo; | ||||
}).collect(Collectors.toList())); | }).collect(Collectors.toList())); | ||||
} | } | ||||
@@ -434,13 +432,11 @@ public class ExpertMetaApplyManage { | |||||
List<ExpertDictionary> expertTypeDictionaryList = expertTypeDictMap.get(userId); | List<ExpertDictionary> expertTypeDictionaryList = expertTypeDictMap.get(userId); | ||||
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { | if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) { | ||||
expertApplyMetaVO.setExpertType(expertTypeDictionaryList.stream().map(r -> { | expertApplyMetaVO.setExpertType(expertTypeDictionaryList.stream().map(r -> { | ||||
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
Optional<DictDTO> dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); | |||||
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); | ||||
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); | ||||
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); | ||||
if (Objects.nonNull(dictionaryDTO)) { | |||||
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName()); | |||||
} | |||||
dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName())); | |||||
return dictionaryFieldInfo; | return dictionaryFieldInfo; | ||||
}).collect(Collectors.toList())); | }).collect(Collectors.toList())); | ||||
} | } | ||||
@@ -25,7 +25,7 @@ import com.hz.pm.api.expert.model.dto.*; | |||||
import com.hz.pm.api.expert.service.*; | import com.hz.pm.api.expert.service.*; | ||||
import com.hz.pm.api.expert.utils.SensitiveModifySegmentUtils; | import com.hz.pm.api.expert.utils.SensitiveModifySegmentUtils; | ||||
import com.hz.pm.api.meeting.helper.YxtCallOrSmsHelper; | import com.hz.pm.api.meeting.helper.YxtCallOrSmsHelper; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.model.ExpertRegionInfo; | import com.hz.pm.api.meta.model.ExpertRegionInfo; | ||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.model.entity.ExpertTag; | import com.hz.pm.api.meta.model.entity.ExpertTag; | ||||
@@ -415,7 +415,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { | |||||
// 保存所有专家字典字段 | // 保存所有专家字典字段 | ||||
List<ExpertDictionaryDTO> expertType = cmd.getExpertType(); | List<ExpertDictionaryDTO> expertType = cmd.getExpertType(); | ||||
if (CollUtil.isNotEmpty(expertType)) { | if (CollUtil.isNotEmpty(expertType)) { | ||||
expertType.forEach(r -> r.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())); | |||||
expertType.forEach(r -> r.setExpertInfoField(ExpertDictTypeEnum.EXPERT_TYPE.getKey())); | |||||
List<ExpertDictionary> saveExpertDictList = buildSaveExpertDictionaryList(expertUserId, expertType); | List<ExpertDictionary> saveExpertDictList = buildSaveExpertDictionaryList(expertUserId, expertType); | ||||
iExpertDictionaryService.saveBatch(saveExpertDictList); | iExpertDictionaryService.saveBatch(saveExpertDictList); | ||||
} | } | ||||
@@ -71,6 +71,9 @@ public class Meeting implements Serializable { | |||||
@ApiModelProperty("是否确认名单") | @ApiModelProperty("是否确认名单") | ||||
private Boolean confirmedRoster; | private Boolean confirmedRoster; | ||||
@ApiModelProperty("短信通知签名") | |||||
private String smsNotifySign; | |||||
@ApiModelProperty("举办单位") | @ApiModelProperty("举办单位") | ||||
private String holdOrg; | private String holdOrg; | ||||
@@ -92,12 +95,6 @@ public class Meeting implements Serializable { | |||||
@ApiModelProperty("备注") | @ApiModelProperty("备注") | ||||
private String remark; | private String remark; | ||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
@ApiModelProperty("创建人ID") | @ApiModelProperty("创建人ID") | ||||
@TableField(fill = FieldFill.INSERT) | @TableField(fill = FieldFill.INSERT) | ||||
private Long createBy; | private Long createBy; | ||||
@@ -1,13 +1,12 @@ | |||||
package com.hz.pm.api.meeting.entity.domain; | package com.hz.pm.api.meeting.entity.domain; | ||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import com.baomidou.mybatisplus.annotation.*; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import java.io.Serializable; | import java.io.Serializable; | ||||
import java.time.LocalDateTime; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -37,4 +36,16 @@ public class MeetingInnerProject implements Serializable { | |||||
@ApiModelProperty("项目编号") | @ApiModelProperty("项目编号") | ||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private LocalDateTime updateOn; | |||||
@TableField(fill = FieldFill.INSERT_UPDATE) | |||||
private Long updateBy; | |||||
} | } |
@@ -43,6 +43,12 @@ public class MeetingOuterProject implements Serializable { | |||||
@ApiModelProperty("申报金额") | @ApiModelProperty("申报金额") | ||||
private BigDecimal declareAmount; | private BigDecimal declareAmount; | ||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
@ApiModelProperty("会议ID") | @ApiModelProperty("会议ID") | ||||
private Long meetingId; | private Long meetingId; | ||||
@@ -4,7 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||
import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||
import lombok.Data; | import lombok.Data; | ||||
import org.hibernate.validator.constraints.Length; | |||||
import javax.validation.constraints.NotBlank; | |||||
import javax.validation.constraints.NotEmpty; | import javax.validation.constraints.NotEmpty; | ||||
import javax.validation.constraints.NotNull; | import javax.validation.constraints.NotNull; | ||||
import java.time.LocalDateTime; | import java.time.LocalDateTime; | ||||
@@ -51,6 +53,11 @@ public class MeetingBasicDTO { | |||||
@ApiModelProperty("评审地点") | @ApiModelProperty("评审地点") | ||||
private String meetingAddress; | private String meetingAddress; | ||||
@NotBlank(message = "短信通知签名不能为空") | |||||
@Length(min = 1, max = 20, message = "短信通知签名无效") | |||||
@ApiModelProperty("短信通知签名") | |||||
private String smsNotifySign; | |||||
@NotEmpty(message = "联系人不能为空") | @NotEmpty(message = "联系人不能为空") | ||||
@ApiModelProperty("联系人") | @ApiModelProperty("联系人") | ||||
private String connecter; | private String connecter; | ||||
@@ -37,7 +37,10 @@ public class MeetingReviewProjectDTO { | |||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildOrg; | private String buildOrg; | ||||
@ApiModelProperty("评审结果") | |||||
private String reviewResult; | |||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
} | } |
@@ -68,4 +68,10 @@ public class ReviewProjectDTO { | |||||
@ApiModelProperty("是否已评价:0 未自评、1 已自评、2 已终评") | @ApiModelProperty("是否已评价:0 未自评、1 已自评、2 已终评") | ||||
private Integer reviewed; | private Integer reviewed; | ||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
} | } |
@@ -21,6 +21,10 @@ public class MeetingResultUploadReq { | |||||
@NotNull(message = "会议ID不能为空") | @NotNull(message = "会议ID不能为空") | ||||
private Long meetingId; | private Long meetingId; | ||||
@ApiModelProperty("项目关联会议ID") | |||||
@NotNull(message = "项目关联会议ID不能为空") | |||||
private Long meetingProjectId; | |||||
@ApiModelProperty("会议结果说明") | @ApiModelProperty("会议结果说明") | ||||
@NotBlank(message = "会议结果说明不能为空") | @NotBlank(message = "会议结果说明不能为空") | ||||
private String resultDescription; | private String resultDescription; | ||||
@@ -15,6 +15,6 @@ import lombok.EqualsAndHashCode; | |||||
@EqualsAndHashCode(callSuper = true) | @EqualsAndHashCode(callSuper = true) | ||||
public class ExpertEvalListItemVO extends ExpertBasicInfoVO{ | public class ExpertEvalListItemVO extends ExpertBasicInfoVO{ | ||||
private Long evaluationId; | |||||
private Long expertJudgeId; | |||||
} | } |
@@ -35,6 +35,9 @@ public class MeetingByManagerVO { | |||||
@JSONField(format = "yyyy-MM-dd HH:mm") | @JSONField(format = "yyyy-MM-dd HH:mm") | ||||
private LocalDateTime endTime; | private LocalDateTime endTime; | ||||
@ApiModelProperty("评审地点") | |||||
private String meetingAddress; | |||||
@ApiModelProperty("会议状态") | @ApiModelProperty("会议状态") | ||||
private Integer status; | private Integer status; | ||||
@@ -57,6 +57,9 @@ public class MeetingDetailBasicVO { | |||||
@ApiModelProperty("会议耗时") | @ApiModelProperty("会议耗时") | ||||
private Integer meetingUsageTime; | private Integer meetingUsageTime; | ||||
@ApiModelProperty("短信通知单位签名") | |||||
private String smsNotifySign; | |||||
@ApiModelProperty("联系人") | @ApiModelProperty("联系人") | ||||
private String connecter; | private String connecter; | ||||
@@ -46,8 +46,11 @@ public class MeetingReviewProjectVO { | |||||
@ApiModelProperty("申报单位") | @ApiModelProperty("申报单位") | ||||
private String buildOrg; | private String buildOrg; | ||||
@ApiModelProperty("评审结果") | |||||
private String reviewResult; | |||||
@ApiModelProperty("会议结果说明") | |||||
private String resultDescription; | |||||
@ApiModelProperty("会议结果附件") | |||||
private String resultAttachFiles; | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") | @JsonFormat(pattern = "yyyy-MM-dd HH:mm") | ||||
@@ -29,9 +29,9 @@ import com.hz.pm.api.meeting.entity.vo.MeetingByManagerVO; | |||||
import com.hz.pm.api.meeting.service.IExpertInviteAvoidRuleService; | import com.hz.pm.api.meeting.service.IExpertInviteAvoidRuleService; | ||||
import com.hz.pm.api.meeting.service.IExpertInviteRuleService; | import com.hz.pm.api.meeting.service.IExpertInviteRuleService; | ||||
import com.hz.pm.api.meeting.service.IMeetingExpertService; | import com.hz.pm.api.meeting.service.IMeetingExpertService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.sys.model.dto.RegionDTO; | import com.hz.pm.api.sys.model.dto.RegionDTO; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
@@ -116,6 +116,7 @@ public class MeetingManageHelper { | |||||
result.setCreateOn(meeting.getCreateOn()); | result.setCreateOn(meeting.getCreateOn()); | ||||
result.setConnecter(meeting.getConnecter()); | result.setConnecter(meeting.getConnecter()); | ||||
result.setContact(meeting.getContact()); | result.setContact(meeting.getContact()); | ||||
result.setMeetingAddress(meeting.getMeetingAddress()); | |||||
return result; | return result; | ||||
} | } | ||||
@@ -166,11 +167,11 @@ public class MeetingManageHelper { | |||||
basicInfoVo.setContact(userInfo.getPhoneNo()); | basicInfoVo.setContact(userInfo.getPhoneNo()); | ||||
basicInfoVo.setCompany(userInfo.getCompany()); | basicInfoVo.setCompany(userInfo.getCompany()); | ||||
Optional<ExpertDictionaryDTO> first = w.getExpertDictionaryList().stream() | Optional<ExpertDictionaryDTO> first = w.getExpertDictionaryList().stream() | ||||
.filter(dict -> dict.getExpertInfoField().equals(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())) | |||||
.filter(dict -> dict.getExpertInfoField().equals(ExpertDictTypeEnum.TITLE_LEVEL.getKey())) | |||||
.findFirst(); | .findFirst(); | ||||
if (first.isPresent()) { | if (first.isPresent()) { | ||||
DictionaryDTO dictInfo = dictionaryCache.getByCode(first.get().getDictionaryCode()); | |||||
basicInfoVo.setJobLevel(dictInfo.getName()); | |||||
Optional<DictDTO> dictInfo = dictionaryCache.getByCode(first.get().getDictionaryCode()); | |||||
dictInfo.ifPresent(d -> basicInfoVo.setJobLevel(d.getName())); | |||||
} else { | } else { | ||||
basicInfoVo.setJobLevel(""); | basicInfoVo.setJobLevel(""); | ||||
} | } | ||||
@@ -127,7 +127,7 @@ public class DashboardManage { | |||||
item.setEndTime(w.getEndTime()); | item.setEndTime(w.getEndTime()); | ||||
item.setStartTime(w.getStartTime()); | item.setStartTime(w.getStartTime()); | ||||
item.setStatus(w.getStatus()); | item.setStatus(w.getStatus()); | ||||
item.setType(dictionaryCache.getByCode(w.getType()).getName()); | |||||
item.setType(dictionaryCache.getByCode(w.getType()).get().getName()); | |||||
item.setMeetingName(w.getName()); | item.setMeetingName(w.getName()); | ||||
return item; | return item; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
@@ -47,7 +47,6 @@ import com.ningdatech.basic.exception.BizException; | |||||
import com.ningdatech.basic.model.IdVo; | import com.ningdatech.basic.model.IdVo; | ||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.ningdatech.basic.util.StrPool; | |||||
import com.ningdatech.basic.util.ValidUtil; | import com.ningdatech.basic.util.ValidUtil; | ||||
import com.ningdatech.cache.lock.DistributedLock; | import com.ningdatech.cache.lock.DistributedLock; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -104,10 +103,10 @@ public class MeetingManage { | |||||
private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | private static final String MEETING_CREATE_KEY = "MEETING_CREATE:"; | ||||
private String getDictName(String dictType) { | |||||
return Optional.ofNullable(dictionaryCache.getByCode(dictType)) | |||||
.flatMap(w -> Optional.of(w.getName())) | |||||
.orElse(StrPool.EMPTY); | |||||
private String getDictName(String dictCode) { | |||||
return dictionaryCache.getByCode(dictCode) | |||||
.flatMap(w -> Optional.ofNullable(w.getName())) | |||||
.orElse(StrUtil.EMPTY); | |||||
} | } | ||||
/** | /** | ||||
@@ -141,7 +140,7 @@ public class MeetingManage { | |||||
meeting.setInviteType(inviteRule.getInviteType()); | meeting.setInviteType(inviteRule.getInviteType()); | ||||
meetingService.save(meeting); | meetingService.save(meeting); | ||||
if (meeting.getIsInnerProject() != null) { | if (meeting.getIsInnerProject() != null) { | ||||
if (meetingBasic.getIsInnerProject()) { | |||||
if (Boolean.TRUE.equals(meetingBasic.getIsInnerProject())) { | |||||
List<MeetingInnerProject> projects = meetingBasic.getInnerProjects().stream().map(w -> { | List<MeetingInnerProject> projects = meetingBasic.getInnerProjects().stream().map(w -> { | ||||
MeetingInnerProject project = BeanUtil.copyProperties(w, MeetingInnerProject.class); | MeetingInnerProject project = BeanUtil.copyProperties(w, MeetingInnerProject.class); | ||||
project.setMeetingId(meeting.getId()); | project.setMeetingId(meeting.getId()); | ||||
@@ -452,15 +451,13 @@ public class MeetingManage { | |||||
.invitedStopped(meeting.getInviteStatus()) | .invitedStopped(meeting.getInviteStatus()) | ||||
.attachFiles(meeting.getAttachFiles()) | .attachFiles(meeting.getAttachFiles()) | ||||
.description(meeting.getDescription()) | .description(meeting.getDescription()) | ||||
.resultDescription(meeting.getResultDescription()) | |||||
.resultAttachFiles(meeting.getResultAttachFiles()) | |||||
.remark(meeting.getRemark()) | .remark(meeting.getRemark()) | ||||
.build(); | .build(); | ||||
if (meeting.getIsInnerProject() != null) { | if (meeting.getIsInnerProject() != null) { | ||||
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { | if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { | ||||
List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | List<MeetingInnerProject> innerProjects = meetingInnerProjectService.listByMeetingId(meetingId); | ||||
List<Project> projects = projectService.listByIds(CollUtils.fieldList(innerProjects, MeetingInnerProject::getProjectId)); | |||||
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId); | |||||
Map<Long, MeetingInnerProject> innerProjectMap = CollUtils.listToMap(innerProjects, MeetingInnerProject::getProjectId); | |||||
List<Project> projects = projectService.listByIds(innerProjectMap.keySet()); | |||||
List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> { | List<MeetingReviewProjectDTO> convert = CollUtils.convert(projects, w -> { | ||||
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); | MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO(); | ||||
mrp.setProjectId(w.getId()); | mrp.setProjectId(w.getId()); | ||||
@@ -470,9 +467,10 @@ public class MeetingManage { | |||||
mrp.setProjectYear(w.getProjectYear()); | mrp.setProjectYear(w.getProjectYear()); | ||||
mrp.setDeclareAmount(w.getDeclareAmount()); | mrp.setDeclareAmount(w.getDeclareAmount()); | ||||
mrp.setProjectCode(w.getProjectCode()); | mrp.setProjectCode(w.getProjectCode()); | ||||
ExpertReview review = reviewMap.get(w.getId()); | |||||
if (review != null) { | |||||
mrp.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()); | |||||
MeetingInnerProject innerProject = innerProjectMap.get(w.getId()); | |||||
if (innerProject != null) { | |||||
mrp.setResultAttachFiles(innerProject.getResultAttachFiles()); | |||||
mrp.setResultDescription(innerProject.getResultDescription()); | |||||
} | } | ||||
return mrp; | return mrp; | ||||
}); | }); | ||||
@@ -591,7 +589,7 @@ public class MeetingManage { | |||||
} | } | ||||
if (randomRule.getExpertDicts() != null) { | if (randomRule.getExpertDicts() != null) { | ||||
randomRule.getExpertDicts().forEach(w -> { | randomRule.getExpertDicts().forEach(w -> { | ||||
List<String> dictNames = CollUtils.convert(w.getDictCodes(), dictCode -> dictionaryCache.getByCode(dictCode).getName()); | |||||
List<String> dictNames = CollUtils.convert(w.getDictCodes(), this::getDictName); | |||||
w.setDictCodes(dictNames); | w.setDictCodes(dictNames); | ||||
}); | }); | ||||
} | } | ||||
@@ -900,18 +898,16 @@ public class MeetingManage { | |||||
public List<MeetingReviewProjectVO> projectsByMeetingId(Long meetingId) { | public List<MeetingReviewProjectVO> projectsByMeetingId(Long meetingId) { | ||||
Meeting meeting = meetingService.getById(meetingId); | Meeting meeting = meetingService.getById(meetingId); | ||||
if (meeting.getIsInnerProject()) { | |||||
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { | |||||
List<MeetingInnerProject> projects = meetingInnerProjectService.listByMeetingId(meetingId); | List<MeetingInnerProject> projects = meetingInnerProjectService.listByMeetingId(meetingId); | ||||
List<Long> projectIdList = CollUtils.fieldList(projects, MeetingInnerProject::getProjectId); | |||||
List<Project> projectList = projectService.listByIds(projectIdList); | |||||
Map<Long, ExpertReview> reviewMap = expertReviewService.listFinalReviewMap(meetingId); | |||||
Map<Long, MeetingInnerProject> projectMap = CollUtils.listToMap(projects, MeetingInnerProject::getProjectId); | |||||
List<Project> projectList = projectService.listByIds(projectMap.keySet()); | |||||
return CollUtils.convert(projectList, w -> { | return CollUtils.convert(projectList, w -> { | ||||
MeetingReviewProjectVO vo = buildProjectList(w); | MeetingReviewProjectVO vo = buildProjectList(w); | ||||
ExpertReview review = reviewMap.get(w.getId()); | |||||
if (review != null) { | |||||
vo.setReviewResult(ReviewResultEnum.getByCode(review.getReviewResult()).getValue()); | |||||
} else { | |||||
vo.setReviewResult("--"); | |||||
MeetingInnerProject innerProject = projectMap.get(w.getId()); | |||||
if (innerProject != null) { | |||||
vo.setResultAttachFiles(innerProject.getResultAttachFiles()); | |||||
vo.setResultDescription(innerProject.getResultDescription()); | |||||
} | } | ||||
return vo; | return vo; | ||||
}); | }); | ||||
@@ -949,7 +945,7 @@ public class MeetingManage { | |||||
} | } | ||||
public void uploadMeetingResult(MeetingResultUploadReq req) { | public void uploadMeetingResult(MeetingResultUploadReq req) { | ||||
String key = "meeting_result_upload:" + req.getMeetingId(); | |||||
String key = "meeting_result_upload:" + req.getMeetingProjectId(); | |||||
if (!distributedLock.lock(key, RETRY_TIMES)) { | if (!distributedLock.lock(key, RETRY_TIMES)) { | ||||
throw BizException.wrap("正在上传会议结果,请勿重复操作"); | throw BizException.wrap("正在上传会议结果,请勿重复操作"); | ||||
} | } | ||||
@@ -962,13 +958,28 @@ public class MeetingManage { | |||||
if (meeting.getEndTime().isAfter(now)) { | if (meeting.getEndTime().isAfter(now)) { | ||||
throw BizException.wrap("会议未结束"); | throw BizException.wrap("会议未结束"); | ||||
} | } | ||||
LambdaUpdateWrapper<Meeting> mUpdate = Wrappers.lambdaUpdate(Meeting.class) | |||||
.set(Meeting::getUpdateOn, now) | |||||
.set(Meeting::getResultDescription, req.getResultDescription()) | |||||
.set(Meeting::getResultAttachFiles, req.getResultAttachFiles()) | |||||
.set(Meeting::getUpdateBy, LoginUserUtil.getUserId()) | |||||
.eq(Meeting::getId, req.getMeetingId()); | |||||
meetingService.update(mUpdate); | |||||
if (meeting.getIsInnerProject() == null) { | |||||
throw BizException.wrap("此会议未关联项目"); | |||||
} | |||||
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { | |||||
LambdaUpdateWrapper<MeetingInnerProject> mUpdate = Wrappers | |||||
.lambdaUpdate(MeetingInnerProject.class) | |||||
.set(MeetingInnerProject::getUpdateOn, now) | |||||
.set(MeetingInnerProject::getResultDescription, req.getResultDescription()) | |||||
.set(MeetingInnerProject::getResultAttachFiles, req.getResultAttachFiles()) | |||||
.set(MeetingInnerProject::getUpdateBy, LoginUserUtil.getUserId()) | |||||
.eq(MeetingInnerProject::getId, req.getMeetingProjectId()); | |||||
meetingInnerProjectService.update(mUpdate); | |||||
} else { | |||||
LambdaUpdateWrapper<MeetingOuterProject> mUpdate = Wrappers | |||||
.lambdaUpdate(MeetingOuterProject.class) | |||||
.set(MeetingOuterProject::getUpdateOn, now) | |||||
.set(MeetingOuterProject::getResultDescription, req.getResultDescription()) | |||||
.set(MeetingOuterProject::getResultAttachFiles, req.getResultAttachFiles()) | |||||
.set(MeetingOuterProject::getUpdateBy, LoginUserUtil.getUserId()) | |||||
.eq(MeetingOuterProject::getId, req.getMeetingProjectId()); | |||||
meetingOuterProjectService.update(mUpdate); | |||||
} | |||||
} finally { | } finally { | ||||
distributedLock.releaseLock(key); | distributedLock.releaseLock(key); | ||||
} | } | ||||
@@ -979,14 +990,14 @@ public class MeetingManage { | |||||
if (experts.isEmpty()) { | if (experts.isEmpty()) { | ||||
return Collections.emptyList(); | return Collections.emptyList(); | ||||
} | } | ||||
Map<Long, Long> evaluationIdMap = meetingExpertJudgeService.getExpertJudgeIdMap(meetingId); | |||||
Map<Long, Long> expertJudgeMap = meetingExpertJudgeService.getExpertJudgeIdMap(meetingId); | |||||
List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | List<Long> expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); | ||||
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); | Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); | ||||
return experts.stream().map(w -> { | return experts.stream().map(w -> { | ||||
Long expertId = w.getExpertId(); | Long expertId = w.getExpertId(); | ||||
ExpertEvalListItemVO item = new ExpertEvalListItemVO(); | ExpertEvalListItemVO item = new ExpertEvalListItemVO(); | ||||
BeanUtil.copyProperties(expertMap.get(expertId), item); | BeanUtil.copyProperties(expertMap.get(expertId), item); | ||||
item.setEvaluationId(evaluationIdMap.get(expertId)); | |||||
item.setExpertJudgeId(expertJudgeMap.get(expertId)); | |||||
return item; | return item; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
} | } | ||||
@@ -36,7 +36,7 @@ public interface IMeetingExpertJudgeService extends IService<MeetingExpertJudge> | |||||
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class) | LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class) | ||||
.select(MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId) | .select(MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId) | ||||
.eq(MeetingExpertJudge::getMeetingId, meetingId); | .eq(MeetingExpertJudge::getMeetingId, meetingId); | ||||
return CollUtils.listToMap(list(query), MeetingExpertJudge::getExpertId, MeetingExpertJudge::getExpertId); | |||||
return CollUtils.listToMap(list(query), MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId); | |||||
} | } | ||||
default List<MeetingExpertJudge> listByMeetingExpertIds(Collection<Long> meetingExpertIds) { | default List<MeetingExpertJudge> listByMeetingExpertIds(Collection<Long> meetingExpertIds) { | ||||
@@ -2,7 +2,7 @@ package com.hz.pm.api.meta.assembler; | |||||
import com.hz.pm.api.meta.model.entity.MetaDictionary; | import com.hz.pm.api.meta.model.entity.MetaDictionary; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.vo.ResDictionaryVO; | import com.hz.pm.api.meta.model.vo.ResDictionaryVO; | ||||
/** | /** | ||||
@@ -12,8 +12,8 @@ import com.hz.pm.api.meta.model.vo.ResDictionaryVO; | |||||
public class MetaDictionaryAssembler { | public class MetaDictionaryAssembler { | ||||
public static DictionaryDTO toDictionaryDTO(MetaDictionary dictionaryManage) { | |||||
DictionaryDTO dictionaryDTO = new DictionaryDTO(); | |||||
public static DictDTO toDictionaryDTO(MetaDictionary dictionaryManage) { | |||||
DictDTO dictionaryDTO = new DictDTO(); | |||||
dictionaryDTO.setDescribe(dictionaryManage.getDictionaryDescribe()); | dictionaryDTO.setDescribe(dictionaryManage.getDictionaryDescribe()); | ||||
dictionaryDTO.setDictionaryCode(dictionaryManage.getDictionaryCode()); | dictionaryDTO.setDictionaryCode(dictionaryManage.getDictionaryCode()); | ||||
dictionaryDTO.setDictionaryType(dictionaryManage.getDictionaryType()); | dictionaryDTO.setDictionaryType(dictionaryManage.getDictionaryType()); | ||||
@@ -23,7 +23,7 @@ public class MetaDictionaryAssembler { | |||||
return dictionaryDTO; | return dictionaryDTO; | ||||
} | } | ||||
public static ResDictionaryVO toDictionaryVO(DictionaryDTO dictionaryDTO) { | |||||
public static ResDictionaryVO toDictionaryVO(DictDTO dictionaryDTO) { | |||||
ResDictionaryVO resDictionaryVO = new ResDictionaryVO(); | ResDictionaryVO resDictionaryVO = new ResDictionaryVO(); | ||||
resDictionaryVO.setDescribe(dictionaryDTO.getDescribe()); | resDictionaryVO.setDescribe(dictionaryDTO.getDescribe()); | ||||
resDictionaryVO.setDictionaryCode(dictionaryDTO.getDictionaryCode()); | resDictionaryVO.setDictionaryCode(dictionaryDTO.getDictionaryCode()); | ||||
@@ -1,53 +0,0 @@ | |||||
package com.hz.pm.api.meta.constant; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/7/21 下午6:08 | |||||
*/ | |||||
@AllArgsConstructor | |||||
@Getter | |||||
public enum DictAllTypeEnum { | |||||
// 政治面貌 | |||||
POLITICAL("political"), | |||||
// 专家来源 | |||||
EXPERT_SOURCE("expert_source"), | |||||
// 学历 | |||||
EDU("edu"), | |||||
// 学位 | |||||
DEGREE("degree"), | |||||
// 在职状态 | |||||
JOB_STATUS("job_status"), | |||||
// 行政职级 | |||||
ADMINISTRATIVE_RANK("administrative_rank"), | |||||
// 内外围(专家类型) | |||||
EXPERT_TYPE("expert_type"), | |||||
// 单位类型 | |||||
COMPANY_ATTRIBUTE("company_attribute"), | |||||
// 职称级别 | |||||
TITLE_LEVEL("title_level"), | |||||
// 通知类型 | |||||
NOTICE_TYPE("notice_type"), | |||||
// 会议类型 | |||||
MEETING_TYPE("meeting_type"); | |||||
private final String key; | |||||
public static boolean contains(String key) { | |||||
if (StringUtils.isBlank(key)) { | |||||
return false; | |||||
} | |||||
for (DictAllTypeEnum typeEnum : DictAllTypeEnum.values()) { | |||||
if (typeEnum.key.equals(key)) { | |||||
return true; | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
} |
@@ -1,92 +0,0 @@ | |||||
package com.hz.pm.api.meta.constant; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import org.apache.commons.lang3.StringUtils; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
/** | |||||
* @author liuxinxin | |||||
* @date 2022/7/21 下午6:08 | |||||
*/ | |||||
@AllArgsConstructor | |||||
@Getter | |||||
public enum DictExpertInfoTypeEnum { | |||||
/** | |||||
* 政治面貌 | |||||
*/ | |||||
POLITICAL("political"), | |||||
/** | |||||
* 学历 | |||||
*/ | |||||
EDU("edu"), | |||||
/** | |||||
* 学位 | |||||
*/ | |||||
DEGREE("degree"), | |||||
/** | |||||
* 在职状态 | |||||
*/ | |||||
JOB_STATUS("job_status"), | |||||
/** | |||||
* 行政职级 | |||||
*/ | |||||
ADMINISTRATIVE_RANK("administrative_rank"), | |||||
/** | |||||
* 内外围(专家类型) | |||||
*/ | |||||
EXPERT_TYPE("expert_type"), | |||||
/** | |||||
* 所属专家库 | |||||
*/ | |||||
EXPERT_LIBRARY("expert_library"), | |||||
/** | |||||
* 单位类型 | |||||
*/ | |||||
COMPANY_ATTRIBUTE("company_attribute"), | |||||
/** | |||||
* 职称级别 | |||||
*/ | |||||
TITLE_LEVEL("title_level"), | |||||
/** | |||||
* 推荐方式 | |||||
*/ | |||||
RECOMMENDED_WAY("recommended_way"); | |||||
private final String key; | |||||
public static List<String> getAll() { | |||||
List<String> dictionaryList = new ArrayList<>(); | |||||
DictExpertInfoTypeEnum[] values = DictExpertInfoTypeEnum.values(); | |||||
for (DictExpertInfoTypeEnum typeEnum : values) { | |||||
dictionaryList.add(typeEnum.key); | |||||
} | |||||
return dictionaryList; | |||||
} | |||||
public static boolean contains(String key) { | |||||
if (StringUtils.isBlank(key)) { | |||||
return false; | |||||
} | |||||
for (DictExpertInfoTypeEnum typeEnum : DictExpertInfoTypeEnum.values()) { | |||||
if (typeEnum.key.equals(key)) { | |||||
return true; | |||||
} | |||||
} | |||||
return false; | |||||
} | |||||
public static DictExpertInfoTypeEnum of(String key) { | |||||
for (DictExpertInfoTypeEnum statusEnum : DictExpertInfoTypeEnum.values()) { | |||||
if (statusEnum.key.equals(key)) { | |||||
return statusEnum; | |||||
} | |||||
} | |||||
throw new IllegalArgumentException(String.format("Illegal DictionaryExpertInfoTypeEnum = %s", key)); | |||||
} | |||||
} |
@@ -0,0 +1,107 @@ | |||||
package com.hz.pm.api.meta.constant; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import java.util.Arrays; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* <p> | |||||
* 所有的专家字典类型 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:50 2023/12/21 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum DictTypeEnum { | |||||
/** | |||||
* 政治面貌 | |||||
*/ | |||||
POLITICAL("political"), | |||||
/** | |||||
* 专家来源 | |||||
*/ | |||||
EXPERT_SOURCE("expert_source"), | |||||
/** | |||||
* 学历 | |||||
*/ | |||||
EDU("edu"), | |||||
/** | |||||
* 学位 | |||||
*/ | |||||
DEGREE("degree"), | |||||
/** | |||||
* 在职状态 | |||||
*/ | |||||
JOB_STATUS("job_status"), | |||||
/** | |||||
* 行政职级 | |||||
*/ | |||||
ADMINISTRATIVE_RANK("administrative_rank"), | |||||
/** | |||||
* 专家类型 | |||||
*/ | |||||
EXPERT_TYPE("expert_type"), | |||||
/** | |||||
* 专家领域 | |||||
*/ | |||||
EXPERT_AREA("expert_area"), | |||||
/** | |||||
* 专家专业特长 | |||||
*/ | |||||
EXPERT_SPECIALTY("expert_specialty"), | |||||
/** | |||||
* 专家级别 | |||||
*/ | |||||
EXPERT_LEVEL("expert_level"), | |||||
/** | |||||
* 所属专家库 | |||||
*/ | |||||
EXPERT_LIBRARY("expert_library"), | |||||
/** | |||||
* 单位类型 | |||||
*/ | |||||
COMPANY_ATTRIBUTE("company_attribute"), | |||||
/** | |||||
* 职称级别 | |||||
*/ | |||||
TITLE_LEVEL("title_level"), | |||||
/** | |||||
* 通知类型 | |||||
*/ | |||||
NOTICE_TYPE("notice_type"), | |||||
/** | |||||
* 会议类型 | |||||
*/ | |||||
MEETING_TYPE("meeting_type"); | |||||
private final String key; | |||||
public static final List<String> ALL; | |||||
static { | |||||
List<String> tmpKeys = Arrays.stream(values()) | |||||
.map(DictTypeEnum::getKey) | |||||
.collect(Collectors.toList()); | |||||
ALL = Collections.unmodifiableList(tmpKeys); | |||||
} | |||||
public static boolean contains(String key) { | |||||
return ALL.contains(key); | |||||
} | |||||
public static DictTypeEnum of(String key) { | |||||
return Arrays.stream(values()) | |||||
.filter(w -> w.getKey().equals(key)) | |||||
.findFirst() | |||||
.orElseThrow(() -> new IllegalArgumentException("字典类型无效:" + key)); | |||||
} | |||||
} |
@@ -0,0 +1,101 @@ | |||||
package com.hz.pm.api.meta.constant; | |||||
import lombok.AllArgsConstructor; | |||||
import lombok.Getter; | |||||
import java.util.Arrays; | |||||
import java.util.Collections; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | |||||
* <p> | |||||
* 专家字典信息枚举类 | |||||
* </p> | |||||
* | |||||
* @author WendyYang | |||||
* @since 13:45 2023/12/21 | |||||
*/ | |||||
@Getter | |||||
@AllArgsConstructor | |||||
public enum ExpertDictTypeEnum { | |||||
/** | |||||
* 政治面貌 | |||||
*/ | |||||
POLITICAL("political"), | |||||
/** | |||||
* 学历 | |||||
*/ | |||||
EDU("edu"), | |||||
/** | |||||
* 学位 | |||||
*/ | |||||
DEGREE("degree"), | |||||
/** | |||||
* 在职状态 | |||||
*/ | |||||
JOB_STATUS("job_status"), | |||||
/** | |||||
* 行政职级 | |||||
*/ | |||||
ADMINISTRATIVE_RANK("administrative_rank"), | |||||
/** | |||||
* 内外围(专家类型) | |||||
*/ | |||||
EXPERT_TYPE("expert_type"), | |||||
/** | |||||
* 专家领域 | |||||
*/ | |||||
EXPERT_AREA("expert_area"), | |||||
/** | |||||
* 专家级别 | |||||
*/ | |||||
EXPERT_LEVEL("expert_level"), | |||||
/** | |||||
* 专家专业特长 | |||||
*/ | |||||
EXPERT_SPECIALTY("expert_specialty"), | |||||
/** | |||||
* 所属专家库 | |||||
*/ | |||||
EXPERT_LIBRARY("expert_library"), | |||||
/** | |||||
* 单位类型 | |||||
*/ | |||||
COMPANY_ATTRIBUTE("company_attribute"), | |||||
/** | |||||
* 职称级别 | |||||
*/ | |||||
TITLE_LEVEL("title_level"), | |||||
/** | |||||
* 推荐方式 | |||||
*/ | |||||
RECOMMENDED_WAY("recommended_way"); | |||||
private final String key; | |||||
//================================================================================================================== | |||||
public static final List<String> ALL; | |||||
static { | |||||
List<String> tmpKeys = Arrays.stream(values()) | |||||
.map(ExpertDictTypeEnum::getKey) | |||||
.collect(Collectors.toList()); | |||||
ALL = Collections.unmodifiableList(tmpKeys); | |||||
} | |||||
public static boolean contains(String key) { | |||||
return ALL.contains(key); | |||||
} | |||||
public static ExpertDictTypeEnum of(String key) { | |||||
return Arrays.stream(values()) | |||||
.filter(w -> w.getKey().equals(key)) | |||||
.findFirst() | |||||
.orElseThrow(() -> new IllegalArgumentException("专家字典类型无效:" + key)); | |||||
} | |||||
} |
@@ -1,12 +1,12 @@ | |||||
package com.hz.pm.api.meta.controller; | package com.hz.pm.api.meta.controller; | ||||
import com.ningdatech.log.annotation.WebLog; | |||||
import com.hz.pm.api.meta.manage.MetaManage; | import com.hz.pm.api.meta.manage.MetaManage; | ||||
import com.hz.pm.api.meta.model.po.ReqAddDictionaryPO; | import com.hz.pm.api.meta.model.po.ReqAddDictionaryPO; | ||||
import com.hz.pm.api.meta.model.po.ReqDictionaryListPO; | import com.hz.pm.api.meta.model.po.ReqDictionaryListPO; | ||||
import com.hz.pm.api.meta.model.vo.ResDictionaryListVO; | import com.hz.pm.api.meta.model.vo.ResDictionaryListVO; | ||||
import com.hz.pm.api.meta.validate.DictParamValidator; | import com.hz.pm.api.meta.validate.DictParamValidator; | ||||
import com.ningdatech.log.annotation.WebLog; | |||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -31,7 +31,6 @@ import java.util.List; | |||||
@Api(tags = "基础数据接口") | @Api(tags = "基础数据接口") | ||||
public class MetaDictionaryManageController { | public class MetaDictionaryManageController { | ||||
// private final IMetaDictionaryManageService metaDictionaryManageService; | |||||
private final MetaManage metaManage; | private final MetaManage metaManage; | ||||
@PostMapping("/list") | @PostMapping("/list") | ||||
@@ -51,8 +50,8 @@ public class MetaDictionaryManageController { | |||||
@PostMapping("/add/dictionary") | @PostMapping("/add/dictionary") | ||||
@ApiOperation("添加字典值") | @ApiOperation("添加字典值") | ||||
@WebLog("添加字典值") | @WebLog("添加字典值") | ||||
public void addDictionary(@Valid @RequestBody ReqAddDictionaryPO reqAddDictionaryPO) { | |||||
metaManage.addDictionary(reqAddDictionaryPO); | |||||
public void addDictionary(@Valid @RequestBody ReqAddDictionaryPO req) { | |||||
metaManage.addDictionary(req); | |||||
} | } | ||||
@PostMapping("/remove/dictionary/{dictionaryCode}") | @PostMapping("/remove/dictionary/{dictionaryCode}") | ||||
@@ -1,11 +1,11 @@ | |||||
package com.hz.pm.api.meta.helper; | package com.hz.pm.api.meta.helper; | ||||
import com.hz.pm.api.meta.constant.DictAllTypeEnum; | |||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import java.util.List; | import java.util.List; | ||||
import java.util.Optional; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
@@ -17,33 +17,36 @@ public interface DictionaryCache { | |||||
/** | /** | ||||
* 根据字典类型枚举 获取 字典列表 | * 根据字典类型枚举 获取 字典列表 | ||||
* | * | ||||
* @param dictionaryType | |||||
* @return | |||||
* @param dictionaryType \ | |||||
* @return \ | |||||
*/ | */ | ||||
List<DictionaryDTO> getDictionaryListByDictionaryType(DictAllTypeEnum dictionaryType); | |||||
List<DictDTO> listDictByDictType(DictTypeEnum dictionaryType); | |||||
/** | /** | ||||
* 根据字典类型 获取 字典列表 | * 根据字典类型 获取 字典列表 | ||||
* | * | ||||
* @param dictionaryType | |||||
* @return | |||||
* @param dictType \ | |||||
* @return \ | |||||
*/ | */ | ||||
List<DictionaryDTO> getDictionaryListByDictionaryType(String dictionaryType); | |||||
List<DictDTO> listDictByDictType(String dictType); | |||||
/** | /** | ||||
* 根据字典类型、字典编码 获取 字典实体 | * 根据字典类型、字典编码 获取 字典实体 | ||||
* | * | ||||
* @param dictionaryType | |||||
* @param code | |||||
* @return | |||||
* @param dictionaryType \ | |||||
* @param code \ | |||||
* @return \ | |||||
*/ | */ | ||||
DictionaryDTO getDictionaryByDictionaryType(DictAllTypeEnum dictionaryType, String code); | |||||
DictDTO getDictionaryByDictionaryType(DictTypeEnum dictionaryType, String code); | |||||
/** | /** | ||||
* 根据字典编码 获取 字典实体 | * 根据字典编码 获取 字典实体 | ||||
* | * | ||||
* @param dictionaryCode | |||||
* @return | |||||
* @param dictCode \ | |||||
* @return \ | |||||
*/ | */ | ||||
DictionaryDTO getByCode(String dictionaryCode); | |||||
Optional<DictDTO> getByCode(String dictCode); | |||||
Optional<DictDTO> getByDictTypeAndName(String dictType, String name); | |||||
} | } |
@@ -2,9 +2,9 @@ package com.hz.pm.api.meta.helper.basic; | |||||
import com.github.benmanes.caffeine.cache.Caffeine; | import com.github.benmanes.caffeine.cache.Caffeine; | ||||
import com.github.benmanes.caffeine.cache.LoadingCache; | import com.github.benmanes.caffeine.cache.LoadingCache; | ||||
import com.hz.pm.api.meta.constant.DictAllTypeEnum; | |||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.service.IMetaDictionaryService; | import com.hz.pm.api.meta.service.IMetaDictionaryService; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
@@ -24,30 +24,31 @@ public abstract class AbstractDictionaryCache implements InitializingBean, Dicti | |||||
private final IMetaDictionaryService metaDictionaryService; | private final IMetaDictionaryService metaDictionaryService; | ||||
protected Map<String, DictionaryDTO> dictionaryMap = new ConcurrentHashMap<>(); | |||||
protected LoadingCache<String, List<DictionaryDTO>> dictionaryCacheHelper; | |||||
protected Map<String, DictDTO> dictionaryMap = new ConcurrentHashMap<>(); | |||||
protected LoadingCache<String, List<DictDTO>> dictCache; | |||||
@Override | @Override | ||||
public void afterPropertiesSet() { | public void afterPropertiesSet() { | ||||
dictionaryCacheHelper = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES) | |||||
.refreshAfterWrite(30, TimeUnit.MINUTES).build(key -> { | |||||
List<DictionaryDTO> dicts = metaDictionaryService.queryAll(); | |||||
dictCache = Caffeine.newBuilder() | |||||
.refreshAfterWrite(30, TimeUnit.MINUTES) | |||||
.build(key -> { | |||||
List<DictDTO> dicts = metaDictionaryService.queryAll(); | |||||
dictionaryMap = buildCateMap(dicts); | dictionaryMap = buildCateMap(dicts); | ||||
Map<String, List<DictionaryDTO>> dictMapByType = CollUtils.group(dicts, DictionaryDTO::getDictionaryType); | |||||
Map<String, List<DictDTO>> dictMapByType = CollUtils.group(dicts, DictDTO::getDictionaryType); | |||||
return dictMapByType.get(key); | return dictMapByType.get(key); | ||||
}); | }); | ||||
warmUp(); | warmUp(); | ||||
} | } | ||||
private Map<String, DictionaryDTO> buildCateMap(List<DictionaryDTO> dictionaryDTOList) { | |||||
Map<String, DictionaryDTO> dictionaryDtoMap = new ConcurrentHashMap<>(128); | |||||
private Map<String, DictDTO> buildCateMap(List<DictDTO> dictionaryDTOList) { | |||||
Map<String, DictDTO> dictionaryDtoMap = new ConcurrentHashMap<>(128); | |||||
dictionaryDTOList.forEach(dictionaryDTO -> dictionaryDtoMap.put(dictionaryDTO.getDictionaryCode(), dictionaryDTO)); | dictionaryDTOList.forEach(dictionaryDTO -> dictionaryDtoMap.put(dictionaryDTO.getDictionaryCode(), dictionaryDTO)); | ||||
return dictionaryDtoMap; | return dictionaryDtoMap; | ||||
} | } | ||||
private void warmUp() { | private void warmUp() { | ||||
for (DictAllTypeEnum typeEnum : DictAllTypeEnum.values()) { | |||||
dictionaryCacheHelper.get(typeEnum.getKey()); | |||||
for (DictTypeEnum typeEnum : DictTypeEnum.values()) { | |||||
dictCache.get(typeEnum.getKey()); | |||||
} | } | ||||
} | } | ||||
@@ -1,13 +1,14 @@ | |||||
package com.hz.pm.api.meta.helper.impl; | package com.hz.pm.api.meta.helper.impl; | ||||
import com.hz.pm.api.meta.constant.DictAllTypeEnum; | |||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.hz.pm.api.meta.helper.basic.AbstractDictionaryCache; | import com.hz.pm.api.meta.helper.basic.AbstractDictionaryCache; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.service.IMetaDictionaryService; | import com.hz.pm.api.meta.service.IMetaDictionaryService; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.List; | import java.util.List; | ||||
import java.util.Objects; | import java.util.Objects; | ||||
import java.util.Optional; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
@@ -21,25 +22,36 @@ public class DictionaryCacheImpl extends AbstractDictionaryCache { | |||||
} | } | ||||
@Override | @Override | ||||
public List<DictionaryDTO> getDictionaryListByDictionaryType(DictAllTypeEnum dictionaryType) { | |||||
return dictionaryCacheHelper.get(dictionaryType.getKey()); | |||||
public List<DictDTO> listDictByDictType(DictTypeEnum dictionaryType) { | |||||
return dictCache.get(dictionaryType.getKey()); | |||||
} | } | ||||
@Override | @Override | ||||
public List<DictionaryDTO> getDictionaryListByDictionaryType(String dictionaryType) { | |||||
return dictionaryCacheHelper.get(dictionaryType); | |||||
public List<DictDTO> listDictByDictType(String dictType) { | |||||
return dictCache.get(dictType); | |||||
} | } | ||||
@Override | @Override | ||||
public DictionaryDTO getDictionaryByDictionaryType(DictAllTypeEnum dictionaryType, String code) { | |||||
return Objects.requireNonNull(dictionaryCacheHelper.get(dictionaryType.getKey())) | |||||
public DictDTO getDictionaryByDictionaryType(DictTypeEnum dictionaryType, String code) { | |||||
return Objects.requireNonNull(dictCache.get(dictionaryType.getKey())) | |||||
.stream().filter(w -> w.getDictionaryCode().equals(code)) | .stream().filter(w -> w.getDictionaryCode().equals(code)) | ||||
.findFirst().orElse(null); | .findFirst().orElse(null); | ||||
} | } | ||||
@Override | @Override | ||||
public DictionaryDTO getByCode(String dictionaryCode) { | |||||
return dictionaryMap.get(dictionaryCode); | |||||
public Optional<DictDTO> getByCode(String dictionaryCode) { | |||||
return Optional.ofNullable(dictionaryMap.get(dictionaryCode)); | |||||
} | |||||
@Override | |||||
public Optional<DictDTO> getByDictTypeAndName(String dictType, String name) { | |||||
List<DictDTO> dicts = dictCache.get(dictType); | |||||
if (dicts == null || dicts.isEmpty()) { | |||||
return Optional.empty(); | |||||
} | |||||
return dicts.stream() | |||||
.filter(w -> w.getName().equalsIgnoreCase(name)) | |||||
.findFirst(); | |||||
} | } | ||||
} | } |
@@ -6,18 +6,19 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | |||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; | ||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils; | import com.baomidou.mybatisplus.core.toolkit.StringUtils; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.hz.pm.api.meta.constant.DictTypeEnum; | |||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.ningdatech.basic.util.CollUtils; | import com.ningdatech.basic.util.CollUtils; | ||||
import com.hz.pm.api.common.enumeration.BoolDisplayEnum; | import com.hz.pm.api.common.enumeration.BoolDisplayEnum; | ||||
import com.hz.pm.api.common.util.BizUtils; | import com.hz.pm.api.common.util.BizUtils; | ||||
import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler; | import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler; | ||||
import com.hz.pm.api.meta.assembler.MetaTagAssembler; | import com.hz.pm.api.meta.assembler.MetaTagAssembler; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertTagEnum; | import com.hz.pm.api.meta.constant.ExpertTagEnum; | ||||
import com.hz.pm.api.meta.constant.TagConst; | import com.hz.pm.api.meta.constant.TagConst; | ||||
import com.hz.pm.api.meta.helper.DictionaryCache; | import com.hz.pm.api.meta.helper.DictionaryCache; | ||||
import com.hz.pm.api.meta.helper.TagCache; | import com.hz.pm.api.meta.helper.TagCache; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import com.hz.pm.api.meta.model.dto.TagTreeDTO; | import com.hz.pm.api.meta.model.dto.TagTreeDTO; | ||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.model.entity.ExpertTag; | import com.hz.pm.api.meta.model.entity.ExpertTag; | ||||
@@ -53,16 +54,15 @@ public class MetaManage { | |||||
private final IExpertTagService iExpertTagService; | private final IExpertTagService iExpertTagService; | ||||
public List<ResDictionaryListVO> getDictionaryList(ReqDictionaryListPO request) { | public List<ResDictionaryListVO> getDictionaryList(ReqDictionaryListPO request) { | ||||
List<String> dictionaryTypeList = request.getDictionaryTypeList(); | |||||
if (CollectionUtils.isEmpty(dictionaryTypeList)) { | |||||
dictionaryTypeList = DictExpertInfoTypeEnum.getAll(); | |||||
} | |||||
List<String> dictionaryTypeList = CollUtil.defaultIfEmpty(request.getDictionaryTypeList(), DictTypeEnum.ALL); | |||||
List<ResDictionaryListVO> resDictionaryListVos = new ArrayList<>(); | List<ResDictionaryListVO> resDictionaryListVos = new ArrayList<>(); | ||||
for (String dictionaryType : dictionaryTypeList) { | for (String dictionaryType : dictionaryTypeList) { | ||||
ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO(); | ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO(); | ||||
resDictionaryListVO.setDictionaryName(dictionaryType); | resDictionaryListVO.setDictionaryName(dictionaryType); | ||||
List<DictionaryDTO> dictionaryList = dictionaryCache.getDictionaryListByDictionaryType(dictionaryType); | |||||
List<DictDTO> dictionaryList = dictionaryCache.listDictByDictType(dictionaryType); | |||||
if (dictionaryList == null) { | |||||
continue; | |||||
} | |||||
List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream() | List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream() | ||||
.map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList()); | .map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList()); | ||||
resDictionaryListVO.setDictionaryList(resDictionaryVOList); | resDictionaryListVO.setDictionaryList(resDictionaryVOList); | ||||
@@ -97,7 +97,7 @@ public class MetaManage { | |||||
for (String dictionaryType : dictionaryTypeList) { | for (String dictionaryType : dictionaryTypeList) { | ||||
ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO(); | ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO(); | ||||
resDictionaryListVO.setDictionaryName(dictionaryType); | resDictionaryListVO.setDictionaryName(dictionaryType); | ||||
List<DictionaryDTO> dictionaryList = dictionaryCache.getDictionaryListByDictionaryType(dictionaryType); | |||||
List<DictDTO> dictionaryList = dictionaryCache.listDictByDictType(dictionaryType); | |||||
List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream() | List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream() | ||||
.map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList()); | .map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList()); | ||||
resDictionaryListVO.setDictionaryList(resDictionaryVOList); | resDictionaryListVO.setDictionaryList(resDictionaryVOList); | ||||
@@ -131,7 +131,7 @@ public class MetaManage { | |||||
@Transactional(rollbackFor = Exception.class) | @Transactional(rollbackFor = Exception.class) | ||||
public void addDictionary(ReqAddDictionaryPO reqAddDictionaryPO) { | public void addDictionary(ReqAddDictionaryPO reqAddDictionaryPO) { | ||||
String dictionaryType = reqAddDictionaryPO.getDictionaryType(); | String dictionaryType = reqAddDictionaryPO.getDictionaryType(); | ||||
boolean contains = DictExpertInfoTypeEnum.contains(dictionaryType); | |||||
boolean contains = ExpertDictTypeEnum.contains(dictionaryType); | |||||
if (!contains) { | if (!contains) { | ||||
throw BizException.wrap("无效的专家字典类型:%s", dictionaryType); | throw BizException.wrap("无效的专家字典类型:%s", dictionaryType); | ||||
} | } | ||||
@@ -7,7 +7,7 @@ import lombok.Data; | |||||
* @date 2022/7/22 上午10:49 | * @date 2022/7/22 上午10:49 | ||||
*/ | */ | ||||
@Data | @Data | ||||
public class DictionaryDTO { | |||||
public class DictDTO { | |||||
private String dictionaryType; | private String dictionaryType; | ||||
@@ -2,7 +2,7 @@ package com.hz.pm.api.meta.service; | |||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import java.util.Collection; | import java.util.Collection; | ||||
@@ -27,7 +27,7 @@ public interface IExpertDictionaryService extends IService<ExpertDictionary> { | |||||
* @return / | * @return / | ||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType); | |||||
List<ExpertDictionary> listByUserId(Collection<Long> userIds, ExpertDictTypeEnum dictType); | |||||
default void removeByUserId(Long userId) { | default void removeByUserId(Long userId) { | ||||
this.remove(Wrappers.lambdaQuery(ExpertDictionary.class).eq(ExpertDictionary::getUserId, userId)); | this.remove(Wrappers.lambdaQuery(ExpertDictionary.class).eq(ExpertDictionary::getUserId, userId)); | ||||
@@ -2,7 +2,7 @@ package com.hz.pm.api.meta.service; | |||||
import com.hz.pm.api.meta.model.entity.MetaDictionary; | import com.hz.pm.api.meta.model.entity.MetaDictionary; | ||||
import com.baomidou.mybatisplus.extension.service.IService; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import java.util.List; | import java.util.List; | ||||
@@ -16,7 +16,7 @@ import java.util.List; | |||||
*/ | */ | ||||
public interface IMetaDictionaryService extends IService<MetaDictionary> { | public interface IMetaDictionaryService extends IService<MetaDictionary> { | ||||
List<DictionaryDTO> queryAll(); | |||||
List<DictDTO> queryAll(); | |||||
} | } |
@@ -3,7 +3,7 @@ package com.hz.pm.api.meta.service.impl; | |||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.mapper.ExpertDictionaryMapper; | import com.hz.pm.api.meta.mapper.ExpertDictionaryMapper; | ||||
import com.hz.pm.api.meta.model.entity.ExpertDictionary; | import com.hz.pm.api.meta.model.entity.ExpertDictionary; | ||||
import com.hz.pm.api.meta.service.IExpertDictionaryService; | import com.hz.pm.api.meta.service.IExpertDictionaryService; | ||||
@@ -24,7 +24,7 @@ import java.util.List; | |||||
public class ExpertDictionaryServiceImpl extends ServiceImpl<ExpertDictionaryMapper, ExpertDictionary> implements IExpertDictionaryService { | public class ExpertDictionaryServiceImpl extends ServiceImpl<ExpertDictionaryMapper, ExpertDictionary> implements IExpertDictionaryService { | ||||
@Override | @Override | ||||
public List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType) { | |||||
public List<ExpertDictionary> listByUserId(Collection<Long> userIds, ExpertDictTypeEnum dictType) { | |||||
// 获取专家职称 | // 获取专家职称 | ||||
LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class) | LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class) | ||||
.in(ExpertDictionary::getUserId, userIds) | .in(ExpertDictionary::getUserId, userIds) | ||||
@@ -5,7 +5,7 @@ import com.hz.pm.api.meta.model.entity.MetaDictionary; | |||||
import com.hz.pm.api.meta.mapper.MetaDictionaryMapper; | import com.hz.pm.api.meta.mapper.MetaDictionaryMapper; | ||||
import com.hz.pm.api.meta.service.IMetaDictionaryService; | import com.hz.pm.api.meta.service.IMetaDictionaryService; | ||||
import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler; | import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler; | ||||
import com.hz.pm.api.meta.model.dto.DictionaryDTO; | |||||
import com.hz.pm.api.meta.model.dto.DictDTO; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import java.util.List; | import java.util.List; | ||||
@@ -23,9 +23,9 @@ import java.util.stream.Collectors; | |||||
public class MetaDictionaryServiceImpl extends ServiceImpl<MetaDictionaryMapper, MetaDictionary> implements IMetaDictionaryService { | public class MetaDictionaryServiceImpl extends ServiceImpl<MetaDictionaryMapper, MetaDictionary> implements IMetaDictionaryService { | ||||
@Override | @Override | ||||
public List<DictionaryDTO> queryAll() { | |||||
public List<DictDTO> queryAll() { | |||||
List<MetaDictionary> dictionaryList = this.lambdaQuery().ne(MetaDictionary::getId, -1).list(); | List<MetaDictionary> dictionaryList = this.lambdaQuery().ne(MetaDictionary::getId, -1).list(); | ||||
List<DictionaryDTO> dictionaryDTOList = dictionaryList.stream().map(MetaDictionaryAssembler::toDictionaryDTO).collect(Collectors.toList()); | |||||
List<DictDTO> dictionaryDTOList = dictionaryList.stream().map(MetaDictionaryAssembler::toDictionaryDTO).collect(Collectors.toList()); | |||||
return dictionaryDTOList; | return dictionaryDTOList; | ||||
} | } | ||||
@@ -1,7 +1,7 @@ | |||||
package com.hz.pm.api.meta.validate; | package com.hz.pm.api.meta.validate; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
import com.hz.pm.api.meta.constant.DictExpertInfoTypeEnum; | |||||
import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; | |||||
import com.hz.pm.api.meta.model.po.ReqDictionaryListPO; | import com.hz.pm.api.meta.model.po.ReqDictionaryListPO; | ||||
import org.apache.commons.collections4.CollectionUtils; | import org.apache.commons.collections4.CollectionUtils; | ||||
@@ -20,7 +20,7 @@ public class DictParamValidator { | |||||
List<String> dictTypeList = req.getDictionaryTypeList(); | List<String> dictTypeList = req.getDictionaryTypeList(); | ||||
if (CollectionUtils.isNotEmpty(dictTypeList)) { | if (CollectionUtils.isNotEmpty(dictTypeList)) { | ||||
for (String dictType : dictTypeList) { | for (String dictType : dictTypeList) { | ||||
if (!DictExpertInfoTypeEnum.contains(dictType)) { | |||||
if (!ExpertDictTypeEnum.contains(dictType)) { | |||||
throw new BizException("无效的字典信息: " + dictType); | throw new BizException("无效的字典信息: " + dictType); | ||||
} | } | ||||
} | } | ||||