Browse Source

查询组员评审意见修改

tags/24080901
WendyYang 1 year ago
parent
commit
a9f5c1a6bc
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java

+ 15
- 0
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java View File

@@ -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;

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


Loading…
Cancel
Save