diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java index f554dc3..14c20cd 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/controller/MeetingController.java @@ -46,6 +46,13 @@ public class MeetingController { meetingManage.continueInvite(req.getMeetingId()); } + @PostMapping("/convertToAppoint") + @ApiOperation(value = "转为指定抽取") + @WebLog(value = "转为指定抽取") + public void convertToAppoint(@Valid @RequestBody MeetingIdReq req) { + meetingManage.convertToAppoint(req.getMeetingId()); + } + @PostMapping("/expertInviteByCreate") @ApiOperation(value = "新建会议-专家抽取", hidden = true) @WebLog(value = "新建会议-专家抽取") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index fd51e2b..ff2f50e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -165,6 +165,27 @@ public class MeetingManage { } @Transactional(rollbackFor = Exception.class) + public void convertToAppoint(Long meetingId) { + String key = "CONVERT_TO_APPOINT:" + meetingId; + if (!distributedLock.lock(key, RETRY_TIMES)) { + throw BizException.wrap("已进行转换,请勿重复点击"); + } + try { + Meeting meeting = meetingService.getById(meetingId); + if (!MeetingStatusEnum.NORMAL.eq(meeting.getStatus())) { + throw BizException.wrap("转换失败,请刷新后重试"); + } + expertInviteTask.cancelByMeetingId(meetingId); + LambdaUpdateWrapper meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) + .set(Meeting::getInviteType, ExpertInviteTypeEnum.APPOINT.getCode()) + .eq(Meeting::getId, meetingId); + meetingService.update(meetingUpdate); + } finally { + distributedLock.releaseLock(key); + } + } + + @Transactional(rollbackFor = Exception.class) public void expertInviteByCreate(ExpertInviteReq req) { String key = INVITED_RULE_CREATE + req.getMeetingId(); if (!distributedLock.lock(key, RETRY_TIMES)) { diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java index 83ad9e5..002ed9a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/IMeetingService.java @@ -23,6 +23,13 @@ public interface IMeetingService extends IService { **/ void stopRandomInvite(Long meetingId); + /** + * 工作台会议状态统计 + * + * @param createBy 创建人 + * @return 各状态会议统计 + * @author WendyYang + **/ Map meetingCountSummary(Long createBy); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java index 44be405..3f11b37 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java @@ -34,8 +34,7 @@ public class MeetingServiceImpl extends ServiceImpl impl @Override public Map meetingCountSummary(Long createBy) { List> meetingCountSummary = baseMapper.meetingCountSummary(createBy); - return CollUtils.listToMap(meetingCountSummary, - w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()), + return CollUtils.listToMap(meetingCountSummary, w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()), CountGroupByDTO::getTotal); }