Răsfoiți Sursa

3.3.1 update

xiaofei 1 an în urmă
părinte
comite
ee2df24891
13 a modificat fișierele cu 30 adăugiri și 93 ștergeri
  1. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/custom/listener/ProcessEventListener.java
  2. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  3. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java
  4. 1 8
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  5. 2 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  6. 4 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java
  7. 1 8
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  8. 10 29
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  9. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java
  10. 3 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java
  11. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskApplyController.java
  12. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskQueryController.java
  13. 0 15
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/activiti/custom/listener/ProcessEventListener.java

@@ -106,7 +106,7 @@ public class ProcessEventListener implements ActivitiEventListener, Serializable
                             //取命题老师ID
                             //取命题老师ID
                             SysUser sysUser = sysUserService.getById(((ExamTask) object).getUserId());
                             SysUser sysUser = sysUserService.getById(((ExamTask) object).getUserId());
                             try {
                             try {
-                                printCommonService.checkDataNew(((ExamTask) object).getSchoolId(), ((ExamTask) object).getExamId(), ((ExamTask) object).getCourseCode(), ((ExamTask) object).getPaperNumber(), sysUser);
+                                printCommonService.checkExamDataAndCreatePdfTask(((ExamTask) object).getSchoolId(), ((ExamTask) object).getExamId(), ((ExamTask) object).getCourseCode(), ((ExamTask) object).getPaperNumber(), sysUser);
                             } catch (IOException e) {
                             } catch (IOException e) {
                                 throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
                                 throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
                             }
                             }

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -157,6 +157,7 @@ public interface ExamDetailService extends IService<ExamDetail> {
     List<String> findExamRoomDatasource(String param, List<Long> printPlanId);
     List<String> findExamRoomDatasource(String param, List<Long> printPlanId);
 
 
     boolean taskSubmit(ExamDetail examDetail) throws IOException;
     boolean taskSubmit(ExamDetail examDetail) throws IOException;
+
     boolean taskFinish(ExamDetail examDetail) throws IOException;
     boolean taskFinish(ExamDetail examDetail) throws IOException;
 
 
     boolean taskCancel(Long id);
     boolean taskCancel(Long id);
@@ -243,5 +244,5 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
 
     int countMakeupUsedByExamIdAndPaperNumber(Long examId, String paperNumber);
     int countMakeupUsedByExamIdAndPaperNumber(Long examId, String paperNumber);
 
 
-    void updateStatusById(ExamDetailStatusEnum examDetailStatusEnum, Long id);
+    void updateStatusById(Long id, ExamDetailStatusEnum examDetailStatusEnum);
 }
 }

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

@@ -237,7 +237,7 @@ public interface PrintCommonService {
      * @param user
      * @param user
      * @throws IOException
      * @throws IOException
      */
      */
-    void checkDataNew(Long schoolId, Long examId, String courseCode, String paperNumber, SysUser user) throws IOException;
+    void checkExamDataAndCreatePdfTask(Long schoolId, Long examId, String courseCode, String paperNumber, SysUser user) throws IOException;
 
 
     void checkDataMakeup(Long schoolId, ExamDetail examDetail, String courseCode, String paperNumber, SysUser user);
     void checkDataMakeup(Long schoolId, ExamDetail examDetail, String courseCode, String paperNumber, SysUser user);
 
 

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

@@ -129,14 +129,7 @@ public class ClientServiceImpl implements ClientService {
             examDetailService.update(updateWrapper);
             examDetailService.update(updateWrapper);
 
 
             // 所有考场打印完成,更新印刷计划状态
             // 所有考场打印完成,更新印刷计划状态
-            QueryWrapper<ExamDetail> examDetailQueryWrapper = new QueryWrapper<>();
-            examDetailQueryWrapper.lambda().eq(ExamDetail::getPrintPlanId, examDetail.getPrintPlanId()).ne(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH);
-            int count = examDetailService.count(examDetailQueryWrapper);
-            if (count == 0) {
-                UpdateWrapper<ExamPrintPlan> examPrintPlanUpdateWrapper = new UpdateWrapper<>();
-                examPrintPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.FINISH).eq(ExamPrintPlan::getId, examDetail.getPrintPlanId());
-                examPrintPlanService.update(examPrintPlanUpdateWrapper);
-            }
+            examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.FINISH);
 
 
             // 记录机器打印数量
             // 记录机器打印数量
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();

