|
@@ -1257,25 +1257,30 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
public Map<String, Object> submitTaskApply(ExamTaskApplyTemp examTaskApplyTemp) {
|
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
- Long customFlowId = examTaskApplyTemp.getCustomFlowId();
|
|
|
- Optional.ofNullable(customFlowId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程ID为空"));
|
|
|
|
|
|
- if (Objects.nonNull(examTaskApplyTemp.getVersion())) {
|
|
|
- Integer version = examTaskApplyTemp.getVersion();
|
|
|
- Optional.ofNullable(version).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程版本号为空"));
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(examTaskApplyTemp.getExamTaskContent());
|
|
|
+ // 新建命题任务
|
|
|
+ ExamTask examTask = JSONObject.parseObject(String.valueOf(jsonObject.get("examTask")), ExamTask.class);
|
|
|
+ BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examTask.getExamId());
|
|
|
|
|
|
- TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(customFlowId);
|
|
|
- Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到自定义流程数据"));
|
|
|
+ if (basicPrintConfig.getReview()) {
|
|
|
+ Long customFlowId = examTaskApplyTemp.getCustomFlowId();
|
|
|
+ Optional.ofNullable(customFlowId).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程ID为空"));
|
|
|
|
|
|
- if (tfCustomFlow.getVersion().intValue() != version.intValue()) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("自定义流程数据已发生改变,请刷新重试");
|
|
|
+ if (Objects.nonNull(examTaskApplyTemp.getVersion())) {
|
|
|
+ Integer version = examTaskApplyTemp.getVersion();
|
|
|
+ Optional.ofNullable(version).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程版本号为空"));
|
|
|
+
|
|
|
+ TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(customFlowId);
|
|
|
+ Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到自定义流程数据"));
|
|
|
+
|
|
|
+ if (tfCustomFlow.getVersion().intValue() != version.intValue()) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("自定义流程数据已发生改变,请刷新重试");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(examTaskApplyTemp.getExamTaskContent());
|
|
|
Map<String, Object> mapVar = new HashMap<>();
|
|
|
- // 新建命题任务
|
|
|
- ExamTask examTask = JSONObject.parseObject(String.valueOf(jsonObject.get("examTask")), ExamTask.class);
|
|
|
try {
|
|
|
if (StringUtils.isNotBlank(examTask.getPaperNumber())) {
|
|
|
validPaperNumberExists(schoolId, examTask);
|
|
@@ -1292,7 +1297,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
|
|
|
examTask.setSchoolId(schoolId);
|
|
|
examTask.setOrgId(basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, examTask.getCourseCode()));
|
|
|
|
|
|
- BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examTask.getExamId());
|
|
|
+
|
|
|
examTask.setReview(basicPrintConfig.getReview());
|
|
|
examTask.setUserId(sysUser.getId());
|
|
|
examTask.setStatus(ExamStatusEnum.SUBMIT);
|