Преглед изворни кода

Merge remote-tracking branch 'origin/master'

master
PoffyZhang пре 1 година
родитељ
комит
45fe365e44
8 измењених фајлова са 166 додато и 130 уклоњено
  1. +4
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/DictionaryAssembler.java
  2. +102
    -101
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java
  4. +13
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  5. +8
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java
  6. +25
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  7. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java
  8. +10
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java

+ 4
- 4
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/DictionaryAssembler.java Прегледај датотеку

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.expert.assembler;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.CollUtil;
import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;

@@ -15,11 +15,11 @@ import java.util.stream.Collectors;

public class DictionaryAssembler {

public static List<DictionaryFieldInfo> toDictionaryFieldInfoList(List<ExpertDictionary> expertDictionaryList) {
if (CollectionUtil.isEmpty(expertDictionaryList)) {
public static List<DictionaryFieldInfo> toDictFieldInfoList(List<ExpertDictionary> expertDictList) {
if (CollUtil.isEmpty(expertDictList)) {
return new ArrayList<>();
}
return expertDictionaryList.stream().map(r -> {
return expertDictList.stream().map(r -> {
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());


+ 102
- 101
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java Прегледај датотеку

@@ -2,6 +2,7 @@ package com.ningdatech.pmapi.expert.assembler;


import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.file.entity.vo.result.AttachFileVo;
import com.ningdatech.pmapi.common.enumeration.BoolDisplayEnum;
@@ -25,7 +26,6 @@ import com.ningdatech.pmapi.meta.model.dto.TagDTO;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.ningdatech.pmapi.meta.model.entity.ExpertTag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

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

// 专家申请履职意向展示列表
@@ -121,8 +121,8 @@ public class ExpertUserInfoAssembler {
}).collect(Collectors.groupingBy(TagFieldInfo::getTagFieldName));
}

public Map<String, List<DictionaryFieldInfo>> buildDictionaryFieldInfoMap(List<ExpertDictionaryDTO> expertDictionaryList) {
return expertDictionaryList.stream().map(r -> {
public Map<String, List<DictionaryFieldInfo>> buildDictInfoMap(List<ExpertDictionaryDTO> expertDictList) {
return expertDictList.stream().map(r -> {
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());
@@ -134,61 +134,63 @@ public class ExpertUserInfoAssembler {
}).collect(Collectors.groupingBy(DictionaryFieldInfo::getDictionaryFieldName));
}

public static ExpertProfessionalInfo buildExpertProfessionalInfo(ExpertUserFullInfoDTO expertUserInfoDTO
, Map<String, List<DictionaryFieldInfo>> dictionaryFieldInfoMap, Map<String, List<TagFieldInfo>> tagFieldInfoMap
, Map<Long, FileBasicInfo> fileBasicInfoMap, List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) {
public static ExpertProfessionalInfo buildExpertProfessionalInfo(ExpertUserFullInfoDTO expertUserInfoDTO,
Map<String, List<DictionaryFieldInfo>> dictInfoMap,
Map<String, List<TagFieldInfo>> tagFieldInfoMap,
Map<Long, FileBasicInfo> fileInfoMap,
List<ExpertAvoidCompanyDTO> expertAvoidCompanyList) {
ExpertProfessionalInfo professionalInfo = new ExpertProfessionalInfo();
professionalInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles());
professionalInfo.setTitleLevel(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()));
professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList()));
professionalInfo.setTitleLevel(dictInfoMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey()));
professionalInfo.setTitleCertificateFile(getFileBasicInfoList(fileInfoMap, expertUserInfoDTO.getTitleCertificateFileIdList()));
professionalInfo.setGoodAt(tagFieldInfoMap.get(ExpertTagEnum.GOOD_AT.getKey()));
professionalInfo.setTechnicalExpertise(tagFieldInfoMap.get(ExpertTagEnum.TECHNICAL_EXPERTISE.getKey()));
professionalInfo.setAwards(expertUserInfoDTO.getAwards());
professionalInfo.setIndustrySector(tagFieldInfoMap.get(ExpertTagEnum.INDUSTRY_SECTOR.getKey()));
professionalInfo.setRecognitionReward(expertUserInfoDTO.getRecognitionReward());
professionalInfo.setAvoidCompanyList(expertAvoidCompanyList.stream().map(r -> {
ExpertAvoidCompanyInfo expertAvoidCompanyInfo = new ExpertAvoidCompanyInfo();
expertAvoidCompanyInfo.setCompanyName(r.getCompanyName());
expertAvoidCompanyInfo.setCompanyUniqCode(r.getCompanyUniqCode());
return expertAvoidCompanyInfo;
ExpertAvoidCompanyInfo avoidCompanyInfo = new ExpertAvoidCompanyInfo();
avoidCompanyInfo.setCompanyName(r.getCompanyName());
avoidCompanyInfo.setCompanyUniqCode(r.getCompanyUniqCode());
return avoidCompanyInfo;
}).collect(Collectors.toList()));
return professionalInfo;
}

public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO
, Map<String, List<DictionaryFieldInfo>> dictionaryFieldInfoMap) {
public static ExpertJobInfo buildExpertJobInfo(ExpertUserFullInfoDTO expertUserInfoDTO,
Map<String, List<DictionaryFieldInfo>> dictInfoMap) {
ExpertJobInfo jobInfo = new ExpertJobInfo();
jobInfo.setJobStatus(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey()));
jobInfo.setJobStatus(dictInfoMap.get(DictExpertInfoTypeEnum.JOB_STATUS.getKey()));
jobInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt());
jobInfo.setCompany(expertUserInfoDTO.getCompany());
jobInfo.setCompanyUniqCode(expertUserInfoDTO.getCompanyUniqCode());
jobInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode());
jobInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties());
jobInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt());
jobInfo.setAdministrativeRank(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey()));
jobInfo.setCompanyAttribute(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()));
jobInfo.setAdministrativeRank(dictInfoMap.get(DictExpertInfoTypeEnum.ADMINISTRATIVE_RANK.getKey()));
jobInfo.setCompanyAttribute(dictInfoMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey()));
jobInfo.setAddress(expertUserInfoDTO.getAddress());
jobInfo.setExperience(expertUserInfoDTO.getExperience());
return jobInfo;
}