+ 2 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -559,14 +559,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         this.update(updateWrapper);
         this.update(updateWrapper);
 
 
         //所有考场都撤回,印刷任务状态改为就绪
         //所有考场都撤回,印刷任务状态改为就绪
-        QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, detail.getPrintPlanId()).notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
-        List<ExamDetail> examDetails = this.list(queryWrapper);
-        if (examDetails.isEmpty()) {
-            UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
-            printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, detail.getPrintPlanId());
-            examPrintPlanService.update(printPlanUpdateWrapper);
-        }
+        examPrintPlanService.updateStatusById(detail.getPrintPlanId(), PrintPlanStatusEnum.READY);
 
 
         // 当关联课程所有考场都撤回,清除提当前计划下打样记录
         // 当关联课程所有考场都撤回,清除提当前计划下打样记录
         QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
         QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
@@ -1247,7 +1240,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     }
     }
 
 
     @Override
     @Override
-    public void updateStatusById(ExamDetailStatusEnum examDetailStatusEnum, Long id) {
+    public void updateStatusById(Long id, ExamDetailStatusEnum examDetailStatusEnum) {
         UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
         UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().eq(ExamDetail::getStatus, examDetailStatusEnum)
         updateWrapper.lambda().eq(ExamDetail::getStatus, examDetailStatusEnum)
                 .eq(ExamDetail::getId, id);
                 .eq(ExamDetail::getId, id);

+ 4 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -408,9 +408,11 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         lambda.eq(ExamDetail::getPrintPlanId, printPlanId);
         lambda.eq(ExamDetail::getPrintPlanId, printPlanId);
         if (PrintPlanStatusEnum.READY.equals(status)) {
         if (PrintPlanStatusEnum.READY.equals(status)) {
             lambda.notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
             lambda.notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
+        } else if (PrintPlanStatusEnum.FINISH.equals(status)) {
+            lambda.ne(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH);
         }
         }
-        List<ExamDetail> examDetails = examDetailService.list(queryWrapper);
-        if (CollectionUtils.isEmpty(examDetails)) {
+        int count = examDetailService.count(queryWrapper);
+        if (count == 0) {
             UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
             UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
             printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, status)
             printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, status)
                     .eq(ExamPrintPlan::getId, printPlanId);
                     .eq(ExamPrintPlan::getId, printPlanId);

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

@@ -141,14 +141,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
 
 
                     // 全部任务都取消,更新计划状态
                     // 全部任务都取消,更新计划状态
                     //所有考场都撤回,印刷任务状态改为就绪
                     //所有考场都撤回,印刷任务状态改为就绪
-                    QueryWrapper<ExamDetail> examDetailQueryWrapper = new QueryWrapper<>();
-                    examDetailQueryWrapper.lambda().eq(ExamDetail::getPrintPlanId, listEntry.getKey()).notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
-                    List<ExamDetail> examDetailList = examDetailService.list(examDetailQueryWrapper);
-                    if (examDetailList.isEmpty()) {
-                        UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
-                        printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, listEntry.getKey());
-                        examPrintPlanService.update(printPlanUpdateWrapper);
-                    }
+                    examPrintPlanService.updateStatusById(listEntry.getKey(), PrintPlanStatusEnum.READY);
                 }
                 }
             }
             }
         }
         }

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

@@ -1281,7 +1281,7 @@ public class PrintCommonServiceImpl implements PrintCommonService {
     }
     }
 
 
     @Override
     @Override
