From 22842ce94671c5b5fe1de90458b263fe740ebce7 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 23 Feb 2023 10:27:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=93=E5=AE=B6=E5=BA=93=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=B8=93=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../expert/assembler/ExpertInfoCmdAssembler.java | 226 +++++++++++++++++++++ .../expert/constant/ExpertAccountStatusEnum.java | 44 ++++ .../expert/constant/ExpertUserInfoStepEnum.java | 31 +++ .../controller/ExpertAvoidCompanyController.java | 20 ++ .../pmapi/expert/controller/ExpertController.java | 26 ++- .../pmapi/expert/entity/ExpertAvoidCompany.java | 36 ++++ .../pmapi/expert/entity/ExpertUserFullInfo.java | 4 +- .../pmapi/expert/helper/ExpertManageHelper.java | 113 +++++++++++ .../pmapi/expert/manage/ExpertManage.java | 78 +++++++ .../expert/mapper/ExpertAvoidCompanyMapper.java | 16 ++ .../expert/mapper/ExpertAvoidCompanyMapper.xml | 5 + .../pmapi/expert/model/DictionaryFieldInfo.java | 34 ++++ .../pmapi/expert/model/ExpertAvoidCompanyInfo.java | 22 ++ .../pmapi/expert/model/ExpertBasicInfo.java | 147 ++++++++++++++ .../pmapi/expert/model/ExpertEduInfo.java | 66 ++++++ .../pmapi/expert/model/ExpertJobInfo.java | 91 +++++++++ .../pmapi/expert/model/ExpertOtherInfo.java | 22 ++ .../pmapi/expert/model/ExpertProfessionalInfo.java | 56 +++++ .../pmapi/expert/model/ExpertRecommendInfo.java | 25 +++ .../pmapi/expert/model/FileBasicInfo.java | 24 +++ .../pmapi/expert/model/TagFieldInfo.java | 24 +++ .../expert/model/cmd/ExpertFullInfoSaveCmd.java | 32 +++ .../expert/model/dto/ExpertAvoidCompanyDTO.java | 20 ++ .../expert/model/dto/ExpertDictionaryDTO.java | 30 +++ .../pmapi/expert/model/dto/ExpertRegionDTO.java | 14 ++ .../pmapi/expert/model/dto/ExpertTagDTO.java | 21 ++ .../expert/model/dto/ExpertUserFullInfoDTO.java | 205 +++++++++++++++++++ .../req/ExpertUserBasicInfoSubmitRequest.java | 36 ++++ .../pmapi/expert/service/ExpertInfoService.java | 14 ++ .../expert/service/IExpertAvoidCompanyService.java | 16 ++ .../expert/service/IExpertUserFullInfoService.java | 8 + .../impl/ExpertAvoidCompanyServiceImpl.java | 20 ++ .../expert/service/impl/ExpertInfoServiceImpl.java | 219 ++++++++++++++++++++ .../impl/ExpertUserFullInfoServiceImpl.java | 11 + 35 files changed, 1752 insertions(+), 6 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertInfoCmdAssembler.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertAccountStatusEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertUserInfoStepEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertAvoidCompany.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertManageHelper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/DictionaryFieldInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAvoidCompanyInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertBasicInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertEduInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertJobInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertOtherInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertProfessionalInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertRecommendInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/FileBasicInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/TagFieldInfo.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertFullInfoSaveCmd.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertAvoidCompanyDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertDictionaryDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertRegionDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertTagDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertUserFullInfoDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertUserBasicInfoSubmitRequest.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAvoidCompanyServiceImpl.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index 49bc070..2f0c620 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -56,7 +56,7 @@ public class GeneratorCodeKingbaseConfig { } public static void main(String[] args) { - generate("Liuxinxin", "expert", PATH_LXX, "expert_intention_work_region"); + generate("Liuxinxin", "expert", PATH_LXX, "expert_avoid_company"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertInfoCmdAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertInfoCmdAssembler.java new file mode 100644 index 0000000..8e712d0 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertInfoCmdAssembler.java @@ -0,0 +1,226 @@ +package com.ningdatech.pmapi.expert.assembler; + + +import com.ningdatech.pmapi.expert.model.*; +import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.dto.*; +import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum; +import com.ningdatech.pmapi.meta.constant.ExpertTagEnum; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2022/7/22 下午5:19 + */ + +public class ExpertInfoCmdAssembler { + + public static ExpertFullInfoSaveCmd buildExpertFullInfoSaveCmd(Long userId + , ExpertBasicInfo expertBasicInfo, ExpertEduInfo expertEduInfo + , ExpertJobInfo expertJobInfo, ExpertProfessionalInfo expertProfessionalInfo) { + + ExpertFullInfoSaveCmd expertFullInfoSaveCmd = new ExpertFullInfoSaveCmd(); + ExpertUserFullInfoDTO expertUserInfoDTO = buildExpertUserFullInfoDTO( + expertBasicInfo, expertEduInfo, expertJobInfo, expertProfessionalInfo, null, null); + List expertDictionaryList = + buildExpertDictionaryList(expertBasicInfo, expertEduInfo, expertJobInfo, expertProfessionalInfo, null); + List expertTagList = buildExpertTagList(expertProfessionalInfo, expertBasicInfo, null); + // 专家履职意向(区域编码) + List expertIntentionWorkRegionInfo = buildExpertRegionList(expertBasicInfo); + List expertAvoidCompanyList = buildExpertAvoidCompanyList(expertProfessionalInfo); + + expertFullInfoSaveCmd.setUserId(userId); + expertFullInfoSaveCmd.setExpertUserInfoDTO(expertUserInfoDTO); + expertFullInfoSaveCmd.setExpertDictionaryList(expertDictionaryList); + expertFullInfoSaveCmd.setExpertTagList(expertTagList); + expertFullInfoSaveCmd.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo); + expertFullInfoSaveCmd.setExpertAvoidCompanyList(expertAvoidCompanyList); + + return expertFullInfoSaveCmd; + } + + + + + private static List buildExpertAvoidCompanyList(ExpertProfessionalInfo professionalInfo) { + List expertAvoidCompanyList = new ArrayList<>(); + List avoidCompanyList = professionalInfo.getAvoidCompanyList(); + if (CollectionUtils.isNotEmpty(avoidCompanyList)) { + expertAvoidCompanyList = avoidCompanyList.stream().map(r -> { + ExpertAvoidCompanyDTO expertAvoidCompanyDTO = new ExpertAvoidCompanyDTO(); + expertAvoidCompanyDTO.setCompanyName(r.getCompanyName()); + expertAvoidCompanyDTO.setCompanyUniqCode(r.getCompanyUniqCode()); + return expertAvoidCompanyDTO; + }).collect(Collectors.toList()); + } + return expertAvoidCompanyList; + } + + private static List buildExpertRegionList(ExpertBasicInfo basicInfo) { + List expertIntentionWorkRegions = basicInfo.getExpertIntentionWorkRegions(); + if (CollectionUtils.isEmpty(expertIntentionWorkRegions)) { + return new ArrayList<>(); + } + return expertIntentionWorkRegions.stream().map(r -> { + ExpertRegionDTO expertRegionDTO = new ExpertRegionDTO(); + expertRegionDTO.setRegionCode(r.getRegionCode()); + expertRegionDTO.setRegionLevel(r.getRegionLevel()); + return expertRegionDTO; + }).collect(Collectors.toList()); + } + + private static List buildExpertTagList(ExpertProfessionalInfo professionalInfo + , ExpertBasicInfo basicInfo, ExpertOtherInfo otherInfo) { + List goodAt = professionalInfo.getGoodAt(); + List technicalExpertise = professionalInfo.getTechnicalExpertise(); + List industrySector = professionalInfo.getIndustrySector(); + List expertSource = basicInfo.getExpertSource(); + List other = new ArrayList<>(); + if (Objects.nonNull(otherInfo)) { + other = otherInfo.getOther(); + } + List tagFieldInfoList = new ArrayList<>(); + assemblerTagExpertInfoFieldName(tagFieldInfoList, goodAt, ExpertTagEnum.GOOD_AT); + assemblerTagExpertInfoFieldName(tagFieldInfoList, technicalExpertise, ExpertTagEnum.TECHNICAL_EXPERTISE); + assemblerTagExpertInfoFieldName(tagFieldInfoList, industrySector, ExpertTagEnum.INDUSTRY_SECTOR); + assemblerTagExpertInfoFieldName(tagFieldInfoList, expertSource, ExpertTagEnum.EXPERT_SOURCE); + assemblerTagExpertInfoFieldName(tagFieldInfoList, other, ExpertTagEnum.OTHER); + + return tagFieldInfoList.stream().map(r -> { + ExpertTagDTO expertTagDTO = new ExpertTagDTO(); + expertTagDTO.setTagCode(r.getTagCode()); + expertTagDTO.setExpertInfoField(r.getTagFieldName()); + return expertTagDTO; + }).collect(Collectors.toList()); + } + + private static void assemblerTagExpertInfoFieldName(List allTagFieldInfoList + , List originalTagFieldInfoList, ExpertTagEnum tagExpertInfoFieldEnum) { + if (CollectionUtils.isNotEmpty(originalTagFieldInfoList)) { + originalTagFieldInfoList = originalTagFieldInfoList.stream().map(r -> { + r.setTagFieldName(tagExpertInfoFieldEnum.getKey()); + return r; + }).collect(Collectors.toList()); + allTagFieldInfoList.addAll(originalTagFieldInfoList); + } + } + + private static List buildExpertDictionaryList(ExpertBasicInfo basicInfo, ExpertEduInfo eduInfo + , ExpertJobInfo jobInfo, ExpertProfessionalInfo professionalInfo, ExpertRecommendInfo recommendInfo) { + List political = basicInfo.getPolitical(); + List expertType = basicInfo.getExpertType(); + List edu = eduInfo.getEdu(); + List degree = eduInfo.getDegree(); + List jobStatus = jobInfo.getJobStatus(); + List companyAttribute = jobInfo.getCompanyAttribute(); + List administrativeRank = jobInfo.getAdministrativeRank(); + List titleLevel = professionalInfo.getTitleLevel(); + + List recommendedWay = new ArrayList<>(); + if (Objects.nonNull(recommendInfo)) { + recommendedWay = recommendInfo.getRecommendedWay(); + } + List 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); + + return dictionaryFieldInfoList.stream().map(r -> { + ExpertDictionaryDTO expertDictionaryDTO = new ExpertDictionaryDTO(); + expertDictionaryDTO.setDictionaryCode(r.getDictionaryCode()); + expertDictionaryDTO.setExpertInfoField(r.getDictionaryFieldName()); + return expertDictionaryDTO; + }).collect(Collectors.toList()); + } + + private static void assemblerDictionaryFieldName( + List allDictionaryFieldInfoList, List originalDictionaryFieldInfoList + , DictExpertInfoTypeEnum dictExpertInfoTypeEnum) { + if (CollectionUtils.isNotEmpty(originalDictionaryFieldInfoList)) { + originalDictionaryFieldInfoList = originalDictionaryFieldInfoList.stream().map(r -> { + r.setDictionaryFieldName(dictExpertInfoTypeEnum.getKey()); + return r; + }).collect(Collectors.toList()); + allDictionaryFieldInfoList.addAll(originalDictionaryFieldInfoList); + } + } + + private static ExpertUserFullInfoDTO buildExpertUserFullInfoDTO(ExpertBasicInfo basicInfo, ExpertEduInfo eduInfo + , ExpertJobInfo jobInfo, ExpertProfessionalInfo professionalInfo, ExpertRecommendInfo recommendInfo, ExpertOtherInfo otherInfo) { + ExpertUserFullInfoDTO expertUserFullInfoDTO = new ExpertUserFullInfoDTO(); + + expertUserFullInfoDTO.setIsDingUser(basicInfo.getIsDingUser()); + expertUserFullInfoDTO.setPhoneNo(basicInfo.getPhoneNo()); + expertUserFullInfoDTO.setGender(basicInfo.getGender()); + expertUserFullInfoDTO.setName(basicInfo.getName()); + if (Objects.nonNull(basicInfo.getAvatarFile())) { + expertUserFullInfoDTO.setAvatarFileId(basicInfo.getAvatarFile().getFileId()); + } + expertUserFullInfoDTO.setIdCard(basicInfo.getIdCard()); + expertUserFullInfoDTO.setOfficePhone(basicInfo.getOfficePhone()); + expertUserFullInfoDTO.setBirth(basicInfo.getBirth()); + expertUserFullInfoDTO.setBankNo(basicInfo.getBankNo()); + expertUserFullInfoDTO.setBank(basicInfo.getBank()); + expertUserFullInfoDTO.setEmail(basicInfo.getEmail()); + expertUserFullInfoDTO.setHometown(basicInfo.getHometown()); + expertUserFullInfoDTO.setNationality(basicInfo.getNationality()); + if (Objects.nonNull(otherInfo)) { + expertUserFullInfoDTO.setRemark(otherInfo.getRemark()); + } + expertUserFullInfoDTO.setSchool(eduInfo.getSchool()); + expertUserFullInfoDTO.setGraduatedAt(eduInfo.getGraduatedAt()); + expertUserFullInfoDTO.setAcademicTitle(eduInfo.getAcademicTitle()); + + if (CollectionUtils.isNotEmpty(eduInfo.getGraduationCertificateFile())) { + expertUserFullInfoDTO.setGraduationCertificateFileIdList(eduInfo.getGraduationCertificateFile().stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); + } + if (CollectionUtils.isNotEmpty(eduInfo.getDegreeCertificateFile())) { + + expertUserFullInfoDTO.setDegreeCertificateFileIdList(eduInfo.getDegreeCertificateFile().stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); + } + + expertUserFullInfoDTO.setRetiredAt(jobInfo.getRetiredAt()); + expertUserFullInfoDTO.setCompany(jobInfo.getCompany()); + expertUserFullInfoDTO.setLegalEntityCode(jobInfo.getLegalEntityCode()); + expertUserFullInfoDTO.setAdministrativeDuties(jobInfo.getAdministrativeDuties()); + expertUserFullInfoDTO.setStartWorkAt(jobInfo.getStartWorkAt()); + expertUserFullInfoDTO.setAddress(jobInfo.getAddress()); + expertUserFullInfoDTO.setExperience(jobInfo.getExperience()); + + expertUserFullInfoDTO.setTechnicalTitles(professionalInfo.getTechnicalTitles()); + if (CollectionUtils.isNotEmpty(professionalInfo.getTitleCertificateFile())) { + expertUserFullInfoDTO.setTitleCertificateFileIdList(professionalInfo.getTitleCertificateFile().stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); + } + expertUserFullInfoDTO.setAwards(professionalInfo.getAwards()); + expertUserFullInfoDTO.setRecognitionReward(professionalInfo.getRecognitionReward()); + + if (Objects.nonNull(basicInfo.getExpertRegionInfo())) { + expertUserFullInfoDTO.setRegionCode(basicInfo.getExpertRegionInfo().getRegionCode()); + expertUserFullInfoDTO.setRegionLevel(basicInfo.getExpertRegionInfo().getRegionLevel()); + } + // 推荐证明材料单独装配 + if (Objects.nonNull(recommendInfo)) { + List recommendationProofFile = recommendInfo.getRecommendationProofFile(); + if (CollectionUtils.isNotEmpty(recommendationProofFile)) { + expertUserFullInfoDTO + .setRecommendationProofFileIdList( + recommendationProofFile.stream().map(FileBasicInfo::getFileId).collect(Collectors.toList())); + + } + } + return expertUserFullInfoDTO; + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertAccountStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertAccountStatusEnum.java new file mode 100644 index 0000000..b0fccbb --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertAccountStatusEnum.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author liuxinxin + * @date 2022/7/22 下午4:21 + */ +@AllArgsConstructor +@Getter +public enum ExpertAccountStatusEnum { + + /** + * 可用 + */ + AVAILABLE("available"), + + /** + * 冻结中 + */ + FREEZE("freeze"), + + /** + * 已出库 + */ + DELIVERY("delivery"), + + /** + * 申请中 + */ + APPLYING("applying"); + + private final String key; + + public static ExpertAccountStatusEnum of(String key) { + for (ExpertAccountStatusEnum statusEnum : ExpertAccountStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return statusEnum; + } + } + throw new IllegalArgumentException(String.format("Illegal ExpertAccountStatusEnum = %s", key)); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertUserInfoStepEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertUserInfoStepEnum.java new file mode 100644 index 0000000..0d176b8 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertUserInfoStepEnum.java @@ -0,0 +1,31 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author liuxinxin + * @date 2022/7/26 上午9:26 + */ +@AllArgsConstructor +@Getter +public enum ExpertUserInfoStepEnum { + + /** + * 待提交信息 + */ + INFORMATION_TO_BE_SUBMITTED("information_to_be_submitted"), + + /** + * 已提交基本信息 + */ + BASIC_INFORMATION_SUBMITTED("basic_information_submitted"), + + /** + * 已提交证明材料 + */ + EVIDENCE_HAS_BEEN_SUBMITTED("evidence_has_been_submitted"); + + private final String key; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java new file mode 100644 index 0000000..e078e71 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertAvoidCompanyController.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.stereotype.Controller; + +/** + *

+ * 前端控制器 + *

+ * + * @author Liuxinxin + * @since 2023-02-23 + */ +@Controller +@RequestMapping("/pmapi.expert/expert-avoid-company") +public class ExpertAvoidCompanyController { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java index d778372..5f9b29f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java @@ -1,20 +1,40 @@ package com.ningdatech.pmapi.expert.controller; +import com.ningdatech.pmapi.expert.manage.ExpertManage; +import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; -import org.springframework.stereotype.Controller; +import javax.validation.Valid; /** *

- * 前端控制器 + * 前端控制器 *

* * @author Liuxinxin * @since 2023-02-22 */ -@Controller +@RestController +@Api(tags = "专家管理相关接口") @RequestMapping("/api/v1/expert") +@RequiredArgsConstructor public class ExpertController { + private final ExpertManage expertManage; + + @PostMapping("/basic-info-submit") + @ApiOperation("填写基本信息接口(专家报名使用))") + public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) { +// ExpertUserInfoValidator.expertUserBasicInfoSubmitRequestValidate(request); + expertManage.expertBasicInfoSubmit(request); + } + + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertAvoidCompany.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertAvoidCompany.java new file mode 100644 index 0000000..1e29c60 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertAvoidCompany.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.expert.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * + *

+ * + * @author Liuxinxin + * @since 2023-02-23 + */ +@TableName("expert_avoid_company") +@ApiModel(value = "ExpertAvoidCompany对象", description = "") +@Data +public class ExpertAvoidCompany implements Serializable { + + private static final long serialVersionUID = 1L; + + private Long id; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + private Long userId; + + private String companyName; + + private String companyUniqCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java index 26842c2..e89563e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertUserFullInfo.java @@ -45,7 +45,7 @@ public class ExpertUserFullInfo implements Serializable { private String expertName; - private String avatarFileId; + private Long avatarFileId; private String idCard; @@ -75,7 +75,7 @@ public class ExpertUserFullInfo implements Serializable { private String administrativeDuties; - private String startWorkAt; + private LocalDateTime startWorkAt; private String address; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertManageHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertManageHelper.java new file mode 100644 index 0000000..ec0ca9f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/helper/ExpertManageHelper.java @@ -0,0 +1,113 @@ +package com.ningdatech.pmapi.expert.helper; + +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.pmapi.expert.model.*; +import com.ningdatech.pmapi.meta.helper.DictionaryCache; +import com.ningdatech.pmapi.meta.helper.TagCache; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO; +import com.ningdatech.pmapi.meta.model.dto.TagDTO; +import com.ningdatech.pmapi.sys.model.dto.RegionDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2023/2/23 上午9:18 + */ + +@Component +public class ExpertManageHelper { + +// @Autowired +// private RegionCache regionCache; + + @Autowired + private TagCache tagCache; + + @Autowired + private DictionaryCache dictionaryCache; + + + /** + * 校验区域code + * + * @param expertRegionInfo + */ + public void expertRegionInfoCheck(ExpertRegionInfo expertRegionInfo) { +// // todo 必须为叶子节点编码 +// String regionCode = expertRegionInfo.getRegionCode(); +// Integer regionLevel = expertRegionInfo.getRegionLevel(); +// RegionDTO regionDTO = regionCache.getByCodeAndLevel(regionCode, regionLevel); +// if (Objects.isNull(regionDTO)) { +// throw new BadRequestException("illegal regionInfo"); +// } + } + + + /** + * 校验标签code是否合法 + * + * @param expertProfessionalInfo + * @param expertBasicInfo + */ + public void tagFieldCheck(ExpertProfessionalInfo expertProfessionalInfo, ExpertBasicInfo expertBasicInfo) { + List goodAt = expertProfessionalInfo.getGoodAt(); + List technicalExpertise = expertProfessionalInfo.getTechnicalExpertise(); + List industrySector = expertProfessionalInfo.getIndustrySector(); + List expertSource = expertBasicInfo.getExpertSource(); + + List tagFieldInfoList = new ArrayList<>(); + tagFieldInfoList.addAll(goodAt); + tagFieldInfoList.addAll(technicalExpertise); + tagFieldInfoList.addAll(industrySector); + tagFieldInfoList.addAll(expertSource); + for (TagFieldInfo tagFieldInfo : tagFieldInfoList) { + String tagCode = tagFieldInfo.getTagCode(); + TagDTO tagCodeDTO = tagCache.getByTagCode(tagCode); + if (Objects.isNull(tagCodeDTO)) { + throw new BizException("illegal tagCode: tagField=" + tagFieldInfo.getTagFieldName() + ",tagCode=" + tagCode); + } + } + } + + + /** + * 校验字典code是否合法 + * + * @param expertBasicInfo + * @param expertEduInfo + * @param expertJobInfo + */ + public void dictionaryFieldCheck(ExpertBasicInfo expertBasicInfo, ExpertEduInfo expertEduInfo + , ExpertJobInfo expertJobInfo) { + List political = expertBasicInfo.getPolitical(); + List edu = expertEduInfo.getEdu(); + List degree = expertEduInfo.getDegree(); + List jobStatus = expertJobInfo.getJobStatus(); + List companyAttribute = expertJobInfo.getCompanyAttribute(); + List administrativeRank = expertJobInfo.getAdministrativeRank(); + + List dictionaryFieldInfoList = new ArrayList<>(); + dictionaryFieldInfoList.addAll(political); + dictionaryFieldInfoList.addAll(edu); + dictionaryFieldInfoList.addAll(degree); + dictionaryFieldInfoList.addAll(jobStatus); + dictionaryFieldInfoList.addAll(companyAttribute); + dictionaryFieldInfoList.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); + } + } + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java new file mode 100644 index 0000000..f9b55dd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java @@ -0,0 +1,78 @@ +package com.ningdatech.pmapi.expert.manage; + +import com.ningdatech.pmapi.expert.assembler.ExpertInfoCmdAssembler; +import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.helper.ExpertManageHelper; +import com.ningdatech.pmapi.expert.model.ExpertBasicInfo; +import com.ningdatech.pmapi.expert.model.ExpertEduInfo; +import com.ningdatech.pmapi.expert.model.ExpertJobInfo; +import com.ningdatech.pmapi.expert.model.ExpertProfessionalInfo; +import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest; +import com.ningdatech.pmapi.expert.service.ExpertInfoService; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import com.ningdatech.pmapi.user.util.LoginUserUtil; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2023/2/23 上午8:55 + */ + +@Component +@RequiredArgsConstructor +public class ExpertManage { + + private final ExpertManageHelper expertManageHelper; + + private final IExpertUserFullInfoService iExpertUserFullInfoService; + + private final ExpertInfoService expertInfoService; + + + /** + * 填写基本信息,只有专家自己可用 + * + * @param request + */ + public void expertBasicInfoSubmit(ExpertUserBasicInfoSubmitRequest request) { + // 用户id + Long userId = LoginUserUtil.getUserId(); + ExpertBasicInfo basicInfo = request.getBasicInfo(); + // 校验区域编码合法性 校验履职意向编码合法性 + ExpertRegionInfo expertRegionInfo = basicInfo.getExpertRegionInfo(); + expertManageHelper.expertRegionInfoCheck(expertRegionInfo); + List expertIntentionWorkRegions = basicInfo.getExpertIntentionWorkRegions(); + for (ExpertRegionInfo expertIntentionWorkRegion : expertIntentionWorkRegions) { + expertManageHelper.expertRegionInfoCheck(expertIntentionWorkRegion); + } + ExpertEduInfo eduInfo = request.getEduInfo(); + ExpertJobInfo jobInfo = request.getJobInfo(); + ExpertProfessionalInfo professionalInfo = request.getProfessionalInfo(); + // 校验标签字段 + expertManageHelper.tagFieldCheck(professionalInfo, basicInfo); + // 校验字典字段 + expertManageHelper.dictionaryFieldCheck(basicInfo, eduInfo, jobInfo); + // 判断专家提交状态,判断是否可以进行此操作 + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); + + boolean submitBasicInfoStatusEnable = Objects.isNull(expertUserFullInfo) + || (ExpertAccountStatusEnum.APPLYING.getKey().equals(expertUserFullInfo.getExpertAccountStatus()) + && !ExpertUserInfoStepEnum.EVIDENCE_HAS_BEEN_SUBMITTED.getKey().equals(expertUserFullInfo.getUserInfoStep())); + if (submitBasicInfoStatusEnable) { + // 新建 保存 + ExpertFullInfoSaveCmd expertFullInfoSaveCmd = ExpertInfoCmdAssembler + .buildExpertFullInfoSaveCmd(userId, basicInfo, eduInfo, jobInfo, professionalInfo); + expertInfoService.saveExpertInfo(expertFullInfoSaveCmd); + } + } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.java new file mode 100644 index 0000000..53050a3 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.mapper; + +import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Liuxinxin + * @since 2023-02-23 + */ +public interface ExpertAvoidCompanyMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.xml new file mode 100644 index 0000000..cbb557d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertAvoidCompanyMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/DictionaryFieldInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/DictionaryFieldInfo.java new file mode 100644 index 0000000..a01f4bd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/DictionaryFieldInfo.java @@ -0,0 +1,34 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author liuxinxin + * @date 2022/7/25 下午2:03 + * 专家信息字典字段信息 + */ +@Data +@ApiModel("字典字段信息") +public class DictionaryFieldInfo { + + /** + * 字段名称 + */ + @NotBlank + @ApiModelProperty("字典字段名称") + private String dictionaryFieldName; + + /** + * 字典code + */ + @ApiModelProperty(value = "字典code") + private String dictionaryCode; + + + @ApiModelProperty(value = "字典code含义", required = false) + private String dictionaryName; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAvoidCompanyInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAvoidCompanyInfo.java new file mode 100644 index 0000000..83286a5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertAvoidCompanyInfo.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @author liuxinxin + * @date 2022/7/25 下午2:16 + */ +@Data +public class ExpertAvoidCompanyInfo { + + @NotBlank + @ApiModelProperty("公司名称") + private String companyName; + + @ApiModelProperty("公司唯一标识 即 调用获取组织架构的树状结构(单位筛选列表) 接口是对应公司的 organizationCode") + private String companyUniqCode; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertBasicInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertBasicInfo.java new file mode 100644 index 0000000..5687d1e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertBasicInfo.java @@ -0,0 +1,147 @@ +package com.ningdatech.pmapi.expert.model; + +import com.ningdatech.pmapi.meta.model.ExpertRegionInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.Email; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午1:44 + * 专家信息中的基本信息一栏 + */ +@Data +@ApiModel(value = "ExpertBasicInfo", description = "专家基本信息") +public class ExpertBasicInfo { + + /** + * 是否浙政钉用户Y/N + */ + @NotNull + @ApiModelProperty(value = "是否浙政钉用户Y/N") + private Boolean isDingUser; + + /** + * 手机号 + */ + @NotBlank + @ApiModelProperty(value = "手机号") + private String phoneNo; + + /** + * 专家姓名 + */ + @NotBlank + @ApiModelProperty(value = "专家姓名") + private String name; + + /** + * 免冠照图片地址 + */ + @NotBlank + @ApiModelProperty(value = "免冠照图片文件") + private FileBasicInfo avatarFile; + + /** + * 性别 0,1:女,男 + */ + @NotBlank + @ApiModelProperty(value = "性别 0,1:女,男") + private String gender; + + /** + * 政治面貌(字典code) + */ + @NotNull + @ApiModelProperty(value = "政治面貌(字典code)") + private List political; + + /** + * 身份证号码 + */ + @NotBlank + @ApiModelProperty(value = "身份证号码") + private String idCard; + + /** + * 办公电话 + */ + @ApiModelProperty(value = "办公电话") + private String officePhone; + + /** + * 出生日期 + */ + @NotNull + @ApiModelProperty(value = "出生日期") + private LocalDateTime birth; + + /** + * 开户银行 + */ + @NotBlank + @ApiModelProperty(value = "开户银行") + private String bank; + + /** + * 银行卡号 + */ + @NotBlank + @ApiModelProperty(value = "银行卡号") + private String bankNo; + + /** + * 电子邮箱 + */ + @NotBlank + @ApiModelProperty(value = "电子邮箱") + @Email + private String email; + + /** + * 专家来源(标签code) + */ + @NotNull + @ApiModelProperty(value = "专家来源(标签code)") + private List expertSource; + + /** + * 专家层级 + */ + @NotNull + @ApiModelProperty(value = "专家层级") + private ExpertRegionInfo expertRegionInfo; + + /** + * 履职意向 + */ + @NotEmpty + @ApiModelProperty(value = "履职意向") + private List expertIntentionWorkRegions; + + /** + * 专家类型(内外围) + */ + @ApiModelProperty(value = "专家类型(内外围)") + private List expertType; + + /** + * 籍贯 + */ + @ApiModelProperty(value = "籍贯") + private String hometown; + + /** + * 民族 + */ + @ApiModelProperty(value = "民族") + private String nationality; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertEduInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertEduInfo.java new file mode 100644 index 0000000..00dda08 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertEduInfo.java @@ -0,0 +1,66 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午1:50 + */ +@Data +@ApiModel(value = "ExpertEduInfo", description = "学历信息") +public class ExpertEduInfo { + + /** + * 毕业院校 + */ + @NotBlank + @ApiModelProperty("毕业院校") + private String school; + + /** + * 毕业时间 + */ + @NotNull + @ApiModelProperty("毕业时间") + private LocalDateTime graduatedAt; + + /** + * 所学专业 + */ + @NotBlank + @ApiModelProperty("所学专业") + private String academicTitle; + + /** + * 学历(字典code) + */ + @NotNull + @ApiModelProperty("学历(字典code)") + private List edu; + + /** + * 毕业证附件信息 + */ + @ApiModelProperty("毕业证附件信息") + private List graduationCertificateFile; + + /** + * 学位(字典code) + */ + @NotNull + @ApiModelProperty("学位(字典code)") + private List degree; + + /** + * 学位证附件信息 + */ + @ApiModelProperty("学位证附件信息") + private List degreeCertificateFile; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertJobInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertJobInfo.java new file mode 100644 index 0000000..ae5c920 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertJobInfo.java @@ -0,0 +1,91 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午1:58 + */ +@Data +@ApiModel(value = "ExpertJobInfo", description = "职业信息") +public class ExpertJobInfo { + + /** + * 在职状态(字典code) + */ + @NotNull + @ApiModelProperty("在职状态(字典code)") + private List jobStatus; + + /** + * 退休时间 + */ + @ApiModelProperty("退休时间") + private LocalDateTime retiredAt; + + /** + * 工作单位 + */ + @NotBlank + @ApiModelProperty("工作单位,组织结构name") + private String company; + + @ApiModelProperty("工作单位,前端使用标识") + private String companyUniqCode; + + /** + * 单位法人编号 + */ + @NotBlank + @ApiModelProperty(" 单位法人编号") + private String legalEntityCode; + + /** + * 行政职务 + */ + @NotBlank + @ApiModelProperty("行政职务") + private String administrativeDuties; + + /** + * 开始工作时间 + */ + @NotNull + @ApiModelProperty("开始工作时间") + private LocalDateTime startWorkAt; + + /** + * 行政职级(字典code) + */ + @NotNull + @ApiModelProperty("行政职级(字典code)") + private List administrativeRank; + + /** + * 单位类型(字典code) + */ + @NotNull + @ApiModelProperty("单位类型(字典code)") + private List companyAttribute; + + /** + * 工作地址 + */ + @NotBlank + @ApiModelProperty("工作地址") + private String address; + + /** + * 工作经历 + */ + @NotBlank + @ApiModelProperty("工作经历") + private String experience; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertOtherInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertOtherInfo.java new file mode 100644 index 0000000..b23ad75 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertOtherInfo.java @@ -0,0 +1,22 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/8/19 下午6:43 + */ +@Data +@ApiModel(description = "其他信息") +public class ExpertOtherInfo { + + @ApiModelProperty(value = "其他标签(标签code)") + private List other; + + @ApiModelProperty(value = "备注") + private String remark; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertProfessionalInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertProfessionalInfo.java new file mode 100644 index 0000000..6c0ed92 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertProfessionalInfo.java @@ -0,0 +1,56 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/25 下午2:07 + */ +@Data +@ApiModel(description = "专业信息") +public class ExpertProfessionalInfo { + + @NotBlank + @ApiModelProperty(value = "技术职称") + private String technicalTitles; + + @NotNull + @ApiModelProperty(value = "职称级别") + private List titleLevel; + + @ApiModelProperty(value = "职称证明") + private List titleCertificateFile; + + @NotNull + @ApiModelProperty(value = "擅长方向(标签code)") + private List goodAt; + + @NotNull + @ApiModelProperty(value = "技术专长(标签code)") + private List technicalExpertise; + + @NotBlank + @ApiModelProperty(value = " 获奖情况") + private String awards; + + @NotNull + @ApiModelProperty(value = "行业领域(标签code)") + private List industrySector; + + @NotBlank + @ApiModelProperty(value = "表彰奖励") + private String recognitionReward; + + @ApiModelProperty(value = "回避单位列表") + private List avoidCompanyList; + + @ApiModelProperty(value = "其他标签") + private List other; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertRecommendInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertRecommendInfo.java new file mode 100644 index 0000000..86056aa --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExpertRecommendInfo.java @@ -0,0 +1,25 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/27 上午11:52 + */ +@Data +@ApiModel(description = "推荐信息") +public class ExpertRecommendInfo { + + /** + * 推荐方式 + */ + @ApiModelProperty("推荐方式") + private List recommendedWay; + + @ApiModelProperty("推荐证明材料") + private List recommendationProofFile; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/FileBasicInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/FileBasicInfo.java new file mode 100644 index 0000000..8a3ffb4 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/FileBasicInfo.java @@ -0,0 +1,24 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/25 下午1:55 + * 用于包装使用 + */ +@Data +@ApiModel("文件信息基类") +public class FileBasicInfo { + + @ApiModelProperty("文件id") + private Long fileId; + + @ApiModelProperty("文件url") + private String url; + + @ApiModelProperty("文件名") + private String fileName; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/TagFieldInfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/TagFieldInfo.java new file mode 100644 index 0000000..63cde0f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/TagFieldInfo.java @@ -0,0 +1,24 @@ +package com.ningdatech.pmapi.expert.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/25 下午2:12 + */ +@Data +@ApiModel("标签信息") +public class TagFieldInfo { + + @ApiModelProperty("标签字段名称") + private String tagFieldName; + + @ApiModelProperty("标签字段code") + private String tagCode; + + @ApiModelProperty(value = "标签code含义", required = false) + private String tagName; +} + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertFullInfoSaveCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertFullInfoSaveCmd.java new file mode 100644 index 0000000..c2d0b51 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertFullInfoSaveCmd.java @@ -0,0 +1,32 @@ +package com.ningdatech.pmapi.expert.model.cmd; + +import com.ningdatech.pmapi.expert.model.dto.*; +import lombok.Data; + +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/22 下午4:41 + */ +@Data +public class ExpertFullInfoSaveCmd { + + private Long userId; + + private ExpertUserFullInfoDTO expertUserInfoDTO; + + private List expertDictionaryList; + + private List expertTagList; + + /** + * 专家履职意向(区域编码) + */ + private List expertIntentionWorkRegionInfo; + + /** + * 回避单位列表 + */ + private List expertAvoidCompanyList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertAvoidCompanyDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertAvoidCompanyDTO.java new file mode 100644 index 0000000..d1b6a5d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertAvoidCompanyDTO.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/25 下午5:14 + */ +@Data +public class ExpertAvoidCompanyDTO { + /** + * 公司名称 + */ + private String companyName; + + /** + * 公司唯一标识 + */ + private String companyUniqCode; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertDictionaryDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertDictionaryDTO.java new file mode 100644 index 0000000..865332c --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertDictionaryDTO.java @@ -0,0 +1,30 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/22 下午5:13 + */ +@Data +public class ExpertDictionaryDTO { + + /** + * 字典编码 + */ + private String dictionaryCode; + + /** + * 手机对应专家信息字段号 + * 政治面貌 political + * 专家来源 expert_source + * 学历 edu + * 学位 degree + * 在职状态 job_status + * 行政职级 administrative_rank + * 内外围(专家类型) expert_type + * 单位类型 company_attribute + * 职称级别 title_level + */ + private String expertInfoField; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertRegionDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertRegionDTO.java new file mode 100644 index 0000000..8b3f3a7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertRegionDTO.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/22 下午5:10 + */ +@Data +public class ExpertRegionDTO { + + private String regionCode; + private Integer regionLevel; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertTagDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertTagDTO.java new file mode 100644 index 0000000..f5e048e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertTagDTO.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +/** + * @author liuxinxin + * @date 2022/7/22 下午5:13 + */ +@Data +public class ExpertTagDTO { + + /** + * 标签code + */ + private String tagCode; + + /** + * 对应专家信息字段 + */ + private String expertInfoField; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertUserFullInfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertUserFullInfoDTO.java new file mode 100644 index 0000000..60fca6e --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/dto/ExpertUserFullInfoDTO.java @@ -0,0 +1,205 @@ +package com.ningdatech.pmapi.expert.model.dto; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author liuxinxin + * @date 2022/7/22 下午4:43 + */ +@Data +public class ExpertUserFullInfoDTO { + + private Long id; + + /** + * 用户id + */ + private Long userId; + + /** + * 专家账号状态 + */ + private String expertAccountStatus; + + /** + * 是否浙政钉用户Y/N + */ + private Boolean isDingUser; + + /** + * 专家信息提交步骤 + * 0,1,2 + * 0 :待提交信息
1: 已提交基本信息
2:已提交推荐证明 + */ + private Integer userInfoStep; + + /** + * 手机号 + */ + private String phoneNo; + + /** + * 性别 + * 0,1
女,男 + */ + private String gender; + + /** + * 姓名 + */ + private String name; + + /** + * 免冠照图片文件地址 + */ + private Long avatarFileId; + + /** + * 身份证号码 + */ + private String idCard; + + /** + * 办公电话 + */ + private String officePhone; + + /** + * 出生日期 + */ + private LocalDateTime birth; + + /** + * 银行卡号 + */ + private String bankNo; + + /** + * 开户银行 + */ + private String bank; + + /** + * 电子邮箱 + */ + private String email; + + /** + * 毕业院校 + */ + private String school; + + /** + * 毕业时间 + */ + private LocalDateTime graduatedAt; + + /** + * 所学专业 + */ + private String academicTitle; + + /** + * 毕业证 文件id + */ + private List graduationCertificateFileIdList; + + /** + * 学位证 文件id + */ + private List degreeCertificateFileIdList; + + /** + * 退休时间 + */ + private LocalDateTime retiredAt; + + /** + * 工作单位 + */ + private String company; + + /** + * 工作单位前端使用标识 + */ + private String companyUniqCode; + + /** + * 单位法人编号 + */ + private String legalEntityCode; + + /** + * 行政职务 + */ + private String administrativeDuties; + + /** + * 开始工作时间 + */ + private LocalDateTime startWorkAt; + + /** + * 工作地址 + */ + private String address; + + /** + * 工作经历 + */ + private String experience; + + /** + * 技术职称 + */ + private String technicalTitles; + + /** + * 职称证明 + * 文件id + */ + private List titleCertificateFileIdList; + + /** + * 获奖情况 + */ + private String awards; + + /** + * 表彰奖励 + */ + private String recognitionReward; + + /** + * 推荐证明材料文件id + */ + private List recommendationProofFileIdList; + + /** + * 专家层级(区域编码) + */ + private String regionCode; + + /** + * 区域级别 + */ + private Integer regionLevel; + + /** + * 专家管理员审核备注 + */ + private String remark; + + /** + * 籍贯 + */ + private String hometown; + + /** + * 民族 + */ + private String nationality; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertUserBasicInfoSubmitRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertUserBasicInfoSubmitRequest.java new file mode 100644 index 0000000..7e8c894 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/ExpertUserBasicInfoSubmitRequest.java @@ -0,0 +1,36 @@ +package com.ningdatech.pmapi.expert.model.req; + +import com.ningdatech.pmapi.expert.model.ExpertBasicInfo; +import com.ningdatech.pmapi.expert.model.ExpertEduInfo; +import com.ningdatech.pmapi.expert.model.ExpertJobInfo; +import com.ningdatech.pmapi.expert.model.ExpertProfessionalInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +/** + * @author liuxinxin + * @date 2022/7/25 下午2:21 + */ +@Data +@ApiModel(value = "ExpertUserBasicInfoSubmitRequest", description = "专家基本信息填写入参") +public class ExpertUserBasicInfoSubmitRequest { + + @NotNull + @ApiModelProperty("基本信息") + private ExpertBasicInfo basicInfo; + + @NotNull + @ApiModelProperty("学历信息") + private ExpertEduInfo eduInfo; + + @NotNull + @ApiModelProperty("职业信息") + private ExpertJobInfo jobInfo; + + @NotNull + @ApiModelProperty("专业信息") + private ExpertProfessionalInfo professionalInfo; +} \ No newline at end of file diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java new file mode 100644 index 0000000..fba707d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/ExpertInfoService.java @@ -0,0 +1,14 @@ +package com.ningdatech.pmapi.expert.service; + +import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; + +/** + * @author liuxinxin + * @date 2022/7/22 下午4:39 + */ + +public interface ExpertInfoService { + + void saveExpertInfo(ExpertFullInfoSaveCmd cmd); + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java new file mode 100644 index 0000000..18b3a5a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertAvoidCompanyService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.service; + +import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Liuxinxin + * @since 2023-02-23 + */ +public interface IExpertAvoidCompanyService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java index 5003a20..7b5960a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java @@ -13,4 +13,12 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExpertUserFullInfoService extends IService { + + /** + * 查询用户信息 + * + * @param userId 用户ID + * @return / + **/ + ExpertUserFullInfo getByUserId(Long userId); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAvoidCompanyServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAvoidCompanyServiceImpl.java new file mode 100644 index 0000000..4caa943 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertAvoidCompanyServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.service.impl; + +import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.ningdatech.pmapi.expert.mapper.ExpertAvoidCompanyMapper; +import com.ningdatech.pmapi.expert.service.IExpertAvoidCompanyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Liuxinxin + * @since 2023-02-23 + */ +@Service +public class ExpertAvoidCompanyServiceImpl extends ServiceImpl implements IExpertAvoidCompanyService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java new file mode 100644 index 0000000..8da61e5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java @@ -0,0 +1,219 @@ +package com.ningdatech.pmapi.expert.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; +import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; +import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; +import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; +import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; +import com.ningdatech.pmapi.expert.model.dto.*; +import com.ningdatech.pmapi.expert.service.ExpertInfoService; +import com.ningdatech.pmapi.expert.service.IExpertAvoidCompanyService; +import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +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 lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author liuxinxin + * @date 2022/7/22 下午4:39 + */ +@Component +@RequiredArgsConstructor +public class ExpertInfoServiceImpl implements ExpertInfoService { + + private final IExpertUserFullInfoService iExpertUserFullInfoService; + + private final IExpertTagService iExpertTagService; + + private final IExpertDictionaryService iExpertDictionaryService; + + private final IExpertAvoidCompanyService iExpertAvoidCompanyService; + + + /** + * 用户第一次申请修改,仅在专家用户状态为applying 状态时调用 + * + * @param cmd + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveExpertInfo(ExpertFullInfoSaveCmd cmd) { + Long userId = cmd.getUserId(); + List expertAvoidCompanyList = cmd.getExpertAvoidCompanyList(); + List expertDictionaryList = cmd.getExpertDictionaryList(); + List expertIntentionWorkRegionInfoList = cmd.getExpertIntentionWorkRegionInfo(); + List expertTagList = cmd.getExpertTagList(); + ExpertUserFullInfoDTO expertUserInfoDTO = cmd.getExpertUserInfoDTO(); + + ExpertUserFullInfo expertUserFullInfo = iExpertUserFullInfoService.getByUserId(userId); + + ExpertUserFullInfo saveExpertUserFullInfo = buildSaveExpertUserFullInfo(expertUserInfoDTO); + if (Objects.nonNull(expertUserFullInfo)) { + // 专家信息审核通过之前,所有信息无需备份 + iExpertUserFullInfoService.removeById(expertUserFullInfo.getId()); + // 删除所有专家标签字段 + LambdaQueryWrapper expertTagRemove = Wrappers.lambdaQuery(ExpertTag.class) + .eq(ExpertTag::getUserId, userId); + iExpertTagService.remove(expertTagRemove); + // 删除所有专家字典字段 + LambdaQueryWrapper expertDictionaryRemove = Wrappers.lambdaQuery(ExpertDictionary.class) + .eq(ExpertDictionary::getUserId, userId); + iExpertDictionaryService.remove(expertDictionaryRemove); + // 删除所有专家履职意向申请 + // TODO 补充审核逻辑 +// LambdaQueryWrapper expertMetaApplyRemove = Wrappers.lambdaQuery(ExpertMetaApply.class) +// .eq(ExpertMetaApply::getUserId, userId) +// .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) +// .eq(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.N.name()); +// iExpertMetaApplyService.remove(expertMetaApplyRemove); + // 删除回避单位 + LambdaQueryWrapper expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class) + .eq(ExpertAvoidCompany::getUserId, userId); + iExpertAvoidCompanyService.remove(expertAvoidCompanyRemove); + } + saveExpertUserFullInfo.setUserId(userId); + saveExpertUserFullInfo.setExpertAccountStatus(ExpertAccountStatusEnum.APPLYING.getKey()); + saveExpertUserFullInfo.setUserInfoStep(ExpertUserInfoStepEnum.BASIC_INFORMATION_SUBMITTED.getKey()); + saveExpertUserFullInfo.setUpdateOn(LocalDateTime.now()); + saveExpertUserFullInfo.setCreateOn(LocalDateTime.now()); + iExpertUserFullInfoService.save(saveExpertUserFullInfo); + // 保存所有专家标签字段 + List saveExpertTagList = buildSaveExpertTagList(userId, expertTagList); + if (CollectionUtils.isNotEmpty(saveExpertTagList)) { + iExpertTagService.saveBatch(saveExpertTagList); + } + // 保存所有专家字典字段 + List saveExpertDictionaryList = buildSaveExpertDictionaryList(userId, expertDictionaryList); + if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { + iExpertDictionaryService.saveBatch(saveExpertDictionaryList); + } + // 保存所有专家履职意向申请 + + // TODO 补充审核逻辑 +// List saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList); +// if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { +// iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); +// } + // 保存所有专家回避单位 + List saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); + if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { + iExpertAvoidCompanyService.saveBatch(saveExpertAvoidCompanyList); + } + } + + + private ExpertUserFullInfo buildSaveExpertUserFullInfo(ExpertUserFullInfoDTO expertUserInfoDTO) { + ExpertUserFullInfo expertUserFullInfo = new ExpertUserFullInfo(); + if (Objects.nonNull(expertUserInfoDTO.getIsDingUser())) { + expertUserFullInfo.setIsDingUser(expertUserInfoDTO.getIsDingUser() ? BoolDisplayEnum.Y.name() : BoolDisplayEnum.N.name()); + } + expertUserFullInfo.setPhoneNo(expertUserInfoDTO.getPhoneNo()); + expertUserFullInfo.setGender(expertUserInfoDTO.getGender()); + expertUserFullInfo.setExpertName(expertUserInfoDTO.getName()); + expertUserFullInfo.setAvatarFileId(expertUserInfoDTO.getAvatarFileId()); + expertUserFullInfo.setIdCard(expertUserInfoDTO.getIdCard()); + expertUserFullInfo.setOfficePhone(expertUserInfoDTO.getOfficePhone()); + expertUserFullInfo.setBirth(expertUserInfoDTO.getBirth()); + expertUserFullInfo.setBankNo(expertUserInfoDTO.getBankNo()); + expertUserFullInfo.setBank(expertUserInfoDTO.getBank()); + expertUserFullInfo.setEmail(expertUserInfoDTO.getEmail()); + expertUserFullInfo.setHometown(expertUserInfoDTO.getHometown()); + expertUserFullInfo.setNationality(expertUserInfoDTO.getNationality()); + + expertUserFullInfo.setSchool(expertUserInfoDTO.getSchool()); + expertUserFullInfo.setGraduatedAt(expertUserInfoDTO.getGraduatedAt()); + expertUserFullInfo.setAcademicTitle(expertUserInfoDTO.getAcademicTitle()); + + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getGraduationCertificateFileIdList())) { + expertUserFullInfo.setGraduationCertificateFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getGraduationCertificateFileIdList())); + } + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getDegreeCertificateFileIdList())) { + expertUserFullInfo.setDegreeCertificateFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getDegreeCertificateFileIdList())); + } + expertUserFullInfo.setRetiredAt(expertUserInfoDTO.getRetiredAt()); + expertUserFullInfo.setCompany(expertUserInfoDTO.getCompany()); + expertUserFullInfo.setLegalEntityCode(expertUserInfoDTO.getLegalEntityCode()); + expertUserFullInfo.setAdministrativeDuties(expertUserInfoDTO.getAdministrativeDuties()); + expertUserFullInfo.setStartWorkAt(expertUserInfoDTO.getStartWorkAt()); + expertUserFullInfo.setAddress(expertUserInfoDTO.getAddress()); + expertUserFullInfo.setExperience(expertUserInfoDTO.getExperience()); + + expertUserFullInfo.setTechnicalTitles(expertUserInfoDTO.getTechnicalTitles()); + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getTitleCertificateFileIdList())) { + expertUserFullInfo.setTitleCertificateFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getTitleCertificateFileIdList())); + } + expertUserFullInfo.setAwards(expertUserInfoDTO.getAwards()); + expertUserFullInfo.setRecognitionReward(expertUserInfoDTO.getRecognitionReward()); + + expertUserFullInfo.setRegionCode(expertUserInfoDTO.getRegionCode()); + expertUserFullInfo.setRegionLevel(expertUserInfoDTO.getRegionLevel()); + if (CollectionUtils.isNotEmpty(expertUserInfoDTO.getRecommendationProofFileIdList())) { + expertUserFullInfo.setRecommendationProofFileIdList(JSONObject.toJSONString(expertUserInfoDTO.getRecommendationProofFileIdList())); + } + expertUserFullInfo.setRemark(expertUserInfoDTO.getRemark()); + return expertUserFullInfo; + } + + + private List buildSaveExpertTagList(Long userId, List expertTagList) { + if (CollectionUtils.isEmpty(expertTagList)) { + return new ArrayList<>(); + } + return expertTagList.stream().map(r -> { + ExpertTag expertTag = new ExpertTag(); + expertTag.setExpertInfoField(r.getExpertInfoField()); + expertTag.setTagCode(r.getTagCode()); + expertTag.setCreateOn(LocalDateTime.now()); + expertTag.setUpdateOn(LocalDateTime.now()); + expertTag.setUserId(userId); + return expertTag; + }).collect(Collectors.toList()); + } + + private List buildSaveExpertDictionaryList(Long userId, List expertDictionaryList) { + if (CollectionUtils.isEmpty(expertDictionaryList)) { + return new ArrayList<>(); + } + return expertDictionaryList.stream().map(r -> { + ExpertDictionary expertDictionary = new ExpertDictionary(); + expertDictionary.setUserId(userId); + expertDictionary.setExpertInfoField(r.getExpertInfoField()); + expertDictionary.setDictionaryCode(r.getDictionaryCode()); + expertDictionary.setUpdateOn(LocalDateTime.now()); + expertDictionary.setCreateOn(LocalDateTime.now()); + return expertDictionary; + }).collect(Collectors.toList()); + } + + + private List buildSaveExpertAvoidCompanyList(Long userId, List expertAvoidCompanyList) { + if (CollectionUtils.isEmpty(expertAvoidCompanyList)) { + return new ArrayList<>(); + } + return expertAvoidCompanyList.stream().map(r -> { + ExpertAvoidCompany expertAvoidCompany = new ExpertAvoidCompany(); + expertAvoidCompany.setCompanyName(r.getCompanyName()); + expertAvoidCompany.setUserId(userId); + expertAvoidCompany.setCompanyUniqCode(r.getCompanyUniqCode()); + expertAvoidCompany.setCreateOn(LocalDateTime.now()); + expertAvoidCompany.setUpdateOn(LocalDateTime.now()); + return expertAvoidCompany; + }).collect(Collectors.toList()); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java index 580d087..4b22e1f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java @@ -1,11 +1,17 @@ package com.ningdatech.pmapi.expert.service.impl; +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.mapper.NdExpertUserFullInfoMapper; import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 服务实现类 @@ -17,4 +23,9 @@ import org.springframework.stereotype.Service; @Service public class ExpertUserFullInfoServiceImpl extends ServiceImpl implements IExpertUserFullInfoService { + @Override + public ExpertUserFullInfo getByUserId(Long userId) { + return getOne(Wrappers.lambdaQuery().eq(ExpertUserFullInfo::getUserId, userId)); + } + }