Procházet zdrojové kódy

修改评审结果上传接口

master
WendyYang před 10 měsíci
rodič
revize
452389a5f7
44 změnil soubory, kde provedl 493 přidání a 370 odebrání
  1. +8
    -8
      hz-pm-api/src/main/java/com/hz/pm/api/common/util/ExpertRegisterUtil.java
  2. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/helper/DashboardChartAssembler.java
  3. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/DashboardExpertManage.java
  4. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java
  5. +5
    -9
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java
  6. +11
    -11
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertInfoCmdAssembler.java
  7. +19
    -21
      hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java
  8. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/expert/entity/ExpertUserFullInfo.java
  9. +25
    -25
      hz-pm-api/src/main/java/com/hz/pm/api/expert/helper/ExpertManageHelper.java
  10. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java
  11. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java
  12. +9
    -13
      hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java
  13. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertInfoServiceImpl.java
  14. +3
    -6
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java
  15. +14
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java
  16. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java
  17. +7
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java
  18. +5
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java
  19. +6
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java
  20. +4
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java
  21. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertEvalListItemVO.java
  22. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java
  23. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java
  24. +5
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java
  25. +6
    -5
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java
  26. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java
  27. +44
    -33
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java
  28. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java
  29. +4
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meta/assembler/MetaDictionaryAssembler.java
  30. +0
    -53
      hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictAllTypeEnum.java
  31. +0
    -92
      hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java
  32. +107
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictTypeEnum.java
  33. +101
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/ExpertDictTypeEnum.java
  34. +3
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java
  35. +19
    -16
      hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/DictionaryCache.java
  36. +13
    -12
      hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/basic/AbstractDictionaryCache.java
  37. +22
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/DictionaryCacheImpl.java
  38. +10
    -10
      hz-pm-api/src/main/java/com/hz/pm/api/meta/manage/MetaManage.java
  39. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meta/model/dto/DictDTO.java
  40. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meta/service/IExpertDictionaryService.java
  41. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meta/service/IMetaDictionaryService.java
  42. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meta/service/impl/ExpertDictionaryServiceImpl.java
  43. +3
    -3
      hz-pm-api/src/main/java/com/hz/pm/api/meta/service/impl/MetaDictionaryServiceImpl.java
  44. +2
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java

+ 8
- 8
hz-pm-api/src/main/java/com/hz/pm/api/common/util/ExpertRegisterUtil.java Zobrazit soubor