public static ExpertEduInfo buildExpertEduInfo(ExpertUserFullInfoDTO expertUserInfoDTO
, Map<String, List<DictionaryFieldInfo>> dictionaryFieldInfoMap, Map<Long, FileBasicInfo> fileBasicInfoMap) {
public static ExpertEduInfo buildExpertEduInfo(ExpertUserFullInfoDTO expertFullInfo,
Map<String, List<DictionaryFieldInfo>> dictInfoMap,
Map<Long, FileBasicInfo> fileInfoMap) {
// 学历信息
ExpertEduInfo eduInfo = new ExpertEduInfo();
eduInfo.setSchool(expertUserInfoDTO.getSchool());
eduInfo.setGraduatedAt(expertUserInfoDTO.getGraduatedAt());
eduInfo.setAcademicTitle(expertUserInfoDTO.getAcademicTitle());
eduInfo.setEdu(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey()));
eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileBasicInfoMap
, expertUserInfoDTO.getGraduationCertificateFileIdList()));
eduInfo.setDegree(dictionaryFieldInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey()));
eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileBasicInfoMap, expertUserInfoDTO.getDegreeCertificateFileIdList()));
eduInfo.setSchool(expertFullInfo.getSchool());
eduInfo.setGraduatedAt(expertFullInfo.getGraduatedAt());
eduInfo.setAcademicTitle(expertFullInfo.getAcademicTitle());
eduInfo.setEdu(dictInfoMap.get(DictExpertInfoTypeEnum.EDU.getKey()));
eduInfo.setGraduationCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getGraduationCertificateFileIdList()));
eduInfo.setDegree(dictInfoMap.get(DictExpertInfoTypeEnum.DEGREE.getKey()));
eduInfo.setDegreeCertificateFile(getFileBasicInfoList(fileInfoMap, expertFullInfo.getDegreeCertificateFileIdList()));
return eduInfo;
}

