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("不可重复填写评审意见");