| | |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.base.SystemCode; |
| | | import com.ycl.jxkg.context.WebContext; |
| | | import com.ycl.jxkg.domain.base.AbsVo; |
| | | import com.ycl.jxkg.domain.entity.*; |
| | | import com.ycl.jxkg.domain.exam.PaperFixQuestionDTO; |
| | | import com.ycl.jxkg.domain.exam.PaperQuestion; |
| | |
| | | entity.setStatus(ExamStatusEnum.getStatusByTime(form.getStartTime(), form.getEndTime(), null)); |
| | | // 如果修改成功发送mq消息 |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | this.sendMQ(entity, entity.getUpdateVersion() + 1); |
| | | this.sendMQ(entity, entity.getUpdateVersion()); |
| | | } |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public Result addTime(AddTimeForm form) { |
| | | if (! websocketServer.checkUserOnline(form.getUserId())) { |
| | | throw new RuntimeException("该学员不在线,无法执行该操作"); |
| | | } |
| | | WebsocketDataVO websocket = new WebsocketDataVO(); |
| | | websocket.setCommend(WebsocketCommendEnum.DELAYED.getCommend()); |
| | | BigDecimal sed = BigDecimal.valueOf(60).multiply(form.getAddTimeM()); |
| | | form.setAddTimeM(sed); |
| | | websocket.setData(form); |
| | | // 发送websocket消息 |
| | | websocketServer.sendOneMessage(form.getUserId(), JSON.toJSONString(form)); |
| | |
| | | |
| | | @Override |
| | | public Result forceSubmit(ForceSubmitForm form) { |
| | | if (! websocketServer.checkUserOnline(form.getUserId())) { |
| | | throw new RuntimeException("该学员不在线,无法执行该操作"); |
| | | } |
| | | WebsocketDataVO websocket = new WebsocketDataVO(); |
| | | websocket.setCommend(WebsocketCommendEnum.FORCE_SUBMIT.getCommend()); |
| | | websocket.setData(form); |