diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java new file mode 100644 index 0000000..945ca97 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/model/CommonPageReq.java @@ -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(); + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java new file mode 100644 index 0000000..11701dc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/constant/ExpertApplyTypeQueryEnum.java @@ -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)); + } + +} 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 index 0757750..95600b3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertMetaApplyController.java @@ -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; /** *

@@ -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 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); + } + + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java new file mode 100644 index 0000000..ad41577 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java @@ -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 metaApplyListQuery(MetaApplyListQuery req) { + Long expertAdminUserId = LoginUserUtil.getUserId(); + // 查找符合专家条件的用户id + // TODO +// List viewRegions = regionLimitHelper.getExpertAdminContainsRegion(expertAdminUserId); + List viewRegions = new ArrayList<>(); + ExpertAdminExpertManageQueryCmd queryCmd = buildExpertAdminExpertManageQueryCmd(req, viewRegions); + // TODO +// List filterExpertUserIdList = expertAdminManageService.filterExpertUserIdList(queryCmd); + List filterExpertUserIdList = new ArrayList<>(); + if (CollUtil.isEmpty(filterExpertUserIdList)) { + return PageVo.empty(); + } + + LambdaQueryWrapper expertMetaApplyListQuery = + buildMetaApplyListQueryWrapper(req, filterExpertUserIdList, viewRegions); + +// RegionWrapperAssembler.expertMetaApplyRegionContainsWrapperAssembler(expertMetaApplyListQuery, viewRegions); + Page pageResult = iMetaApplyService.page(req.page(), expertMetaApplyListQuery); + PageVo result = new PageVo<>(); + result.setTotal(pageResult.getTotal()); + BizUtils.notEmpty(pageResult.getRecords(), records -> { + List expertIds = CollUtils.fieldList(records, ExpertMetaApply::getUserId); + // 根据用户id 获取专家基本信息 + List expertList = userFullInfoService.listByUserIds(expertIds); + Map expertMap = CollUtils.listToMap(expertList, ExpertUserFullInfo::getUserId); + List expertDictList = expertDictionaryService.listByUserId(expertIds, DictExpertInfoTypeEnum.TITLE_LEVEL); + Map> 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 fileIdList = CollUtils.fieldList(list, FileBasicInfo::getFileId); +// List attachFiles = fileService.getByIds(fileIdList); +// List 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 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 sensitiveModifySegments = JSONUtils.parseArray(originalJson, SensitiveModifySegment.class); +// +// infoModifyApplyDisplayVo.setExpertApplyId(metaApplyId); +// List 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 applyTypeTrans(ExpertApplyTypeQueryEnum applyTypeQueryEnum) { + List 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 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 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 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 buildExpertApplyMetaVOList(List expertMetaApplyList + , Map expertUserFullInfoMap + , Map> expertDictionaryListMap) { + List 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 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 buildMetaApplyListQueryWrapper(MetaApplyListQuery applyListReq, + List expertIdList, + List viewRegions) { + // 审核类型 + List applyTypeList = new ArrayList<>(); + if (CollUtil.isNotEmpty(applyListReq.getApplyTypeList())) { + List applyTypeQueryEnumList = applyListReq.getApplyTypeList(); + for (ExpertApplyTypeQueryEnum applyTypeQueryEnum : applyTypeQueryEnumList) { + applyTypeList.addAll(applyTypeTrans(applyTypeQueryEnum)); + } + } + // 审核结果 + List applyStatusList = new ArrayList<>(); + if (CollUtil.isNotEmpty(applyListReq.getApplyStatusList())) { + applyStatusList = CollUtils.fieldList(applyListReq.getApplyStatusList(), ExpertApplyStatusEnum::getKey); + ; + } + + LocalDateTime applyStartTime = applyListReq.getApplyStartTime(); + LocalDateTime applyEndTime = applyListReq.getApplyEndTime(); + + // 不展示撤回的申请记录 + LambdaQueryWrapper 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; + } + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java new file mode 100644 index 0000000..a0e8abf --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/ExtraMaterialDO.java @@ -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 evidenceList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java index c38d32c..57bf9f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/ExpertAdminExpertManageQueryCmd.java @@ -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 expertAccountStatusList; -// -// /** -// * 区域编码 -// */ -// @ApiModelProperty("区域编码") -// private String regionCode; -// -// /** -// * 区域级别 -// */ -// @ApiModelProperty("区域级别") -// private Integer regionLevel; -// -// /** -// * 专家管理区域范围 -// */ -// List regionContainsList; -// -// /** -// * 专家字典信息 -// */ -// private List expertDictionaryQueryList; -// -// /** -// * 专家标签信息 -// */ -// private List 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 expertAccountStatusList; + + /** + * 区域编码 + */ + @ApiModelProperty("区域编码") + private String regionCode; + + /** + * 区域级别 + */ + @ApiModelProperty("区域级别") + private Integer regionLevel; + + /** + * 专家管理区域范围 + */ + List regionContainsList; + + /** + * 专家字典信息 + */ + private List expertDictionaryQueryList; + + /** + * 专家标签信息 + */ + private List expertTagQueryList; + + /** + * 是否为钉用户 + */ + private Boolean isDingUser; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java new file mode 100644 index 0000000..0049729 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/cmd/MetaApplyListQuery.java @@ -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 applyTypeList; + + @ApiModelProperty("审核结果") + private List 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; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java new file mode 100644 index 0000000..0220b2f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertDictionaryQuery.java @@ -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 dictionaryCodeList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java new file mode 100644 index 0000000..164ba63 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ExpertTagQuery.java @@ -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 tagCodeList; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java new file mode 100644 index 0000000..e39c3af --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/query/ListExpertQuery.java @@ -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 expertAccountStatusList; + + /** + * 区域编码 + */ + private String regionCode; + + /** + * 区域级别 + */ + private Integer regionLevel; + + /** + * 专家管理区域范围 + */ + List regionContainsList; + + /** + * 专家字典信息 + */ + private List expertDictionaryQueryList; + + /** + * 专家标签信息 + */ + private List expertTagQueryList; + + private Boolean isDingUser; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java new file mode 100644 index 0000000..5272f6f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/req/MetaApplyResultRequest.java @@ -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 expertType; + + @ApiModelProperty("其他标签(标签code)") + private List other; + + @ApiModelProperty("备注") + private String remark; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java new file mode 100644 index 0000000..37f8acd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/ExpertApplyMetaVO.java @@ -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 titleLevel; + + /** + * 工作单位 + */ + @ApiModelProperty("工作单位") + private String company; + + /** + * 手机号 + */ + @ApiModelProperty("手机号") + private String phoneNo; + + /** + * 申请时间 + */ + @ApiModelProperty("申请时间") + private LocalDateTime applyTime; + + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java new file mode 100644 index 0000000..fae2507 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/model/vo/MetaApplyResultVo.java @@ -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; + +/** + *

