@@ -46,6 +46,13 @@ public class MeetingController { | |||||
meetingManage.continueInvite(req.getMeetingId()); | meetingManage.continueInvite(req.getMeetingId()); | ||||
} | } | ||||
@PostMapping("/convertToAppoint") | |||||
@ApiOperation(value = "转为指定抽取") | |||||
@WebLog(value = "转为指定抽取") | |||||
public void convertToAppoint(@Valid @RequestBody MeetingIdReq req) { | |||||
meetingManage.convertToAppoint(req.getMeetingId()); | |||||
} | |||||
@PostMapping("/expertInviteByCreate") | @PostMapping("/expertInviteByCreate") | ||||
@ApiOperation(value = "新建会议-专家抽取", hidden = true) | @ApiOperation(value = "新建会议-专家抽取", hidden = true) | ||||
@WebLog(value = "新建会议-专家抽取") | @WebLog(value = "新建会议-专家抽取") | ||||
@@ -165,6 +165,27 @@ public class MeetingManage { | |||||
} | } | ||||
@Transactional(rollbackFor = Exception.class) | @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<Meeting> 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) { | public void expertInviteByCreate(ExpertInviteReq req) { | ||||
String key = INVITED_RULE_CREATE + req.getMeetingId(); | String key = INVITED_RULE_CREATE + req.getMeetingId(); | ||||
if (!distributedLock.lock(key, RETRY_TIMES)) { | if (!distributedLock.lock(key, RETRY_TIMES)) { | ||||
@@ -23,6 +23,13 @@ public interface IMeetingService extends IService<Meeting> { | |||||
**/ | **/ | ||||
void stopRandomInvite(Long meetingId); | void stopRandomInvite(Long meetingId); | ||||
/** | |||||
* 工作台会议状态统计 | |||||
* | |||||
* @param createBy 创建人 | |||||
* @return 各状态会议统计 | |||||
* @author WendyYang | |||||
**/ | |||||
Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy); | Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy); | ||||
} | } |
@@ -34,8 +34,7 @@ public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> impl | |||||
@Override | @Override | ||||
public Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy) { | public Map<MeetingStatusByDashboard, Integer> meetingCountSummary(Long createBy) { | ||||
List<CountGroupByDTO<String>> meetingCountSummary = baseMapper.meetingCountSummary(createBy); | List<CountGroupByDTO<String>> meetingCountSummary = baseMapper.meetingCountSummary(createBy); | ||||
return CollUtils.listToMap(meetingCountSummary, | |||||
w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()), | |||||
return CollUtils.listToMap(meetingCountSummary, w -> MeetingStatusByDashboard.valueOf(w.getGroupKey()), | |||||
CountGroupByDTO::getTotal); | CountGroupByDTO::getTotal); | ||||
} | } | ||||