diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java index 2045526..c20f006 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertController.java @@ -37,8 +37,14 @@ public class ExpertController { private final ExpertManage expertManage; private final ExpertAdminManage expertAdminManage; +// @PostMapping("/basic-info-submit") +// @ApiOperation("专家管理员新增专家)") +// public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) { +// expertManage.expertBasicInfoSubmit(request); +// } + @PostMapping("/basic-info-submit") - @ApiOperation("填写基本信息接口(专家报名使用))") + @ApiOperation("专家管理员新增专家)") public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) { expertManage.expertBasicInfoSubmit(request); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java index 0f2a426..08ee800 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertManage.java @@ -117,6 +117,9 @@ public class ExpertManage { applyResult.setApplyResult(true); expertMetaApplyManage.metaApplyResult(applyResult); + // 批量通过专家履职意向审核 + expertMetaApplyManage.autoPassExpertIntentionApply(userId); + // 增加用户专家角色 Role expertRole = iRoleService.getOne(Wrappers.lambdaQuery(Role.class).eq(Role::getCode, RoleEnum.EXPERT.name())); UserRole expertUserRole = iUserRoleService.getOne(Wrappers.lambdaQuery(UserRole.class) 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 index 9dbec46..bb7fd84 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertMetaApplyManage.java @@ -590,4 +590,20 @@ public class ExpertMetaApplyManage { expertIntentionApplyDealCmd.setExpertRegionLevel(expertMetaApply.getRegionLevel()); return expertIntentionApplyDealCmd; } + + public void autoPassExpertIntentionApply(Long expertUserId) { + List expertIntentionJoinApplyList = iMetaApplyService.list(Wrappers + .lambdaQuery(ExpertMetaApply.class) + .eq(ExpertMetaApply::getUserId, expertUserId) + .eq(ExpertMetaApply::getApplyType, ExpertApplyTypeEnum.EXPERT_INTENTION_JOIN.getKey()) + .eq(ExpertMetaApply::getApplyStatus, ExpertApplyStatusEnum.PENDING_REVIEW.getKey())); + + for (ExpertMetaApply expertMetaApply : expertIntentionJoinApplyList) { + MetaApplyResultRequest applyResult = new MetaApplyResultRequest(); + applyResult.setApplyId(expertMetaApply.getId()); + applyResult.setAuditOpinion("同意"); + applyResult.setApplyResult(true); + metaApplyResult(applyResult); + } + } }