Pārlūkot izejas kodu

专家审核相关接口列表

tags/24080901
liuxinxin pirms 1 gada
vecāks
revīzija
04306724ac
18 mainītis faili ar 974 papildinājumiem un 69 dzēšanām
  1. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java
  2. +50
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java
  3. +42
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java
  4. +387
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java
  5. +29
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java
  6. +61
    -61
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java
  7. +46
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java
  8. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java
  9. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java
  10. +59
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java
  11. +49
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java
  12. +76
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java
  13. +70
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java
  14. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java
  15. +10
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java
  16. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java
  17. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java
  18. +17
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java

+ 22
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java Parādīt failu

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.common.model;

import lombok.Data;

/**
* @author liuxinxin
* @date 2022/8/4 上午11:19
*/
@Data
public class CommonPageReq {
private static final long serialVersionUID = 1L;
private int pageSize;
private int pageNumber;

public int getOffset() {
return (this.getPageNumber() - 1) * this.getPageSize();
}

public int getLimit() {
return this.getPageSize();
}
}

+ 50
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java Parādīt failu

@@ -0,0 +1,50 @@
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 ExpertApplyTypeQueryEnum {

// 专家入库
EXPERT_STORAGE("expert_storage"),
// 专家出库
EXPERT_DELIVERY("expert_delivery"),
// 专家履职意变更
EXPERT_INTENTION_CHANGE("expert_intention_change"),
// 长期请假申请
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 (ExpertApplyTypeQueryEnum typeEnum : ExpertApplyTypeQueryEnum.values()) {
if (typeEnum.key.equals(key)) {
return true;
}
}
return false;
}

public static ExpertApplyTypeQueryEnum of(String key) {
for (ExpertApplyTypeQueryEnum typeEnum : ExpertApplyTypeQueryEnum.values()) {
if (typeEnum.key.equals(key)) {
return typeEnum;
}
}
throw new IllegalArgumentException(String.format("ExpertApplyTypeQueryEnum = %s", key));
}

}

+ 42
- 4
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java Parādīt failu

@@ -1,10 +1,19 @@
package com.ningdatech.pmapi.expert.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.expert.manage.ExpertMetaApplyManage;
import com.ningdatech.pmapi.expert.model.cmd.MetaApplyListQuery;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertApplyMetaVO;
import com.ningdatech.pmapi.expert.model.vo.MetaApplyResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
* <p>
@@ -15,10 +24,39 @@ import org.springframework.web.bind.annotation.RestController;
* @since 2023-03-01
*/
@RestController
@Api(tags = "专家相关审核")
@RequestMapping("/api/v1/expert-meta-apply")
@RequestMapping("/api/v1/apply/meta/")
@Validated
@RequiredArgsConstructor
@Api(value = "ExpertMetaApplyController", tags = "专家申请管理相关接口")
public class ExpertMetaApplyController {

private final ExpertMetaApplyManage expertMetaApplyManage;

@PostMapping("/list")
@ApiOperation(value = "审核列表筛选")
public PageVo<ExpertApplyMetaVO> metaApplyListQuery(@RequestBody @Valid MetaApplyListQuery metaApplyListQuery) {
// ExpertMetaApplyValidator.metaApplyListQueryValidate(metaApplyListQuery);
return expertMetaApplyManage.metaApplyListQuery(metaApplyListQuery);
}

@PostMapping("/result")
@ApiOperation(value = "审核结果处理")
public void metaApplyResult(@RequestBody @Valid MetaApplyResultRequest applyResultRequest) {
expertMetaApplyManage.metaApplyResult(applyResultRequest);
}

@PostMapping("/revoke/{applyId}")
@ApiOperation(value = "申请撤销")
public void metaApplyRevoke(@PathVariable Long applyId) {
expertMetaApplyManage.metaApplyRevoke(applyId);
}

@ApiOperation("申请审核详情")
@GetMapping("/detail/{applyId}")
public MetaApplyResultVo applyAuditDetail(@PathVariable Long applyId) {
return expertMetaApplyManage.metaApplyResult(applyId);
}



}

+ 387
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java Parādīt failu