public static List<FileBasicInfo> getFileBasicInfoList(Map<Long, FileBasicInfo> fileBasicInfoMap, List<Long> fileIdList) {
if (CollectionUtils.isEmpty(fileIdList)) {
private static List<FileBasicInfo> getFileBasicInfoList(Map<Long, FileBasicInfo> fileBasicInfoMap, List<Long> fileIdList) {
if (CollUtil.isEmpty(fileIdList)) {
return new ArrayList<>();
}
List<FileBasicInfo> fileBasicInfoList = new ArrayList<>();
@@ -249,33 +251,33 @@ public class ExpertUserInfoAssembler {
return basicInfo;
}

public static ExpertFullInfoAllDTO buildExpertFullInfoAllDTO(ExpertUserFullInfo expertUserFullInfo
, List<ExpertTag> expertTagList
, List<ExpertDictionary> expertDictionaryList
, List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList
, List<ExpertMetaApply> expertMetaApplyList
, List<ExpertAvoidCompany> expertAvoidCompanyList) {
ExpertUserFullInfoDTO expertUserFullInfoDTO = buildExpertUserFullInfoDTO(expertUserFullInfo);
List<ExpertDictionaryDTO> expertDictionaryDTOList = buildExpertDictionaryDTOList(expertDictionaryList);
List<ExpertTagDTO> expertTagDTOList = buildExpertTagDTOList(expertTagList);
List<ExpertRegionDTO> expertIntentionWorkRegionInfo = buildExpertIntentionWorkRegionInfo(expertIntentionWorkRegionList);
public static ExpertFullInfoAllDTO buildExpertFullInfoAllDTO(ExpertUserFullInfo expertUserFullInfo,
List<ExpertTag> expertTagList,
List<ExpertDictionary> expertDictionaryList,
List<ExpertIntentionWorkRegion> intentionWorkRegionList,
List<ExpertMetaApply> expertMetaApplyList,
List<ExpertAvoidCompany> expertAvoidCompanyList) {
ExpertUserFullInfoDTO expertFullInfoDto = buildExpertUserFullInfoDTO(expertUserFullInfo);
List<ExpertDictionaryDTO> expertDicts = buildExpertDictionaryDTOList(expertDictionaryList);
List<ExpertTagDTO> expertTags = buildExpertTagDTOList(expertTagList);
List<ExpertRegionDTO> intentionWorkRegions = buildExpertIntentionWorkRegionInfo(intentionWorkRegionList);

// 专家申请履职意向展示列表
List<ExpertRegionDTO> expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList);
List<ExpertRegionDTO> applyIntentionWorkRegions = buildExpertApplyIntentionWorkRegionInfo(intentionWorkRegionList, expertMetaApplyList);
List<ExpertAvoidCompanyDTO> expertAvoidCompanyDTOList = buildExpertAvoidCompanyDTOList(expertAvoidCompanyList);
ExpertFullInfoAllDTO expertFullInfoAllDTO = new ExpertFullInfoAllDTO();
expertFullInfoAllDTO.setUserId(expertUserFullInfo.getUserId());
expertFullInfoAllDTO.setExpertUserInfoDTO(expertUserFullInfoDTO);
expertFullInfoAllDTO.setExpertDictionaryList(expertDictionaryDTOList);
expertFullInfoAllDTO.setExpertTagList(expertTagDTOList);
expertFullInfoAllDTO.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo);
expertFullInfoAllDTO.setExpertApplyIntentionWorkRegionInfo(expertApplyIntentionWorkRegionInfo);
expertFullInfoAllDTO.setExpertAvoidCompanyList(expertAvoidCompanyDTOList);
return expertFullInfoAllDTO;
ExpertFullInfoAllDTO expertFullInfoAll = new ExpertFullInfoAllDTO();
expertFullInfoAll.setUserId(expertUserFullInfo.getUserId());
expertFullInfoAll.setExpertUserInfoDTO(expertFullInfoDto);
expertFullInfoAll.setExpertDictionaryList(expertDicts);
expertFullInfoAll.setExpertTagList(expertTags);
expertFullInfoAll.setExpertIntentionWorkRegionInfo(intentionWorkRegions);
expertFullInfoAll.setExpertApplyIntentionWorkRegionInfo(applyIntentionWorkRegions);
expertFullInfoAll.setExpertAvoidCompanyList(expertAvoidCompanyDTOList);
return expertFullInfoAll;
}

private static List<ExpertRegionDTO> buildExpertApplyIntentionWorkRegionInfo(List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList
, List<ExpertMetaApply> expertMetaApplyList) {
private static List<ExpertRegionDTO> buildExpertApplyIntentionWorkRegionInfo(List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList,
List<ExpertMetaApply> expertMetaApplyList) {
Set<RegionDtoMapKey> set = new HashSet<>();
for (ExpertIntentionWorkRegion expertIntentionWorkRegion : expertIntentionWorkRegionList) {
RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey();
@@ -403,57 +405,56 @@ public class ExpertUserInfoAssembler {
return expertUserFullInfoDTO;
}

public static ExpertAdminExpertManageListDTO buildExpertAdminExpertManageListDTO(ExpertUserFullInfo expertUserFullInfo
, Map<Long, List<ExpertDictionary>> expertDictionaryMap, Map<Long, List<ExpertTag>> expertTagMap) {
public static ExpertAdminExpertManageListDTO buildExpertAdminExpertManageListDTO(ExpertUserFullInfo expertUserFullInfo,
Map<Long, List<ExpertDictionary>> expertDictMap,
Map<Long, List<ExpertTag>> expertTagMap) {
Long userId = expertUserFullInfo.getUserId();
ExpertAdminExpertManageListDTO expertAdminExpertManageListDTO = new ExpertAdminExpertManageListDTO();
expertAdminExpertManageListDTO.setUserId(expertUserFullInfo.getUserId());
expertAdminExpertManageListDTO.setExpertName(expertUserFullInfo.getExpertName());
expertAdminExpertManageListDTO.setPhoneNo(expertUserFullInfo.getPhoneNo());
expertAdminExpertManageListDTO.setIsDingUser(BoolDisplayEnum.judgeBoolean(expertUserFullInfo.getIsDingUser()));
expertAdminExpertManageListDTO.setCompany(expertUserFullInfo.getCompany());
expertAdminExpertManageListDTO.setLegalEntityCode(expertUserFullInfo.getLegalEntityCode());
expertAdminExpertManageListDTO.setExpertAccountStatus(expertUserFullInfo.getExpertAccountStatus());
ExpertAdminExpertManageListDTO adminManageExpertListItem = new ExpertAdminExpertManageListDTO();
adminManageExpertListItem.setUserId(expertUserFullInfo.getUserId());
adminManageExpertListItem.setExpertName(expertUserFullInfo.getExpertName());
adminManageExpertListItem.setPhoneNo(expertUserFullInfo.getPhoneNo());
adminManageExpertListItem.setIsDingUser(BoolDisplayEnum.judgeBoolean(expertUserFullInfo.getIsDingUser()));
adminManageExpertListItem.setCompany(expertUserFullInfo.getCompany());
adminManageExpertListItem.setLegalEntityCode(expertUserFullInfo.getLegalEntityCode());
adminManageExpertListItem.setExpertAccountStatus(expertUserFullInfo.getExpertAccountStatus());

// 装配字典数据
List<ExpertDictionary> userExpertDictionaryList = Objects.isNull(expertDictionaryMap.get(userId)) ? new ArrayList<>() : expertDictionaryMap.get(userId);
Map<String, List<ExpertDictionary>> fieldExpertDictionaryMap = userExpertDictionaryList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField));
expertAdminExpertManageListDTO.setExpertType(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())));
expertAdminExpertManageListDTO.setCompanyAttribute(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())));
expertAdminExpertManageListDTO.setTitleLevel(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey())));
List<ExpertDictionary> userExpertDictList = expertDictMap.getOrDefault(userId, Collections.emptyList());
Map<String, List<ExpertDictionary>> fieldExpertDictMap = userExpertDictList.stream().collect(Collectors.groupingBy(ExpertDictionary::getExpertInfoField));
adminManageExpertListItem.setExpertType(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())));
adminManageExpertListItem.setCompanyAttribute(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.COMPANY_ATTRIBUTE.getKey())));
adminManageExpertListItem.setTitleLevel(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.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));
expertAdminExpertManageListDTO.setExpertSource(
TagAssembler.toTagFieldInfoList(fieldExpertTagMap.get(ExpertTagEnum.EXPERT_SOURCE.getKey())));
adminManageExpertListItem.setExpertSource(TagAssembler.toTagFieldInfoList(fieldExpertTagMap.get(ExpertTagEnum.EXPERT_SOURCE.getKey())));

