From f285d86fffe190e4290f71bdacaf54f28cd33e8f Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Wed, 1 Mar 2023 13:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=92=A4=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expert/controller/ExpertMetaApplyController.java | 1 - .../pmapi/expert/manage/ExpertMetaApplyManage.java | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) 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 95600b3..7060bb0 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 @@ -58,5 +58,4 @@ public class ExpertMetaApplyController { } - } 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 ac93a49..215221f 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 @@ -241,9 +241,25 @@ public class ExpertMetaApplyManage { public void metaApplyRevoke(Long applyId) { - + Long userId = LoginUserUtil.getUserId(); + ExpertMetaApply expertMetaApply = iMetaApplyService.getById(applyId); + if (Objects.isNull(expertMetaApply)) { + throw new BizException("apply not exist"); + } + if (!expertMetaApply.getUserId().equals(userId)) { + throw new BizException("has not right to operate"); + } + String applyStatus = expertMetaApply.getApplyStatus(); + ExpertApplyStatusEnum expertApplyStatusEnum = ExpertApplyStatusEnum.of(applyStatus); + if (!ExpertApplyStatusEnum.PENDING_REVIEW.equals(expertApplyStatusEnum)) { + throw new BizException("apply is already deal"); + } + expertMetaApply.setApplyStatus(ExpertApplyStatusEnum.REVOKED.getKey()); + expertMetaApply.setUpdateOn(LocalDateTime.now()); + iMetaApplyService.updateById(expertMetaApply); } + private void buildIntentionApplyDisplayVO(MetaApplyResultVo metaApplyResultVo, ExpertMetaApply metaApply, ExpertApplyTypeEnum applyTypeEnum) { String regionCode = metaApply.getRegionCode(); Integer regionLevel = metaApply.getRegionLevel();