@@ -0,0 +1,387 @@
package com.ningdatech.pmapi.expert.manage;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.exception.BizException;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.constant.BoolDisplayEnum;
import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum;
import com.ningdatech.pmapi.expert.entity.ExpertMetaApply;
import com.ningdatech.pmapi.expert.entity.ExpertUserFullInfo;
import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo;
import com.ningdatech.pmapi.expert.model.cmd.ExpertAdminExpertManageQueryCmd;
import com.ningdatech.pmapi.expert.model.cmd.MetaApplyListQuery;
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery;
import com.ningdatech.pmapi.expert.model.req.MetaApplyResultRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertApplyMetaVO;
import com.ningdatech.pmapi.expert.model.vo.MetaApplyResultVo;
import com.ningdatech.pmapi.expert.service.IExpertMetaApplyService;
import com.ningdatech.pmapi.expert.service.IExpertUserFullInfoService;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.helper.DictionaryCache;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO;
import com.ningdatech.pmapi.meta.model.dto.DictionaryDTO;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/3/1 上午10:38
*/

@Component
@RequiredArgsConstructor
public class ExpertMetaApplyManage {

private final IExpertMetaApplyService iMetaApplyService;
private final IExpertDictionaryService expertDictionaryService;

// private final IExpertAdminManageService ExpertAdminManageService;
private final IExpertUserFullInfoService userFullInfoService;
private final DictionaryCache dictionaryCache;


public PageVo<ExpertApplyMetaVO> metaApplyListQuery(MetaApplyListQuery req) {
Long expertAdminUserId = LoginUserUtil.getUserId();
// 查找符合专家条件的用户id
// TODO
// List<RegionContainsBO> viewRegions = regionLimitHelper.getExpertAdminContainsRegion(expertAdminUserId);
List<RegionContainsBO> viewRegions = new ArrayList<>();
ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions);
// TODO
// List<Long> filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd);
List<Long> filterExpertUserIdList = new ArrayList<>();
if (CollUtil.isEmpty(filterExpertUserIdList)) {
return PageVo.empty();
}

LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery =
buildMetaApplyListQueryWrapper(req, filterExpertUserIdList, viewRegions);

// RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions);
Page<ExpertMetaApply> pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery);
PageVo<ExpertApplyMetaVO> result = new PageVo<>();
result.setTotal(pageResult.getTotal());
BizUtils.notEmpty(pageResult.getRecords(), records -> {
List<Long> expertIds = CollUtils.fieldList(records, ExpertMetaApply::getUserId);
// 根据用户id 获取专家基本信息
List<ExpertUserFullInfo> expertList = userFullInfoService.listByUserIds(expertIds);
Map<Long, ExpertUserFullInfo> expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId);
List<ExpertDictionary> expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL);
Map<Long, List<ExpertDictionary>> dictMap = CollUtils.group(expertDictList, ExpertDictionary::getUserId);
result.setRecords(buildExpertApplyMetaVOList(records, expertMap, dictMap));
});
return result;
}

public void metaApplyResult(MetaApplyResultRequest applyResultRequest) {

}


public MetaApplyResultVo metaApplyResult(Long applyId) {
ExpertMetaApply metaApply = iMetaApplyService.getById(applyId);
if (Objects.isNull(metaApply)) {
throw BizException.wrap("当前审核不存在");
}
MetaApplyResultVo metaApplyResultVo = MetaApplyResultVo.builder()
.applyTime(metaApply.getCreateOn())
.auditor(metaApply.getApprover())
.expertUserId(metaApply.getUserId())
.auditOption(metaApply.getAuditOpinion())
.auditStatus(metaApply.getApplyStatus())
.auditTime(metaApply.getReviewTime())
.build();
String extraMaterialStr = metaApply.getExtraMaterial();
// if (StringUtils.isNotBlank(extraMaterialStr)) {
// ExtraMaterialDO extraMaterialDO = JSONObject.parseObject(extraMaterialStr, ExtraMaterialDO.class);
// ModifyApplyExtraInfo modifyApplyExtraInfo = new ModifyApplyExtraInfo();
// BizUtils.notEmpty(extraMaterialDO.getEvidenceList(), list -> {
// List<Long> fileIdList = CollUtils.fieldList(list, FileBasicInfo::getFileId);
// List<AttachFileVo> attachFiles = fileService.getByIds(fileIdList);
// List<FileBasicInfo> tempList = attachFiles.stream().map(r -> {
// FileBasicInfo fileBasicInfo = new FileBasicInfo();
// fileBasicInfo.setFileId(r.getFileId());
// fileBasicInfo.setFileName(r.getOriginalFileName());
// return fileBasicInfo;
// }).collect(Collectors.toList());
// modifyApplyExtraInfo.setEvidenceList(tempList);
// });
// modifyApplyExtraInfo.setFactSheet(extraMaterialDO.getFactSheet());
// metaApplyResultVo.setModifyApplyExtraInfo(modifyApplyExtraInfo);
// }
String applyType = metaApply.getApplyType();
ExpertApplyTypeEnum applyTypeEnum = ExpertApplyTypeEnum.of(applyType);
switch (applyTypeEnum) {
// case EXPERT_INFO_MODIFY:
// buildInfoModifyApplyDisplayVO(metaApplyResultVo, metaApply);
// break;
case EXPERT_INTENTION_JOIN:
case EXPERT_INTENTION_LEAVE:
buildIntentionApplyDisplayVO(metaApplyResultVo, metaApply, applyTypeEnum);
break;
case EXPERT_DELIVERY:
case LONG_TERM_LEAVE:
case EXPERT_STORAGE:
default:
break;
}
metaApplyResultVo.setApplyType(applyTypeTrans(applyTypeEnum));
return metaApplyResultVo;
}