if (StringUtils.isNotBlank(expertUserFullInfo.getRegionCode()) && Objects.nonNull(expertUserFullInfo.getRegionLevel())) {
if (StrUtil.isNotBlank(expertUserFullInfo.getRegionCode()) && Objects.nonNull(expertUserFullInfo.getRegionLevel())) {
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo();
expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel());
expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode());
expertAdminExpertManageListDTO.setExpertRegionInfo(expertRegionInfo);
adminManageExpertListItem.setExpertRegionInfo(expertRegionInfo);
}

// 以下数据为专家excel导出使用
expertAdminExpertManageListDTO.setGender(expertUserFullInfo.getGender());
expertAdminExpertManageListDTO.setBirth(expertUserFullInfo.getBirth());
expertAdminExpertManageListDTO.setHometown(expertUserFullInfo.getHometown());
expertAdminExpertManageListDTO.setNationality(expertUserFullInfo.getNationality());
expertAdminExpertManageListDTO.setPolitical(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())));
expertAdminExpertManageListDTO.setIdCard(expertUserFullInfo.getIdCard());
expertAdminExpertManageListDTO.setBankNo(expertUserFullInfo.getBankNo());
expertAdminExpertManageListDTO.setEdu(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.EDU.getKey())));
expertAdminExpertManageListDTO.setRecommendedWay(
DictionaryAssembler.toDictionaryFieldInfoList(fieldExpertDictionaryMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())));

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