+ * LeaveAuditInfoVo + *

+ * + * @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; + } + + +} 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 index 2c518bd..e9dcba1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertMetaApplyService.java @@ -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; /** *

- * 服务类 + * 服务类 *

* * @author Liuxinxin 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 af68be9..a0a6c27 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 @@ -32,4 +32,14 @@ public interface IExpertUserFullInfoService extends IService **/ List listByUserId(List userId); + + + /** + * 批量查询专家用户信息 + * + * @param userIds 用户ID + * @return / + */ + List listByUserIds(List userIds); + } 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 69544bc..234d70d 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 @@ -33,4 +33,9 @@ public class ExpertUserFullInfoServiceImpl extends ServiceImpllambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); } + @Override + public List listByUserIds(List userIds) { + return list(Wrappers.lambdaQuery().in(ExpertUserFullInfo::getUserId, userIds)); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java index 9ea3a35..cfb9ed0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/IExpertDictionaryService.java @@ -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; + /** *

* 服务类 @@ -13,4 +17,15 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IExpertDictionaryService extends IService { + + /** + * 根据专家ID批量查询专家字典信息 + * + * @param userIds 专家ID + * @param dictType 专家字典类型 + * @return / + * @author WendyYang + **/ + List listByUserId(Collection userIds, DictExpertInfoTypeEnum dictType); + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java index 346f4ec..43ccffa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meta/service/impl/ExpertDictionaryServiceImpl.java @@ -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; + /** *

* 服务实现类 @@ -17,4 +23,13 @@ import org.springframework.stereotype.Service; @Service public class ExpertDictionaryServiceImpl extends ServiceImpl implements IExpertDictionaryService { + @Override + public List listByUserId(Collection userIds, DictExpertInfoTypeEnum dictType) { + // 获取专家职称 + LambdaQueryWrapper query = Wrappers.lambdaQuery(ExpertDictionary.class) + .in(ExpertDictionary::getUserId, userIds) + .eq(ExpertDictionary::getExpertInfoField, dictType.getKey()); + return list(query); + } + }