public void metaApplyRevoke(Long applyId) {

}

private void buildIntentionApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply metaApply, ExpertApplyTypeEnum applyTypeEnum) {
String regionCode = metaApply.getRegionCode();
Integer regionLevel = metaApply.getRegionLevel();
// String unionPathStr = regionCache.getUnionPathStr(regionCode, regionLevel);
MetaApplyResultVo.IntentionApplyDisplayVO intentionApplyDisplayVO = new MetaApplyResultVo.IntentionApplyDisplayVO();
intentionApplyDisplayVO.setExpertApplyId(metaApply.getId());
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo();
expertRegionInfo.setRegionCode(regionCode);
expertRegionInfo.setRegionLevel(regionLevel);
// expertRegionInfo.setRegionName(unionPathStr);
switch (applyTypeEnum) {
case EXPERT_INTENTION_LEAVE: {
intentionApplyDisplayVO.setReduceExpertRegion(expertRegionInfo);
}
break;
case EXPERT_INTENTION_JOIN: {
intentionApplyDisplayVO.setAddExpertRegion(expertRegionInfo);
}
break;
default:
break;
}
metaApplyResultVo.setIntentionApplyDisplayVo(intentionApplyDisplayVO);
}

// private void buildInfoModifyApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply infoModifyApply) {
// InfoModifyApplyDisplayVO infoModifyApplyDisplayVo = new InfoModifyApplyDisplayVO();
// if (Objects.nonNull(infoModifyApply)) {
// Long metaApplyId = infoModifyApply.getId();
// LambdaQueryWrapper<ExpertSensitiveInfoModifyDetailRecord> eq = Wrappers.lambdaQuery(ExpertSensitiveInfoModifyDetailRecord.class)
// .eq(ExpertSensitiveInfoModifyDetailRecord::getMetaApplyId, metaApplyId);
// ExpertSensitiveInfoModifyDetailRecord one = iExpertSensitiveInfoModifyDetailRecordService.getOne(eq);
// String originalJson = null;
// if (StringUtils.isNotBlank(one.getOriginalJson())) {
// originalJson = GzipUtils.uncompress(one.getOriginalJson());
// }
// List<SensitiveModifySegment> sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class);
//
// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId);
// List<InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue> displayValueList = new ArrayList<>();
// for (SensitiveModifySegment segment : sensitiveModifySegments) {
// InfoModifyApplyDisplayVO.InfoModifyApplyDisplayValue displayValue = sensitiveModifySegmentParser.getDisplayValue(segment);
// displayValueList.add(displayValue);
// }
// infoModifyApplyDisplayVo.setInfoModifyApplyDisplayValueList(displayValueList);
// metaApplyResultVo.setInfoModifyApplyDisplayVo(infoModifyApplyDisplayVo);
// }
// }

private String applyTypeTrans(ExpertApplyTypeEnum applyTypeEnum) {
switch (applyTypeEnum) {
case EXPERT_INTENTION_JOIN:
case EXPERT_INTENTION_LEAVE: {
return ExpertApplyTypeQueryEnum.EXPERT_INTENTION_CHANGE.getKey();
}
case EXPERT_INFO_MODIFY: {
return ExpertApplyTypeQueryEnum.EXPERT_INFO_MODIFY.getKey();
}
case LONG_TERM_LEAVE: {
return ExpertApplyTypeQueryEnum.LONG_TERM_LEAVE.getKey();
}
case EXPERT_DELIVERY: {
return ExpertApplyTypeQueryEnum.EXPERT_DELIVERY.getKey();
}
case EXPERT_STORAGE: {
return ExpertApplyTypeQueryEnum.EXPERT_STORAGE.getKey();
}
default:
return null;
}
}