-    public void checkDataNew(Long schoolId, Long examId, String courseCode, String paperNumber, SysUser user) throws IOException {
+    public void checkExamDataAndCreatePdfTask(Long schoolId, Long examId, String courseCode, String paperNumber, SysUser user) {
         // 校验命题任务是否提交
         // 校验命题任务是否提交
         ExamTask examTask = examTaskService.getByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         ExamTask examTask = examTaskService.getByExamIdAndCourseCodeAndPaperNumber(examId, courseCode, paperNumber);
         BasicExam basicExam = basicExamService.getById(examTask.getExamId());
         BasicExam basicExam = basicExamService.getById(examTask.getExamId());
@@ -1311,31 +1311,20 @@ public class PrintCommonServiceImpl implements PrintCommonService {
 
 
         if (canCreatePdf) {
         if (canCreatePdf) {
             // 2.校验考务数据是否导入
             // 2.校验考务数据是否导入
-            List<ExamDetail> examDetails = examDetailService.listByCourseCodeAndPaperNumber(schoolId, examId, courseCode, paperNumber);
-            if (examDetails != null && examDetails.size() > 0) {
+            List<ExamDetail> examDetailList = examDetailService.listByCourseCodeAndPaperNumber(schoolId, examId, courseCode, paperNumber);
+            if (CollectionUtils.isNotEmpty(examDetailList)) {
                 // 3.检查examDetailId下有无其它课程
                 // 3.检查examDetailId下有无其它课程
-                for (ExamDetail examDetail : examDetails) {
+                for (ExamDetail examDetail : examDetailList) {
                     List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByExamDetailIdAndStatus(examDetail.getId());
                     List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByExamDetailIdAndStatus(examDetail.getId());
                     // 4.没有未完成的命题任务
                     // 4.没有未完成的命题任务
                     if (examDetailCourses.isEmpty()) {
                     if (examDetailCourses.isEmpty()) {
                         // 更新考场状态为初始新建状态
                         // 更新考场状态为初始新建状态
-                        UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
-                        examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.NEW).eq(ExamDetail::getId, examDetail.getId());
-                        examDetailService.update(examDetailUpdateWrapper);
+                        examDetailService.updateStatusById(examDetail.getId(), ExamDetailStatusEnum.NEW);
 
 
                         //所有考场都撤回,印刷任务状态改为就绪
                         //所有考场都撤回,印刷任务状态改为就绪
-                        QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
-                        queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, examDetail.getPrintPlanId()).notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
-                        List<ExamDetail> examDetailss = examDetailService.list(queryWrapper);
-                        if (examDetailss.isEmpty()) {
-                            UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
-                            printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, examDetail.getPrintPlanId());
-                            examPrintPlanService.update(printPlanUpdateWrapper);
-                        }
+                        examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.READY);
                         TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
                         TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
-                        TBTaskPdf tbTaskPdf = tbTaskPdfService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), user, examDetail.getId());
-//                        MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(map.get(SystemConstant.TB_TASK_ID)));
-//                        redisUtil.sendMessage(mqDto.getTopic(), mqDto);
+                        tbTaskPdfService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), user, examDetail.getId());
                     }
                     }
                 }
                 }
             }
             }
@@ -1381,18 +1370,10 @@ public class PrintCommonServiceImpl implements PrintCommonService {
 
 
         if (canCreatePdf) {
         if (canCreatePdf) {
             //所有考场都撤回,印刷任务状态改为就绪
             //所有考场都撤回,印刷任务状态改为就绪
-            QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
-            queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, examDetail.getPrintPlanId()).notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
-            List<ExamDetail> examDetailss = examDetailService.list(queryWrapper);
-            if (examDetailss.isEmpty()) {
-                UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
-                printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, examDetail.getPrintPlanId());
-                examPrintPlanService.update(printPlanUpdateWrapper);
-            }
+            examPrintPlanService.updateStatusById(examDetail.getPrintPlanId(), PrintPlanStatusEnum.READY);
+            //创建pdf生成任务
             TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
             TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetail.getId());
-            Map<String, Object> map = tbTaskService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), user, examDetail.getId());
-            MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(map.get(SystemConstant.TB_TASK_ID)));
-            redisUtil.sendMessage(mqDto.getTopic(), mqDto);
+            tbTaskPdfService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), user, examDetail.getId());
         }
         }
     }
     }
 
 

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