@@ -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.model.*;
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.helper.DictionaryCache;
import com.hz.pm.api.meta.helper.TagCache;
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.organization.model.entity.DingOrganization;
import com.hz.pm.api.organization.service.IDingOrganizationService;
@@ -62,7 +62,7 @@ public class ExpertRegisterUtil {
// 政治面貌
basic.setPolitical(new ArrayList<>());
String political = MapUtil.getStr(w, "政治面貌");
List<DictionaryDTO> politicalDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.POLITICAL.getKey());
List<DictDTO> politicalDicts = dictionaryCache.listDictByDictType(DictTypeEnum.POLITICAL.getKey());
if (!politicalDicts.isEmpty()) {
politicalDicts.stream()
.filter(dict -> dict.getName().equals(political))
@@ -82,7 +82,7 @@ public class ExpertRegisterUtil {
eduInfo.setDegree(new ArrayList<>());
// 学历
String eduStr = MapUtil.getStr(w, "学历");
List<DictionaryDTO> eduDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.EDU.getKey());
List<DictDTO> eduDicts = dictionaryCache.listDictByDictType(DictTypeEnum.EDU.getKey());
if (!eduDicts.isEmpty()) {
eduDicts.stream()
.filter(dict -> dict.getName().equals(eduStr))
@@ -96,7 +96,7 @@ public class ExpertRegisterUtil {
}
// 学位
String degreeStr = MapUtil.getStr(w, "学位");
List<DictionaryDTO> degreeDicts = dictionaryCache.getDictionaryListByDictionaryType(DictAllTypeEnum.DEGREE.getKey());
List<DictDTO> degreeDicts = dictionaryCache.listDictByDictType(DictTypeEnum.DEGREE.getKey());
if (!degreeDicts.isEmpty()) {
degreeDicts.stream()
.filter(dict -> dict.getName().equals(degreeStr))
@@ -139,7 +139,7 @@ public class ExpertRegisterUtil {
jobInfo.setAdministrativeDuties(MapUtil.getStr(w, "行政职务"));
jobInfo.setAdministrativeRank(new ArrayList<>());
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()) {
administrativeRankDicts.stream()
.filter(dict -> dict.getName().equals(administrativeRankStr))
@@ -153,7 +153,7 @@ public class ExpertRegisterUtil {
}
jobInfo.setCompanyAttribute(new ArrayList<>());
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()) {
companyTypeDicts.stream()
.filter(dict -> dict.getName().equals(companyTypeStr))
@@ -240,7 +240,7 @@ public class ExpertRegisterUtil {
}
professionalInfo.setTitleLevel(new ArrayList<>());
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()) {
titleLevelDicts.stream()
.filter(dict -> dict.getName().equals(titleLevel))


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/helper/DashboardChartAssembler.java Zobrazit soubor

@@ -114,7 +114,7 @@ public class DashboardChartAssembler {

for (String dictionaryCode : dictionaryCodeIdMap.keySet()) {
AnalysisData analysisData = new AnalysisData();
analysisData.setKey(dictionaryCache.getByCode(dictionaryCode).getName());
analysisData.setKey(dictionaryCache.getByCode(dictionaryCode).get().getName());
analysisData.setValue(dictionaryCodeIdMap.get(dictionaryCode).size());
dataList.add(analysisData);
}


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/DashboardExpertManage.java Zobrazit soubor

@@ -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.service.IMeetingExpertJudgeService;
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.service.IExpertDictionaryService;
import lombok.RequiredArgsConstructor;
@@ -98,7 +98,7 @@ public class DashboardExpertManage {
if (CollectionUtil.isNotEmpty(regionDegreeExpertIdList)) {
// 区域学历分布
List<ExpertDictionary> degreeExpertDictionaryList = iExpertDictionaryService
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.DEGREE);
.listByUserId(regionDegreeExpertIdList, ExpertDictTypeEnum.DEGREE);
Map<String, List<String>> degreeCodeMap = degreeExpertDictionaryList.stream()
.map(ExpertDictionary::getDictionaryCode)
.collect(Collectors.groupingBy(Function.identity()));
@@ -108,7 +108,7 @@ public class DashboardExpertManage {

// 区域职称级别分布
List<ExpertDictionary> titleLevelExpertDictionaryList = iExpertDictionaryService
.listByUserId(regionDegreeExpertIdList, DictExpertInfoTypeEnum.TITLE_LEVEL);
.listByUserId(regionDegreeExpertIdList, ExpertDictTypeEnum.TITLE_LEVEL);
Map<String, List<ExpertDictionary>> titleLevelCodeMap = titleLevelExpertDictionaryList.stream()
.collect(Collectors.groupingBy(ExpertDictionary::getDictionaryCode));
AnalysisChart regionExpertTitleLevelChartAnalysisChart =


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/dashboard/manage/ExpertStatisticsManage.java Zobrazit soubor

@@ -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.service.IExpertIntentionWorkRegionService;
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.entity.ExpertDictionary;
import com.hz.pm.api.meta.model.entity.ExpertTag;
@@ -96,10 +96,10 @@ public class ExpertStatisticsManage {

List<TagDTO> tags = metaTagService.queryAll();

List<DictionaryDTO> dictionaries = metaDictionaryService.queryAll();
List<DictDTO> dictionaries = metaDictionaryService.queryAll();
Set<String> code = Sets.newHashSet();
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)
.eq(ExpertDictionary::getExpertInfoField, DashboardConstant.Expert.EXPERT_TYPE));


+ 5
- 9
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertAdminExpertManageAssembler.java Zobrazit soubor

@@ -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.impl.TagsCacheImpl;
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.sys.model.dto.RegionDTO;
import lombok.RequiredArgsConstructor;
@@ -19,9 +19,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
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;

/**
@@ -104,13 +102,11 @@ public class ExpertAdminExpertManageAssembler {

public List<DictionaryFieldInfo> assembleDictionaryName(List<DictionaryFieldInfo> collect) {
if (CollectionUtil.isEmpty(collect)){
return new ArrayList<>();
return Collections.emptyList();
}
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());
}



+ 11
- 11
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertInfoCmdAssembler.java Zobrazit soubor

@@ -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.ExpertInfoModifyCmd;
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.model.ExpertRegionInfo;
import org.apache.commons.collections4.CollectionUtils;
@@ -133,15 +133,15 @@ public class ExpertInfoCmdAssembler {
recommendedWay = recommendInfo.getRecommendedWay();
}
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 -> {
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO();
@@ -153,7 +153,7 @@ public class ExpertInfoCmdAssembler {

private static void assemblerDictionaryFieldName(
List<DictionaryFieldInfo> allDictionaryFieldInfoList, List<DictionaryFieldInfo> originalDictionaryFieldInfoList
, DictExpertInfoTypeEnum dictExpertInfoTypeEnum) {
, ExpertDictTypeEnum dictExpertInfoTypeEnum) {
if (CollectionUtils.isNotEmpty(originalDictionaryFieldInfoList)) {
originalDictionaryFieldInfoList = originalDictionaryFieldInfoList.stream().map(r -> {
r.setDictionaryFieldName(dictExpertInfoTypeEnum.getKey());


+ 19
- 21
hz-pm-api/src/main/java/com/hz/pm/api/expert/assembler/ExpertUserInfoAssembler.java Zobrazit soubor

@@ -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.vo.ExpertFullInfoVO;
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.helper.DictionaryCache;
import com.hz.pm.api.meta.helper.TagCache;
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.entity.ExpertDictionary;
import com.hz.pm.api.meta.model.entity.ExpertTag;
@@ -67,7 +67,7 @@ public class ExpertUserInfoAssembler {
ExpertProfessionalInfo profession = buildExpertProfessionalInfo(expertUserInfo, dictMap, tagMap, fileMap, avoidCompanies);
// 推荐信息
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()));
// 其他信息
ExpertOtherInfo otherInfo = new ExpertOtherInfo();
@@ -125,10 +125,8 @@ public class ExpertUserInfoAssembler {
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
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;
}).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName));
}
@@ -140,7 +138,7 @@ public class ExpertUserInfoAssembler {
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) {
ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo();
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.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey()));
professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey()));
@@ -159,15 +157,15 @@ public class ExpertUserInfoAssembler {
public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO,
Map<String, List<DictionaryFieldInfo>> dictInfoMap) {
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.setCompany(expertUserInfoDTO.getCompany());
jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode());
jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode());
jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties());
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.setExperience(expertUserInfoDTO.getExperience());
return jobInfo;
@@ -181,9 +179,9 @@ public class ExpertUserInfoAssembler {
eduInfo.setSchool(expertFullInfo.getSchool());
eduInfo.setGraduatedAt(expertFullInfo.getGraduatedAt());
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.setDegree(dictInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey()));
eduInfo.setDegree(dictInfoMap.get(ExpertDictTypeEnum.DEGREE.getKey()));
eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getDegreeCertificateFileIdList()));
return eduInfo;
}
@@ -226,7 +224,7 @@ public class ExpertUserInfoAssembler {
basicInfo.setName(expertUserInfoDTO.getName());
basicInfo.setAvatarFile(getFileBasicInfo(fileBasicInfoMap, expertUserInfoDTO.getAvatarFileId()));
basicInfo.setGender(expertUserInfoDTO.getGender());
basicInfo.setPolitical(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey()));
basicInfo.setPolitical(dictionaryFieldInfoMap.get(ExpertDictTypeEnum.POLITICAL.getKey()));
basicInfo.setIdCard(expertUserInfoDTO.getIdCard());
basicInfo.setOfficePhone(expertUserInfoDTO.getPhoneNo());
basicInfo.setBirth(expertUserInfoDTO.getBirth());
@@ -246,7 +244,7 @@ public class ExpertUserInfoAssembler {
expertIntentionWorkRegion.setRegionName(regionCacheHelper.getUnionPath(r.getRegionCode(), r.getRegionLevel()));
return expertIntentionWorkRegion;
}).collect(Collectors.toList()));
basicInfo.setExpertType(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()));
basicInfo.setExpertType(dictionaryFieldInfoMap.get(ExpertDictTypeEnum.EXPERT_TYPE.getKey()));
return basicInfo;
}

@@ -423,11 +421,11 @@ public class ExpertUserInfoAssembler {
List<ExpertDictionary> userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList());
Map<String, List<ExpertDictionary>> fieldExpertDictMap = userExpertDictList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField));
adminManageExpertListItem.setExpertType(
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.EXPERT_TYPE.getKey())));
adminManageExpertListItem.setCompanyAttribute(
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.COMPANY_ATTRIBUTE.getKey())));
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);
Map<String, List<ExpertTag>> fieldExpertTagMap = expertTagList.stream().collect(Collectors.groupingBy(ExpertTag::getExpertInfoField));
@@ -446,13 +444,13 @@ public class ExpertUserInfoAssembler {
adminManageExpertListItem.setHometown(expertUserFullInfo.getHometown());
adminManageExpertListItem.setNationality(expertUserFullInfo.getNationality());
adminManageExpertListItem.setPolitical(
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.POLITICAL.getKey())));
adminManageExpertListItem.setIdCard(expertUserFullInfo.getIdCard());
adminManageExpertListItem.setBankNo(expertUserFullInfo.getBankNo());
adminManageExpertListItem.setEdu(
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EDU.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.EDU.getKey())));
adminManageExpertListItem.setRecommendedWay(
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())));
DictAssembler.toDictFieldInfoList(fieldExpertDictMap.get(ExpertDictTypeEnum.RECOMMENDED_WAY.getKey())));

adminManageExpertListItem.setCreateTime(expertUserFullInfo.getCreateOn());
return adminManageExpertListItem;


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/expert/entity/ExpertUserFullInfo.java Zobrazit soubor

@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
*/
@Data
@TableName("nd_expert_user_full_info")
@ApiModel(value = "NdExpertUserFullInfo对象", description = "")
@ApiModel(value = "NdExpertUserFullInfo对象")
public class ExpertUserFullInfo implements Serializable {

private static final long serialVersionUID = 1L;


+ 25
- 25
hz-pm-api/src/main/java/com/hz/pm/api/expert/helper/ExpertManageHelper.java Zobrazit soubor

@@ -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.TagCache;
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.ningdatech.basic.exception.BizException;
import lombok.RequiredArgsConstructor;
@@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
* @author liuxinxin
@@ -76,33 +77,32 @@ public class ExpertManageHelper {
/**
* 校验字典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);
}
}
}


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertAdminManage.java Zobrazit soubor

@@ -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.ExpertInfoService;
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.model.ExpertRegionInfo;
import com.hz.pm.api.meta.model.bo.RegionContainsBO;
@@ -105,19 +105,19 @@ public class ExpertAdminManage {
List<ExpertDictionaryQuery> expertDictQueryList = new ArrayList<>();
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) {
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery();
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey());
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.TITLE_LEVEL.getKey());
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode()));
expertDictQueryList.add(expertDictQuery);
}
if (StringUtils.isNotBlank(query.getCompanyAttributeDictionaryCode())) {
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery();
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey());
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.COMPANY_ATTRIBUTE.getKey());
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getCompanyAttributeDictionaryCode()));
expertDictQueryList.add(expertDictQuery);
}
if (StringUtils.isNotBlank(query.getExpertTypeDictionaryCode())) {
ExpertDictionaryQuery expertDictQuery = new ExpertDictionaryQuery();
expertDictQuery.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey());
expertDictQuery.setExpertInfoField(ExpertDictTypeEnum.EXPERT_TYPE.getKey());
expertDictQuery.setDictionaryCodeList(CollectionUtil.toList(query.getExpertTypeDictionaryCode()));
expertDictQueryList.add(expertDictQuery);
}


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertManage.java Zobrazit soubor

@@ -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.service.IMeetingExpertJudgeService;
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.sms.constant.VerificationCodeType;
import com.hz.pm.api.sms.helper.VerifyCodeCheckHelper;
@@ -185,7 +185,7 @@ public class ExpertManage {
recommendedWay.forEach(r -> {
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO();
expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode());
expertDictionaryDTO.setExpertInfoField(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey());
expertDictionaryDTO.setExpertInfoField(ExpertDictTypeEnum.RECOMMENDED_WAY.getKey());
recommendedWayDictionaryDTOList.add(expertDictionaryDTO);
});
}


+ 9
- 13
hz-pm-api/src/main/java/com/hz/pm/api/expert/manage/ExpertMetaApplyManage.java Zobrazit soubor

@@ -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.IExpertMetaApplyService;
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.ExpertUserInfoHelper;
import com.hz.pm.api.meta.model.ExpertRegionInfo;
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.service.IExpertDictionaryService;
import com.hz.pm.api.sys.model.dto.RegionDTO;
@@ -113,10 +113,10 @@ public class ExpertMetaApplyManage {
// 根据用户id 获取专家基本信息
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds);
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);

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);
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, titleLevelDictMap, expertTypeDictMap));
});
@@ -359,7 +359,7 @@ public class ExpertMetaApplyManage {
List<ExpertDictionaryQuery> expertDictionaryQueryList = new ArrayList<>();
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) {
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery();
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey());
expertDictionaryQuery.setExpertInfoField(ExpertDictTypeEnum.TITLE_LEVEL.getKey());
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode()));
expertDictionaryQueryList.add(expertDictionaryQuery);
}
@@ -419,13 +419,11 @@ public class ExpertMetaApplyManage {
List<ExpertDictionary> titleLevelDictionaryList = titleLevelDictMap.get(userId);
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) {
expertApplyMetaVO.setTitleLevel(titleLevelDictionaryList.stream().map(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
Optional<DictDTO> dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
if (Objects.nonNull(dictionaryDTO)) {
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName());
}
dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName()));
return dictionaryFieldInfo;
}).collect(Collectors.toList()));
}
@@ -434,13 +432,11 @@ public class ExpertMetaApplyManage {
List<ExpertDictionary> expertTypeDictionaryList = expertTypeDictMap.get(userId);
if (CollectionUtils.isNotEmpty(titleLevelDictionaryList)) {
expertApplyMetaVO.setExpertType(expertTypeDictionaryList.stream().map(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
Optional<DictDTO> dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
if (Objects.nonNull(dictionaryDTO)) {
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName());
}
dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName()));
return dictionaryFieldInfo;
}).collect(Collectors.toList()));
}


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/expert/service/impl/ExpertInfoServiceImpl.java Zobrazit soubor

@@ -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.utils.SensitiveModifySegmentUtils;
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.entity.ExpertDictionary;
import com.hz.pm.api.meta.model.entity.ExpertTag;
@@ -415,7 +415,7 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
// 保存所有专家字典字段
List<ExpertDictionaryDTO> expertType = cmd.getExpertType();
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);
iExpertDictionaryService.saveBatch(saveExpertDictList);
}


+ 3
- 6
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/Meeting.java Zobrazit soubor

@@ -71,6 +71,9 @@ public class Meeting implements Serializable {
@ApiModelProperty("是否确认名单")
private Boolean confirmedRoster;

@ApiModelProperty("短信通知签名")
private String smsNotifySign;

@ApiModelProperty("举办单位")
private String holdOrg;

@@ -92,12 +95,6 @@ public class Meeting implements Serializable {
@ApiModelProperty("备注")
private String remark;

@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("会议结果附件")
private String resultAttachFiles;

@ApiModelProperty("创建人ID")
@TableField(fill = FieldFill.INSERT)
private Long createBy;


+ 14
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingInnerProject.java Zobrazit soubor

@@ -1,13 +1,12 @@
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.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
* <p>
@@ -37,4 +36,16 @@ public class MeetingInnerProject implements Serializable {
@ApiModelProperty("项目编号")
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;

}

+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingOuterProject.java Zobrazit soubor

@@ -43,6 +43,12 @@ public class MeetingOuterProject implements Serializable {
@ApiModelProperty("申报金额")
private BigDecimal declareAmount;

@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("会议结果附件")
private String resultAttachFiles;

@ApiModelProperty("会议ID")
private Long meetingId;



+ 7
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingBasicDTO.java Zobrazit soubor

@@ -4,7 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
@@ -51,6 +53,11 @@ public class MeetingBasicDTO {
@ApiModelProperty("评审地点")
private String meetingAddress;

@NotBlank(message = "短信通知签名不能为空")
@Length(min = 1, max = 20, message = "短信通知签名无效")
@ApiModelProperty("短信通知签名")
private String smsNotifySign;

@NotEmpty(message = "联系人不能为空")
@ApiModelProperty("联系人")
private String connecter;


+ 5
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/MeetingReviewProjectDTO.java Zobrazit soubor

@@ -37,7 +37,10 @@ public class MeetingReviewProjectDTO {
@ApiModelProperty("申报单位")
private String buildOrg;

@ApiModelProperty("评审结果")
private String reviewResult;
@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("会议结果附件")
private String resultAttachFiles;

}

+ 6
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/dto/ReviewProjectDTO.java Zobrazit soubor

@@ -68,4 +68,10 @@ public class ReviewProjectDTO {
@ApiModelProperty("是否已评价:0 未自评、1 已自评、2 已终评")
private Integer reviewed;

@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("会议结果附件")
private String resultAttachFiles;

}

+ 4
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/req/MeetingResultUploadReq.java Zobrazit soubor

@@ -21,6 +21,10 @@ public class MeetingResultUploadReq {
@NotNull(message = "会议ID不能为空")
private Long meetingId;

@ApiModelProperty("项目关联会议ID")
@NotNull(message = "项目关联会议ID不能为空")
private Long meetingProjectId;

@ApiModelProperty("会议结果说明")
@NotBlank(message = "会议结果说明不能为空")
private String resultDescription;


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/ExpertEvalListItemVO.java Zobrazit soubor

@@ -15,6 +15,6 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class ExpertEvalListItemVO extends ExpertBasicInfoVO{

private Long evaluationId;
private Long expertJudgeId;

}

+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingByManagerVO.java Zobrazit soubor

@@ -35,6 +35,9 @@ public class MeetingByManagerVO {
@JSONField(format = "yyyy-MM-dd HH:mm")
private LocalDateTime endTime;

@ApiModelProperty("评审地点")
private String meetingAddress;

@ApiModelProperty("会议状态")
private Integer status;



+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingDetailBasicVO.java Zobrazit soubor

@@ -57,6 +57,9 @@ public class MeetingDetailBasicVO {
@ApiModelProperty("会议耗时")
private Integer meetingUsageTime;

@ApiModelProperty("短信通知单位签名")
private String smsNotifySign;

@ApiModelProperty("联系人")
private String connecter;



+ 5
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/MeetingReviewProjectVO.java Zobrazit soubor

@@ -46,8 +46,11 @@ public class MeetingReviewProjectVO {
@ApiModelProperty("申报单位")
private String buildOrg;

@ApiModelProperty("评审结果")
private String reviewResult;
@ApiModelProperty("会议结果说明")
private String resultDescription;

@ApiModelProperty("会议结果附件")
private String resultAttachFiles;

@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")


+ 6
- 5
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingManageHelper.java Zobrazit soubor

@@ -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.IExpertInviteRuleService;
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.model.dto.DictionaryDTO;
import com.hz.pm.api.meta.model.dto.DictDTO;
import com.hz.pm.api.sys.model.dto.RegionDTO;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.util.CollUtils;
@@ -116,6 +116,7 @@ public class MeetingManageHelper {
result.setCreateOn(meeting.getCreateOn());
result.setConnecter(meeting.getConnecter());
result.setContact(meeting.getContact());
result.setMeetingAddress(meeting.getMeetingAddress());
return result;
}

@@ -166,11 +167,11 @@ public class MeetingManageHelper {
basicInfoVo.setContact(userInfo.getPhoneNo());
basicInfoVo.setCompany(userInfo.getCompany());
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();
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 {
basicInfoVo.setJobLevel("");
}


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/DashboardManage.java Zobrazit soubor

@@ -127,7 +127,7 @@ public class DashboardManage {
item.setEndTime(w.getEndTime());
item.setStartTime(w.getStartTime());
item.setStatus(w.getStatus());
item.setType(dictionaryCache.getByCode(w.getType()).getName());
item.setType(dictionaryCache.getByCode(w.getType()).get().getName());
item.setMeetingName(w.getName());
return item;
}).collect(Collectors.toList());


+ 44
- 33
hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java Zobrazit soubor

@@ -47,7 +47,6 @@ import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.IdVo;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.StrPool;
import com.ningdatech.basic.util.ValidUtil;
import com.ningdatech.cache.lock.DistributedLock;
import lombok.RequiredArgsConstructor;
@@ -104,10 +103,10 @@ public class MeetingManage {

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());
meetingService.save(meeting);
if (meeting.getIsInnerProject() != null) {
if (meetingBasic.getIsInnerProject()) {
if (Boolean.TRUE.equals(meetingBasic.getIsInnerProject())) {
List<MeetingInnerProject> projects = meetingBasic.getInnerProjects().stream().map(w -> {
MeetingInnerProject project = BeanUtil.copyProperties(w, MeetingInnerProject.class);
project.setMeetingId(meeting.getId());
@@ -452,15 +451,13 @@ public class MeetingManage {
.invitedStopped(meeting.getInviteStatus())
.attachFiles(meeting.getAttachFiles())
.description(meeting.getDescription())
.resultDescription(meeting.getResultDescription())
.resultAttachFiles(meeting.getResultAttachFiles())
.remark(meeting.getRemark())
.build();
if (meeting.getIsInnerProject() != null) {
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) {
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 -> {
MeetingReviewProjectDTO mrp = new MeetingReviewProjectDTO();
mrp.setProjectId(w.getId());
@@ -470,9 +467,10 @@ public class MeetingManage {
mrp.setProjectYear(w.getProjectYear());
mrp.setDeclareAmount(w.getDeclareAmount());
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;
});
@@ -591,7 +589,7 @@ public class MeetingManage {
}
if (randomRule.getExpertDicts() != null) {
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);
});
}
@@ -900,18 +898,16 @@ public class MeetingManage {

public List<MeetingReviewProjectVO> projectsByMeetingId(Long meetingId) {
Meeting meeting = meetingService.getById(meetingId);
if (meeting.getIsInnerProject()) {
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) {
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 -> {
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;
});
@@ -949,7 +945,7 @@ public class MeetingManage {
}

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)) {
throw BizException.wrap("正在上传会议结果,请勿重复操作");
}
@@ -962,13 +958,28 @@ public class MeetingManage {
if (meeting.getEndTime().isAfter(now)) {
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 {
distributedLock.releaseLock(key);
}
@@ -979,14 +990,14 @@ public class MeetingManage {
if (experts.isEmpty()) {
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);
Map<Long, ExpertBasicInfoVO> expertMap = meetingManageHelper.getExpertBasicInfo(expertIds);
return experts.stream().map(w -> {
Long expertId = w.getExpertId();
ExpertEvalListItemVO item = new ExpertEvalListItemVO();
BeanUtil.copyProperties(expertMap.get(expertId), item);
item.setEvaluationId(evaluationIdMap.get(expertId));
item.setExpertJudgeId(expertJudgeMap.get(expertId));
return item;
}).collect(Collectors.toList());
}


+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java Zobrazit soubor

@@ -36,7 +36,7 @@ public interface IMeetingExpertJudgeService extends IService<MeetingExpertJudge>
LambdaQueryWrapper<MeetingExpertJudge> query = Wrappers.lambdaQuery(MeetingExpertJudge.class)
.select(MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId)
.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) {


+ 4
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meta/assembler/MetaDictionaryAssembler.java Zobrazit soubor

@@ -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.dto.DictionaryDTO;
import com.hz.pm.api.meta.model.dto.DictDTO;
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 static DictionaryDTO toDictionaryDTO(MetaDictionary dictionaryManage) {
DictionaryDTO dictionaryDTO = new DictionaryDTO();
public static DictDTO toDictionaryDTO(MetaDictionary dictionaryManage) {
DictDTO dictionaryDTO = new DictDTO();
dictionaryDTO.setDescribe(dictionaryManage.getDictionaryDescribe());
dictionaryDTO.setDictionaryCode(dictionaryManage.getDictionaryCode());
dictionaryDTO.setDictionaryType(dictionaryManage.getDictionaryType());
@@ -23,7 +23,7 @@ public class MetaDictionaryAssembler {
return dictionaryDTO;
}

public static ResDictionaryVO toDictionaryVO(DictionaryDTO dictionaryDTO) {
public static ResDictionaryVO toDictionaryVO(DictDTO dictionaryDTO) {
ResDictionaryVO resDictionaryVO = new ResDictionaryVO();
resDictionaryVO.setDescribe(dictionaryDTO.getDescribe());
resDictionaryVO.setDictionaryCode(dictionaryDTO.getDictionaryCode());


+ 0
- 53
hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictAllTypeEnum.java Zobrazit soubor

@@ -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;
}

}

+ 0
- 92
hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictExpertInfoTypeEnum.java Zobrazit soubor

@@ -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));
}

}

+ 107
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/DictTypeEnum.java Zobrazit soubor

@@ -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));
}


}

+ 101
- 0
hz-pm-api/src/main/java/com/hz/pm/api/meta/constant/ExpertDictTypeEnum.java Zobrazit soubor

@@ -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));
}

}

+ 3
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meta/controller/MetaDictionaryManageController.java Zobrazit soubor

@@ -1,12 +1,12 @@
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.model.po.ReqAddDictionaryPO;
import com.hz.pm.api.meta.model.po.ReqDictionaryListPO;
import com.hz.pm.api.meta.model.vo.ResDictionaryListVO;
import com.hz.pm.api.meta.validate.DictParamValidator;
import com.ningdatech.log.annotation.WebLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -31,7 +31,6 @@ import java.util.List;
@Api(tags = "基础数据接口")
public class MetaDictionaryManageController {

// private final IMetaDictionaryManageService metaDictionaryManageService;
private final MetaManage metaManage;

@PostMapping("/list")
@@ -51,8 +50,8 @@ public class MetaDictionaryManageController {
@PostMapping("/add/dictionary")
@ApiOperation("添加字典值")
@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}")


+ 19
- 16
hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/DictionaryCache.java Zobrazit soubor

@@ -1,11 +1,11 @@
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.Optional;

/**
* @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);

}

+ 13
- 12
hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/basic/AbstractDictionaryCache.java Zobrazit soubor

@@ -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.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.model.dto.DictionaryDTO;
import com.hz.pm.api.meta.model.dto.DictDTO;
import com.hz.pm.api.meta.service.IMetaDictionaryService;
import com.ningdatech.basic.util.CollUtils;
import lombok.RequiredArgsConstructor;
@@ -24,30 +24,31 @@ public abstract class AbstractDictionaryCache implements InitializingBean, Dicti

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
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);
Map<String, List<DictionaryDTO>> dictMapByType = CollUtils.group(dicts, DictionaryDTO::getDictionaryType);
Map<String, List<DictDTO>> dictMapByType = CollUtils.group(dicts, DictDTO::getDictionaryType);
return dictMapByType.get(key);
});
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));
return dictionaryDtoMap;
}

private void warmUp() {
for (DictAllTypeEnum typeEnum : DictAllTypeEnum.values()) {
dictionaryCacheHelper.get(typeEnum.getKey());
for (DictTypeEnum typeEnum : DictTypeEnum.values()) {
dictCache.get(typeEnum.getKey());
}
}



+ 22
- 10
hz-pm-api/src/main/java/com/hz/pm/api/meta/helper/impl/DictionaryCacheImpl.java Zobrazit soubor

@@ -1,13 +1,14 @@
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.model.dto.DictionaryDTO;
import com.hz.pm.api.meta.model.dto.DictDTO;
import com.hz.pm.api.meta.service.IMetaDictionaryService;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Objects;
import java.util.Optional;

/**
* @author liuxinxin
@@ -21,25 +22,36 @@ public class DictionaryCacheImpl extends AbstractDictionaryCache {
}

@Override
public List<DictionaryDTO> getDictionaryListByDictionaryType(DictAllTypeEnum dictionaryType) {
return dictionaryCacheHelper.get(dictionaryType.getKey());
public List<DictDTO> listDictByDictType(DictTypeEnum dictionaryType) {
return dictCache.get(dictionaryType.getKey());
}

@Override
public List<DictionaryDTO> getDictionaryListByDictionaryType(String dictionaryType) {
return dictionaryCacheHelper.get(dictionaryType);
public List<DictDTO> listDictByDictType(String dictType) {
return dictCache.get(dictType);
}

@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))
.findFirst().orElse(null);
}

@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();
}

}

+ 10
- 10
hz-pm-api/src/main/java/com/hz/pm/api/meta/manage/MetaManage.java Zobrazit soubor

@@ -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.StringUtils;
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.util.CollUtils;
import com.hz.pm.api.common.enumeration.BoolDisplayEnum;
import com.hz.pm.api.common.util.BizUtils;
import com.hz.pm.api.meta.assembler.MetaDictionaryAssembler;
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.TagConst;
import com.hz.pm.api.meta.helper.DictionaryCache;
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.entity.ExpertDictionary;
import com.hz.pm.api.meta.model.entity.ExpertTag;
@@ -53,16 +54,15 @@ public class MetaManage {
private final IExpertTagService iExpertTagService;

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<>();
for (String dictionaryType : dictionaryTypeList) {
ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO();
resDictionaryListVO.setDictionaryName(dictionaryType);
List<DictionaryDTO> dictionaryList = dictionaryCache.getDictionaryListByDictionaryType(dictionaryType);
List<DictDTO> dictionaryList = dictionaryCache.listDictByDictType(dictionaryType);
if (dictionaryList == null) {
continue;
}
List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream()
.map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList());
resDictionaryListVO.setDictionaryList(resDictionaryVOList);
@@ -97,7 +97,7 @@ public class MetaManage {
for (String dictionaryType : dictionaryTypeList) {
ResDictionaryListVO resDictionaryListVO = new ResDictionaryListVO();
resDictionaryListVO.setDictionaryName(dictionaryType);
List<DictionaryDTO> dictionaryList = dictionaryCache.getDictionaryListByDictionaryType(dictionaryType);
List<DictDTO> dictionaryList = dictionaryCache.listDictByDictType(dictionaryType);
List<ResDictionaryVO> resDictionaryVOList = dictionaryList.stream()
.map(MetaDictionaryAssembler::toDictionaryVO).collect(Collectors.toList());
resDictionaryListVO.setDictionaryList(resDictionaryVOList);
@@ -131,7 +131,7 @@ public class MetaManage {
@Transactional(rollbackFor = Exception.class)
public void addDictionary(ReqAddDictionaryPO reqAddDictionaryPO) {
String dictionaryType = reqAddDictionaryPO.getDictionaryType();
boolean contains = DictExpertInfoTypeEnum.contains(dictionaryType);
boolean contains = ExpertDictTypeEnum.contains(dictionaryType);
if (!contains) {
throw BizException.wrap("无效的专家字典类型:%s", dictionaryType);
}


hz-pm-api/src/main/java/com/hz/pm/api/meta/model/dto/DictionaryDTO.java → hz-pm-api/src/main/java/com/hz/pm/api/meta/model/dto/DictDTO.java Zobrazit soubor

@@ -7,7 +7,7 @@ import lombok.Data;
* @date 2022/7/22 上午10:49
*/
@Data
public class DictionaryDTO {
public class DictDTO {

private String dictionaryType;


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meta/service/IExpertDictionaryService.java Zobrazit soubor

@@ -2,7 +2,7 @@ package com.hz.pm.api.meta.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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 java.util.Collection;
@@ -27,7 +27,7 @@ public interface IExpertDictionaryService extends IService<ExpertDictionary> {
* @return /
* @author WendyYang
**/
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType);
List<ExpertDictionary> listByUserId(Collection<Long> userIds, ExpertDictTypeEnum dictType);

default void removeByUserId(Long userId) {
this.remove(Wrappers.lambdaQuery(ExpertDictionary.class).eq(ExpertDictionary::getUserId, userId));


+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meta/service/IMetaDictionaryService.java Zobrazit soubor

@@ -2,7 +2,7 @@ package com.hz.pm.api.meta.service;

import com.hz.pm.api.meta.model.entity.MetaDictionary;
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;

@@ -16,7 +16,7 @@ import java.util.List;
*/
public interface IMetaDictionaryService extends IService<MetaDictionary> {

List<DictionaryDTO> queryAll();
List<DictDTO> queryAll();


}

+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meta/service/impl/ExpertDictionaryServiceImpl.java Zobrazit soubor

@@ -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.toolkit.Wrappers;
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.model.entity.ExpertDictionary;
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 {

@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)
.in(ExpertDictionary::getUserId, userIds)


+ 3
- 3
hz-pm-api/src/main/java/com/hz/pm/api/meta/service/impl/MetaDictionaryServiceImpl.java Zobrazit soubor

@@ -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.service.IMetaDictionaryService;
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 java.util.List;
@@ -23,9 +23,9 @@ import java.util.stream.Collectors;
public class MetaDictionaryServiceImpl extends ServiceImpl<MetaDictionaryMapper, MetaDictionary> implements IMetaDictionaryService {

@Override
public List<DictionaryDTO> queryAll() {
public List<DictDTO> queryAll() {
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;
}



+ 2
- 2
hz-pm-api/src/main/java/com/hz/pm/api/meta/validate/DictParamValidator.java Zobrazit soubor

@@ -1,7 +1,7 @@
package com.hz.pm.api.meta.validate;

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 org.apache.commons.collections4.CollectionUtils;

@@ -20,7 +20,7 @@ public class DictParamValidator {
List<String> dictTypeList = req.getDictionaryTypeList();
if (CollectionUtils.isNotEmpty(dictTypeList)) {
for (String dictType : dictTypeList) {
if (!DictExpertInfoTypeEnum.contains(dictType)) {
if (!ExpertDictTypeEnum.contains(dictType)) {
throw new BizException("无效的字典信息: " + dictType);
}
}


Načítá se…
Zrušit
Uložit