private List<String> applyTypeTrans(ExpertApplyTypeQueryEnum applyTypeQueryEnum) {
List<String> applyTypeList = new ArrayList<>();
switch (applyTypeQueryEnum) {
case EXPERT_INTENTION_CHANGE: {
applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey());
applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INTENTION_LEAVE.getKey());
}
break;
case EXPERT_INFO_MODIFY: {
applyTypeList.add(ExpertApplyTypeEnum.EXPERT_INFO_MODIFY.getKey());
}
break;
case LONG_TERM_LEAVE: {
applyTypeList.add(ExpertApplyTypeEnum.LONG_TERM_LEAVE.getKey());
}
break;
case EXPERT_DELIVERY: {
applyTypeList.add(ExpertApplyTypeEnum.EXPERT_DELIVERY.getKey());
}
break;
case EXPERT_STORAGE: {
applyTypeList.add(ExpertApplyTypeEnum.EXPERT_STORAGE.getKey());
}
break;
default:
break;
}
return applyTypeList;
}

private ExpertAdminExpertManageQueryCmd buildExpertAdminExpertManageQueryCmd(MetaApplyListQuery query, List<RegionContainsBO> expertAdminContainsRegionList) {
ExpertAdminExpertManageQueryCmd expertAdminExpertManageQueryCmd = new ExpertAdminExpertManageQueryCmd();
expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber());
expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize());
if (StringUtils.isNotBlank(query.getExpertName())) {
expertAdminExpertManageQueryCmd.setExpertName(query.getExpertName());
}
if (StringUtils.isNotBlank(query.getCompanyName())) {
expertAdminExpertManageQueryCmd.setCompany(query.getCompanyName());
}
List<ExpertDictionaryQuery> expertDictionaryQueryList = new ArrayList<>();
if (StringUtils.isNotBlank(query.getTitleLevelDictionaryCode())) {
ExpertDictionaryQuery expertDictionaryQuery = new ExpertDictionaryQuery();
expertDictionaryQuery.setExpertInfoField(DictExpertInfoTypeEnum.TITLE_LEVEL.getKey());
expertDictionaryQuery.setDictionaryCodeList(CollectionUtil.toList(query.getTitleLevelDictionaryCode()));
expertDictionaryQueryList.add(expertDictionaryQuery);
}

// List<RegionContainsBO> containsRegion;
// if (Objects.nonNull(query.getExpertRegion())) {
// RegionContainsBO containsRegionBo = regionLimitHelper.getContainsRegionBo(query.getExpertRegion().getRegionLevel()
// , query.getExpertRegion().getRegionCode());
// containsRegion = regionLimitHelper.queryContainsRegionAssembler(containsRegionBo, expertAdminContainsRegionList);
// } else {
// containsRegion = expertAdminContainsRegionList;
// }

expertAdminExpertManageQueryCmd.setExpertDictionaryQueryList(expertDictionaryQueryList);
// expertAdminExpertManageQueryCmd.setRegionContainsList(containsRegion);
expertAdminExpertManageQueryCmd.setPageSize(query.getPageSize());
expertAdminExpertManageQueryCmd.setPageNumber(query.getPageNumber());
return expertAdminExpertManageQueryCmd;
}


