|
@@ -752,11 +752,22 @@ public class MeetingManage { |
|
|
try { |
|
|
try { |
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
if (MeetingStatusEnum.CANCEL.eq(meeting.getStatus())) { |
|
|
if (MeetingStatusEnum.CANCEL.eq(meeting.getStatus())) { |
|
|
throw ReturnException.wrap("会议已取消"); |
|
|
|
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
if (meeting.getStartTime().isBefore(LocalDateTime.now())) { |
|
|
if (meeting.getStartTime().isBefore(LocalDateTime.now())) { |
|
|
throw ReturnException.wrap("会议已开始,暂时无法取消"); |
|
|
throw ReturnException.wrap("会议已开始,暂时无法取消"); |
|
|
} |
|
|
} |
|
|
|
|
|
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { |
|
|
|
|
|
// 取消项目时候重置项目状态 |
|
|
|
|
|
List<MeetingInnerProject> innerProjList = meetingInnerProjectService.listByMeetingId(meetingId); |
|
|
|
|
|
if (CollUtil.anyMatch(innerProjList, w -> w.getReviewResult() != null)) { |
|
|
|
|
|
throw ReturnException.wrap("已上传项目评审结果,会议无法取消!"); |
|
|
|
|
|
} |
|
|
|
|
|
List<Long> projectIds = CollUtils.fieldList(innerProjList, MeetingInnerProject::getProjectId); |
|
|
|
|
|
List<Project> projects = projectService.listByIds(projectIds); |
|
|
|
|
|
projects.forEach(projectStateMachineUtil::withDraw); |
|
|
|
|
|
projectService.updateBatchById(projects); |
|
|
|
|
|
} |
|
|
Wrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) |
|
|
Wrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) |
|
|
.set(Meeting::getStatus, MeetingStatusEnum.CANCEL.getCode()) |
|
|
.set(Meeting::getStatus, MeetingStatusEnum.CANCEL.getCode()) |
|
|
.eq(Meeting::getId, meetingId); |
|
|
.eq(Meeting::getId, meetingId); |
|
@@ -768,14 +779,6 @@ public class MeetingManage { |
|
|
if (!experts.isEmpty()) { |
|
|
if (!experts.isEmpty()) { |
|
|
meetingNotifyHelper.sendCancelMeetingMsg(experts, meeting); |
|
|
meetingNotifyHelper.sendCancelMeetingMsg(experts, meeting); |
|
|
} |
|
|
} |
|
|
if (Boolean.TRUE.equals(meeting.getIsInnerProject())) { |
|
|
|
|
|
// 取消项目时候重置项目状态 |
|
|
|
|
|
List<MeetingInnerProject> meetingInnerProjects = meetingInnerProjectService.listByMeetingId(meetingId); |
|
|
|
|
|
List<Long> projectIds = CollUtils.fieldList(meetingInnerProjects, MeetingInnerProject::getProjectId); |
|
|
|
|
|
List<Project> projects = projectService.listByIds(projectIds); |
|
|
|
|
|
projects.forEach(w -> w.setStatus(ProjectStatus.WITHOUT_EXPERT_REVIEW.getCode())); |
|
|
|
|
|
projectService.updateBatchById(projects); |
|
|
|
|
|
} |
|
|
|
|
|
// 将取消的会议推送给MH |
|
|
// 将取消的会议推送给MH |
|
|
mhApiClient.cancelMeetingToMh(meetingId); |
|
|
mhApiClient.cancelMeetingToMh(meetingId); |
|
|
} finally { |
|
|
} finally { |
|
@@ -1010,13 +1013,13 @@ public class MeetingManage { |
|
|
Meeting meeting = meetingService.getById(req.getMeetingId()); |
|
|
Meeting meeting = meetingService.getById(req.getMeetingId()); |
|
|
Assert.notNull(meeting, "会议不存在"); |
|
|
Assert.notNull(meeting, "会议不存在"); |
|
|
Assert.isTrue(MeetingStatusEnum.NORMAL.eq(meeting.getStatus()), "当前会议无法添加项目"); |
|
|
Assert.isTrue(MeetingStatusEnum.NORMAL.eq(meeting.getStatus()), "当前会议无法添加项目"); |
|
|
List<String> projectCodes = req.getProjectCodes(); |
|
|
|
|
|
|
|
|
List<String> projectCodes = CollUtils.convert(req.getProjectIds(), ProjectIdCodeCacheUtil::get); |
|
|
Wrapper<MeetingInnerProject> query = Wrappers.lambdaQuery(MeetingInnerProject.class) |
|
|
Wrapper<MeetingInnerProject> query = Wrappers.lambdaQuery(MeetingInnerProject.class) |
|
|
.select(MeetingInnerProject::getMeetingId, MeetingInnerProject::getProjectCode, |
|
|
.select(MeetingInnerProject::getMeetingId, MeetingInnerProject::getProjectCode, |
|
|
MeetingInnerProject::getId, MeetingInnerProject::getReviewResult) |
|
|
MeetingInnerProject::getId, MeetingInnerProject::getReviewResult) |
|
|
.in(MeetingInnerProject::getProjectCode, projectCodes); |
|
|
.in(MeetingInnerProject::getProjectCode, projectCodes); |
|
|
Collection<MeetingInnerProject> linkedProjList = BizUtils.groupFirst(meetingInnerProjectService.list(query), |
|
|
Collection<MeetingInnerProject> linkedProjList = BizUtils.groupFirst(meetingInnerProjectService.list(query), |
|
|
MeetingInnerProject::getProjectId, Comparator.comparing(MeetingInnerProject::getId).reversed()); |
|
|
|
|
|
|
|
|
MeetingInnerProject::getProjectCode, Comparator.comparing(MeetingInnerProject::getId).reversed()); |
|
|
// 移除已关联当前会议的项目 |
|
|
// 移除已关联当前会议的项目 |
|
|
projectCodes.removeIf(w -> CollUtil.anyMatch(linkedProjList, |
|
|
projectCodes.removeIf(w -> CollUtil.anyMatch(linkedProjList, |
|
|
x -> x.getProjectCode().equals(w) && x.getMeetingId().equals(meeting.getId()))); |
|
|
x -> x.getProjectCode().equals(w) && x.getMeetingId().equals(meeting.getId()))); |
|
@@ -1059,7 +1062,7 @@ public class MeetingManage { |
|
|
Meeting meeting = meetingService.getById(req.getMeetingId()); |
|
|
Meeting meeting = meetingService.getById(req.getMeetingId()); |
|
|
Assert.notNull(meeting, "会议不存在"); |
|
|
Assert.notNull(meeting, "会议不存在"); |
|
|
Assert.isTrue(MeetingStatusEnum.NORMAL.eq(meeting.getStatus()), "当前会议无法移除项目"); |
|
|
Assert.isTrue(MeetingStatusEnum.NORMAL.eq(meeting.getStatus()), "当前会议无法移除项目"); |
|
|
List<String> projectCodes = req.getProjectCodes(); |
|
|
|
|
|
|
|
|
List<String> projectCodes = CollUtils.convert(req.getProjectIds(), ProjectIdCodeCacheUtil::get); |
|
|
Wrapper<MeetingInnerProject> query = Wrappers.lambdaQuery(MeetingInnerProject.class) |
|
|
Wrapper<MeetingInnerProject> query = Wrappers.lambdaQuery(MeetingInnerProject.class) |
|
|
.select(MeetingInnerProject::getId, MeetingInnerProject::getProjectCode, MeetingInnerProject::getReviewResult) |
|
|
.select(MeetingInnerProject::getId, MeetingInnerProject::getProjectCode, MeetingInnerProject::getReviewResult) |
|
|
.in(MeetingInnerProject::getProjectCode, projectCodes) |
|
|
.in(MeetingInnerProject::getProjectCode, projectCodes) |
|
|