Browse Source

3.4.2 update-1223 考务数据导入时增加课程管理数据

xiaofei 6 tháng trước cách đây
mục cha
commit
0fa030a31e

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

@@ -893,21 +893,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             examTaskDetail.setUnexposedPaperType(examTaskDetail.getPaperType());
             examTaskDetail.setExamTaskId(examTask.getId());
             examTaskDetail.insertInfo(sysUser.getId());
-            List<PaperInfoVo> filePathVoList = examTaskDetail.getPaperInfoVoList();
-            for (PaperInfoVo paperInfoVo : filePathVoList) {
-                BasicAttachment basicAttachment = basicAttachmentService.getById(paperInfoVo.getAttachmentId());
-                if (basicAttachment != null) {
-                    FilePathVo filePathVo = JSON.parseObject(basicAttachment.getPath(), FilePathVo.class);
-                    InputStream inputStream = fileUploadService.downloadFile(filePathVo.getPath(), filePathVo.getUploadType(), filePathVo.getType());
-                    List<ConvertJpgStorage> convertJpgStorageList = htmlToJpgUtil.convertPdfToJpg(Long.valueOf(paperInfoVo.getAttachmentId()), inputStream, sysUser.getId());
-                    if (convertJpgStorageList.size() > 0) {
-                        paperInfoVo.setJpgAttachmentId(JSON.toJSONString(convertJpgStorageList));
-                    } else {
-                        paperInfoVo.setJpgAttachmentId(null);
-                    }
-                }
-            }
-            examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(filePathVoList));
             examTaskDetailService.save(examTaskDetail);
 
             String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
@@ -1296,19 +1281,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 examTaskDetail.setUnexposedPaperType(examTaskDetail.getPaperType());
                 examTaskDetail.setExamTaskId(examTask.getId());
                 examTaskDetail.insertInfo(sysUser.getId());
-                List<PaperInfoVo> filePathVoList = examTaskDetail.getPaperInfoVoList();
-                for (PaperInfoVo paperInfoVo : filePathVoList) {
-                    BasicAttachment basicAttachment = basicAttachmentService.getById(paperInfoVo.getAttachmentId());
-                    FilePathVo filePathVo = JSON.parseObject(basicAttachment.getPath(), FilePathVo.class);
-                    InputStream inputStream = fileUploadService.downloadFile(filePathVo.getPath(), filePathVo.getUploadType(), filePathVo.getType());
-                    List<ConvertJpgStorage> convertJpgStorageList = htmlToJpgUtil.convertPdfToJpg(Long.valueOf(paperInfoVo.getAttachmentId()), inputStream, sysUser.getId());
-                    if (convertJpgStorageList.size() > 0) {
-                        paperInfoVo.setJpgAttachmentId(JSON.toJSONString(convertJpgStorageList));
-                    } else {
-                        paperInfoVo.setJpgAttachmentId(null);
-                    }
-                }
-                examTaskDetail.setPaperAttachmentIds(JSON.toJSONString(filePathVoList));
                 examTaskDetailService.save(examTaskDetail);
 
                 String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();

+ 7 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncExamStudentImportService.java

@@ -63,6 +63,8 @@ public class AsyncExamStudentImportService extends AsyncImportTaskTemplete {
     @Resource
     private BasicExamStudentService basicExamStudentService;
     @Resource
+    private TeachCourseService teachCourseService;
+    @Resource
     private FileUploadService fileUploadService;
 
     @Override
@@ -130,7 +132,11 @@ public class AsyncExamStudentImportService extends AsyncImportTaskTemplete {
 
                 List<BasicExamStudent> basicExamStudentList = JSON.parseArray(JSON.toJSONString(result.get(SystemConstant.DATASOURCE)), BasicExamStudent.class);
                 basicExamStudentService.saveOrUpdateBatch(basicExamStudentList);
-                SystemConstant.addSummary(stringJoinerSummary, "保存基础考生数据完成,开始保存印刷任务数据");
+                SystemConstant.addSummary(stringJoinerSummary, "保存基础考生数据完成,开始保存课程管理数据");
+
+                // 自动创建课程管理数据
+                teachCourseService.batchCreateTeachCourse(tbTask.getSchoolId(), tbTask.getExamId(), basicExamStudentList);
+                SystemConstant.addSummary(stringJoinerSummary, "保存课程管理数据完成,开始保存印刷任务数据");
 
                 ExamPrintPlan examPrintPlan = examPrintPlanService.getById(tbTask.getPrintPlanId());
                 // 组装exam_detail数据