/**
* 装配 专家审核列表筛选返回VO
*
* @param expertMetaApplyList /
* @param expertUserFullInfoMap /
* @param expertDictionaryListMap /
* @return /
*/
private List<ExpertApplyMetaVO> buildExpertApplyMetaVOList(List<ExpertMetaApply> expertMetaApplyList
, Map<Long, ExpertUserFullInfo> expertUserFullInfoMap
, Map<Long, List<ExpertDictionary>> expertDictionaryListMap) {
List<ExpertApplyMetaVO> expertApplyMetaVOList = new ArrayList<>();
for (ExpertMetaApply expertMetaApply : expertMetaApplyList) {
ExpertApplyMetaVO expertApplyMetaVO = new ExpertApplyMetaVO();
Long userId = expertMetaApply.getUserId();
ExpertUserFullInfo expertUserFullInfo = expertUserFullInfoMap.get(userId);
expertApplyMetaVO.setId(expertMetaApply.getId());
expertApplyMetaVO.setUserId(userId);
expertApplyMetaVO.setApplyStatus(expertMetaApply.getApplyStatus());

String applyType = expertMetaApply.getApplyType();
if (Objects.nonNull(applyType)) {
expertApplyMetaVO.setApplyType(applyTypeTrans(ExpertApplyTypeEnum.of(applyType)));
}
expertApplyMetaVO.setName(expertUserFullInfo.getExpertName());

// RegionDTO regionDTO = regionCache.getByCodeAndLevel(expertUserFullInfo.getRegionCode(), expertUserFullInfo.getRegionLevel());
ExpertRegionInfo expertRegionInfo = new ExpertRegionInfo();
expertRegionInfo.setRegionCode(expertUserFullInfo.getRegionCode());
expertRegionInfo.setRegionLevel(expertUserFullInfo.getRegionLevel());
// expertRegionInfo.setRegionName(regionDTO.getRegionName());
expertApplyMetaVO.setExpertRegionInfo(expertRegionInfo);

List<ExpertDictionary> expertDictionaryList = expertDictionaryListMap.get(userId);
if (CollectionUtils.isNotEmpty(expertDictionaryList)) {
expertApplyMetaVO.setTitleLevel(expertDictionaryList.stream().map(r -> {
DictionaryDTO dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode());
DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo();
dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode());
dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField());
if (Objects.nonNull(dictionaryDTO)) {
dictionaryFieldInfo.setDictionaryName(dictionaryDTO.getName());
}
return dictionaryFieldInfo;
}).collect(Collectors.toList()));
}

expertApplyMetaVO.setCompany(expertUserFullInfo.getCompany());
expertApplyMetaVO.setPhoneNo(expertUserFullInfo.getPhoneNo());
expertApplyMetaVO.setApplyTime(expertMetaApply.getCreateOn());
expertApplyMetaVOList.add(expertApplyMetaVO);
}
return expertApplyMetaVOList;
}

private LambdaQueryWrapper<ExpertMetaApply> buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq,
List<Long> expertIdList,
List<RegionContainsBO> viewRegions) {
// 审核类型
List<String> applyTypeList = new ArrayList<>();
if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) {
List<ExpertApplyTypeQueryEnum> applyTypeQueryEnumList = applyListReq.getApplyTypeList();
for (ExpertApplyTypeQueryEnum applyTypeQueryEnum : applyTypeQueryEnumList) {
applyTypeList.addAll(applyTypeTrans(applyTypeQueryEnum));
}
}
// 审核结果
List<String> applyStatusList = new ArrayList<>();
if (CollUtil.isNotEmpty(applyListReq.getApplyStatusList())) {
applyStatusList = CollUtils.fieldList(applyListReq.getApplyStatusList(), ExpertApplyStatusEnum::getKey);
;
}

LocalDateTime applyStartTime = applyListReq.getApplyStartTime();
LocalDateTime applyEndTime = applyListReq.getApplyEndTime();

// 不展示撤回的申请记录
LambdaQueryWrapper<ExpertMetaApply> expertMetaApplyListQuery = Wrappers.lambdaQuery(ExpertMetaApply.class)
.in(CollectionUtils.isNotEmpty(applyTypeList), ExpertMetaApply::getApplyType, applyTypeList)
.in(CollectionUtils.isNotEmpty(applyStatusList), ExpertMetaApply::getApplyStatus, applyStatusList)
.in(ExpertMetaApply::getDisplayEnable, BoolDisplayEnum.Y.name())
.in(CollectionUtils.isNotEmpty(expertIdList), ExpertMetaApply::getUserId, expertIdList)
.gt(Objects.nonNull(applyStartTime), ExpertMetaApply::getCreateOn, applyStartTime)
.lt(Objects.nonNull(applyEndTime), ExpertMetaApply::getCreateOn, applyEndTime)
.ne(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.REVOKED.getKey())
.orderByDesc(ExpertMetaApply::getCreateOn);

// RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions);
return expertMetaApplyListQuery;
}


}

+ 29
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java Parādīt failu