@@ -156,7 +156,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
             throw ExceptionResultEnum.ERROR.exception(e.getMessage());
         } finally {
         } finally {
             if (ExamDetailStatusEnum.NEW.equals(examDetailStatusEnum)) {
             if (ExamDetailStatusEnum.NEW.equals(examDetailStatusEnum)) {
-                examDetailService.updateStatusById(examDetailStatusEnum, tbTaskPdf.getId());
+                examDetailService.updateStatusById(tbTaskPdf.getId(), examDetailStatusEnum);
             }
             }
         }
         }
 
 

+ 3 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -177,15 +177,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         examDetailService.update(examDetailQueryWrapper);
         examDetailService.update(examDetailQueryWrapper);
 
 
         //所有考场都撤回,印刷任务状态改为就绪
         //所有考场都撤回,印刷任务状态改为就绪
-        QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamDetail::getPrintPlanId, tbTask.getPrintPlanId())
-                .notIn(ExamDetail::getStatus, ExamDetailStatusEnum.NEW, ExamDetailStatusEnum.READY);
-        List<ExamDetail> examDetails = examDetailService.list(queryWrapper);
-        if (CollectionUtils.isEmpty(examDetails)) {
-            UpdateWrapper<ExamPrintPlan> printPlanUpdateWrapper = new UpdateWrapper<>();
-            printPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.READY).eq(ExamPrintPlan::getId, tbTask.getPrintPlanId());
-            examPrintPlanService.update(printPlanUpdateWrapper);
-        }
+        examPrintPlanService.updateStatusById(tbTask.getPrintPlanId(), PrintPlanStatusEnum.READY);
         return map;
         return map;
     }
     }
 
 
@@ -565,10 +557,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 basicAttachmentService.batchDeleteAttachment(basicAttachmentList);
                 basicAttachmentService.batchDeleteAttachment(basicAttachmentList);
             }
             }
             // 生成失败,状态改为新建
             // 生成失败,状态改为新建