adminManageExpertListItem.setGender(expertUserFullInfo.getGender());
adminManageExpertListItem.setBirth(expertUserFullInfo.getBirth());
adminManageExpertListItem.setHometown(expertUserFullInfo.getHometown());
adminManageExpertListItem.setNationality(expertUserFullInfo.getNationality());
adminManageExpertListItem.setPolitical(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.POLITICAL.getKey())));
adminManageExpertListItem.setIdCard(expertUserFullInfo.getIdCard());
adminManageExpertListItem.setBankNo(expertUserFullInfo.getBankNo());
adminManageExpertListItem.setEdu(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.EDU.getKey())));
adminManageExpertListItem.setRecommendedWay(
DictionaryAssembler.toDictFieldInfoList(fieldExpertDictMap.get(DictExpertInfoTypeEnum.RECOMMENDED_WAY.getKey())));

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




+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertInfoSensitiveFieldModifyCheckHelper.java Прегледај датотеку

@@ -53,7 +53,7 @@ public class ExpertInfoSensitiveFieldModifyCheckHelper {
ExpertUserFullInfoDTO expertUserInfoDTO = expertUserFullInfoAll.getExpertUserInfoDTO();
// 字典字典段map
Map<String, List<DictionaryFieldInfo>> dictionaryFieldInfoMap =
expertUserInfoAssembler.buildDictionaryFieldInfoMap(expertUserFullInfoAll.getExpertDictionaryList());
expertUserInfoAssembler.buildDictInfoMap(expertUserFullInfoAll.getExpertDictionaryList());
// 专家文件资料map
Map<Long, FileBasicInfo> fileBasicInfoMap = ExpertUserInfoAssembler.buildFileBasicInfoMap(attachFiles);
// 专家标签字段map


+ 13
- 12
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java Прегледај датотеку

@@ -26,6 +26,7 @@ import com.ningdatech.pmapi.expert.model.dto.ExpertDictionaryDTO;
import com.ningdatech.pmapi.expert.model.dto.ExpertTagDTO;
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest.StorageApplyResultExtraInfo;
import com.ningdatech.pmapi.expert.model.vo.ExpertApplyMetaVO;
import com.ningdatech.pmapi.expert.model.vo.MetaApplyResultVo;
import com.ningdatech.pmapi.expert.service.ExpertAdminManageService;
@@ -527,16 +528,17 @@ public class ExpertMetaApplyManage {
return expertMetaApplyListQuery;
}

private ExpertStorageDealCmd buildExpertStorageDealCmd(
MetaApplyResultRequest applyResultRequest, Long expertUserId, ExpertMetaApply expertMetaApply) {
MetaApplyResultRequest.StorageApplyResultExtraInfo extraInfo = applyResultRequest.getStorageApplyResultExtraInfo();
private ExpertStorageDealCmd buildExpertStorageDealCmd(MetaApplyResultRequest applyResultRequest,
Long expertUserId,
ExpertMetaApply expertMetaApply) {
StorageApplyResultExtraInfo extraInfo = applyResultRequest.getStorageApplyResultExtraInfo();
ExpertStorageDealCmd expertStorageDealCmd = new ExpertStorageDealCmd();
Boolean applyResult = applyResultRequest.getApplyResult();
expertStorageDealCmd.setApplyResult(applyResult);

if (Objects.nonNull(extraInfo)) {
List<DictionaryFieldInfo> expertType = extraInfo.getExpertType();
if (CollectionUtils.isNotEmpty(expertType)) {
if (CollUtil.isNotEmpty(expertType)) {
expertStorageDealCmd.setExpertType(extraInfo.getExpertType().stream().map(r -> {
ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO();
expertDictionaryDTO.setExpertInfoField(r.getDictionaryFieldName());
@@ -545,7 +547,7 @@ public class ExpertMetaApplyManage {
}).collect(Collectors.toList()));
}
List<TagFieldInfo> other = extraInfo.getOther();
if (CollectionUtils.isNotEmpty(other)) {
if (CollUtil.isNotEmpty(other)) {
expertStorageDealCmd.setOther(extraInfo.getOther().stream().map(r -> {
ExpertTagDTO expertTagDTO = new ExpertTagDTO();
expertTagDTO.setExpertInfoField(r.getTagFieldName());
@@ -562,8 +564,8 @@ public class ExpertMetaApplyManage {
}


private ExpertInfoModifyApplyDealCmd buildExpertInfoModifyApplyDealCmd(MetaApplyResultRequest applyResultRequest
, Long userId, Long applyId) {
private ExpertInfoModifyApplyDealCmd buildExpertInfoModifyApplyDealCmd(MetaApplyResultRequest applyResultRequest,
Long userId, Long applyId) {
ExpertInfoModifyApplyDealCmd expertInfoModifyApplyDealCmd = new ExpertInfoModifyApplyDealCmd();
Boolean applyResult = applyResultRequest.getApplyResult();
expertInfoModifyApplyDealCmd.setApplyResult(applyResult);
@@ -572,8 +574,8 @@ public class ExpertMetaApplyManage {
return expertInfoModifyApplyDealCmd;
}

private ExpertIntentionApplyDealCmd buildExpertIntentionApplyDealCmd(MetaApplyResultRequest applyResultRequest
, ExpertMetaApply expertMetaApply) {
private ExpertIntentionApplyDealCmd buildExpertIntentionApplyDealCmd(MetaApplyResultRequest applyResultRequest,
ExpertMetaApply expertMetaApply) {
Boolean applyResult = applyResultRequest.getApplyResult();
String applyType = expertMetaApply.getApplyType();
ExpertApplyTypeEnum applyTypeEnum = ExpertApplyTypeEnum.of(applyType);
@@ -590,12 +592,11 @@ public class ExpertMetaApplyManage {
/**
* 专家管理员 新增专家使用使用
*
* @param expertUserId
* @param expertUserId \
*/
@Transactional(rollbackFor = Exception.class)
public void autoPassExpertApply(Long expertUserId) {
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers
.lambdaQuery(ExpertMetaApply.class)
List<ExpertMetaApply> expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class)
.eq(ExpertMetaApply::getUserId, expertUserId)
.in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_STORAGE.getKey())
.eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()));


+ 8
- 4
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java Прегледај датотеку

@@ -27,19 +27,23 @@ public interface ExpertInfoService {
/**
* 专家信息修改审核结果处理
*
* @param expertInfoModifyApplyDealCmd
* @param expertInfoModifyApplyDealCmd \
*/
void expertInfoModifyDeal(ExpertInfoModifyApplyDealCmd expertInfoModifyApplyDealCmd);

/**
* 根据user_id 获取用户全量信息
*
* @param userId
* @return
* @param userId \
* @return \
*/
ExpertFullInfoAllDTO getExpertUserFullInfoAll(Long userId);


/**
* 专家入库审核处理
*
* @param cmd \
**/
void expertStorageDeal(ExpertStorageDealCmd cmd);




+ 25
- 8
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java Прегледај датотеку

@@ -29,6 +29,12 @@ import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.ningdatech.pmapi.meta.model.entity.ExpertTag;
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService;
import com.ningdatech.pmapi.meta.service.IExpertTagService;
import com.ningdatech.pmapi.sys.model.entity.Role;
import com.ningdatech.pmapi.sys.model.entity.UserRole;
import com.ningdatech.pmapi.sys.service.IRoleService;
import com.ningdatech.pmapi.sys.service.IUserRoleService;
import com.ningdatech.pmapi.sys.service.impl.UserRoleServiceImpl;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.ningdatech.yxt.utils.JSONUtils;
import lombok.RequiredArgsConstructor;
@@ -56,6 +62,8 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
private final IExpertAvoidCompanyService iExpertAvoidCompanyService;
private final IExpertIntentionWorkRegionService iExpertIntentionWorkRegionService;
private final IExpertMetaApplyService iExpertMetaApplyService;
private final IRoleService roleService;
private final IUserRoleService userRoleService;
private final IExpertSensitiveInfoModifyDetailRecordService iExpertSensitiveInfoModifyDetailRecordService;


@@ -369,16 +377,14 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
/**
* 专家入库审核
*
* @param cmd
* @param cmd \
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void expertStorageDeal(ExpertStorageDealCmd cmd) {
boolean applyResult = cmd.getApplyResult();
Long expertUserId = cmd.getExpertUserId();
ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(expertUserId);

if (applyResult) {
if (cmd.getApplyResult()) {
// 修改专家状态为可用
expertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.AVAILABLE.getKey());
expertUserFullInfo.setRemark(cmd.getRemark());
@@ -390,10 +396,21 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
iExpertTagService.saveBatch(saveExpertTagList);
// 保存所有专家字典字段
List<ExpertDictionaryDTO> expertType = cmd.getExpertType();
if (CollectionUtils.isNotEmpty(expertType)) {
expertType = expertType.stream().peek(r -> r.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey())).collect(Collectors.toList());
List<ExpertDictionary> saveExpertDictionaryList = buildSaveExpertDictionaryList(expertUserId, expertType);
iExpertDictionaryService.saveBatch(saveExpertDictionaryList);
if (CollUtil.isNotEmpty(expertType)) {
expertType.forEach(r -> r.setExpertInfoField(DictExpertInfoTypeEnum.EXPERT_TYPE.getKey()));
List<ExpertDictionary> saveExpertDictList = buildSaveExpertDictionaryList(expertUserId, expertType);
iExpertDictionaryService.saveBatch(saveExpertDictList);
}
// 补充专家 专家角色
Role role = roleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT));
if (Objects.nonNull(role)) {
UserRole one = userRoleService.getOne(expertUserId, role.getId());
if (Objects.isNull(one)) {
UserRole saveUserRole = new UserRole();
saveUserRole.setUserId(expertUserId);
saveUserRole.setRoleId(role.getId());
userRoleService.save(saveUserRole);
}
}
} else {
expertUserFullInfo.setUserInfoStep(ExpertUserInfoStepEnum.INFORMATION_TO_BE_SUBMITTED.getKey());


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IRoleService.java Прегледај датотеку

@@ -75,4 +75,7 @@ public interface IRoleService extends IService<Role> {
* @return boolean
*/
Boolean check(String name, Long id);



}

+ 10
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/service/IUserRoleService.java Прегледај датотеку

@@ -1,6 +1,9 @@
package com.ningdatech.pmapi.sys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.sys.model.entity.UserRole;

import java.util.List;
@@ -32,5 +35,12 @@ public interface IUserRoleService extends IService<UserRole> {
**/
List<Long> listUserIdByRoleId(Long roleId);

default UserRole getOne(Long userId, Long roleId) {
LambdaQueryWrapper<UserRole> eq = Wrappers.lambdaQuery(UserRole.class)
.eq(UserRole::getUserId, userId)
.eq(UserRole::getRoleId, roleId)
.last(BizConst.LIMIT_1);
return getOne(eq);
}

}

Loading…
Откажи
Сачувај