Browse Source

获取专家评审详情修改

tags/24080901
WendyYang 1 year ago
parent
commit
1eb17dcaaa
6 changed files with 16 additions and 8 deletions
  1. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java
  2. +4
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java
  3. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java
  4. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java
  5. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java
  6. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java

+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/expert/controller/ExpertReviewController.java View File

@@ -38,14 +38,16 @@ public class ExpertReviewController {
expertReviewManage.expertReview(req);
}

@GetMapping("/detail/{projectId}/{userId}")
@GetMapping("/detail/{meetingId}/{projectId}/{userId}")
@ApiOperation("获取专家评审详情")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "专家ID"),
@ApiImplicitParam(name = "projectId", value = "项目ID")
})
public ExpertReviewDetailVO getExpertReviewDetail(@PathVariable Long userId, @PathVariable Long projectId) {
return expertReviewManage.getExpertReviewDetail(userId, projectId);
public ExpertReviewDetailVO getExpertReviewDetail(@PathVariable Long userId,
@PathVariable Long projectId,
@PathVariable Long meetingId) {
return expertReviewManage.getExpertReviewDetail(userId, projectId, meetingId);
}

@GetMapping("/listForGroupLeader/{projectId}/{meetingId}")


+ 4
- 3
pmapi/src/main/java/com/ningdatech/pmapi/expert/manage/ExpertReviewManage.java View File

@@ -65,12 +65,13 @@ public class ExpertReviewManage {
public void expertReview(ExpertReviewDetailReq req) {
Long userId = LoginUserUtil.getUserId();
Long projectId = req.getProjectId();
Long meetingId = req.getMeetingId();
String expertReviewKey = buildExpertReviewKey(projectId, userId);
if (!distributedLock.lock(expertReviewKey)) {
throw BizException.wrap("保存评审意见失败,请重试");
}
try {
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId);
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId, meetingId);
if (req.getIsFinal()) {
if (reviews.isEmpty()) {
throw BizException.wrap("请先填写个人评审意见");
@@ -109,8 +110,8 @@ public class ExpertReviewManage {
}
}

public ExpertReviewDetailVO getExpertReviewDetail(Long projectId, Long userId) {
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId);
public ExpertReviewDetailVO getExpertReviewDetail(Long projectId, Long userId, Long meetingId) {
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId, meetingId);
reviews.removeIf(ExpertReview::getIsFinal);
if (reviews.isEmpty()) {
throw BizException.wrap("评审记录不存在");


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/IExpertReviewService.java View File

@@ -21,10 +21,11 @@ public interface IExpertReviewService extends IService<ExpertReview> {
*
* @param projectId 项目ID
* @param expertId 专家ID
* @param meetingId 会议ID
* @return 评审记录
* @author WendyYang
**/
List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId);
List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId, Long meetingId);

/**
* 获取最终评审结果


+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/expert/service/impl/ExpertReviewServiceImpl.java View File

@@ -25,10 +25,11 @@ import java.util.Map;
public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, ExpertReview> implements IExpertReviewService {

@Override
public List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId) {
public List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId, Long meetingId) {
LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class);
query.eq(ExpertReview::getProjectId, projectId);
query.eq(ExpertReview::getCreateBy, expertId);
query.eq(ExpertReview::getMeetingId, meetingId);
query.orderByAsc(ExpertReview::getCreateOn);
return list(query);
}


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/vo/MeetingDetailBasicVO.java View File

@@ -36,6 +36,8 @@ public class MeetingDetailBasicVO {
@ApiModelProperty("会议类型名称")
private String typeName;

private String regionCode;

@ApiModelProperty("会议类型代码")
private String meetingType;



+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -410,6 +410,7 @@ public class MeetingManage {
Assert.notNull(meeting, "会议不存在");
MeetingDetailBasicVO detail = MeetingDetailBasicVO.builder()
.meetingId(meeting.getId())
.regionCode(meeting.getRegionCode())
.meetingName(meeting.getName())
.meetingType(meeting.getType())
.meetingAddress(meeting.getMeetingAddress())


Loading…
Cancel
Save