|
@@ -436,7 +436,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
examTask.setTeachingRoomId(teachingRoomId);
|
|
examTask.setTeachingRoomId(teachingRoomId);
|
|
if (examTask.getUserId() == null) {
|
|
if (examTask.getUserId() == null) {
|
|
examTask.setStatus(ExamStatusEnum.DRAFT);
|
|
examTask.setStatus(ExamStatusEnum.DRAFT);
|
|
- } else if (examTask.getReview()) {
|
|
|
|
|
|
+ } else if (Objects.nonNull(examTask.getReview()) && examTask.getReview()) {
|
|
examTask.setStatus(ExamStatusEnum.STAGE);
|
|
examTask.setStatus(ExamStatusEnum.STAGE);
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
examTask,
|
|
examTask,
|
|
@@ -447,7 +447,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
|
|
examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
|
|
map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.NEW);
|
|
map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.NEW);
|
|
tfFlowJoinService.saveOrUpdate(map);
|
|
tfFlowJoinService.saveOrUpdate(map);
|
|
- } else if (!examTask.getReview()) {
|
|
|
|
|
|
+ } else if (Objects.nonNull(examTask.getReview()) && !examTask.getReview()) {
|
|
examTask.setStatus(ExamStatusEnum.STAGE);
|
|
examTask.setStatus(ExamStatusEnum.STAGE);
|
|
}
|
|
}
|
|
this.save(examTask);
|
|
this.save(examTask);
|
|
@@ -760,7 +760,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
}
|
|
}
|
|
this.saveBatch(list);
|
|
this.saveBatch(list);
|
|
for (ExamTask examTask : list) {
|
|
for (ExamTask examTask : list) {
|
|
- if (examTask.getReview() && Objects.nonNull(examTask.getUserId()) && Objects.isNull(examTask.getFlowId())) {
|
|
|
|
|
|
+ if (Objects.nonNull(examTask.getReview()) && examTask.getReview() && Objects.nonNull(examTask.getUserId()) && Objects.isNull(examTask.getFlowId())) {
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
examTask,
|
|
examTask,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
@@ -785,7 +785,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, auditStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, sysUser.getId(), userName);
|
|
IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(new Page<>(pageNumber, pageSize), schoolId, semesterId, examId, auditStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, sysUser.getId(), userName);
|
|
for (ExamTaskDto record : examTaskDtoIPage.getRecords()) {
|
|
for (ExamTaskDto record : examTaskDtoIPage.getRecords()) {
|
|
- if ((record.getReview() && FlowStatusEnum.FINISH.name().equals(record.getAuditStatus()) && !ExamModelEnum.MODEL3.equals(record.getExamModel()))) {
|
|
|
|
|
|
+ if ((Objects.nonNull(record.getReview()) && record.getReview() && FlowStatusEnum.FINISH.name().equals(record.getAuditStatus()) && !ExamModelEnum.MODEL3.equals(record.getExamModel()))) {
|
|
record.setApproveFormStatus(true);
|
|
record.setApproveFormStatus(true);
|
|
} else {
|
|
} else {
|
|
record.setApproveFormStatus(false);
|
|
record.setApproveFormStatus(false);
|
|
@@ -937,12 +937,12 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
}
|
|
}
|
|
examTaskDetail.setUpdateId(sysUser.getId());
|
|
examTaskDetail.setUpdateId(sysUser.getId());
|
|
examTaskDetail.setUpdateTime(System.currentTimeMillis());
|
|
examTaskDetail.setUpdateTime(System.currentTimeMillis());
|
|
- examTaskDetailService.saveOrUpdate(examTaskDetail);
|
|
|
|
|
|
+ examTaskDetailService.saveOrUpdate(examTaskDetail);
|
|
|
|
|
|
// 将题卡更新为已绑定
|
|
// 将题卡更新为已绑定
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
List<JSONObject> paperAttachmentIdsJson = JSON.parseArray(paperAttachmentIds, JSONObject.class);
|
|
List<JSONObject> paperAttachmentIdsJson = JSON.parseArray(paperAttachmentIds, JSONObject.class);
|
|
- List<Long> cardIds = paperAttachmentIdsJson.stream().filter(m->CardTypeEnum.CUSTOM.name().equals(m.getString("cardType"))).map(m->m.getLong("cardId")).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> cardIds = paperAttachmentIdsJson.stream().filter(m -> CardTypeEnum.CUSTOM.name().equals(m.getString("cardType"))).map(m -> m.getLong("cardId")).collect(Collectors.toList());
|
|
for (Long cardId : cardIds) {
|
|
for (Long cardId : cardIds) {
|
|
UpdateWrapper<ExamCard> cardUpdateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<ExamCard> cardUpdateWrapper = new UpdateWrapper<>();
|
|
cardUpdateWrapper.lambda().set(ExamCard::getUsed, true).eq(ExamCard::getId, cardId);
|
|
cardUpdateWrapper.lambda().set(ExamCard::getUsed, true).eq(ExamCard::getId, cardId);
|
|
@@ -956,7 +956,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
public boolean status(ExamTask examTask) {
|
|
public boolean status(ExamTask examTask) {
|
|
Optional.ofNullable(examTask.getId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("参数有误"));
|
|
Optional.ofNullable(examTask.getId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("参数有误"));
|
|
ExamTask task = this.getById(examTask.getId());
|
|
ExamTask task = this.getById(examTask.getId());
|
|
- if (!task.getReview()) {
|
|
|
|
|
|
+ if (Objects.nonNull(task.getReview()) && !task.getReview()) {
|
|
throw ExceptionResultEnum.ERROR.exception("命题任务不需要审核,不能撤回");
|
|
throw ExceptionResultEnum.ERROR.exception("命题任务不需要审核,不能撤回");
|
|
}
|
|
}
|
|
Optional.ofNullable(task.getFlowId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("审核流程有误,不能撤回"));
|
|
Optional.ofNullable(task.getFlowId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("审核流程有误,不能撤回"));
|
|
@@ -1468,7 +1468,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
|
|
|
examTask.setStatus(ExamStatusEnum.valueOf(examTaskDetail.getOperateType()));
|
|
examTask.setStatus(ExamStatusEnum.valueOf(examTaskDetail.getOperateType()));
|
|
if (Objects.isNull(examTask.getFlowId())) {
|
|
if (Objects.isNull(examTask.getFlowId())) {
|
|
- if (basicPrintConfig.getReview()) {
|
|
|
|
|
|
+ if (Objects.nonNull(basicPrintConfig.getReview()) && basicPrintConfig.getReview()) {
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
examTask,
|
|
examTask,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
@@ -1610,7 +1610,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
examTask.setCardRuleId(basicPrintConfig.getCardRuleId());
|
|
examTask.setCardRuleId(basicPrintConfig.getCardRuleId());
|
|
|
|
|
|
if (Objects.isNull(examTask.getFlowId())) {
|
|
if (Objects.isNull(examTask.getFlowId())) {
|
|
- if (basicPrintConfig.getReview()) {
|
|
|
|
|
|
+ if (Objects.nonNull(basicPrintConfig.getReview()) && basicPrintConfig.getReview()) {
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
|
|
examTask,
|
|
examTask,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
TFCustomTypeEnum.ELECTRON_FLOW,
|
|
@@ -1639,7 +1639,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
// 将题卡更新为已绑定
|
|
// 将题卡更新为已绑定
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
|
|
List<JSONObject> paperAttachmentIdsJson = JSON.parseArray(paperAttachmentIds, JSONObject.class);
|
|
List<JSONObject> paperAttachmentIdsJson = JSON.parseArray(paperAttachmentIds, JSONObject.class);
|
|
- List<Long> cardIds = paperAttachmentIdsJson.stream().filter(m->CardTypeEnum.CUSTOM.name().equals(m.getString("cardType"))).map(m->m.getLong("cardId")).collect(Collectors.toList());
|
|
|
|
|
|
+ List<Long> cardIds = paperAttachmentIdsJson.stream().filter(m -> CardTypeEnum.CUSTOM.name().equals(m.getString("cardType"))).map(m -> m.getLong("cardId")).collect(Collectors.toList());
|
|
for (Long cardId : cardIds) {
|
|
for (Long cardId : cardIds) {
|
|
UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
|
|
updateWrapper.lambda().set(ExamCard::getUsed, true).eq(ExamCard::getId, cardId);
|
|
updateWrapper.lambda().set(ExamCard::getUsed, true).eq(ExamCard::getId, cardId);
|