@@ -0,0 +1,29 @@
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 下午4:18
* 提交修改申请额外信息
*/
@Data
@ApiModel("提交修改申请额外信息,保存于expert_meta_apply表的 extra_material 字段")
public class ExtraMaterialDO {

/**
* 情况说明
*/
@ApiModelProperty("申请说明")
private String factSheet;

/**
* 证明材料
*/
@ApiModelProperty("证明材料")
private List<FileBasicInfo> evidenceList;
}

+ 61
- 61
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java Parādīt failu

@@ -1,61 +1,61 @@
//package com.ningdatech.pmapi.expert.model.cmd;
//
//import com.ningdatech.emapi.common.model.CommonPageReq;
//import com.ningdatech.emapi.expert.constants.ExpertAccountStatusEnum;
//import com.ningdatech.emapi.expert.entity.bo.RegionContainsBO;
//import com.ningdatech.emapi.expert.entity.query.ExpertDictionaryQuery;
//import com.ningdatech.emapi.expert.entity.query.ExpertTagQuery;
//import io.swagger.annotations.ApiModelProperty;
//import lombok.Data;
//
//import java.util.List;
//
///**
// * @author liuxinxin
// * @date 2022/8/4 上午11:11
// */
//@Data
//public class ExpertAdminExpertManageQueryCmd extends CommonPageReq {
//
// @ApiModelProperty("专家姓名(精准匹配)")
// private String expertName;
//
// @ApiModelProperty("工作单位(模糊匹配)")
// private String company;
//
// @ApiModelProperty("专家账号状态")
// private List<ExpertAccountStatusEnum> expertAccountStatusList;
//
// /**
// * 区域编码
// */
// @ApiModelProperty("区域编码")
// private String regionCode;
//
// /**
// * 区域级别
// */
// @ApiModelProperty("区域级别")
// private Integer regionLevel;
//
// /**
// * 专家管理区域范围
// */
// List<RegionContainsBO> regionContainsList;
//
// /**
// * 专家字典信息
// */
// private List<ExpertDictionaryQuery> expertDictionaryQueryList;
//
// /**
// * 专家标签信息
// */
// private List<ExpertTagQuery> expertTagQueryList;
//
// /**
// * 是否为钉用户
// */
// private Boolean isDingUser;
//
//}
package com.ningdatech.pmapi.expert.model.cmd;
import com.ningdatech.pmapi.common.model.CommonPageReq;
import com.ningdatech.pmapi.expert.constant.ExpertAccountStatusEnum;
import com.ningdatech.pmapi.expert.model.query.ExpertDictionaryQuery;
import com.ningdatech.pmapi.expert.model.query.ExpertTagQuery;
import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author liuxinxin
* @date 2022/8/4 上午11:11
*/
@Data
public class ExpertAdminExpertManageQueryCmd extends CommonPageReq {
@ApiModelProperty("专家姓名(精准匹配)")
private String expertName;
@ApiModelProperty("工作单位(模糊匹配)")
private String company;
@ApiModelProperty("专家账号状态")
private List<ExpertAccountStatusEnum> expertAccountStatusList;
/**
* 区域编码
*/
@ApiModelProperty("区域编码")
private String regionCode;
/**
* 区域级别
*/
@ApiModelProperty("区域级别")
private Integer regionLevel;
/**
* 专家管理区域范围
*/
List<RegionContainsBO> regionContainsList;
/**
* 专家字典信息
*/
private List<ExpertDictionaryQuery> expertDictionaryQueryList;
/**
* 专家标签信息
*/
private List<ExpertTagQuery> expertTagQueryList;
/**
* 是否为钉用户
*/
private Boolean isDingUser;
}

+ 46
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java Parādīt failu

@@ -0,0 +1,46 @@
package com.ningdatech.pmapi.expert.model.cmd;

import com.ningdatech.basic.model.PagePo;
import com.ningdatech.pmapi.expert.constant.ExpertApplyStatusEnum;
import com.ningdatech.pmapi.expert.constant.ExpertApplyTypeQueryEnum;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
* @author liuxinxin
* @date 2022/7/26 下午2:35
*/
@Data
@ApiModel("申请列表查询请求")
public class MetaApplyListQuery extends PagePo {

@ApiModelProperty("审核类型")
private List<ExpertApplyTypeQueryEnum> applyTypeList;

@ApiModelProperty("审核结果")
private List<ExpertApplyStatusEnum> applyStatusList;

@ApiModelProperty("工作单位")
private String companyName;

@ApiModelProperty("专家姓名")
private String expertName;

@ApiModelProperty("职称级别字典编码")
private String titleLevelDictionaryCode;

@ApiModelProperty("专家层级")
private ExpertRegionInfo expertRegion;

@ApiModelProperty("筛选开始时间")
private LocalDateTime applyStartTime;

@ApiModelProperty("筛选结束时间")
private LocalDateTime applyEndTime;

}

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java Parādīt failu