-            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.NEW)
-                    .eq(ExamDetail::getId, examDetailId);
-            examDetailService.update(updateWrapper);
+            examDetailService.updateStatusById(examDetailId, ExamDetailStatusEnum.NEW);
             if (e instanceof ApiException) {
             if (e instanceof ApiException) {
                 ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
                 ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
             } else {
             } else {
@@ -2079,7 +2068,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         Long examId = SystemConstant.convertIdToLong(String.valueOf(map.get("examId")));
         Long examId = SystemConstant.convertIdToLong(String.valueOf(map.get("examId")));
         Long schoolId = requestUser.getSchoolId();
         Long schoolId = requestUser.getSchoolId();
         BasicExam basicExam = basicExamService.getById(examId);
         BasicExam basicExam = basicExamService.getById(examId);
-        if (Objects.isNull(basicExam)){
+        if (Objects.isNull(basicExam)) {
             throw ExceptionResultEnum.ERROR.exception("考试不存在");
             throw ExceptionResultEnum.ERROR.exception("考试不存在");
         }
         }
         Long semesterId = SystemConstant.convertIdToLong(basicExam.getSemesterId());
         Long semesterId = SystemConstant.convertIdToLong(basicExam.getSemesterId());

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskApplyController.java

@@ -165,7 +165,7 @@ public class ExamTaskApplyController {
         ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
         ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
         if (examTaskDetail.getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && (Objects.nonNull(examTask.getReview()) && !examTask.getReview())) {
         if (examTaskDetail.getOperateType().equals(ExamStatusEnum.SUBMIT.name()) && (Objects.nonNull(examTask.getReview()) && !examTask.getReview())) {
             // 校验是否可以提交打印状态
             // 校验是否可以提交打印状态
-            printCommonService.checkDataNew(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
+            printCommonService.checkExamDataAndCreatePdfTask(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
         }
         }
         Boolean sendFlowMq = (Boolean) map.get(SystemConstant.SEND_FLOW_MQ);
         Boolean sendFlowMq = (Boolean) map.get(SystemConstant.SEND_FLOW_MQ);
         if (Objects.nonNull(sendFlowMq) && sendFlowMq) {
         if (Objects.nonNull(sendFlowMq) && sendFlowMq) {
@@ -205,7 +205,7 @@ public class ExamTaskApplyController {
         ExamTask examTask = (ExamTask) map.get(SystemConstant.EXAM_TASK);
         ExamTask examTask = (ExamTask) map.get(SystemConstant.EXAM_TASK);
         if (Objects.nonNull(examTask.getReview()) && !examTask.getReview()) {
         if (Objects.nonNull(examTask.getReview()) && !examTask.getReview()) {
             // 校验是否可以提交打印状态
             // 校验是否可以提交打印状态
-            printCommonService.checkDataNew(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
+            printCommonService.checkExamDataAndCreatePdfTask(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), (SysUser) ServletUtil.getRequestUser());
         }
         }
         Boolean sendFlowStartMq = (Boolean) map.get(SystemConstant.SEND_FLOW_START_MQ);
         Boolean sendFlowStartMq = (Boolean) map.get(SystemConstant.SEND_FLOW_START_MQ);
         Boolean sendFlowMq = (Boolean) map.get(SystemConstant.SEND_FLOW_MQ);
         Boolean sendFlowMq = (Boolean) map.get(SystemConstant.SEND_FLOW_MQ);

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskQueryController.java

@@ -115,7 +115,7 @@ public class ExamTaskQueryController {
             Boolean isCreate = printCommonService.checkExamDetailStatus(examTask.getSchoolId(), null, examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber());
             Boolean isCreate = printCommonService.checkExamDetailStatus(examTask.getSchoolId(), null, examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber());
             // 校验是否可以提交打印状态
             // 校验是否可以提交打印状态
             if (isCreate) {
             if (isCreate) {
-                printCommonService.checkDataNew(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
+                printCommonService.checkExamDataAndCreatePdfTask(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
             }
             }
         }
         }
         return ResultUtil.ok(isSuccess);
         return ResultUtil.ok(isSuccess);
@@ -130,7 +130,7 @@ public class ExamTaskQueryController {
     @ApiOperation(value = "卷库查询-卷库修改")
     @ApiOperation(value = "卷库查询-卷库修改")
     @RequestMapping(value = "/paper_update", method = RequestMethod.POST)
     @RequestMapping(value = "/paper_update", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
-    public Result taskPaperUpdate(@RequestBody ExamTaskDetail examTaskDetail) throws IOException {
+    public Result taskPaperUpdate(@RequestBody ExamTaskDetail examTaskDetail) {
         Map<String, Object> map = examTaskDetailService.paperUpdate(examTaskDetail);
         Map<String, Object> map = examTaskDetailService.paperUpdate(examTaskDetail);
         Boolean isSuccess = (Boolean) map.get(SystemConstant.SUCCESS);
         Boolean isSuccess = (Boolean) map.get(SystemConstant.SUCCESS);
         if (isSuccess) {
         if (isSuccess) {

+ 0 - 15
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -178,21 +178,6 @@ public class TFCustomFlowController {
         map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
         map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
         activitiService.taskApprove(map);
         activitiService.taskApprove(map);
         activitiService.sendFlowTaskApproveMsg(map);
         activitiService.sendFlowTaskApproveMsg(map);
-        /*TFFlowLog tfFlowLog = (TFFlowLog) map.get(SystemConstant.APPROVE_TF_FLOW_LOG);
-        TFFlowApprove tfFlowApprove = (TFFlowApprove) map.get(SystemConstant.APPROVE_TF_FLOW_APPROVE);
-        if (Objects.nonNull(tfFlowLog.getObjectTable())) {
-            if (Objects.equals(tfFlowLog.getObjectTable(), TFCustomTypeEnum.ELECTRON_FLOW.getTable())
-                    && tfFlowApprove.getStatus() == FlowStatusEnum.FINISH) {//如果是命题任务交卷
-                ExamTask examTask = examTaskService.getById(tfFlowLog.getObjectId());
-                //取命题老师ID
-                SysUser sysUser = sysUserService.getById(examTask.getUserId());
-                try {
-                    printCommonService.checkData(examTask.getSchoolId(), examTask.getExamId(), examTask.getCourseCode(), examTask.getPaperNumber(), sysUser);
-                } catch (IOException e) {
-                    throw ExceptionResultEnum.ERROR.exception("生成pdf失败");
-                }
-            }
-        }*/
         return ResultUtil.ok(true);
         return ResultUtil.ok(true);
     }
     }