Przeglądaj źródła

加入review为空判断

wangliang 2 lat temu
rodzic
commit
8252880d78

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java

@@ -453,7 +453,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         }
 
         // 不需要审核,直接更新,否则加入待审核列表(状态为不需要审核的或者为管理员身份的都不重新走审核流程)
-        if (examTask.getReview() || !sysUserService.isAdminDataAuth(requestUser.getId())) {
+        if ((Objects.nonNull(examTask.getReview()) && examTask.getReview()) || !sysUserService.isAdminDataAuth(requestUser.getId())) {
             // 发起新流程
             Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
                     examTask,

+ 10 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -436,7 +436,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             examTask.setTeachingRoomId(teachingRoomId);
             if (examTask.getUserId() == null) {
                 examTask.setStatus(ExamStatusEnum.DRAFT);
-            } else if (examTask.getReview()) {
+            } else if (Objects.nonNull(examTask.getReview()) && examTask.getReview()) {
                 examTask.setStatus(ExamStatusEnum.STAGE);
                 Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
                         examTask,
@@ -447,7 +447,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
                 map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.NEW);
                 tfFlowJoinService.saveOrUpdate(map);
-            } else if (!examTask.getReview()) {
+            } else if (Objects.nonNull(examTask.getReview()) && !examTask.getReview()) {
                 examTask.setStatus(ExamStatusEnum.STAGE);
             }
             this.save(examTask);
@@ -760,7 +760,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }
         this.saveBatch(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(),
                         examTask,
                         TFCustomTypeEnum.ELECTRON_FLOW,
@@ -785,7 +785,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         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);
         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);
             } else {
                 record.setApproveFormStatus(false);
@@ -937,12 +937,12 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }
         examTaskDetail.setUpdateId(sysUser.getId());
         examTaskDetail.setUpdateTime(System.currentTimeMillis());
-         examTaskDetailService.saveOrUpdate(examTaskDetail);
+        examTaskDetailService.saveOrUpdate(examTaskDetail);
 
         // 将题卡更新为已绑定
         String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
         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) {
             UpdateWrapper<ExamCard> cardUpdateWrapper = new UpdateWrapper<>();
             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) {
         Optional.ofNullable(examTask.getId()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("参数有误"));
         ExamTask task = this.getById(examTask.getId());
-        if (!task.getReview()) {
+        if (Objects.nonNull(task.getReview()) && !task.getReview()) {
             throw 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()));
             if (Objects.isNull(examTask.getFlowId())) {
-                if (basicPrintConfig.getReview()) {
+                if (Objects.nonNull(basicPrintConfig.getReview()) && basicPrintConfig.getReview()) {
                     Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
                             examTask,
                             TFCustomTypeEnum.ELECTRON_FLOW,
@@ -1610,7 +1610,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             examTask.setCardRuleId(basicPrintConfig.getCardRuleId());
 
             if (Objects.isNull(examTask.getFlowId())) {
-                if (basicPrintConfig.getReview()) {
+                if (Objects.nonNull(basicPrintConfig.getReview()) && basicPrintConfig.getReview()) {
                     Map<String, Object> map = SystemConstant.buildFlowVar(examTask.getId(),
                             examTask,
                             TFCustomTypeEnum.ELECTRON_FLOW,
@@ -1639,7 +1639,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             // 将题卡更新为已绑定
             String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
             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) {
                 UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
                 updateWrapper.lambda().set(ExamCard::getUsed, true).eq(ExamCard::getId, cardId);

+ 4 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -363,7 +363,7 @@ public class ExamTaskController {
     public Result taskApplySave(@RequestBody ExamTaskDetail examTaskDetail) throws IOException {
         boolean isSuccess = examTaskService.saveExamTaskDetail(examTaskDetail);
         ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
-        if (examTaskDetail.getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && !examTask.getReview()) {
+        if (examTaskDetail.getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && (Objects.nonNull(examTask.getReview()) && !examTask.getReview())) {
             // 校验是否可以提交打印状态
             printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
         }
@@ -636,7 +636,7 @@ public class ExamTaskController {
         boolean isSuccess = examTaskDetailService.paperUpdate(examTaskDetail);
         if (isSuccess) {
             ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
-            if (examTask.getReview()) {
+            if (Objects.nonNull(examTask.getReview()) && examTask.getReview()) {
                 // 发送短信
                 basicMessageService.sendNoticeTaskAuditCreateOrReview(examTask, MessageEnum.NOTICE_OF_AUDIT_REVIEW);
             } else {
@@ -706,7 +706,7 @@ public class ExamTaskController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.ADD)
     public Result submitTaskApply(@RequestBody ExamTaskApplyTemp examTaskApplyTemp) throws IOException {
         ExamTask examTask = examTaskService.submitTaskApply(examTaskApplyTemp);
-        if (!examTask.getReview()) {
+        if (Objects.nonNull(examTask.getReview()) && !examTask.getReview()) {
             // 校验是否可以提交打印状态
             printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
         }
@@ -724,7 +724,7 @@ public class ExamTaskController {
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.ADD)
     public Result saveTaskApply(@RequestBody ExamTaskApplyParam examTaskApplyParam) throws IOException {
         ExamTask examTask = examTaskService.saveExamTaskAndExamTaskDetail(examTaskApplyParam);
-        if (examTaskApplyParam.getExamTaskDetail().getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && !examTask.getReview()) {
+        if (examTaskApplyParam.getExamTaskDetail().getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && (Objects.nonNull(examTask.getReview()) && !examTask.getReview())) {
             // 校验是否可以提交打印状态
             printCommonService.checkData(examTask.getSchoolId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
         }