From a9f5c1a6bc3c35011a3e85120a454fd934537d4e Mon Sep 17 00:00:00 2001 From: WendyYang Date: Mon, 3 Apr 2023 16:48:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E5=91=98=E8=AF=84?= =?UTF-8?q?=E5=AE=A1=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/expert/manage/ExpertReviewManage.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java index 4d977dc..ac53807 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java @@ -11,12 +11,16 @@ import com.ningdatech.pmapi.expert.model.entity.ExpertReview; import com.ningdatech.pmapi.expert.model.req.ExpertReviewDetailReq; import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO; import com.ningdatech.pmapi.expert.service.IExpertReviewService; +import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; +import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Component; import java.util.List; +import static com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum.AGREED; + /** *

* ExpertReviewManage @@ -31,6 +35,7 @@ public class ExpertReviewManage { private final IExpertReviewService expertReviewService; private final DistributedLock distributedLock; + private final IMeetingExpertService meetingExpertService; private static final String EXPERT_REVIEW_KEY = "expert_review:"; @@ -68,6 +73,16 @@ public class ExpertReviewManage { if (reviews.size() > 1) { throw BizException.wrap("不可重复填写最终评审意见"); } + int agreeCnt = meetingExpertService.countExpertByStatusAndMeetingId(AGREED, req.getMeetingId(), null); + if (agreeCnt > 1) { + LambdaQueryWrapper query = Wrappers.lambdaQuery(ExpertReview.class) + .eq(ExpertReview::getProjectId, req.getProjectId()) + .eq(ExpertReview::getMeetingId, req.getMeetingId()) + .ne(ExpertReview::getCreateBy, userId); + if (expertReviewService.count(query) < agreeCnt - 1) { + throw BizException.wrap("所有组员填写完评审意见后,方可填写最终评审意见"); + } + } } else { if (!reviews.isEmpty()) { throw BizException.wrap("不可重复填写评审意见");