@@ -0,0 +1,17 @@
package com.ningdatech.pmapi.expert.model.query;

import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2022/8/5 上午11:16
*/
@Data
public class ExpertDictionaryQuery {

private String expertInfoField;

private List<String> dictionaryCodeList;
}

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java Parādīt failu

@@ -0,0 +1,17 @@
package com.ningdatech.pmapi.expert.model.query;

import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2022/8/5 上午11:16
*/
@Data
public class ExpertTagQuery {

private String expertInfoField;

private List<String> tagCodeList;
}

+ 59
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java Parādīt failu

@@ -0,0 +1,59 @@
package com.ningdatech.pmapi.expert.model.query;

import com.ningdatech.pmapi.meta.model.bo.RegionContainsBO;
import lombok.Data;

import java.util.List;

/**
* @author liuxinxin
* @date 2022/8/5 上午10:52
*/
@Data
public class ListExpertQuery {

private Integer limit;
private Integer offset;

/**
* 专家姓名(精准匹配)
*/
private String expertName;

/**
* 工作单位(模糊匹配)
*/
private String company;

/**
* 专家账号状态
*/
private List<String> expertAccountStatusList;

/**
* 区域编码
*/
private String regionCode;

/**
* 区域级别
*/
private Integer regionLevel;

/**
* 专家管理区域范围
*/
List<RegionContainsBO> regionContainsList;

/**
* 专家字典信息
*/
private List<ExpertDictionaryQuery> expertDictionaryQueryList;

/**
* 专家标签信息
*/
private List<ExpertTagQuery> expertTagQueryList;

private Boolean isDingUser;
}

+ 49
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java Parādīt failu

@@ -0,0 +1,49 @@
package com.ningdatech.pmapi.expert.model.req;

import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo;
import com.ningdatech.pmapi.expert.model.TagFieldInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
* @author liuxinxin
* @date 2022/7/26 下午4:20
* 申请结果请求基类
*/
@Data
@Validated
public class MetaApplyResultRequest {

@NotNull
@ApiModelProperty("申请id")
private Long applyId;

@NotNull
@ApiModelProperty("审核结果")
private Boolean applyResult;

@ApiModelProperty("审核意见")
private String auditOpinion;

@ApiModelProperty("入库审核额外参数,只有入库审核结果审批才需要填写")
private StorageApplyResultExtraInfo storageApplyResultExtraInfo;


@Data
@ApiModel("入库审核额外参数")
public static class StorageApplyResultExtraInfo {
@ApiModelProperty("专家类型-内外围")
private List<DictionaryFieldInfo> expertType;

@ApiModelProperty("其他标签(标签code)")
private List<TagFieldInfo> other;

@ApiModelProperty("备注")
private String remark;
}
}

+ 76
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java Parādīt failu

@@ -0,0 +1,76 @@
package com.ningdatech.pmapi.expert.model.vo;

import com.ningdatech.pmapi.expert.model.DictionaryFieldInfo;
import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
* @author liuxinxin
* @date 2022/7/26 上午11:17
* 专家审核列表展示VO基础类
*/
@Data
@ApiModel("审核列表展示VO")
public class ExpertApplyMetaVO {

@ApiModelProperty("id")
private Long id;

@ApiModelProperty("用户id")
private Long userId;

/**
* 审核结果
*/
@ApiModelProperty("审核结果")
private String applyStatus;

/**
* 审核类型
*/
@ApiModelProperty("审核类型")
private String applyType;

/**
* 专家姓名
*/
@ApiModelProperty("专家姓名")
private String name;

/**
* 专家层级
*/
@ApiModelProperty("专家层级")
private ExpertRegionInfo expertRegionInfo;

/**
* 职称级别
*/
@ApiModelProperty("职称级别")
private List<DictionaryFieldInfo> titleLevel;

/**
* 工作单位
*/
@ApiModelProperty("工作单位")
private String company;

/**
* 手机号
*/
@ApiModelProperty("手机号")
private String phoneNo;

/**
* 申请时间
*/
@ApiModelProperty("申请时间")
private LocalDateTime applyTime;


}

