Selaa lähdekoodia

查询组员评审意见修改

master
WendyYang 1 vuosi sitten
vanhempi
commit
a9f5c1a6bc
1 muutettua tiedostoa jossa 15 lisäystä ja 0 poistoa
  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 Näytä tiedosto

@@ -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…
Peruuta
Tallenna