Browse Source

3.2.7 bug修改

xiaofei 1 year ago
parent
commit
d27724858a

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java

@@ -86,10 +86,10 @@ public interface ExamTaskService extends IService<ExamTask> {
     /**
     /**
      * 根据考务-考场检验该考场下的所有命题任务是否已经完成,全部完成则生成pdf
      * 根据考务-考场检验该考场下的所有命题任务是否已经完成,全部完成则生成pdf
      *
      *
-     * @param examDetailId 考务考场id
-     * @param user         用户id
+     * @param examDetailIdList 考务考场ids
+     * @param user             用户id
      */
      */
-    void checkDataByExamination(Long printPlanId, Long examDetailId, SysUser user) throws IOException;
+    void checkDataByExamination(Long printPlanId, List<Long> examDetailIdList, SysUser user) throws IOException;
 
 
     /**
     /**
      * 根据命题任务id从('exam_task_detail'表和'exam_task_paper_log'表查找审核样品信息)
      * 根据命题任务id从('exam_task_detail'表和'exam_task_paper_log'表查找审核样品信息)

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

@@ -704,6 +704,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             ExamStudent examStudent = new ExamStudent();
             ExamStudent examStudent = new ExamStudent();
             examStudent.setId(SystemConstant.getDbUuid());
             examStudent.setId(SystemConstant.getDbUuid());
             examStudent.setSchoolId(schoolId);
             examStudent.setSchoolId(schoolId);
+            examStudent.setOrgId(sysUser.getOrgId());
             examStudent.setExamId(examId);
             examStudent.setExamId(examId);
             examStudent.setExamDetailCourseId(examDetailCourseId);
             examStudent.setExamDetailCourseId(examDetailCourseId);
             examStudent.setPaperNumber(paperNumber);
             examStudent.setPaperNumber(paperNumber);

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

@@ -471,7 +471,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
         List<GroupInfo> groupInfo = JSON.parseArray(jsonObject.getString("groupInfo"), GroupInfo.class);
         List<GroupInfo> groupInfo = JSON.parseArray(jsonObject.getString("groupInfo"), GroupInfo.class);
         evaluationParameters.setGroupInfo(groupInfo);
         evaluationParameters.setGroupInfo(groupInfo);
 
 
-        Boolean openClassReading = jsonObject.getBoolean("openClassReading");
+        Boolean openClassReading = jsonObject.containsKey("openClassReading") && jsonObject.getBoolean("openClassReading");
         List<ClassMarker> classInfo = openClassReading ? JSON.parseArray(jsonObject.getString("classInfo"), ClassMarker.class) : null;
         List<ClassMarker> classInfo = openClassReading ? JSON.parseArray(jsonObject.getString("classInfo"), ClassMarker.class) : null;
         evaluationParameters.setClassInfo(classInfo);
         evaluationParameters.setClassInfo(classInfo);
 
 

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

@@ -20,6 +20,7 @@ import com.qmth.teachcloud.common.bean.result.TbTaskDetailResult;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.SysOrg;
 import com.qmth.teachcloud.common.entity.SysOrg;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.entity.TBTask;
 import com.qmth.teachcloud.common.enums.*;
 import com.qmth.teachcloud.common.enums.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.util.RedisUtil;
 import com.qmth.teachcloud.common.util.RedisUtil;
@@ -72,6 +73,9 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     @Resource
     @Resource
     TBTaskService tbTaskService;
     TBTaskService tbTaskService;
 
 
+    @Resource
+    TBSyncTaskService tbSyncTaskService;
+
     @Resource
     @Resource
     TeachcloudCommonService teachcloudCommonService;
     TeachcloudCommonService teachcloudCommonService;
 
 
@@ -105,6 +109,9 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     @Resource
     @Resource
     ExamTaskSyncService examTaskSyncService;
     ExamTaskSyncService examTaskSyncService;
 
 
+    @Resource
+    ExamPaperStructureService examPaperStructureService;
+
     @Transactional
     @Transactional
     @Override
     @Override
     public boolean enable(ExamTaskDetail examTaskDetail) {
     public boolean enable(ExamTaskDetail examTaskDetail) {
@@ -644,6 +651,38 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
                 .eq(ExamTaskSync::getExamId, examTask.getExamId())
                 .eq(ExamTaskSync::getExamId, examTask.getExamId())
                 .eq(ExamTaskSync::getPaperNumber, paperNumber);
                 .eq(ExamTaskSync::getPaperNumber, paperNumber);
         examTaskSyncService.update(examTaskSyncUpdateWrapper);
         examTaskSyncService.update(examTaskSyncUpdateWrapper);
+
+        // 任务数据改为作废
+        UpdateWrapper<TBTask> tbTaskUpdateWrapper = new UpdateWrapper<>();
+        tbTaskUpdateWrapper.lambda().set(TBTask::getPaperNumber, paperNumberCancel)
+                .eq(TBTask::getSchoolId, examTask.getSchoolId())
+                .eq(TBTask::getExamId, examTask.getExamId())
+                .eq(TBTask::getPaperNumber, paperNumber);
+        tbTaskService.update(tbTaskUpdateWrapper);
+
+        // 考生表数据改为作废
+        UpdateWrapper<ExamStudent> examStudentUpdateWrapper = new UpdateWrapper<>();
+        examStudentUpdateWrapper.lambda().set(ExamStudent::getPaperNumber, paperNumberCancel)
+                .eq(ExamStudent::getSchoolId, examTask.getSchoolId())
+                .eq(ExamStudent::getExamId, examTask.getExamId())
+                .eq(ExamStudent::getPaperNumber, paperNumber);
+        examStudentService.update(examStudentUpdateWrapper);
+
+        // 同步表数据改为作废
+        UpdateWrapper<TBSyncTask> tbSyncTaskUpdateWrapper = new UpdateWrapper<>();
+        tbSyncTaskUpdateWrapper.lambda().set(TBSyncTask::getPaperNumber, paperNumberCancel)
+                .eq(TBSyncTask::getSchoolId, examTask.getSchoolId())
+                .eq(TBSyncTask::getExamId, examTask.getExamId())
+                .eq(TBSyncTask::getPaperNumber, paperNumber);
+        tbSyncTaskService.update(tbSyncTaskUpdateWrapper);
+
+        // 评卷参数表改为作废
+        UpdateWrapper<ExamPaperStructure> examPaperStructureUpdateWrapper = new UpdateWrapper<>();
+        examPaperStructureUpdateWrapper.lambda().set(ExamPaperStructure::getPaperNumber, paperNumberCancel)
+                .eq(ExamPaperStructure::getSchoolId, examTask.getSchoolId())
+                .eq(ExamPaperStructure::getExamId, examTask.getExamId())
+                .eq(ExamPaperStructure::getPaperNumber, paperNumber);
+        examPaperStructureService.update(examPaperStructureUpdateWrapper);
         return true;
         return true;
     }
     }
 
 

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

@@ -1053,40 +1053,45 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
     }
 
 
     @Override
     @Override
-    public void checkDataByExamination(Long printPlanId, Long examDetailId, SysUser user) {
-        StringJoiner stringJoiner = new StringJoiner("\r\n");
+    public void checkDataByExamination(Long printPlanId, List<Long> examDetailIdList, SysUser user) {
+        Set<String> stringSet = new HashSet<>();
         ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
         ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
-        ExamDetail examDetail = examDetailService.getById(examDetailId);
-        if (Objects.isNull(examDetail)) {
-            stringJoiner.add(String.format("印刷计划[%s]没有考场ID[%s]的数据", examPrintPlan.getName(), examDetailId));
-        }
-        List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(new QueryWrapper<ExamDetailCourse>().lambda()
-                .eq(ExamDetailCourse::getSchoolId, examDetail.getSchoolId())
-                .eq(ExamDetailCourse::getExamDetailId, examDetailId));
-        if (CollectionUtils.isEmpty(examDetailCourseList)) {
-            stringJoiner.add(String.format("印刷计划[%s]没有考点[%s]、考场[%s]的课程数据", examPrintPlan.getName(), examDetail.getExamPlace(), examDetail.getExamRoom()));
-        }
+        for (Long examDetailId : examDetailIdList) {
+            ExamDetail examDetail = examDetailService.getById(examDetailId);
+            if (Objects.isNull(examDetail)) {
+                stringSet.add(String.format("印刷计划[%s]没有考场ID[%s]的数据", examPrintPlan.getName(), examDetailId));
+            }
+            List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(new QueryWrapper<ExamDetailCourse>().lambda()
+                    .eq(ExamDetailCourse::getSchoolId, examDetail.getSchoolId())
+                    .eq(ExamDetailCourse::getExamDetailId, examDetailId));
+            if (CollectionUtils.isEmpty(examDetailCourseList)) {
+                stringSet.add(String.format("印刷计划[%s]没有考点[%s]、考场[%s]的课程数据", examPrintPlan.getName(), examDetail.getExamPlace(), examDetail.getExamRoom()));
+            }
 
 
-        for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
-            String courseCode = examDetailCourse.getCourseCode();
-            String courseName = examDetailCourse.getCourseName();
-            String paperNumber = examDetailCourse.getPaperNumber();
-            Long schoolId = examDetailCourse.getSchoolId();
+            for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
+                String courseCode = examDetailCourse.getCourseCode();
+                String courseName = examDetailCourse.getCourseName();
+                String paperNumber = examDetailCourse.getPaperNumber();
+                Long schoolId = examDetailCourse.getSchoolId();
 
 
-            List<ExamTask> examTaskList = examTaskMapper.findExamTaskByFlowStatus(schoolId, examPrintPlan.getExamId(), courseCode, paperNumber, FlowStatusEnum.FINISH.name());
-            if (CollectionUtils.isEmpty(examTaskList)) {
-                stringJoiner.add(String.format("课程[%s(%s)],试卷编号[%s]的任务未创建或者未审核通过", courseName, courseCode, paperNumber));
+                List<ExamTask> examTaskList = examTaskMapper.findExamTaskByFlowStatus(schoolId, examPrintPlan.getExamId(), courseCode, paperNumber, FlowStatusEnum.FINISH.name());
+                if (CollectionUtils.isEmpty(examTaskList)) {
+                    stringSet.add(String.format("课程[%s(%s)],试卷编号[%s]的任务未创建或者未审核通过", courseName, courseCode, paperNumber));
+                }
             }
             }
         }
         }
 
 
         // 有异常抛出
         // 有异常抛出
-        if (stringJoiner.length() > 0) {
-            throw ExceptionResultEnum.ERROR.exception(stringJoiner.toString());
+        if (!CollectionUtils.isEmpty(stringSet)) {
+            throw ExceptionResultEnum.ERROR.exception(String.join(";\r\n", stringSet));
+        }
+
+        for (Long examDetailId : examDetailIdList) {
+            TbTaskDetailResult tbTaskDetailResult = examDetailCourseService.getByExamDetailId(examDetailId);
+            Map<String, Object> map = tbTaskService.saveTask(tbTaskDetailResult, TaskTypeEnum.CREATE_PDF, printPlanId, user, examDetailId);
+            MqDto mqDto = new MqDto(MqTagEnum.PDF.getCode(), map, String.valueOf(map.get(SystemConstant.TB_TASK_ID)));
+            redisUtil.sendMessage(mqDto.getTopic(), mqDto);
         }
         }
-        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);
     }
     }
 
 
     @Override
     @Override

+ 8 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExaminationImportTemplateService.java

@@ -88,6 +88,12 @@ public class AsyncExaminationImportTemplateService extends AsyncImportTaskTemple
                     // 生成excel
                     // 生成excel
                     this.createLocalErrorExcel(examinationImportDtoList, fieldsDtoList, tbTask);
                     this.createLocalErrorExcel(examinationImportDtoList, fieldsDtoList, tbTask);
                 }
                 }
+
+                // 错误信息抛出去
+                List<String> errorList = (List<String>) result.get("errorList");
+                if (!CollectionUtils.isEmpty(errorList)) {
+                    throw ExceptionResultEnum.ERROR.exception(String.join(";\r\n", errorList));
+                }
             }
             }
 
 
             // 检测是否去生成pdf
             // 检测是否去生成pdf
@@ -97,9 +103,8 @@ public class AsyncExaminationImportTemplateService extends AsyncImportTaskTemple
             examDetailIdList = (List<Long>) map.get("examDetailIdList");
             examDetailIdList = (List<Long>) map.get("examDetailIdList");
             // 按照考场检验命题任务是否全部完成,完成生成pdf
             // 按照考场检验命题任务是否全部完成,完成生成pdf
             SysUser user = (SysUser) map.get(SystemConstant.USER);
             SysUser user = (SysUser) map.get(SystemConstant.USER);
-            for (Long examDetailId : examDetailIdList) {
-                examTaskService.checkDataByExamination(tbTask.getPrintPlanId(), examDetailId, user);
-            }
+
+            examTaskService.checkDataByExamination(tbTask.getPrintPlanId(), examDetailIdList, user);
 
 
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, Long.valueOf(String.valueOf(result.get("dataCount"))), FINISH_ERROR_SIZE));
             stringJoinerSummary.add(MessageFormat.format("{0}{1}{2}{3}", DateUtil.format(new Date(), SystemConstant.DEFAULT_DATE_PATTERN), FINISH_TITLE, Long.valueOf(String.valueOf(result.get("dataCount"))), FINISH_ERROR_SIZE));
             tbTask.setResult(TaskResultEnum.SUCCESS);
             tbTask.setResult(TaskResultEnum.SUCCESS);

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

@@ -501,10 +501,10 @@ public class TaskLogicServiceImpl implements TaskLogicService {
     public Map<String, Object> executeCreatePdfLogic(Map<String, Object> map) {
     public Map<String, Object> executeCreatePdfLogic(Map<String, Object> map) {
         List<BasicAttachment> basicAttachmentList = null;
         List<BasicAttachment> basicAttachmentList = null;
         List<File> fileTempList = new ArrayList<>();
         List<File> fileTempList = new ArrayList<>();
+        TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
+        SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
+        Long examDetailId = tbTask.getEntityId();
         try {
         try {
-            TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
-            SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
-            Long examDetailId = tbTask.getEntityId();
             String paperTypeParam = Objects.nonNull(map.get("paperType")) ? (String) map.get("paperType") : null;
             String paperTypeParam = Objects.nonNull(map.get("paperType")) ? (String) map.get("paperType") : null;
 
 
             //查询printPlan
             //查询printPlan
@@ -526,58 +526,56 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 throw ExceptionResultEnum.EXAM_DETAIL_IS_NULL.exception();
                 throw ExceptionResultEnum.EXAM_DETAIL_IS_NULL.exception();
             }
             }
             Set<Long> attachmentIds = new HashSet<>();
             Set<Long> attachmentIds = new HashSet<>();
-            for (ExamDetail examDetail : examDetailList) {
-                tbTask.setObjName(examDetail.getExamRoom() + SystemConstant.HYPHEN + examDetail.getExamPlace());
-                //查询examDetailCourse
-                QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
-                examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getExamDetailId, examDetail.getId());
-                List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(examDetailCourseQueryWrapper);
-
-                // 考场内没有任务课程数据,直接跳过
-                if (CollectionUtils.isEmpty(examDetailCourseList)) {
-                    continue;
-                }
-                List<PdfDto> variablePdfList = new ArrayList<>();//变量印品(签到表、卷袋贴)
-                List<PdfDto> ordinaryPdfList = new ArrayList<>();//普通印品(登记表)
-                List<PdfDto> paperPdfList = new ArrayList<>();//所有试卷
-                List<PdfDto> examStudentPdfList = new ArrayList<>();//所有题卡
-                List<PdfDto> backupPaperPdfList = new ArrayList<>();//备份试卷
-                List<PdfDto> backupCardPdfList = new ArrayList<>();//备份题卡
-
-                //创建pdf核心逻辑
-                basicAttachmentList = createPdfCoreLogic(examDetailCourseList,
-                        examPrintPlan,
-                        examDetail,
-                        sysUser,
-                        paperTypeParam,
-                        basicAttachmentList,
-                        attachmentIds,
-                        fileTempList,
-                        backupPaperPdfList,
-                        backupCardPdfList,
-                        paperPdfList,
-                        examStudentPdfList);
-
-                createA4File(examPrintPlan, examDetail, basicSchool, examDetailCourseList, fileTempList, ordinaryPdfList, variablePdfList);
-
-                //合并A3(试卷+题卡+备用试卷+备用题卡)
+            ExamDetail examDetail = examDetailList.get(0);
+
+            tbTask.setObjName(examDetail.getExamRoom() + SystemConstant.HYPHEN + examDetail.getExamPlace());
+            //查询examDetailCourse
+            QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
+            examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getExamDetailId, examDetail.getId());
+            List<ExamDetailCourse> examDetailCourseList = examDetailCourseService.list(examDetailCourseQueryWrapper);
+
+
+            List<PdfDto> variablePdfList = new ArrayList<>();//变量印品(签到表、卷袋贴)
+            List<PdfDto> ordinaryPdfList = new ArrayList<>();//普通印品(登记表)
+            List<PdfDto> paperPdfList = new ArrayList<>();//所有试卷
+            List<PdfDto> examStudentPdfList = new ArrayList<>();//所有题卡
+            List<PdfDto> backupPaperPdfList = new ArrayList<>();//备份试卷
+            List<PdfDto> backupCardPdfList = new ArrayList<>();//备份题卡
+
+            //创建pdf核心逻辑
+            basicAttachmentList = createPdfCoreLogic(examDetailCourseList,
+                    examPrintPlan,
+                    examDetail,
+                    sysUser,
+                    paperTypeParam,
+                    basicAttachmentList,
+                    attachmentIds,
+                    fileTempList,
+                    backupPaperPdfList,
+                    backupCardPdfList,
+                    paperPdfList,
+                    examStudentPdfList);
+
+            createA4File(examPrintPlan, examDetail, basicSchool, examDetailCourseList, fileTempList, ordinaryPdfList, variablePdfList);
+
+            //合并A3(试卷+题卡+备用试卷+备用题卡)
 //                String dirNameA3 = createPdfUtil.mergeA3Pdf(paperPdfList, examStudentPdfList, backupPaperPdfList, backupCardPdfList);
 //                String dirNameA3 = createPdfUtil.mergeA3Pdf(paperPdfList, examStudentPdfList, backupPaperPdfList, backupCardPdfList);
-                //合并(试卷+备用试卷)
-                String dirNamePaper = createPdfUtil.mergeA3Pdf(fileTempList, paperPdfList, backupPaperPdfList);
-                //合并A4(签到表+卷袋贴+登记表)
-                String dirNameA4 = createPdfUtil.mergeA4Pdf(fileTempList, variablePdfList, ordinaryPdfList);
-                //合并A3(题卡+备用题卡)
-                String dirNameCardA3 = createPdfUtil.mergeA3Pdf(fileTempList, examStudentPdfList, backupCardPdfList);
-
-                BasicAttachment attachment = createPdfUtil.mergePdfSaveDb(dirNamePaper, dirNameCardA3, tbTask, sysUser.getId(), examDetail, basicPrintConfig, fileTempList);
-                if (basicAttachmentList != null) {
-                    basicAttachmentList.add(attachment);
-                }
+            //合并(试卷+备用试卷)
+            String dirNamePaper = createPdfUtil.mergeA3Pdf(fileTempList, paperPdfList, backupPaperPdfList);
+            //合并A4(签到表+卷袋贴+登记表)
+            String dirNameA4 = createPdfUtil.mergeA4Pdf(fileTempList, variablePdfList, ordinaryPdfList);
+            //合并A3(题卡+备用题卡)
+            String dirNameCardA3 = createPdfUtil.mergeA3Pdf(fileTempList, examStudentPdfList, backupCardPdfList);
 
 
-                // 保存任务ID,方便后面重新生成
-                examDetail.setTaskId(tbTask.getId());
-                examDetailService.updateById(examDetail);
+            BasicAttachment attachment = createPdfUtil.mergePdfSaveDb(dirNamePaper, dirNameCardA3, tbTask, sysUser.getId(), examDetail, basicPrintConfig, fileTempList);
+            if (basicAttachmentList != null) {
+                basicAttachmentList.add(attachment);
             }
             }
+
+            // 保存任务ID,方便后面重新生成
+            examDetail.setTaskId(tbTask.getId());
+            examDetailService.updateById(examDetail);
+
             updateExamPrintPlan(basicPrintConfig, examPrintPlan);
             updateExamPrintPlan(basicPrintConfig, examPrintPlan);
             map.computeIfAbsent("size", v -> examDetailList.size());
             map.computeIfAbsent("size", v -> examDetailList.size());
         } catch (Exception e) {
         } catch (Exception e) {
@@ -585,6 +583,11 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             if (Objects.nonNull(dictionaryConfig.sysDomain()) && dictionaryConfig.sysDomain().isOss()) {
             if (Objects.nonNull(dictionaryConfig.sysDomain()) && dictionaryConfig.sysDomain().isOss()) {
                 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);
             if (e instanceof ApiException) {
             if (e instanceof ApiException) {
                 ResultUtil.error((ApiException) e, e.getMessage());
                 ResultUtil.error((ApiException) e, e.getMessage());
             } else {
             } else {
@@ -894,6 +897,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         if (!CollectionUtils.isEmpty(errorList)) {
         if (!CollectionUtils.isEmpty(errorList)) {
             // 优先处理excel每个独立行的数据异常
             // 优先处理excel每个独立行的数据异常
             map.put(SystemConstant.ERROR_DATA_LIST, examinationImportDtoList);
             map.put(SystemConstant.ERROR_DATA_LIST, examinationImportDtoList);
+            map.put("errorList", errorList);
             map.put("fieldsDtoList", fieldsDtoList);
             map.put("fieldsDtoList", fieldsDtoList);
             return map;
             return map;
         }
         }
@@ -1469,7 +1473,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
             map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
             map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
             map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
             return finalExcelList;
             return finalExcelList;
-        },2);
+        }, 2);
         return basicStudentService.executeBasicStudentImportLogic(finalList, map);
         return basicStudentService.executeBasicStudentImportLogic(finalList, map);
     }
     }
 
 
@@ -1603,7 +1607,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(excelErrorTemp));
                 throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(excelErrorTemp));
             }
             }
             return finalExcelList;
             return finalExcelList;
-        },2);
+        }, 2);
         return basicClazzService.executeBasicClazzImportLogic(finalList, map);
         return basicClazzService.executeBasicClazzImportLogic(finalList, map);
     }
     }
 
 
@@ -1680,7 +1684,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             tcStatisticsService.importJoinData(tcStatisticsImportTempList);
             tcStatisticsService.importJoinData(tcStatisticsImportTempList);
             tcStatisticsTempService.removeByIds(tcStatisticsImportTempList.stream().map(BaseEntity::getId).collect(Collectors.toSet()));
             tcStatisticsTempService.removeByIds(tcStatisticsImportTempList.stream().map(BaseEntity::getId).collect(Collectors.toSet()));
             return finalExcelList;
             return finalExcelList;
-        },2);
+        }, 2);
         return map;
         return map;
     }
     }
 
 

+ 2 - 0
distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql

@@ -300,3 +300,5 @@ ADD COLUMN `exam_id` BIGINT(20) NULL COMMENT '考试' AFTER `semester_id`,
 ADD COLUMN `course_code` VARCHAR(50) NULL COMMENT '课程代码' AFTER `exam_id`,
 ADD COLUMN `course_code` VARCHAR(50) NULL COMMENT '课程代码' AFTER `exam_id`,
 ADD COLUMN `course_name` VARCHAR(100) NULL COMMENT '课程名称' AFTER `course_code`,
 ADD COLUMN `course_name` VARCHAR(100) NULL COMMENT '课程名称' AFTER `course_code`,
 ADD COLUMN `paper_number` VARCHAR(45) NULL COMMENT '试卷编号' AFTER `course_name`;
 ADD COLUMN `paper_number` VARCHAR(45) NULL COMMENT '试卷编号' AFTER `course_name`;
+
+DELETE FROM `sys_privilege` WHERE (`id` = '234');

+ 3 - 1
distributed-print-business/src/main/resources/db/upgrade/3.2.7.sql

@@ -205,4 +205,6 @@ ALTER TABLE `t_b_task`
 ADD COLUMN `exam_id` BIGINT(20) NULL COMMENT '考试' AFTER `semester_id`,
 ADD COLUMN `exam_id` BIGINT(20) NULL COMMENT '考试' AFTER `semester_id`,
 ADD COLUMN `course_code` VARCHAR(50) NULL COMMENT '课程代码' AFTER `exam_id`,
 ADD COLUMN `course_code` VARCHAR(50) NULL COMMENT '课程代码' AFTER `exam_id`,
 ADD COLUMN `course_name` VARCHAR(100) NULL COMMENT '课程名称' AFTER `course_code`,
 ADD COLUMN `course_name` VARCHAR(100) NULL COMMENT '课程名称' AFTER `course_code`,
-ADD COLUMN `paper_number` VARCHAR(45) NULL COMMENT '试卷编号' AFTER `course_name`;
+ADD COLUMN `paper_number` VARCHAR(45) NULL COMMENT '试卷编号' AFTER `course_name`;
+
+DELETE FROM `sys_privilege` WHERE (`id` = '234');

+ 1 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -856,6 +856,7 @@ public class SysController {
         //注意getResource("")里面是空字符串
         //注意getResource("")里面是空字符串
         String path = this.getClass().getClassLoader().getResource("").getPath();
         String path = this.getClass().getClassLoader().getResource("").getPath();
         File file = new File(path + File.separator + "temps", importTemplateEnum.getTemplateName());
         File file = new File(path + File.separator + "temps", importTemplateEnum.getTemplateName());
+        log.info("模板下载路径:{}", file.getPath());
         if (!file.exists()) {
         if (!file.exists()) {
             throw ExceptionResultEnum.ERROR.exception("模板文件下载失败");
             throw ExceptionResultEnum.ERROR.exception("模板文件下载失败");
         }
         }

+ 9 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/result/TaskListResult.java

@@ -40,7 +40,7 @@ public class TaskListResult implements Serializable {
     @ApiModelProperty(value = "课程代码")
     @ApiModelProperty(value = "课程代码")
     String courseCode;
     String courseCode;
 
 
-    @ApiModelProperty(value = "课程代码")
+    @ApiModelProperty(value = "课程名称")
     String courseName;
     String courseName;
 
 
     @ApiModelProperty(value = "试卷编号")
     @ApiModelProperty(value = "试卷编号")
@@ -137,6 +137,14 @@ public class TaskListResult implements Serializable {
         this.courseCode = courseCode;
         this.courseCode = courseCode;
     }
     }
 
 
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
     public String getPaperNumber() {
     public String getPaperNumber() {
         return paperNumber;
         return paperNumber;
     }
     }

+ 2 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysRoleServiceImpl.java

@@ -94,6 +94,8 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
             if (role.getDefaultRole()) {
             if (role.getDefaultRole()) {
                 role.setSource(RoleSourceEnum.SYS);
                 role.setSource(RoleSourceEnum.SYS);
                 role.setInterpret("系统内置");
                 role.setInterpret("系统内置");
+            }else {
+                role.setInterpret(sysRolePrivilegeParams.getInterpret());
             }
             }
             // 内置角色学校为null
             // 内置角色学校为null
             role.setSchoolId(role.getDefaultRole() ? null : schoolId);
             role.setSchoolId(role.getDefaultRole() ? null : schoolId);