+ 70
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java Parādīt failu

@@ -0,0 +1,70 @@
package com.ningdatech.pmapi.expert.model.vo;

import com.ningdatech.pmapi.meta.model.ExpertRegionInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;

/**
* <p>
* LeaveAuditInfoVo
* </p>
*
* @author WendyYang
* @since 13:46 2022/8/12
*/
@Data
@Builder
@ApiModel("审核详情返回参数")
public class MetaApplyResultVo {

@ApiModelProperty("审核人")
private String auditor;

@ApiModelProperty("审核时间")
private LocalDateTime auditTime;

@ApiModelProperty("审核意见")
private String auditOption;

@ApiModelProperty("审核状态")
private String auditStatus;

@ApiModelProperty("申请时间")
private LocalDateTime applyTime;

@ApiModelProperty("申请类型")
private String applyType;

@ApiModelProperty("专家用户userId")
private Long expertUserId;

// @ApiModelProperty("额外的材料")
// private ModifyApplyExtraInfo modifyApplyExtraInfo;
//
// @ApiModelProperty("信息修改申请展示列表-只有审核类型为信息变更审核时才有值")
// private InfoModifyApplyDisplayVO infoModifyApplyDisplayVo;

@ApiModelProperty("履职意向修改申请展示列表-只有审核类型为履职意向变更时才会有值")
private IntentionApplyDisplayVO intentionApplyDisplayVo;


@Data
@ApiModel("履职意向修改申请展示列表")
public static class IntentionApplyDisplayVO {

@ApiModelProperty("审核申请id")
private Long expertApplyId;

@ApiModelProperty("履职意向增加")
private ExpertRegionInfo addExpertRegion;

@ApiModelProperty("履职意向减少")
private ExpertRegionInfo reduceExpertRegion;
}


}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java Parādīt failu

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

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

/**
* <p>
* 服务类
* 服务类
* </p>
*
* @author Liuxinxin


+ 10
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertUserFullInfoService.java Parādīt failu

@@ -32,4 +32,14 @@ public interface IExpertUserFullInfoService extends IService<ExpertUserFullInfo>
**/
List<ExpertUserFullInfo> listByUserId(List<Long> userId);



/**
* 批量查询专家用户信息
*
* @param userIds 用户ID
* @return /
*/
List<ExpertUserFullInfo> listByUserIds(List<Long> userIds);

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertUserFullInfoServiceImpl.java Parādīt failu

@@ -33,4 +33,9 @@ public class ExpertUserFullInfoServiceImpl extends ServiceImpl<NdExpertUserFullI
return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds));
}

@Override
public List<ExpertUserFullInfo> listByUserIds(List<Long> userIds) {
return list(Wrappers.<ExpertUserFullInfo>lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds));
}

}

+ 15
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java Parādīt failu

@@ -1,8 +1,12 @@
package com.ningdatech.pmapi.meta.service;

import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务类
@@ -13,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IExpertDictionaryService extends IService<ExpertDictionary> {


/**
* 根据专家ID批量查询专家字典信息
*
* @param userIds 专家ID
* @param dictType 专家字典类型
* @return /
* @author WendyYang
**/
List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType);

}

+ 17
- 2
pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java Parādīt failu

@@ -1,11 +1,17 @@
package com.ningdatech.pmapi.meta.service.impl;

import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.meta.constant.DictExpertInfoTypeEnum;
import com.ningdatech.pmapi.meta.mapper.ExpertDictionaryMapper;
import com.ningdatech.pmapi.meta.model.entity.ExpertDictionary;
import com.ningdatech.pmapi.meta.service.IExpertDictionaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
* <p>
* 服务实现类
@@ -17,4 +23,13 @@ import org.springframework.stereotype.Service;
@Service
public class ExpertDictionaryServiceImpl extends ServiceImpl<ExpertDictionaryMapper, ExpertDictionary> implements IExpertDictionaryService {

@Override
public List<ExpertDictionary> listByUserId(Collection<Long> userIds, DictExpertInfoTypeEnum dictType) {
// 获取专家职称
LambdaQueryWrapper<ExpertDictionary> query = Wrappers.lambdaQuery(ExpertDictionary.class)
.in(ExpertDictionary::getUserId, userIds)
.eq(ExpertDictionary::getExpertInfoField, dictType.getKey());
return list(query);
}

}

Notiek ielāde…
Atcelt
Saglabāt