@@ -38,14 +38,16 @@ public class ExpertReviewController { | |||||
expertReviewManage.expertReview(req); | expertReviewManage.expertReview(req); | ||||
} | } | ||||
@GetMapping("/detail/{projectId}/{userId}") | |||||
@GetMapping("/detail/{meetingId}/{projectId}/{userId}") | |||||
@ApiOperation("获取专家评审详情") | @ApiOperation("获取专家评审详情") | ||||
@ApiImplicitParams({ | @ApiImplicitParams({ | ||||
@ApiImplicitParam(name = "userId", value = "专家ID"), | @ApiImplicitParam(name = "userId", value = "专家ID"), | ||||
@ApiImplicitParam(name = "projectId", 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}") | @GetMapping("/listForGroupLeader/{projectId}/{meetingId}") | ||||
@@ -65,12 +65,13 @@ public class ExpertReviewManage { | |||||
public void expertReview(ExpertReviewDetailReq req) { | public void expertReview(ExpertReviewDetailReq req) { | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
Long projectId = req.getProjectId(); | Long projectId = req.getProjectId(); | ||||
Long meetingId = req.getMeetingId(); | |||||
String expertReviewKey = buildExpertReviewKey(projectId, userId); | String expertReviewKey = buildExpertReviewKey(projectId, userId); | ||||
if (!distributedLock.lock(expertReviewKey)) { | if (!distributedLock.lock(expertReviewKey)) { | ||||
throw BizException.wrap("保存评审意见失败,请重试"); | throw BizException.wrap("保存评审意见失败,请重试"); | ||||
} | } | ||||
try { | try { | ||||
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId); | |||||
List<ExpertReview> reviews = expertReviewService.listByProjectIdAndExpertId(projectId, userId, meetingId); | |||||
if (req.getIsFinal()) { | if (req.getIsFinal()) { | ||||
if (reviews.isEmpty()) { | if (reviews.isEmpty()) { | ||||
throw BizException.wrap("请先填写个人评审意见"); | 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); | reviews.removeIf(ExpertReview::getIsFinal); | ||||
if (reviews.isEmpty()) { | if (reviews.isEmpty()) { | ||||
throw BizException.wrap("评审记录不存在"); | throw BizException.wrap("评审记录不存在"); | ||||
@@ -21,10 +21,11 @@ public interface IExpertReviewService extends IService<ExpertReview> { | |||||
* | * | ||||
* @param projectId 项目ID | * @param projectId 项目ID | ||||
* @param expertId 专家ID | * @param expertId 专家ID | ||||
* @param meetingId 会议ID | |||||
* @return 评审记录 | * @return 评审记录 | ||||
* @author WendyYang | * @author WendyYang | ||||
**/ | **/ | ||||
List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId); | |||||
List<ExpertReview> listByProjectIdAndExpertId(Long projectId, Long expertId, Long meetingId); | |||||
/** | /** | ||||
* 获取最终评审结果 | * 获取最终评审结果 | ||||
@@ -25,10 +25,11 @@ import java.util.Map; | |||||
public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, ExpertReview> implements IExpertReviewService { | public class ExpertReviewServiceImpl extends ServiceImpl<ExpertReviewMapper, ExpertReview> implements IExpertReviewService { | ||||
@Override | @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); | LambdaQueryWrapper<ExpertReview> query = Wrappers.lambdaQuery(ExpertReview.class); | ||||
query.eq(ExpertReview::getProjectId, projectId); | query.eq(ExpertReview::getProjectId, projectId); | ||||
query.eq(ExpertReview::getCreateBy, expertId); | query.eq(ExpertReview::getCreateBy, expertId); | ||||
query.eq(ExpertReview::getMeetingId, meetingId); | |||||
query.orderByAsc(ExpertReview::getCreateOn); | query.orderByAsc(ExpertReview::getCreateOn); | ||||
return list(query); | return list(query); | ||||
} | } | ||||
@@ -36,6 +36,8 @@ public class MeetingDetailBasicVO { | |||||
@ApiModelProperty("会议类型名称") | @ApiModelProperty("会议类型名称") | ||||
private String typeName; | private String typeName; | ||||
private String regionCode; | |||||
@ApiModelProperty("会议类型代码") | @ApiModelProperty("会议类型代码") | ||||
private String meetingType; | private String meetingType; | ||||
@@ -410,6 +410,7 @@ public class MeetingManage { | |||||
Assert.notNull(meeting, "会议不存在"); | Assert.notNull(meeting, "会议不存在"); | ||||
MeetingDetailBasicVO detail = MeetingDetailBasicVO.builder() | MeetingDetailBasicVO detail = MeetingDetailBasicVO.builder() | ||||
.meetingId(meeting.getId()) | .meetingId(meeting.getId()) | ||||
.regionCode(meeting.getRegionCode()) | |||||
.meetingName(meeting.getName()) | .meetingName(meeting.getName()) | ||||
.meetingType(meeting.getType()) | .meetingType(meeting.getType()) | ||||
.meetingAddress(meeting.getMeetingAddress()) | .meetingAddress(meeting.getMeetingAddress()) | ||||