Selaa lähdekoodia

专家入库审核逻辑

tags/24080901
liuxinxin 1 vuosi sitten
vanhempi
commit
d3cd9df879
13 muutettua tiedostoa jossa 376 lisäystä ja 101 poistoa
  1. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  2. +43
    -44
      pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java
  3. +45
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java
  4. +52
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java
  5. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java
  6. +24
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java
  7. +61
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java
  8. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java
  9. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml
  10. +41
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java
  11. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java
  12. +52
    -36
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java
  13. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java

+ 1
- 1
ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java Näytä tiedosto

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

}

+ 43
- 44
pmapi/src/main/java/com/ningdatech/pmapi/expert/assembler/ExpertUserInfoAssembler.java Näytä tiedosto

@@ -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<ExpertTag> expertTagList
, List<ExpertDictionary> expertDictionaryList
, List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList
// , List<ExpertMetaApply> expertMetaApplyList
, List<ExpertMetaApply> expertMetaApplyList
, List<ExpertAvoidCompany> expertAvoidCompanyList) {
ExpertUserFullInfoDTO expertUserFullInfoDTO = buildExpertUserFullInfoDTO(expertUserFullInfo);
List<ExpertDictionaryDTO> expertDictionaryDTOList = buildExpertDictionaryDTOList(expertDictionaryList);
@@ -283,7 +282,7 @@ public class ExpertUserInfoAssembler {
List<ExpertRegionDTO> expertIntentionWorkRegionInfo = buildExpertIntentionWorkRegionInfo(expertIntentionWorkRegionList);

// 专家申请履职意向展示列表
// List<ExpertRegionDTO> expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList);
List<ExpertRegionDTO> expertApplyIntentionWorkRegionInfo = buildExpertApplyIntentionWorkRegionInfo(expertIntentionWorkRegionList, expertMetaApplyList);
List<ExpertAvoidCompanyDTO> 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<ExpertRegionDTO> buildExpertApplyIntentionWorkRegionInfo(List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList
// , List<ExpertMetaApply> expertMetaApplyList) {
// HashSet<RegionDtoMapKey> 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<ExpertRegionDTO> buildExpertApplyIntentionWorkRegionInfo(List<ExpertIntentionWorkRegion> expertIntentionWorkRegionList
, List<ExpertMetaApply> expertMetaApplyList) {
HashSet<RegionDtoMapKey> 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<ExpertAvoidCompanyDTO> buildExpertAvoidCompanyDTOList(List<ExpertAvoidCompany> expertAvoidCompanyList) {
return expertAvoidCompanyList.stream().map(r -> {


+ 45
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyStatusEnum.java Näytä tiedosto

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

+ 52
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeEnum.java Näytä tiedosto

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

}

+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertIntentionWorkRegionController.java Näytä tiedosto

@@ -1,20 +0,0 @@
package com.ningdatech.pmapi.expert.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author Liuxinxin
* @since 2023-02-22
*/
@Controller
@RequestMapping("/pmapi.expert/expert-intention-work-region")
public class ExpertIntentionWorkRegionController {

}

+ 24
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java Näytä tiedosto

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

/**
* <p>
* 前端控制器
* </p>
*
* @author Liuxinxin
* @since 2023-03-01
*/
@RestController
@Api(tags = "专家相关审核")
@RequestMapping("/api/v1/expert-meta-apply")
@RequiredArgsConstructor
public class ExpertMetaApplyController {


}

+ 61
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/entity/ExpertMetaApply.java Näytä tiedosto

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

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

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.java Näytä tiedosto

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.expert.mapper;

import com.ningdatech.pmapi.expert.entity.ExpertMetaApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
* <p>
* Mapper 接口
* </p>
*
* @author Liuxinxin
* @since 2023-03-01
*/
public interface ExpertMetaApplyMapper extends BaseMapper<ExpertMetaApply> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/mapper/ExpertMetaApplyMapper.xml Näytä tiedosto

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ningdatech.pmapi.expert.mapper.ExpertMetaApplyMapper">

</mapper>

+ 41
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/RegionDtoMapKey.java Näytä tiedosto

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

+ 16
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java Näytä tiedosto

@@ -0,0 +1,16 @@
package com.ningdatech.pmapi.expert.service;

import com.ningdatech.pmapi.expert.entity.ExpertMetaApply;
import com.baomidou.mybatisplus.extension.service.IService;

/**
* <p>
* 服务类
* </p>
*
* @author Liuxinxin
* @since 2023-03-01
*/
public interface IExpertMetaApplyService extends IService<ExpertMetaApply> {

}

+ 52
- 36
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertInfoServiceImpl.java Näytä tiedosto

@@ -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<ExpertMetaApply> 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<ExpertMetaApply> 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<ExpertAvoidCompany> expertAvoidCompanyRemove = Wrappers.lambdaQuery(ExpertAvoidCompany.class)
.eq(ExpertAvoidCompany::getUserId, userId);
@@ -110,11 +107,11 @@ public class ExpertInfoServiceImpl implements ExpertInfoService {
}
// 保存所有专家履职意向申请

// TODO 补充审核逻辑
// List<ExpertMetaApply> saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList);
// if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) {
// iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList);
// }
// 审核逻辑
List<ExpertMetaApply> saveExpertIntentionWorkRegionApplyList = buildSaveExpertIntentionWorkRegionApplyList(userId, expertIntentionWorkRegionInfoList);
if (CollectionUtils.isNotEmpty(saveExpertDictionaryList)) {
iExpertMetaApplyService.saveBatch(saveExpertIntentionWorkRegionApplyList);
}
// 保存所有专家回避单位
List<ExpertAvoidCompany> 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<ExpertIntentionWorkRegion> expertIntentionWorkRegionList = iExpertIntentionWorkRegionService
.list(Wrappers.lambdaQuery(ExpertIntentionWorkRegion.class).eq(ExpertIntentionWorkRegion::getUserId, userId));
// // 专家履职意向申请列表
// List<ExpertMetaApply> 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<ExpertMetaApply> 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<ExpertAvoidCompany> 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<ExpertMetaApply> buildSaveExpertIntentionWorkRegionApplyList(Long userId, List<ExpertRegionDTO> 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());
}


}

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertMetaApplyServiceImpl.java Näytä tiedosto

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

/**
* <p>
* 服务实现类
* </p>
*
* @author Liuxinxin
* @since 2023-03-01
*/
@Service
public class ExpertMetaApplyServiceImpl extends ServiceImpl<ExpertMetaApplyMapper, ExpertMetaApply> implements IExpertMetaApplyService {

}

Loading…
Peruuta
Tallenna