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 05cf414..4fc30ed 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("WendyYang", "meeting", PATH_YYD, "meeting_inner_project","meeting_outer_project"); + generate("Liuxinxin", "expert", PATH_LXX, "expert_meta_apply"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java index 2d71b44..0ef9338 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java @@ -21,8 +21,10 @@ package com.ningdatech.pmapi.expert.assembler; import com.alibaba.fastjson.JSONObject; import com.ningdatech.file.entity.vo.result.AttachFileVo; import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.model.*; import com.ningdatech.pmapi.expert.model.dto.*; @@ -41,10 +43,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -275,7 +274,7 @@ public class ExpertUserInfoAssembler { , List expertTagList , List expertDictionaryList , List expertIntentionWorkRegionList -// , List expertMetaApplyList + , List expertMetaApplyList , List expertAvoidCompanyList) { ExpertUserFullInfoDTO expertUserFullInfoDTO = buildExpertUserFullInfoDTO(expertUserFullInfo); List expertDictionaryDTOList = buildExpertDictionaryDTOList(expertDictionaryList); @@ -283,7 +282,7 @@ public class ExpertUserInfoAssembler { List expertIntentionWorkRegionInfo = buildExpertIntentionWorkRegionInfo(expertIntentionWorkRegionList); // 专家申请履职意向展示列表 -// List expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList); + List expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList); List expertAvoidCompanyDTOList = buildExpertAvoidCompanyDTOList(expertAvoidCompanyList); ExpertFullInfoAllDTO expertFullInfoAllDTO = new ExpertFullInfoAllDTO(); expertFullInfoAllDTO.setUserId(expertUserFullInfo.getUserId()); @@ -291,47 +290,47 @@ public class ExpertUserInfoAssembler { expertFullInfoAllDTO.setExpertDictionaryList(expertDictionaryDTOList); expertFullInfoAllDTO.setExpertTagList(expertTagDTOList); expertFullInfoAllDTO.setExpertIntentionWorkRegionInfo(expertIntentionWorkRegionInfo); -// expertFullInfoAllDTO.setExpertApplyIntentionWorkRegionInfo(expertApplyIntentionWorkRegionInfo); + expertFullInfoAllDTO.setExpertApplyIntentionWorkRegionInfo(expertApplyIntentionWorkRegionInfo); expertFullInfoAllDTO.setExpertAvoidCompanyList(expertAvoidCompanyDTOList); return expertFullInfoAllDTO; } -// -// private static List buildExpertApplyIntentionWorkRegionInfo(List expertIntentionWorkRegionList -// , List expertMetaApplyList) { -// HashSet set = new HashSet(); -// for (ExpertIntentionWorkRegion expertIntentionWorkRegion : expertIntentionWorkRegionList) { -// RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); -// regionDtoMapKey.setRegionCode(expertIntentionWorkRegion.getRegionCode()); -// regionDtoMapKey.setRegionLevel(expertIntentionWorkRegion.getRegionLevel()); -// set.add(regionDtoMapKey); -// } -// -// for (ExpertMetaApply expertMetaApply : expertMetaApplyList) { -// String applyType = expertMetaApply.getApplyType(); -// RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); -// regionDtoMapKey.setRegionCode(expertMetaApply.getRegionCode()); -// regionDtoMapKey.setRegionLevel(expertMetaApply.getRegionLevel()); -// ExpertApplyTypeEnum typeEnum = ExpertApplyTypeEnum.of(applyType); -// switch (typeEnum) { -// case EXPERT_INTENTION_LEAVE: { -// set.remove(regionDtoMapKey); -// } -// break; -// case EXPERT_INTENTION_JOIN: { -// set.add(regionDtoMapKey); -// } -// break; -// default: -// break; -// } -// } -// return set.stream().map(r -> { -// ExpertRegionDTO expertRegionDTO = new ExpertRegionDTO(); -// expertRegionDTO.setRegionCode(r.getRegionCode()); -// expertRegionDTO.setRegionLevel(r.getRegionLevel()); -// return expertRegionDTO; -// }).collect(Collectors.toList()); -// } + + private static List buildExpertApplyIntentionWorkRegionInfo(List expertIntentionWorkRegionList + , List expertMetaApplyList) { + HashSet set = new HashSet(); + for (ExpertIntentionWorkRegion expertIntentionWorkRegion : expertIntentionWorkRegionList) { + RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); + regionDtoMapKey.setRegionCode(expertIntentionWorkRegion.getRegionCode()); + regionDtoMapKey.setRegionLevel(expertIntentionWorkRegion.getRegionLevel()); + set.add(regionDtoMapKey); + } + + for (ExpertMetaApply expertMetaApply : expertMetaApplyList) { + String applyType = expertMetaApply.getApplyType(); + RegionDtoMapKey regionDtoMapKey = new RegionDtoMapKey(); + regionDtoMapKey.setRegionCode(expertMetaApply.getRegionCode()); + regionDtoMapKey.setRegionLevel(expertMetaApply.getRegionLevel()); + ExpertApplyTypeEnum typeEnum = ExpertApplyTypeEnum.of(applyType); + switch (typeEnum) { + case EXPERT_INTENTION_LEAVE: { + set.remove(regionDtoMapKey); + } + break; + case EXPERT_INTENTION_JOIN: { + set.add(regionDtoMapKey); + } + break; + default: + break; + } + } + return set.stream().map(r -> { + ExpertRegionDTO expertRegionDTO = new ExpertRegionDTO(); + expertRegionDTO.setRegionCode(r.getRegionCode()); + expertRegionDTO.setRegionLevel(r.getRegionLevel()); + return expertRegionDTO; + }).collect(Collectors.toList()); + } private static List buildExpertAvoidCompanyDTOList(List expertAvoidCompanyList) { return expertAvoidCompanyList.stream().map(r -> { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java new file mode 100644 index 0000000..f56b30a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java @@ -0,0 +1,45 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/7/26 下午1:38 + */ +@AllArgsConstructor +@Getter +public enum ExpertApplyStatusEnum { + + // 待审核 + PENDING_REVIEW("pending_review"), + // 审核通过 + PASSED("passed"), + // 审核不通过 + REFUSED("refused"), + // 已撤销 + REVOKED("revoked"); + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (ExpertApplyStatusEnum statusEnum : ExpertApplyStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return true; + } + } + return false; + } + + public static ExpertApplyStatusEnum of(String key) { + for (ExpertApplyStatusEnum statusEnum : ExpertApplyStatusEnum.values()) { + if (statusEnum.key.equals(key)) { + return statusEnum; + } + } + throw new IllegalArgumentException(String.format("Illegal ExpertApplyStatusEnum = %s", key)); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java new file mode 100644 index 0000000..19b173a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java @@ -0,0 +1,52 @@ +package com.ningdatech.pmapi.expert.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import org.apache.commons.lang3.StringUtils; + +/** + * @author liuxinxin + * @date 2022/7/26 下午1:40 + * 专家审核申请类型 + */ +@AllArgsConstructor +@Getter +public enum ExpertApplyTypeEnum { + + // 专家入库 + EXPERT_STORAGE("expert_storage"), + // 专家出库 + EXPERT_DELIVERY("expert_delivery"), + // 专家履职意向加入 + EXPERT_INTENTION_JOIN("expert_intention_join"), + // 专家履职意向退出 + EXPERT_INTENTION_LEAVE("expert_intention_leave"), + // 长期请假申请 + LONG_TERM_LEAVE("long_term_leave"), + // 专家信息修改申请 + EXPERT_INFO_MODIFY("expert_info_modify"); + + private final String key; + + public static boolean contains(String key) { + if (StringUtils.isBlank(key)) { + return false; + } + for (ExpertApplyTypeEnum typeEnum : ExpertApplyTypeEnum.values()) { + if (typeEnum.key.equals(key)) { + return true; + } + } + return false; + } + + public static ExpertApplyTypeEnum of(String key) { + for (ExpertApplyTypeEnum typeEnum : ExpertApplyTypeEnum.values()) { + if (typeEnum.key.equals(key)) { + return typeEnum; + } + } + throw new IllegalArgumentException(String.format("IllegalExpertApplyTypeEnum = %s", key)); + } + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java deleted file mode 100644 index 55ef1a5..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ningdatech.pmapi.expert.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; - -/** - *

- * 前端控制器 - *

- * - * @author Liuxinxin - * @since 2023-02-22 - */ -@Controller -@RequestMapping("/pmapi.expert/expert-intention-work-region") -public class ExpertIntentionWorkRegionController { - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java new file mode 100644 index 0000000..0757750 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java @@ -0,0 +1,24 @@ +package com.ningdatech.pmapi.expert.controller; + + +import io.swagger.annotations.Api; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + *

+ * 前端控制器 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +@RestController +@Api(tags = "专家相关审核") +@RequestMapping("/api/v1/expert-meta-apply") +@RequiredArgsConstructor +public class ExpertMetaApplyController { + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java new file mode 100644 index 0000000..46c6296 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.expert.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +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-03-01 + */ +@TableName("expert_meta_apply") +@ApiModel(value = "ExpertMetaApply对象", description = "") +@Data +public class ExpertMetaApply implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(type = IdType.AUTO) + private Long id; + + private LocalDateTime createOn; + + private LocalDateTime updateOn; + + private Long createBy; + + private Long updateBy; + + private String applyType; + + private Long userId; + + private Long approverUserId; + + private String applyStatus; + + private LocalDateTime reviewTime; + + private String auditOpinion; + + private String regionCode; + + private String approver; + + private Integer regionLevel; + + private Long applicantId; + + private String extraMaterial; + + private String displayEnable; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java new file mode 100644 index 0000000..77ee648 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.mapper; + +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +public interface ExpertMetaApplyMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml new file mode 100644 index 0000000..6ebe245 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java new file mode 100644 index 0000000..d38894d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java @@ -0,0 +1,41 @@ +package com.ningdatech.pmapi.expert.model; + +import lombok.Data; + +import java.util.Objects; + +/** + * @author liuxinxin + * @date 2022/7/22 上午10:07 + */ +@Data +public class RegionDtoMapKey { + + /** + * 区域码 + */ + private String regionCode; + + /** + * 地区级别 + */ + private Integer regionLevel; + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegionDtoMapKey regionDtoMapKey = (RegionDtoMapKey) o; + return regionCode.equals(regionDtoMapKey.getRegionCode()) && + regionLevel.equals(regionDtoMapKey.getRegionLevel()); + } + + @Override + public int hashCode() { + return Objects.hash(regionCode, regionLevel); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java new file mode 100644 index 0000000..2c518bd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.expert.service; + +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +public interface IExpertMetaApplyService extends IService { + +} 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 index a738451..c52202e 100644 --- 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 @@ -6,17 +6,17 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.common.constant.BoolDisplayEnum; import com.ningdatech.pmapi.expert.assembler.ExpertUserInfoAssembler; import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum; +import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum; import com.ningdatech.pmapi.expert.constant.ExpertUserInfoStepEnum; import com.ningdatech.pmapi.expert.entity.ExpertAvoidCompany; import com.ningdatech.pmapi.expert.entity.ExpertIntentionWorkRegion; +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo; import com.ningdatech.pmapi.expert.model.cmd.ExpertFullInfoSaveCmd; import com.ningdatech.pmapi.expert.model.cmd.ExpertRecommendProofSaveCmd; 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.IExpertIntentionWorkRegionService; -import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService; +import com.ningdatech.pmapi.expert.service.*; import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary; import com.ningdatech.pmapi.meta.model.entity.ExpertTag; import com.ningdatech.pmapi.meta.service.IExpertDictionaryService; @@ -41,14 +41,11 @@ import java.util.stream.Collectors; public class ExpertInfoServiceImpl implements ExpertInfoService { private final IExpertUserFullInfoService iExpertUserFullInfoService; - private final IExpertTagService iExpertTagService; - private final IExpertDictionaryService iExpertDictionaryService; - private final IExpertAvoidCompanyService iExpertAvoidCompanyService; - private final IExpertIntentionWorkRegionService iExpertIntentionWorkRegionService; + private final IExpertMetaApplyService iExpertMetaApplyService; /** @@ -81,12 +78,12 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { .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 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); @@ -110,11 +107,11 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { } // 保存所有专家履职意向申请 - // TODO 补充审核逻辑 -// List saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList); -// if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { -// iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); -// } + // 审核逻辑 + List saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList); + if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) { + iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList); + } // 保存所有专家回避单位 List saveExpertAvoidCompanyList = buildSaveExpertAvoidCompanyList(userId, expertAvoidCompanyList); if (CollectionUtils.isNotEmpty(saveExpertAvoidCompanyList)) { @@ -247,15 +244,15 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { iExpertDictionaryService.saveBatch(saveExpertDictionaryList); } -// // 创建入库申请 -// ExpertMetaApply expertRegionApply = new ExpertMetaApply(); -// expertRegionApply.setApplyType(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); -// expertRegionApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); -// expertRegionApply.setRegionCode(expertUserFullInfo.getRegionCode()); -// expertRegionApply.setRegionLevel(expertUserFullInfo.getRegionLevel()); -// expertRegionApply.setUserId(userId); -// expertRegionApply.setDisplayEnable(BoolDisplayEnum.Y.name()); -// iExpertMetaApplyService.save(expertRegionApply); + // 创建入库申请 + ExpertMetaApply expertRegionApply = new ExpertMetaApply(); + expertRegionApply.setApplyType(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey()); + expertRegionApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); + expertRegionApply.setRegionCode(expertUserFullInfo.getRegionCode()); + expertRegionApply.setRegionLevel(expertUserFullInfo.getRegionLevel()); + expertRegionApply.setUserId(userId); + expertRegionApply.setDisplayEnable(BoolDisplayEnum.Y.name()); + iExpertMetaApplyService.save(expertRegionApply); } @Override @@ -273,19 +270,38 @@ public class ExpertInfoServiceImpl implements ExpertInfoService { // 专家履职意向列表 List expertIntentionWorkRegionList = iExpertIntentionWorkRegionService .list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class).eq(ExpertIntentionWorkRegion::getUserId, userId)); -// // 专家履职意向申请列表 -// List expertMetaApplyList = iExpertMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) -// .eq(ExpertMetaApply::getUserId, userId) -// .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) -// .in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey())); + // 专家履职意向申请列表 + List expertMetaApplyList = iExpertMetaApplyService.list(Wrappers.lambdaQuery(ExpertMetaApply.class) + .eq(ExpertMetaApply::getUserId, userId) + .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey()) + .in(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey(), ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey())); // 所有专家回避单位 List expertAvoidCompanyList = iExpertAvoidCompanyService .list(Wrappers.lambdaQuery(ExpertAvoidCompany.class).eq(ExpertAvoidCompany::getUserId, userId)); -// return ExpertUserInfoAssembler.buildExpertFullInfoAllDTO(expertUserFullInfo, expertTagList, expertDictionaryList -// , expertIntentionWorkRegionList, expertMetaApplyList, expertAvoidCompanyList); return ExpertUserInfoAssembler.buildExpertFullInfoAllDTO(expertUserFullInfo, expertTagList, expertDictionaryList - , expertIntentionWorkRegionList, expertAvoidCompanyList); + , expertIntentionWorkRegionList, expertMetaApplyList, expertAvoidCompanyList); + } + + private List buildSaveExpertIntentionWorkRegionApplyList(Long userId, List expertIntentionWorkRegionInfoList) { + if (CollectionUtils.isEmpty(expertIntentionWorkRegionInfoList)) { + return new ArrayList<>(); + } + return expertIntentionWorkRegionInfoList.stream().map(r -> { + ExpertMetaApply expertMetaApply = new ExpertMetaApply(); + expertMetaApply.setApplyType(ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()); + expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.PENDING_REVIEW.getKey()); + expertMetaApply.setRegionCode(r.getRegionCode()); + expertMetaApply.setRegionLevel(r.getRegionLevel()); + expertMetaApply.setUserId(userId); + expertMetaApply.setDisplayEnable(BoolDisplayEnum.N.name()); + expertMetaApply.setUpdateOn(LocalDateTime.now()); + expertMetaApply.setCreateOn(LocalDateTime.now()); + return expertMetaApply; + }).collect(Collectors.toList()); + } + + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java new file mode 100644 index 0000000..481fbc5 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.expert.service.impl; + +import com.ningdatech.pmapi.expert.entity.ExpertMetaApply; +import com.ningdatech.pmapi.expert.mapper.ExpertMetaApplyMapper; +import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Liuxinxin + * @since 2023-03-01 + */ +@Service +public class ExpertMetaApplyServiceImpl extends ServiceImpl implements IExpertMetaApplyService { + +}