xiaofei 11 сар өмнө
parent
commit
dc17adb1f6
19 өөрчлөгдсөн 52 нэмэгдсэн , 1076 устгасан
  1. 0 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPaperExportDto.java
  2. 0 8
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  3. 2 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/PrintCommonService.java
  4. 9 173
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  5. 3 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  6. 0 20
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/DownloadLogicService.java
  7. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/TaskLogicService.java
  8. 3 508
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java
  9. 0 311
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java
  10. 3 0
      distributed-print/install/mysql/upgrade/3.4.0.sql
  11. 17 17
      distributed-print/src/main/java/com/qmth/distributed/print/api/TBTaskController.java
  12. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TCPaperStructController.java
  13. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java
  14. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/TBTaskMapper.java
  15. 2 2
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/TBTaskService.java
  16. 4 4
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TBTaskServiceImpl.java
  17. 2 2
      teachcloud-common/src/main/resources/mapper/TBTaskMapper.xml
  18. 1 1
      teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCFinalScoreServiceImpl.java
  19. 2 2
      teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCPaperStructServiceImpl.java

+ 0 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPaperExportDto.java

@@ -83,16 +83,6 @@ public class ExamTaskPaperExportDto implements Serializable {
         this.unexposedPaperType = examTaskDetailDto.getUnexposedPaperType();
     }
 
-    public ExamTaskPaperExportDto(String courseName, String courseCode, String paperNumber, String paperType, String exposedPaperType, String unexposedPaperType, String result) {
-        this.courseName = courseName;
-        this.courseCode = courseCode;
-        this.paperNumber = paperNumber;
-        this.paperType = paperType;
-        this.exposedPaperType = exposedPaperType;
-        this.unexposedPaperType = unexposedPaperType;
-        this.result = result;
-    }
-
     public String getExposedPaperType() {
         return exposedPaperType;
     }

+ 0 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -123,14 +123,6 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     boolean taskBatchCancel(Map data);
 
-    /**
-     * 根据考务数据Excel数据处理考务-场次表
-     *
-     * @param dataList Excel处理后的数据
-     * @param sysUser
-     */
-    List<Long> disposeExamDataByExaminationExcel(ExamPrintPlan examPrintPlan, List<ExaminationImportDto> dataList, SysUser sysUser);
-
     /**
      * 删除考务数据
      *

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

@@ -170,18 +170,17 @@ public interface PrintCommonService {
     /**
      * 成绩管理导入excel校验
      */
-    public MarkPaper scoreImportExcelValid(MultipartFile file, Long cultureProgramId, String courseCode, String paperNumber, Long courseId) throws IOException;
+    public MarkPaper scoreImportExcelValid(MultipartFile file, Long cultureProgramId, String paperNumber, Long courseId) throws IOException;
 
     /**
      * 获取阅卷数据
      *
      * @param examId
-     * @param courseCode
      * @param paperNumber
      * @param courseId
      * @return
      */
-    public MarkPaper getMarkPaper(Long examId, String courseCode, String paperNumber, Long courseId);
+    public MarkPaper getMarkPaper(Long examId, String paperNumber, Long courseId);
 
     /**
      * 成绩管理动态生成excel

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

@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.dto.initMarkData.ExamDetailCourseInitMarkDto;
 import com.qmth.distributed.print.business.bean.dto.initMarkData.InitExamDetailDto;
@@ -27,9 +26,15 @@ import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.teachcloud.common.bean.examRule.FieldsDto;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.*;
+import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.BasicExamStudent;
+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.service.*;
+import com.qmth.teachcloud.common.service.BasicAttachmentService;
+import com.qmth.teachcloud.common.service.BasicRoleDataPermissionService;
+import com.qmth.teachcloud.common.service.CommonCacheService;
+import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.*;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import com.qmth.teachcloud.mark.service.*;
@@ -44,8 +49,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.context.annotation.Lazy;
-import org.springframework.dao.DataIntegrityViolationException;
-import org.springframework.jdbc.BadSqlGrammarException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -58,7 +61,6 @@ import java.io.IOException;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 /**
  * <p>
@@ -584,172 +586,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return true;
     }
 
-    @Transactional(rollbackFor = Exception.class)
-    @Override
-    public List<Long> disposeExamDataByExaminationExcel(ExamPrintPlan examPrintPlan, List<ExaminationImportDto> dataList, SysUser sysUser) {
-        try {
-            List<Map<String, Object>> examDetailKeyList = dataList.stream().flatMap(e -> {
-                Long schoolIdId = e.getSchoolId();
-                Map<String, Object> map = new HashMap<>();
-                map.put("schoolId", schoolIdId);
-                map.put("examPlace", e.getExamPlace());
-                map.put("examRoom", e.getExamRoom());
-                map.put("examStartTime", e.getExamStartTime());
-                map.put("examEndTime", e.getExamEndTime());
-                return Stream.of(map);
-            }).distinct().collect(Collectors.toList());
-
-            List<Long> examDetailIdList = new ArrayList<>();
-            for (Map<String, Object> map : examDetailKeyList) {
-                Long schoolId = Long.valueOf(String.valueOf(map.get("schoolId")));
-                String examPlace = String.valueOf(map.get("examPlace"));
-                String examRoom = String.valueOf(map.get("examRoom"));
-                String examStartTime = String.valueOf(map.get("examStartTime"));
-                String examEndTime = String.valueOf(map.get("examEndTime"));
-
-                QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
-                queryWrapper.lambda().eq(ExamDetail::getSchoolId, schoolId)
-                        .eq(ExamDetail::getPrintPlanId, examPrintPlan.getId())
-                        .eq(ExamDetail::getExamPlace, examPlace)
-                        .eq(ExamDetail::getExamRoom, examRoom)
-                        .eq(ExamDetail::getExamStartTime, SystemConstant.convertIdToLong(examStartTime))
-                        .eq(ExamDetail::getExamEndTime, SystemConstant.convertIdToLong(examEndTime));
-                ExamDetail examDetailOld = this.getOne(queryWrapper);
-                if (examDetailOld != null) {
-                    this.deleteExaminationDataByExamDetailIds(Arrays.asList(examDetailOld.getId()));
-                }
-
-                List<ExaminationImportDto> examDetailStudentList = dataList.stream().filter(e -> e.getExamPlace().equals(examPlace) &&
-                                e.getExamRoom().equals(examRoom) && e.getExamStartTime().equals(examStartTime) && e.getExamEndTime().equals(examEndTime))
-                        .collect(Collectors.toList());
-
-                ExamDetail examDetail = new ExamDetail();
-                examDetail.setId(SystemConstant.getDbUuid());
-                examDetail.setPackageCode("1" + redisCounterUtil.getCounter(schoolId, 6, "packageCode"));
-                examDetail.setSchoolId(schoolId);
-                examDetail.setOrgId(sysUser.getOrgId());
-                examDetail.setPrintPlanId(examPrintPlan.getId());
-                examDetail.setPrintPlanName(examPrintPlan.getName());
-                examDetail.setExamId(examPrintPlan.getExamId());
-                examDetail.setExamPlace(examPlace);
-                examDetail.setExamRoom(examRoom);
-                examDetail.setStatus(ExamDetailStatusEnum.NEW);
-                examDetail.setTotalSubjects(examDetailStudentList.size());
-                examDetail.setExamStartTime(SystemConstant.convertIdToLong(examStartTime));
-                examDetail.setExamEndTime(SystemConstant.convertIdToLong(examEndTime));
-                examDetail.setExamDataSource(ExamDataSourceEnum.FILE_IMPORT);
-                examDetail.setNormal(true);
-                examDetail.setCreateId(sysUser.getId());
-                examDetail.setBackupCount(examPrintPlan.getBackupCount());
-                this.save(examDetail);
-                examDetailIdList.add(examDetail.getId());
-
-                //组装exam_detail_course数据
-                disposeExamDetailCourseData(examPrintPlan.getExamId(), examDetail.getId(), examDetailStudentList, sysUser);
-            }
-            return examDetailIdList;
-        } catch (Exception e) {
-            if (e instanceof DataIntegrityViolationException || e instanceof BadSqlGrammarException) {
-                String content = JdbcErrorUtil.parseErrorMsg(e.getMessage().toString());
-                throw ExceptionResultEnum.SQL_ERROR.exception(content);
-            } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-        return null;
-    }
-
-    /**
-     * 生成考场科目数据
-     *
-     * @param examId                考试ID
-     * @param examDetailId          考场ID
-     * @param examDetailStudentList 考场下学生集合(excel中读取)
-     * @param sysUser               用户
-     */
-    private void disposeExamDetailCourseData(Long examId, Long examDetailId, List<ExaminationImportDto> examDetailStudentList, SysUser sysUser) {
-        List<Map<String, Object>> examDetailKeyList = examDetailStudentList.stream().flatMap(e -> {
-            Map<String, Object> map = new HashMap<>();
-            map.put("courseCode", e.getCourseCode());
-            map.put("courseName", e.getCourseName());
-            map.put("paperNumber", e.getPaperNumber());
-            map.put("coursePaperId", e.getCoursePaperId());
-            return Stream.of(map);
-        }).distinct().collect(Collectors.toList());
-
-        Long schoolId = sysUser.getSchoolId();
-
-        for (Map<String, Object> map : examDetailKeyList) {
-            String courseCode = String.valueOf(map.get("courseCode"));
-            String courseName = String.valueOf(map.get("courseName"));
-            String paperNumber = String.valueOf(map.get("paperNumber"));
-            String coursePaperId = String.valueOf(map.get("coursePaperId"));
-
-            // 获取该科目下的考生人数
-            List<ExaminationImportDto> examDetailCourseStudentList = examDetailStudentList.stream().filter(e -> e.getCourseCode().equals(courseCode) &&
-                    e.getCourseName().equals(courseName) && e.getPaperNumber().equals(paperNumber)).collect(Collectors.toList());
-
-            ExamDetailCourse examDetailCourse = new ExamDetailCourse();
-            examDetailCourse.setId(SystemConstant.getDbUuid());
-            examDetailCourse.setSchoolId(schoolId);
-            examDetailCourse.setExamDetailId(examDetailId);
-            examDetailCourse.setCourseCode(courseCode);
-            examDetailCourse.setCourseName(courseName);
-            examDetailCourse.setPaperNumber(paperNumber);
-            examDetailCourse.setCoursePaperId(coursePaperId);
-            examDetailCourse.setTotalSubjects(examDetailCourseStudentList.size());
-            examDetailCourse.setCreateId(sysUser.getId());
-            String clazzName = examDetailCourseStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getClazzName())).map(ExaminationImportDto::getClazzName).collect(Collectors.joining(","));
-            if (StringUtils.isNotBlank(clazzName)) {
-                examDetailCourse.setClazzName(clazzName);
-            }
-            examDetailCourseService.save(examDetailCourse);
-
-            //组装exam_student数据
-            disposeExamStudentData(examId, examDetailCourse.getId(), examDetailCourseStudentList, sysUser);
-        }
-    }
-
-    /**
-     * @param examId                      考试ID
-     * @param examDetailCourseId          考场科目
-     * @param examDetailCourseStudentList 考场科目下学生集合(excel读取)
-     * @param sysUser                     用户
-     */
-    private void disposeExamStudentData(Long examId, Long examDetailCourseId, List<ExaminationImportDto> examDetailCourseStudentList, SysUser sysUser) {
-        List<ExamStudent> examStudentList = new ArrayList<>();
-        Long schoolId = sysUser.getSchoolId();
-        for (ExaminationImportDto examinationImportDto : examDetailCourseStudentList) {
-            List<FieldsDto> fieldsDtoList = examinationImportDto.getSecondaryFieldList();
-            List<CodeNameEnableValue> extendFieldsDtoList = this.getExtendFieldsByFields(fieldsDtoList);
-
-            ExamStudent examStudent = new ExamStudent();
-            examStudent.setId(SystemConstant.getDbUuid());
-            examStudent.setSchoolId(schoolId);
-            examStudent.setOrgId(sysUser.getOrgId());
-            examStudent.setExamId(examId);
-            examStudent.setExamDetailCourseId(examDetailCourseId);
-            examStudent.setPaperNumber(examinationImportDto.getPaperNumber());
-            examStudent.setCoursePaperId(examinationImportDto.getCoursePaperId());
-            examStudent.setStudentCode(examinationImportDto.getStudentCode());
-            examStudent.setStudentName(examinationImportDto.getStudentName());
-            examStudent.setRequiredFields(JSON.toJSONString(examinationImportDto.getRequiredFieldList()));
-            examStudent.setExtendFields(JSON.toJSONString(extendFieldsDtoList));
-            examStudent.setSiteNumber(examinationImportDto.getSiteNumber());
-            examStudent.setCollegeName(examinationImportDto.getCollegeName());
-            examStudent.setMajorName(examinationImportDto.getMajorName());
-            examStudent.setClazzName(examinationImportDto.getClazzName());
-            examStudent.setTeachClazzName(examinationImportDto.getTeachClazzName());
-            examStudent.setTeacherName(examinationImportDto.getTeacherName());
-            examStudent.setTeacherId(examinationImportDto.getTeacherId());
-            examStudent.setCreateId(sysUser.getId());
-            examStudentList.add(examStudent);
-        }
-        examStudentService.saveBatch(examStudentList);
-    }
-
     @Override
     public List<ExamDetail> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, Long courseId, String paperNumber) {
         List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseIdAndPaperNumber(schoolId, printPlanId, courseId, paperNumber);
@@ -934,7 +770,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
                             }
                         }
                         // 清空考生管理中卷型
-                        basicExamStudentService.clearPaperNumberAndPaperType(examStudents.stream().filter(m->m.getBasicStudentId() != null).map(ExamStudent::getBasicStudentId).collect(Collectors.toList()));
+                        basicExamStudentService.clearPaperNumberAndPaperType(examStudents.stream().filter(m -> m.getBasicStudentId() != null).map(ExamStudent::getBasicStudentId).collect(Collectors.toList()));
                     }
                     examStudentService.removeByIds(examStudentIds);
                 }

+ 3 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -222,26 +222,20 @@ public class PrintCommonServiceImpl implements PrintCommonService {
      * @throws IOException
      */
     @Override
-    public MarkPaper scoreImportExcelValid(MultipartFile file, Long cultureProgramId, String courseCode, String paperNumber, Long courseId) throws IOException {
+    public MarkPaper scoreImportExcelValid(MultipartFile file, Long cultureProgramId, String paperNumber, Long courseId) throws IOException {
         String reqFileMd5 = ServletUtil.getRequestMd5();
         String fileMd5 = DigestUtils.md5Hex(file.getBytes());
         if (!Objects.equals(fileMd5, reqFileMd5)) {
             throw ExceptionResultEnum.MD5_EQUALS_FALSE.exception();
         }
-        return this.getMarkPaper(null, courseCode, paperNumber, courseId);
+        return this.getMarkPaper(null, paperNumber, courseId);
     }
 
     /**
      * 获取阅卷数据
-     *
-     * @param examId
-     * @param courseCode
-     * @param paperNumber
-     * @param courseId
-     * @return
      */
     @Override
-    public MarkPaper getMarkPaper(Long examId, String courseCode, String paperNumber, Long courseId) {
+    public MarkPaper getMarkPaper(Long examId, String paperNumber, Long courseId) {
         BasicCourse basicCourse = null;
         if (Objects.nonNull(courseId)) {
             basicCourse = basicCourseService.getById(courseId);

+ 0 - 20
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/DownloadLogicService.java

@@ -20,8 +20,6 @@ public interface DownloadLogicService {
      */
     Map<String, Object> executeExaminationLogic(Map<String, Object> map) throws Exception;
 
-    Map<String, Object> executeImportExaminationLogic(Map<String, Object> map) throws Exception;
-
     /**
      * 下载pdf
      *
@@ -38,24 +36,6 @@ public interface DownloadLogicService {
      */
     Map<String, Object> executeExportPaperAndCardLogic(Map<String, Object> map) throws Exception;
 
-    /**
-     * 处理导入用户数据
-     *
-     * @param map 数据源
-     * @return 结果
-     * @throws Exception 异常
-     */
-    Map<String, Object> executeImportSysUserLogic(Map<String, Object> map) throws Exception;
-
-    /**
-     * 处理命题统计导入数据
-     *
-     * @param map 数据源
-     * @return 结果
-     * @throws Exception 异常
-     */
-    Map<String, Object> executeImportStatisticsLogic(Map<String, Object> map) throws Exception;
-
     /**
      * 成绩导出
      *

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/TaskLogicService.java

@@ -20,8 +20,6 @@ public interface TaskLogicService {
      */
     Map<String, Object> executeExaminationLogic(Map<String, Object> map) throws Exception;
 
-    Map<String, Object> executeImportExaminationLogic(Map<String, Object> map) throws Exception;
-
     /**
      * 下载pdf
      *

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

@@ -4,31 +4,22 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.google.common.collect.Lists;
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.params.DownloadPaperFileParam;
 import com.qmth.distributed.print.business.bean.result.TSyncExamStudentScoreResult;
-import com.qmth.distributed.print.business.entity.*;
+import com.qmth.distributed.print.business.entity.ExamCard;
+import com.qmth.distributed.print.business.entity.TSyncExamStudentScore;
+import com.qmth.distributed.print.business.entity.TeachClazz;
 import com.qmth.distributed.print.business.enums.ImageTrajectoryEnum;
 import com.qmth.distributed.print.business.enums.PaperFileDownloadContentEnum;
 import com.qmth.distributed.print.business.enums.PaperFileDownloadExposureStatusEnum;
-import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.service.DownloadLogicService;
-import com.qmth.distributed.print.business.templete.service.TaskLogicService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
-import com.qmth.teachcloud.common.annotation.ExcelDBFieldDesc;
-import com.qmth.teachcloud.common.base.BaseEntity;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
-import com.qmth.teachcloud.common.bean.dto.excel.DescribeImportDto;
-import com.qmth.teachcloud.common.bean.dto.excel.StatisticsImportDto;
-import com.qmth.teachcloud.common.bean.dto.excel.SysUserImportDto;
-import com.qmth.teachcloud.common.bean.dto.excel.export.SysUserErrorExportDto;
-import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
-import com.qmth.teachcloud.common.bean.examRule.FieldsDto;
 import com.qmth.teachcloud.common.bean.params.ArraysParams;
 import com.qmth.teachcloud.common.bean.result.DictionaryResult;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
@@ -45,32 +36,20 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.BeanUtils;
 import org.springframework.context.annotation.Lazy;
-import org.springframework.dao.DuplicateKeyException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.FileCopyUtils;
-import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.InputStream;
-import java.lang.reflect.Field;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
 
 /**
  * @Description: 任务处理逻辑impl
@@ -158,317 +137,6 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
         return map;
     }
 
-    @Transactional
-    @Override
-    public Map<String, Object> executeImportExaminationLogic(Map<String, Object> map) throws Exception {
-        SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
-        TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
-        InputStream inputStream = (InputStream) map.get("inputStream");
-        Long printPlanId = tbTask.getPrintPlanId();
-        Long schoolId = tbTask.getSchoolId();
-        ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
-        if (examPrintPlan == null) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划不存在");
-        }
-
-        String printPlanName = examPrintPlan.getName();
-        if (!tbTaskPdfService.countByPrintPlanIdAndEntityId(schoolId, printPlanId)) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划[" + printPlanName + "]有考场正在生成PDF文件,无法导入考务数据");
-        }
-        PrintPlanStatusEnum printPlanStatus = examPrintPlan.getStatus();
-        if (PrintPlanStatusEnum.NEW != printPlanStatus && PrintPlanStatusEnum.READY != printPlanStatus) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划状态为[" + PrintPlanStatusEnum.NEW.getName() + "、" + PrintPlanStatusEnum.READY.getName() + "]时才可导入,当前状态[" + printPlanStatus.getName() + "]");
-        }
-        // 该学校有效考务规则字段
-        List<FieldsDto> fieldsDtoList = examDetailService.findExaminationFields(schoolId);
-
-        String importFilePath = tbTask.getImportFilePath();
-        Map importFilePathMap = JSONObject.parseObject(importFilePath);
-        String path = String.valueOf(importFilePathMap.get(SystemConstant.PATH));
-        Workbook workbook;
-        if (path.endsWith(SystemConstant.XLSX)) {
-            workbook = new XSSFWorkbook(inputStream);
-        } else if (path.endsWith(SystemConstant.XLS)) {
-            workbook = new HSSFWorkbook(inputStream);
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("不支持的文件格式。只允许上传后缀为" + SystemConstant.XLSX + "、" + SystemConstant.XLS + "的文件");
-        }
-        // 读取第一个工作表
-        Sheet sheet = workbook.getSheetAt(0);
-        if (sheet.getLastRowNum() == 0 && sheet.getPhysicalNumberOfRows() == 0) {
-            throw ExceptionResultEnum.ERROR.exception("第一个sheet为空,考务数据必须放在第一个sheet(工作表)内");
-        }
-        // 第一行为说明内容,不能为空
-        if (sheet.getRow(0) == null || !sheet.getRow(0).getCell(0).getStringCellValue().startsWith("说明")) {
-            throw ExceptionResultEnum.ERROR.exception("表格第一行为说明内容,不能为空,且必须以\"说明\"开头");
-        }
-        // 第二行为表头,不能为空,且校验第一列为学号
-//        if (sheet.getRow(1) == null || !"学号".equals(sheet.getRow(1).getCell(0).getStringCellValue())) {
-//            throw ExceptionResultEnum.ERROR.exception("表格第二行为表头,不能为空,且第一列必须为\"学号\"");
-//        }
-        // 获取sheet行数
-        int totalRows = sheet.getLastRowNum() + 1;
-        // 获取sheet列数(列数从第二行开始记录,因为第一行是说明内容)
-        int totalCells = 0;
-        if (totalRows > 2 && sheet.getRow(1) != null) {
-            totalCells = sheet.getRow(1).getPhysicalNumberOfCells();
-        }
-        // 获取sheet的title(第二行为表头)
-        Row head = sheet.getRow(1);
-        List<String> headList = new ArrayList<>();
-        // 将必填字段匹配excel解析的表头索引
-        for (int i = 0; i < totalCells; i++) {
-            String cellValue = String.valueOf(ExcelUtil.convert(head.getCell(i)));
-            for (FieldsDto fieldsDto : fieldsDtoList) {
-                if (cellValue.equals(fieldsDto.getName())) {
-                    // 如果通用规则必填字段和excel表头匹配上了,则为该必选字段设置其在excel中的索引,并跳出循环体
-                    fieldsDto.setIndex(i);
-                    break;
-                }
-            }
-            headList.add(cellValue);
-        }
-
-        // 搜索所有有效字段 excel中的表头是否包含
-        for (FieldsDto fieldsDto : fieldsDtoList) {
-            if (!headList.contains(fieldsDto.getName())) {
-                throw ExceptionResultEnum.ERROR.exception("考务数据必填字段[" + fieldsDto.getName() + "]在表头中不存在");
-            }
-        }
-
-        List<ExaminationImportDto> examinationImportDtoList = new ArrayList<>();
-
-        // 文件中课程代码对应的课程名称Map
-        Map<String, String> courseCodeNameInExcelMap = new HashMap<>();
-        // 课程管理中课程代码-课程名
-        Map<String, String> courseCodeNameInBasicCourseMap = new HashMap<>();
-        List<BasicCourse> basicCourseList = basicCourseService.list(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId));
-        basicCourseList.forEach(e -> {
-            courseCodeNameInBasicCourseMap.put(e.getCode(), e.getName());
-        });
-        // 文件中试卷编号对应多个课程代码
-        Map<String, String> paperNumberWithCourseCodeInExcelMap = new HashMap<>();
-        // 试卷编号在考试下有多个命题任务map
-        Map<String, Integer> paperNumberWithExamTaskMap = new HashMap<>();
-        Map<String, String> paperNumberCoureseSequenceMap = new HashMap<>();
-        // 命题任务中试卷编号对应的课程代码map
-        Map<String, String> paperNumberWithCourseCodeInExamTaskMap = new HashMap<>();
-
-        Long examId = examPrintPlan.getExamId();
-        List<ExamTask> examTaskList = examTaskService.list(new QueryWrapper<ExamTask>()
-                .lambda()
-                .eq(ExamTask::getSchoolId, schoolId)
-                .eq(ExamTask::getExamId, examId));
-        for (ExamTask examTask : examTaskList) {
-            String paperNumber = examTask.getPaperNumber();
-            String courseCode = examTask.getCourseCode();
-            paperNumberWithCourseCodeInExamTaskMap.put(paperNumber, courseCode);
-            if (paperNumberWithExamTaskMap.containsKey(paperNumber)) {
-                int count = paperNumberWithExamTaskMap.get(paperNumber);
-                paperNumberWithExamTaskMap.put(paperNumber, count);
-            } else {
-                paperNumberWithExamTaskMap.put(paperNumber, 1);
-            }
-
-            paperNumberCoureseSequenceMap.put(paperNumber, String.valueOf(examTask.getId()));
-        }
-
-        // 从第三行开始为数据(第一行说明,第二行表头,第三行往后为数据)
-        for (int r = 2; r < totalRows; r++) {
-            // excel中的数据错误
-            StringJoiner errorRowDate = new StringJoiner(";\r\n");
-            Row row = sheet.getRow(r);
-            if (row == null || ExcelUtil.isRowAllCellEmpty(row, head)) {
-                // excel中整行为空,直接跳过
-                continue;
-            }
-
-            // 备选字段
-            List<FieldsDto> secondaryFieldList = new ArrayList<>();
-
-            ExaminationImportDto examinationImportDto = new ExaminationImportDto();
-            Field[] examinationImportDtoFields = examinationImportDto.getClass().getDeclaredFields();
-            List<CodeNameEnableValue> requiredFields = new ArrayList<>();
-            for (FieldsDto fieldsDto : fieldsDtoList) {
-                boolean match = false;
-                String name = fieldsDto.getName();
-                String code = fieldsDto.getCode();
-                int index = fieldsDto.getIndex();
-                String level = fieldsDto.getLevel();
-
-                if (Objects.nonNull(row)) {
-                    Cell cell = row.getCell(index);
-                    String cellValue = cell == null ? null : String.valueOf(ExcelUtil.convert(cell));
-                    if (cellValue == null || cellValue.length() < 1 || cellValue.equals("null")) {
-                        cellValue = "";
-                        errorRowDate.add("第" + (r + 1) + "行,第" + (index + 1) + "列,字段[" + name + "]必填");
-                    }
-
-                    for (Field examinationImportDtoField : examinationImportDtoFields) {
-                        ExcelDBFieldDesc excelDBFieldDesc = examinationImportDtoField.getAnnotation(ExcelDBFieldDesc.class);
-                        if (excelDBFieldDesc == null) {
-                            // 如果没有注解,说明该数据库必须字段不是从excel中获得的,直接跳过
-                            continue;
-                        }
-                        // 如果数据库字段中文名和必填字段中文名称对应,则通过反射为数据库必选字段赋值
-                        String dbName = excelDBFieldDesc.name();
-                        int dbLength = excelDBFieldDesc.length();
-                        if (dbName.equals(name)) {
-                            if (dbLength > 0) {
-                                SystemConstant.verifyLength(cellValue, dbLength, dbName);
-                            }
-                            examinationImportDtoField.setAccessible(true);
-                            examinationImportDtoField.set(examinationImportDto, cellValue);
-                            match = true;
-
-                            // 匹配上为必选字段
-                            CodeNameEnableValue codeNameEnableValue = new CodeNameEnableValue();
-                            codeNameEnableValue.setCode(code);
-                            codeNameEnableValue.setName(name);
-                            codeNameEnableValue.setEnable(true);
-                            codeNameEnableValue.setValue(cellValue);
-                            requiredFields.add(codeNameEnableValue);
-                            break;
-                        }
-                    }
-                    if (!match || "secondary".equals(level)) {
-                        // 必选+扩展字段不能匹配到数据库中的字段存放 或者 该字段为扩展字段,则添加到扩展字段中
-                        FieldsDto secondaryField = new FieldsDto();
-                        secondaryField.setCode(code);
-                        secondaryField.setName(name);
-                        secondaryField.setEnable(true);
-                        secondaryField.setValue(cellValue);
-                        secondaryFieldList.add(secondaryField);
-                    }
-                }
-            }
-            examinationImportDto.setRequiredFieldList(requiredFields);
-            examinationImportDto.setSecondaryFieldList(secondaryFieldList);
-            examinationImportDto.setSchoolId(schoolId);
-            // 解析时间
-            try {
-                Map<String, Object> timeMap = ConvertUtil.analyzeStartAndEndTime(examinationImportDto.getExamDate(), examinationImportDto.getExamTime());
-                String examStartTime = String.valueOf(timeMap.get("startTime"));
-                String examEndTime = String.valueOf(timeMap.get("endTime"));
-                examinationImportDto.setExamStartTime(examStartTime);
-                examinationImportDto.setExamEndTime(examEndTime);
-            } catch (Exception e) {
-                errorRowDate.add(e.getMessage());
-            }
-
-            // 唯一关系校验
-            String courseCode = examinationImportDto.getCourseCode();
-            String courseName = examinationImportDto.getCourseName();
-            String paperNumber = examinationImportDto.getPaperNumber();
-            String studentCode = examinationImportDto.getStudentCode();
-            String teacherName = examinationImportDto.getTeacherName();
-            if (StringUtils.isNotBlank(teacherName)) {
-                SysUser user = sysUserService.getByLoginName(schoolId, teacherName);
-                if (user == null) {
-                    errorRowDate.add("任课老师[" + teacherName + "]在用户管理中不存在");
-                } else {
-                    examinationImportDto.setTeacherId(user.getId());
-                }
-            }
-            if (!SystemConstant.isOneNull(courseCode, courseName)) {
-                // 校验1 - 文件中课程代码对应多个不同的课程名称
-                if (courseCodeNameInExcelMap.containsKey(courseCode)) {
-                    String name = courseCodeNameInExcelMap.get(courseCode);
-                    if (!courseName.equals(name)) {
-                        errorRowDate.add("文件中课程代码[" + courseCode + "]对应多个不同的课程名称");
-                    }
-                } else {
-                    courseCodeNameInExcelMap.put(courseCode, courseName);
-                }
-                // 校验2 - 文件中课程代码对应的课程名称和课程管理中对应课程名称不一致
-                String basicName = courseCodeNameInBasicCourseMap.get(courseCode);
-                if (StringUtils.isBlank(basicName)) {
-                    errorRowDate.add(String.format("文件中课程代码[%s]对应课程名称为[%s],课程管理中课程不存在", courseCode, courseName));
-                } else if (!courseName.equals(basicName)) {
-                    errorRowDate.add(String.format("文件中课程代码[%s]对应课程名称为[%s],课程管理中对应课程名称为[%s]", courseCode, courseName, basicName));
-                }
-            }
-            if (!RegexUtil.validStudentCode(studentCode)) {
-                errorRowDate.add("文件中学号[" + studentCode + "]不对,学号只能由数字、字母组成");
-            }
-            if (!SystemConstant.isOneNull(paperNumber, courseCode)) {
-                // 检验4 - 文件中试卷编号[%s]对应多个不同的课程代码[%s]
-                if (paperNumberWithCourseCodeInExcelMap.containsKey(paperNumber)) {
-                    String code = paperNumberWithCourseCodeInExcelMap.get(paperNumber);
-                    if (!courseCode.equals(code)) {
-                        errorRowDate.add(String.format("文件中试卷编号[%s]对应多个不同的课程代码", paperNumber));
-                    }
-                } else {
-                    paperNumberWithCourseCodeInExcelMap.put(paperNumber, courseCode);
-                }
-            }
-            if (SystemConstant.strNotNull(paperNumber)) {
-                //检验5 - 试卷编号[%s]在考试[%s]下有多条命题任务,请联系管理员处理
-                if (paperNumberWithExamTaskMap.containsKey(paperNumber)) {
-                    int count = paperNumberWithExamTaskMap.get(paperNumber);
-                    if (count > 1) {
-                        errorRowDate.add(String.format("试卷编号[%s]在考试[%s]下有多条命题任务,请联系管理员处理", paperNumber, count));
-                    }
-                }
-            }
-            if (!SystemConstant.isOneNull(paperNumber, courseCode)) {
-                //检验6 - 文件中试卷编号[%s]对应课程代码为[%s],命题任务中对应课程代码为[%s]
-                if (paperNumberWithCourseCodeInExamTaskMap.containsKey(paperNumber)) {
-                    String code = paperNumberWithCourseCodeInExamTaskMap.get(paperNumber);
-                    if (!courseCode.equals(code)) {
-                        errorRowDate.add(String.format("文件中试卷编号[%s]对应课程代码为[%s],命题任务中对应课程代码为[%s]", paperNumber, courseCode, code));
-                    }
-                }
-            }
-            examinationImportDto.setCoursePaperId(paperNumberCoureseSequenceMap.get(paperNumber));
-            examinationImportDto.setErrorMessage(errorRowDate.toString());
-            examinationImportDtoList.add(examinationImportDto);
-        }
-        List<String> errorList = examinationImportDtoList.stream()
-                .map(ExaminationImportDto::getErrorMessage)
-                .filter(SystemConstant::strNotNull)
-                .collect(Collectors.toList());
-        if (!CollectionUtils.isEmpty(errorList)) {
-            // 优先处理excel每个独立行的数据异常
-            map.put(SystemConstant.ERROR_DATA_LIST, examinationImportDtoList);
-            map.put("errorList", errorList);
-            map.put("fieldsDtoList", fieldsDtoList);
-            return map;
-        }
-
-        // 按考点+开始时间+课程代码+考场排序
-        examinationImportDtoList.sort(Comparator.comparing(ExaminationImportDto::getExamPlace)
-                .thenComparing(ExaminationImportDto::getExamStartTime)
-                .thenComparing(ExaminationImportDto::getCourseCode)
-                .thenComparing(ExaminationImportDto::getExamRoom)
-        );
-
-        // 卷袋号生成规则
-        try {
-            // 组装exam_detail数据
-            List<Long> examDetailIdList = examDetailService.disposeExamDataByExaminationExcel(examPrintPlan, examinationImportDtoList, sysUser);
-            // 更改印刷计划状态
-            examPrintPlan.setStatus(PrintPlanStatusEnum.READY);
-            examPrintPlanService.updateById(examPrintPlan);
-
-            map.put("examDetailIdList", examDetailIdList);
-            map.put("dataCount", examinationImportDtoList.size());
-        } catch (Exception e) {
-            if (e instanceof DuplicateKeyException) {
-                String errorColumn = e.getCause().toString();
-                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
-                String[] data = errorColumn.split("-");
-                data[1] = data[1].substring(0, data[1].indexOf("'"));
-                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "'" + data[1] + "']" + "数据不允许重复插入");
-            } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-        return map;
-    }
-
     /**
      * 下载pdf
      *
@@ -685,179 +353,6 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
         return map;
     }
 
-
-    @Transactional
-    @Override
-    public Map<String, Object> executeImportSysUserLogic(Map<String, Object> map) throws Exception {
-        InputStream inputStream = (InputStream) map.get("inputStream");
-
-        List<SysUserErrorExportDto> errorDataList = new ArrayList<>();
-        AtomicInteger totalInteger = new AtomicInteger(0);
-        AtomicInteger successInteger = new AtomicInteger(0);
-        List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(inputStream, Lists.newArrayList(SysUserImportDto.class, DescribeImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
-            Map<String, SysUserImportDto> checkDtoMap = new HashMap<>();
-
-            for (int i = 0; i < finalExcelList.size(); i++) {
-                LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
-                List<Object> sysUserImportDtoList = excelMap.get(i);
-                if (CollectionUtils.isEmpty(sysUserImportDtoList)) {
-                    continue;
-                }
-                map.put(SystemConstant.DATA_COUNT, sysUserImportDtoList.size());
-                List<SysUserImportDto> removeDataList = new ArrayList<>();
-                Map<String, Integer> phoneNumberMap = new HashMap<>();
-                for (int y = 0; y < Objects.requireNonNull(sysUserImportDtoList).size(); y++) {
-                    SysUserImportDto sysUserImportDto = (SysUserImportDto) sysUserImportDtoList.get(y);
-                    totalInteger.getAndIncrement();
-                    SysUserErrorExportDto sysUserErrorExportDto = new SysUserErrorExportDto();
-                    BeanUtils.copyProperties(sysUserImportDto, sysUserErrorExportDto);
-
-                    String name = sysUserImportDto.getName();
-                    String loginName = sysUserImportDto.getLoginName();
-                    String phoneNumber = sysUserImportDto.getPhoneNumber();
-                    String orgName = sysUserImportDto.getOrgName();
-                    String roleName = sysUserImportDto.getRoleName();
-
-                    StringJoiner errorStringJoiner = new StringJoiner(";");
-                    String errorStringEmpty = ExcelUtil.checkExcelField(sysUserImportDto);
-                    if (errorStringEmpty.length() > 0) {
-                        errorStringJoiner.add(errorStringEmpty);
-                    }
-                    if (checkDtoMap.containsKey(loginName)) {
-                        SysUserImportDto primaryCell = checkDtoMap.get(loginName);
-                        String priName = primaryCell.getName();
-                        String priPhoneNumber = primaryCell.getPhoneNumber();
-                        String priOrgName = primaryCell.getOrgName();
-                        if (!Objects.equals(priName, name)) {
-                            errorStringJoiner.add("用户名/工号[" + loginName + "]的用户存在不同的姓名");
-                        }
-                        if (!Objects.equals(priPhoneNumber, phoneNumber)) {
-                            errorStringJoiner.add("用户名/工号[" + loginName + "]的用户存在不同的手机号");
-                        }
-                        if (!Objects.equals(priOrgName, orgName)) {
-                            errorStringJoiner.add("用户名/工号[" + loginName + "]的用户存在不同的组织架构");
-                        }
-                        String priRoleName = primaryCell.getRoleName();
-                        if (SystemConstant.strNotNull(roleName)) {
-                            priRoleName = priRoleName + SystemConstant.COMMA + roleName;
-                            primaryCell.setRoleName(priRoleName);
-                        }
-                    } else {
-                        checkDtoMap.put(loginName, sysUserImportDto);
-                    }
-
-                    if (StringUtils.isNotBlank(loginName) && !loginName.matches(SystemConstant.REGULAR_EXPRESSION_OF_CODE)) {
-                        errorStringJoiner.add("用户名/工号[" + loginName + "]不符合规范");
-                    }
-                    if (StringUtils.isNotBlank(phoneNumber) && !phoneNumber.matches(SystemConstant.REGULAR_EXPRESSION_OF_PHONE)) {
-                        errorStringJoiner.add("手机号[" + phoneNumber + "]不符合输入规范");
-                    }
-                    if (StringUtils.isNotBlank(phoneNumber)) {
-                        if (phoneNumberMap.containsKey(phoneNumber)) {
-                            errorStringJoiner.add("手机号[" + phoneNumber + "]在文件中重复");
-                        } else {
-                            phoneNumberMap.put(phoneNumber, y);
-                        }
-                    }
-                    String errorString = errorStringJoiner.toString();
-                    if (errorString.length() > 0) {
-                        sysUserErrorExportDto.setErrorMsg(errorString);
-                        errorDataList.add(sysUserErrorExportDto);
-                        removeDataList.add(sysUserImportDto);
-                    } else {
-                        // 校验通过的数据
-                        successInteger.getAndIncrement();
-                    }
-                }
-                sysUserImportDtoList.removeAll(removeDataList);
-            }
-            if (!errorDataList.isEmpty()) {
-                map.put(SystemConstant.ERROR_DATA_LIST, errorDataList);
-            }
-            map.put(SystemConstant.DATA_COUNT, totalInteger.get());
-            map.put(SystemConstant.SUCCESS_DATA_COUNT, successInteger.get());
-            map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
-            return finalExcelList;
-        }, 2);
-        return sysUserService.executeSysUserImportLogic(finalList, map);
-    }
-
-    @Override
-    @Transactional
-    public Map<String, Object> executeImportStatisticsLogic(Map<String, Object> map) throws Exception {
-        InputStream inputStream = (InputStream) map.get("inputStream");
-        Long examId = SystemConstant.convertIdToLong(String.valueOf(map.get("examId")));
-        SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
-
-        List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(inputStream, Lists.newArrayList(StatisticsImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
-            // 只允许导入一个sheet
-            if (finalExcelList.size() > 1) {
-                throw ExceptionResultEnum.ERROR.exception("excel中只允许有一个sheet");
-            }
-            if (finalExcelErrorList.size() > 0) {
-                throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(finalExcelErrorList));
-            }
-            List<ExcelError> excelErrorTemp = new ArrayList<>();
-            // 校验系统中是否存在
-            Map<String, SysOrg> collegeOrgMap = new HashMap<>();
-            Map<String, SysOrg> teachingRoomMap = new HashMap<>();
-            Map<String, BasicCourse> courseMap = new HashMap<>();
-            Map<String, DictionaryResult> clazzMap = new HashMap<>();
-            String batchNo = SystemConstant.getNanoId();
-            List<TCStatisticsTemp> tcStatisticsImportTempList = new ArrayList<>();
-
-            for (int i = 0; i < finalExcelList.size(); i++) {
-                LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
-                List<Object> statisticsTempList = excelMap.get(i);
-                for (int y = 0; y < Objects.requireNonNull(statisticsTempList).size(); y++) {
-                    StatisticsImportDto statisticsImportDto = (StatisticsImportDto) statisticsTempList.get(y);
-                    SysOrg collegeOrg = this.validSysOrgExists(collegeOrgMap, statisticsImportDto.getCollegeName(), sysUser.getSchoolId(), excelErrorTemp, (y + 1), (i + 1), "开课学院");
-                    SysOrg teachingRoomOrg = this.validSysOrgExists(teachingRoomMap, statisticsImportDto.getTeachingRoomName(), sysUser.getSchoolId(), excelErrorTemp, (y + 1), (i + 1), "开课学院");
-                    BasicCourse basicCourse = this.validBasicCourseExists(courseMap, statisticsImportDto.getCourseName(), sysUser.getSchoolId(), statisticsImportDto.getCourseCode(), excelErrorTemp, (y + 1), (i + 1));
-                    String teacherName = statisticsImportDto.getTeacherName();
-                    String clazzNames = statisticsImportDto.getClazzName();
-                    List<DictionaryResult> dictionaryResultList = new ArrayList<>();
-                    for (String clazzName : clazzNames.split(",")) {
-                        DictionaryResult clazz = this.validBasicClazzExists(clazzMap, clazzName, sysUser.getSchoolId(), excelErrorTemp, (y + 1), (i + 1));
-                        dictionaryResultList.add(clazz);
-                    }
-                    String clazzIds = dictionaryResultList.stream().map(e -> String.valueOf(e.getId())).collect(Collectors.joining(","));
-
-
-                    if (excelErrorTemp.size() == 0) {
-
-                        TCStatisticsTemp tcStatistics = new TCStatisticsTemp(
-                                examId,
-                                collegeOrg.getId(),
-                                collegeOrg.getName(),
-                                teachingRoomOrg.getId(),
-                                teachingRoomOrg.getName(),
-                                basicCourse.getName(),
-                                basicCourse.getCode(),
-                                teacherName,
-                                clazzIds,
-                                clazzNames,
-                                batchNo,
-                                sysUser.getId());
-                        tcStatisticsImportTempList.add(tcStatistics);
-                    }
-                }
-            }
-            if (excelErrorTemp.size() > 0) {
-                List<String> errors = excelErrorTemp.stream().map(ExcelError::getExcelErrorType).collect(Collectors.toList());
-                throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(errors));
-            }
-            //加入删除(根据考试id和当前登录人)
-            tcStatisticsService.removeImportData(examId, sysUser.getId());
-            tcStatisticsTempService.saveBatch(tcStatisticsImportTempList);
-            map.put("dataCount", tcStatisticsImportTempList.size());
-            tcStatisticsService.importJoinData(tcStatisticsImportTempList);
-            tcStatisticsTempService.removeByIds(tcStatisticsImportTempList.stream().map(BaseEntity::getId).collect(Collectors.toSet()));
-            return finalExcelList;
-        }, 2);
-        return map;
-    }
-
     /**
      * 成绩导出
      *

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

@@ -158,317 +158,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         return map;
     }
 
-    @Transactional
-    @Override
-    public Map<String, Object> executeImportExaminationLogic(Map<String, Object> map) throws Exception {
-        SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
-        TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
-        InputStream inputStream = (InputStream) map.get("inputStream");
-        Long printPlanId = tbTask.getPrintPlanId();
-        Long schoolId = tbTask.getSchoolId();
-        ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
-        if (examPrintPlan == null) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划不存在");
-        }
-
-        String printPlanName = examPrintPlan.getName();
-        if (!tbTaskPdfService.countByPrintPlanIdAndEntityId(schoolId, printPlanId)) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划[" + printPlanName + "]有考场正在生成PDF文件,无法导入考务数据");
-        }
-        PrintPlanStatusEnum printPlanStatus = examPrintPlan.getStatus();
-        if (PrintPlanStatusEnum.NEW != printPlanStatus && PrintPlanStatusEnum.READY != printPlanStatus) {
-            throw ExceptionResultEnum.ERROR.exception("印刷计划状态为[" + PrintPlanStatusEnum.NEW.getName() + "、" + PrintPlanStatusEnum.READY.getName() + "]时才可导入,当前状态[" + printPlanStatus.getName() + "]");
-        }
-        // 该学校有效考务规则字段
-        List<FieldsDto> fieldsDtoList = examDetailService.findExaminationFields(schoolId);
-
-        String importFilePath = tbTask.getImportFilePath();
-        Map importFilePathMap = JSONObject.parseObject(importFilePath);
-        String path = String.valueOf(importFilePathMap.get(SystemConstant.PATH));
-        Workbook workbook;
-        if (path.endsWith(SystemConstant.XLSX)) {
-            workbook = new XSSFWorkbook(inputStream);
-        } else if (path.endsWith(SystemConstant.XLS)) {
-            workbook = new HSSFWorkbook(inputStream);
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("不支持的文件格式。只允许上传后缀为" + SystemConstant.XLSX + "、" + SystemConstant.XLS + "的文件");
-        }
-        // 读取第一个工作表
-        Sheet sheet = workbook.getSheetAt(0);
-        if (sheet.getLastRowNum() == 0 && sheet.getPhysicalNumberOfRows() == 0) {
-            throw ExceptionResultEnum.ERROR.exception("第一个sheet为空,考务数据必须放在第一个sheet(工作表)内");
-        }
-        // 第一行为说明内容,不能为空
-        if (sheet.getRow(0) == null || !sheet.getRow(0).getCell(0).getStringCellValue().startsWith("说明")) {
-            throw ExceptionResultEnum.ERROR.exception("表格第一行为说明内容,不能为空,且必须以\"说明\"开头");
-        }
-        // 第二行为表头,不能为空,且校验第一列为学号
-//        if (sheet.getRow(1) == null || !"学号".equals(sheet.getRow(1).getCell(0).getStringCellValue())) {
-//            throw ExceptionResultEnum.ERROR.exception("表格第二行为表头,不能为空,且第一列必须为\"学号\"");
-//        }
-        // 获取sheet行数
-        int totalRows = sheet.getLastRowNum() + 1;
-        // 获取sheet列数(列数从第二行开始记录,因为第一行是说明内容)
-        int totalCells = 0;
-        if (totalRows > 2 && sheet.getRow(1) != null) {
-            totalCells = sheet.getRow(1).getPhysicalNumberOfCells();
-        }
-        // 获取sheet的title(第二行为表头)
-        Row head = sheet.getRow(1);
-        List<String> headList = new ArrayList<>();
-        // 将必填字段匹配excel解析的表头索引
-        for (int i = 0; i < totalCells; i++) {
-            String cellValue = String.valueOf(ExcelUtil.convert(head.getCell(i)));
-            for (FieldsDto fieldsDto : fieldsDtoList) {
-                if (cellValue.equals(fieldsDto.getName())) {
-                    // 如果通用规则必填字段和excel表头匹配上了,则为该必选字段设置其在excel中的索引,并跳出循环体
-                    fieldsDto.setIndex(i);
-                    break;
-                }
-            }
-            headList.add(cellValue);
-        }
-
-        // 搜索所有有效字段 excel中的表头是否包含
-        for (FieldsDto fieldsDto : fieldsDtoList) {
-            if (!headList.contains(fieldsDto.getName())) {
-                throw ExceptionResultEnum.ERROR.exception("考务数据必填字段[" + fieldsDto.getName() + "]在表头中不存在");
-            }
-        }
-
-        List<ExaminationImportDto> examinationImportDtoList = new ArrayList<>();
-
-        // 文件中课程代码对应的课程名称Map
-        Map<String, String> courseCodeNameInExcelMap = new HashMap<>();
-        // 课程管理中课程代码-课程名
-        Map<String, String> courseCodeNameInBasicCourseMap = new HashMap<>();
-        List<BasicCourse> basicCourseList = basicCourseService.list(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId));
-        basicCourseList.forEach(e -> {
-            courseCodeNameInBasicCourseMap.put(e.getCode(), e.getName());
-        });
-        // 文件中试卷编号对应多个课程代码
-        Map<String, String> paperNumberWithCourseCodeInExcelMap = new HashMap<>();
-        // 试卷编号在考试下有多个命题任务map
-        Map<String, Integer> paperNumberWithExamTaskMap = new HashMap<>();
-        Map<String, String> paperNumberCoureseSequenceMap = new HashMap<>();
-        // 命题任务中试卷编号对应的课程代码map
-        Map<String, String> paperNumberWithCourseCodeInExamTaskMap = new HashMap<>();
-
-        Long examId = examPrintPlan.getExamId();
-        List<ExamTask> examTaskList = examTaskService.list(new QueryWrapper<ExamTask>()
-                .lambda()
-                .eq(ExamTask::getSchoolId, schoolId)
-                .eq(ExamTask::getExamId, examId));
-        for (ExamTask examTask : examTaskList) {
-            String paperNumber = examTask.getPaperNumber();
-            String courseCode = examTask.getCourseCode();
-            paperNumberWithCourseCodeInExamTaskMap.put(paperNumber, courseCode);
-            if (paperNumberWithExamTaskMap.containsKey(paperNumber)) {
-                int count = paperNumberWithExamTaskMap.get(paperNumber);
-                paperNumberWithExamTaskMap.put(paperNumber, count);
-            } else {
-                paperNumberWithExamTaskMap.put(paperNumber, 1);
-            }
-
-            paperNumberCoureseSequenceMap.put(paperNumber, String.valueOf(examTask.getId()));
-        }
-
-        // 从第三行开始为数据(第一行说明,第二行表头,第三行往后为数据)
-        for (int r = 2; r < totalRows; r++) {
-            // excel中的数据错误
-            StringJoiner errorRowDate = new StringJoiner(";\r\n");
-            Row row = sheet.getRow(r);
-            if (row == null || ExcelUtil.isRowAllCellEmpty(row, head)) {
-                // excel中整行为空,直接跳过
-                continue;
-            }
-
-            // 备选字段
-            List<FieldsDto> secondaryFieldList = new ArrayList<>();
-
-            ExaminationImportDto examinationImportDto = new ExaminationImportDto();
-            Field[] examinationImportDtoFields = examinationImportDto.getClass().getDeclaredFields();
-            List<CodeNameEnableValue> requiredFields = new ArrayList<>();
-            for (FieldsDto fieldsDto : fieldsDtoList) {
-                boolean match = false;
-                String name = fieldsDto.getName();
-                String code = fieldsDto.getCode();
-                int index = fieldsDto.getIndex();
-                String level = fieldsDto.getLevel();
-
-                if (Objects.nonNull(row)) {
-                    Cell cell = row.getCell(index);
-                    String cellValue = cell == null ? null : String.valueOf(ExcelUtil.convert(cell));
-                    if (cellValue == null || cellValue.length() < 1 || cellValue.equals("null")) {
-                        cellValue = "";
-                        errorRowDate.add("第" + (r + 1) + "行,第" + (index + 1) + "列,字段[" + name + "]必填");
-                    }
-
-                    for (Field examinationImportDtoField : examinationImportDtoFields) {
-                        ExcelDBFieldDesc excelDBFieldDesc = examinationImportDtoField.getAnnotation(ExcelDBFieldDesc.class);
-                        if (excelDBFieldDesc == null) {
-                            // 如果没有注解,说明该数据库必须字段不是从excel中获得的,直接跳过
-                            continue;
-                        }
-                        // 如果数据库字段中文名和必填字段中文名称对应,则通过反射为数据库必选字段赋值
-                        String dbName = excelDBFieldDesc.name();
-                        int dbLength = excelDBFieldDesc.length();
-                        if (dbName.equals(name)) {
-                            if (dbLength > 0) {
-                                SystemConstant.verifyLength(cellValue, dbLength, dbName);
-                            }
-                            examinationImportDtoField.setAccessible(true);
-                            examinationImportDtoField.set(examinationImportDto, cellValue);
-                            match = true;
-
-                            // 匹配上为必选字段
-                            CodeNameEnableValue codeNameEnableValue = new CodeNameEnableValue();
-                            codeNameEnableValue.setCode(code);
-                            codeNameEnableValue.setName(name);
-                            codeNameEnableValue.setEnable(true);
-                            codeNameEnableValue.setValue(cellValue);
-                            requiredFields.add(codeNameEnableValue);
-                            break;
-                        }
-                    }
-                    if (!match || "secondary".equals(level)) {
-                        // 必选+扩展字段不能匹配到数据库中的字段存放 或者 该字段为扩展字段,则添加到扩展字段中
-                        FieldsDto secondaryField = new FieldsDto();
-                        secondaryField.setCode(code);
-                        secondaryField.setName(name);
-                        secondaryField.setEnable(true);
-                        secondaryField.setValue(cellValue);
-                        secondaryFieldList.add(secondaryField);
-                    }
-                }
-            }
-            examinationImportDto.setRequiredFieldList(requiredFields);
-            examinationImportDto.setSecondaryFieldList(secondaryFieldList);
-            examinationImportDto.setSchoolId(schoolId);
-            // 解析时间
-            try {
-                Map<String, Object> timeMap = ConvertUtil.analyzeStartAndEndTime(examinationImportDto.getExamDate(), examinationImportDto.getExamTime());
-                String examStartTime = String.valueOf(timeMap.get("startTime"));
-                String examEndTime = String.valueOf(timeMap.get("endTime"));
-                examinationImportDto.setExamStartTime(examStartTime);
-                examinationImportDto.setExamEndTime(examEndTime);
-            } catch (Exception e) {
-                errorRowDate.add(e.getMessage());
-            }
-
-            // 唯一关系校验
-            String courseCode = examinationImportDto.getCourseCode();
-            String courseName = examinationImportDto.getCourseName();
-            String paperNumber = examinationImportDto.getPaperNumber();
-            String studentCode = examinationImportDto.getStudentCode();
-            String teacherName = examinationImportDto.getTeacherName();
-            if (StringUtils.isNotBlank(teacherName)) {
-                SysUser user = sysUserService.getByLoginName(schoolId, teacherName);
-                if (user == null) {
-                    errorRowDate.add("任课老师[" + teacherName + "]在用户管理中不存在");
-                } else {
-                    examinationImportDto.setTeacherId(user.getId());
-                }
-            }
-            if (!SystemConstant.isOneNull(courseCode, courseName)) {
-                // 校验1 - 文件中课程代码对应多个不同的课程名称
-                if (courseCodeNameInExcelMap.containsKey(courseCode)) {
-                    String name = courseCodeNameInExcelMap.get(courseCode);
-                    if (!courseName.equals(name)) {
-                        errorRowDate.add("文件中课程代码[" + courseCode + "]对应多个不同的课程名称");
-                    }
-                } else {
-                    courseCodeNameInExcelMap.put(courseCode, courseName);
-                }
-                // 校验2 - 文件中课程代码对应的课程名称和课程管理中对应课程名称不一致
-                String basicName = courseCodeNameInBasicCourseMap.get(courseCode);
-                if (StringUtils.isBlank(basicName)) {
-                    errorRowDate.add(String.format("文件中课程代码[%s]对应课程名称为[%s],课程管理中课程不存在", courseCode, courseName));
-                } else if (!courseName.equals(basicName)) {
-                    errorRowDate.add(String.format("文件中课程代码[%s]对应课程名称为[%s],课程管理中对应课程名称为[%s]", courseCode, courseName, basicName));
-                }
-            }
-            if (!RegexUtil.validStudentCode(studentCode)) {
-                errorRowDate.add("文件中学号[" + studentCode + "]不对,学号只能由数字、字母组成");
-            }
-            if (!SystemConstant.isOneNull(paperNumber, courseCode)) {
-                // 检验4 - 文件中试卷编号[%s]对应多个不同的课程代码[%s]
-                if (paperNumberWithCourseCodeInExcelMap.containsKey(paperNumber)) {
-                    String code = paperNumberWithCourseCodeInExcelMap.get(paperNumber);
-                    if (!courseCode.equals(code)) {
-                        errorRowDate.add(String.format("文件中试卷编号[%s]对应多个不同的课程代码", paperNumber));
-                    }
-                } else {
-                    paperNumberWithCourseCodeInExcelMap.put(paperNumber, courseCode);
-                }
-            }
-            if (SystemConstant.strNotNull(paperNumber)) {
-                //检验5 - 试卷编号[%s]在考试[%s]下有多条命题任务,请联系管理员处理
-                if (paperNumberWithExamTaskMap.containsKey(paperNumber)) {
-                    int count = paperNumberWithExamTaskMap.get(paperNumber);
-                    if (count > 1) {
-                        errorRowDate.add(String.format("试卷编号[%s]在考试[%s]下有多条命题任务,请联系管理员处理", paperNumber, count));
-                    }
-                }
-            }
-            if (!SystemConstant.isOneNull(paperNumber, courseCode)) {
-                //检验6 - 文件中试卷编号[%s]对应课程代码为[%s],命题任务中对应课程代码为[%s]
-                if (paperNumberWithCourseCodeInExamTaskMap.containsKey(paperNumber)) {
-                    String code = paperNumberWithCourseCodeInExamTaskMap.get(paperNumber);
-                    if (!courseCode.equals(code)) {
-                        errorRowDate.add(String.format("文件中试卷编号[%s]对应课程代码为[%s],命题任务中对应课程代码为[%s]", paperNumber, courseCode, code));
-                    }
-                }
-            }
-            examinationImportDto.setCoursePaperId(paperNumberCoureseSequenceMap.get(paperNumber));
-            examinationImportDto.setErrorMessage(errorRowDate.toString());
-            examinationImportDtoList.add(examinationImportDto);
-        }
-        List<String> errorList = examinationImportDtoList.stream()
-                .map(ExaminationImportDto::getErrorMessage)
-                .filter(SystemConstant::strNotNull)
-                .collect(Collectors.toList());
-        if (!CollectionUtils.isEmpty(errorList)) {
-            // 优先处理excel每个独立行的数据异常
-            map.put(SystemConstant.ERROR_DATA_LIST, examinationImportDtoList);
-            map.put("errorList", errorList);
-            map.put("fieldsDtoList", fieldsDtoList);
-            return map;
-        }
-
-        // 按考点+开始时间+课程代码+考场排序
-        examinationImportDtoList.sort(Comparator.comparing(ExaminationImportDto::getExamPlace)
-                .thenComparing(ExaminationImportDto::getExamStartTime)
-                .thenComparing(ExaminationImportDto::getCourseCode)
-                .thenComparing(ExaminationImportDto::getExamRoom)
-        );
-
-        // 卷袋号生成规则
-        try {
-            // 组装exam_detail数据
-            List<Long> examDetailIdList = examDetailService.disposeExamDataByExaminationExcel(examPrintPlan, examinationImportDtoList, sysUser);
-            // 更改印刷计划状态
-            examPrintPlan.setStatus(PrintPlanStatusEnum.READY);
-            examPrintPlanService.updateById(examPrintPlan);
-
-            map.put("examDetailIdList", examDetailIdList);
-            map.put("dataCount", examinationImportDtoList.size());
-        } catch (Exception e) {
-            if (e instanceof DuplicateKeyException) {
-                String errorColumn = e.getCause().toString();
-                String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3, errorColumn.length()).replaceAll("'", "");
-                String[] data = errorColumn.split("-");
-                data[1] = data[1].substring(0, data[1].indexOf("'"));
-                throw ExceptionResultEnum.SQL_ERROR.exception("[" + FieldUniqueEnum.convertToTitle(columnStr) + "'" + data[1] + "']" + "数据不允许重复插入");
-            } else if (e instanceof ApiException) {
-                ResultUtil.error((ApiException) e, ((ApiException) e).getCode(), e.getMessage());
-            } else {
-                ResultUtil.error(e.getMessage());
-            }
-        }
-        return map;
-    }
-
     /**
      * 下载pdf
      *

+ 3 - 0
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -323,3 +323,6 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 ALTER TABLE `basic_school` ADD COLUMN `exam_task_instr` VARCHAR(500) NULL COMMENT '广药命题界面提示信息' AFTER `background_image`;
 ALTER TABLE `mark_track` ADD INDEX `index4` (`task_id` ASC) ;
 ALTER TABLE `mark_student` ADD INDEX `index5` (`basic_student_id` ASC);
+
+ALTER TABLE `t_b_task` ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID' AFTER `exam_id`;
+update t_b_task a left join basic_exam be on a.exam_id = be.id left join basic_course bc on be.school_id = bc.school_id and a.course_code = bc.code set a.course_id = bc.id where a.course_id is null;

+ 17 - 17
distributed-print/src/main/java/com/qmth/distributed/print/api/TBTaskController.java

@@ -46,17 +46,17 @@ public class TBTaskController {
     @ApiOperation(value = "任务管理查询接口")
     @RequestMapping(value = "/query", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "任务管理列表信息", response = TaskListResult.class)})
-    public Result taskQuery(@ApiParam(value = "学期", required = false) @RequestParam(value = "semesterId", required = false) Long semesterId,
-                            @ApiParam(value = "考试", required = false) @RequestParam(value = "examId", required = false) Long examId,
-                            @ApiParam(value = "课程代码", required = false) @RequestParam(value = "courseCode", required = false) String courseCode,
-                            @ApiParam(value = "试着编号", required = false) @RequestParam(value = "paperNumber", required = false) String paperNumber,
-                            @ApiParam(value = "印刷计划id", required = false) @RequestParam(required = false) String printPlanId,
-                            @ApiParam(value = "任务状态", required = false) @RequestParam(required = false) TaskStatusEnum status,
-                            @ApiParam(value = "任务类型", required = false) @RequestParam(required = false) TaskTypeEnum type,
-                            @ApiParam(value = "任务数据结果", required = false) @RequestParam(required = false) TaskResultEnum result,
+    public Result taskQuery(@ApiParam(value = "学期") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                            @ApiParam(value = "考试") @RequestParam(value = "examId", required = false) Long examId,
+                            @ApiParam(value = "课程代码") @RequestParam(value = "courseId", required = false) Long courseId,
+                            @ApiParam(value = "试着编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                            @ApiParam(value = "印刷计划id") @RequestParam(required = false) String printPlanId,
+                            @ApiParam(value = "任务状态") @RequestParam(required = false) TaskStatusEnum status,
+                            @ApiParam(value = "任务类型") @RequestParam(required = false) TaskTypeEnum type,
+                            @ApiParam(value = "任务数据结果") @RequestParam(required = false) TaskResultEnum result,
                             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TaskListResult> taskListResultIPage = tbTaskService.query(new Page<>(pageNumber, pageSize), semesterId, examId, courseCode, paperNumber, Objects.nonNull(ServletUtil.getRequestHeaderSchoolId()) ? Long.parseLong(ServletUtil.getRequestHeaderSchoolId().toString()) : null, SystemConstant.convertIdToLong(printPlanId), status, type, result);
+        IPage<TaskListResult> taskListResultIPage = tbTaskService.query(new Page<>(pageNumber, pageSize), semesterId, examId, courseId, paperNumber, Objects.nonNull(ServletUtil.getRequestHeaderSchoolId()) ? Long.parseLong(ServletUtil.getRequestHeaderSchoolId().toString()) : null, SystemConstant.convertIdToLong(printPlanId), status, type, result);
         if (Objects.nonNull(taskListResultIPage) && Objects.nonNull(taskListResultIPage.getRecords()) && taskListResultIPage.getRecords().size() > 0) {
             List<TaskListResult> taskListResultList = taskListResultIPage.getRecords();
             for (TaskListResult taskListResult : taskListResultList) {
@@ -75,16 +75,16 @@ public class TBTaskController {
     @ApiOperation(value = "任务管理查询接口")
     @PostMapping("/query_result")
     @ApiResponses({@ApiResponse(code = 200, message = "任务管理列表信息", response = TaskListResult.class)})
-    public Result taskQuery(@ApiParam(value = "学期", required = false) @RequestParam(value = "semesterId", required = false) Long semesterId,
-                            @ApiParam(value = "考试", required = false) @RequestParam(value = "examId", required = false) Long examId,
-                            @ApiParam(value = "课程代码", required = false) @RequestParam(value = "courseCode", required = false) String courseCode,
-                            @ApiParam(value = "试着编号", required = false) @RequestParam(value = "paperNumber", required = false) String paperNumber,
-                            @ApiParam(value = "任务状态", required = false) @RequestParam(required = false) TaskStatusEnum status,
-                            @ApiParam(value = "任务类型", required = false) @RequestParam(required = false) TaskTypeEnum type,
-                            @ApiParam(value = "任务数据结果", required = false) @RequestParam(required = false) TaskResultEnum result,
+    public Result taskQuery(@ApiParam(value = "学期") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                            @ApiParam(value = "考试") @RequestParam(value = "examId", required = false) Long examId,
+                            @ApiParam(value = "课程代码") @RequestParam(value = "courseId", required = false) Long courseId,
+                            @ApiParam(value = "试着编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                            @ApiParam(value = "任务状态") @RequestParam(required = false) TaskStatusEnum status,
+                            @ApiParam(value = "任务类型") @RequestParam(required = false) TaskTypeEnum type,
+                            @ApiParam(value = "任务数据结果") @RequestParam(required = false) TaskResultEnum result,
                             @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<TaskListResult> taskListResultIPage = tbTaskService.queryResult(new Page<>(pageNumber, pageSize), semesterId, examId, courseCode, paperNumber, status, type, result);
+        IPage<TaskListResult> taskListResultIPage = tbTaskService.queryResult(new Page<>(pageNumber, pageSize), semesterId, examId, courseId, paperNumber, status, type, result);
         if (Objects.nonNull(taskListResultIPage) && Objects.nonNull(taskListResultIPage.getRecords()) && taskListResultIPage.getRecords().size() > 0) {
             List<TaskListResult> taskListResultList = taskListResultIPage.getRecords();
             for (TaskListResult taskListResult : taskListResultList) {

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TCPaperStructController.java

@@ -180,7 +180,7 @@ public class TCPaperStructController {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         TCPaperStruct tcPaperStructDb = tcPaperStructService.queryPaperStruct(paperStructParams.getCultureProgramId(), paperStructParams.getCourseId(), paperStructParams.getPaperNumber());
         if (Objects.isNull(tcPaperStructDb)) {
-            MarkPaper markPaper = printCommonService.getMarkPaper(paperStructParams.getExamId(), paperStructParams.getCourseCode(), paperStructParams.getPaperNumber(), paperStructParams.getCourseId());
+            MarkPaper markPaper = printCommonService.getMarkPaper(paperStructParams.getExamId(), paperStructParams.getPaperNumber(), paperStructParams.getCourseId());
             tcPaperStructDb = new TCPaperStruct(paperStructParams.getExamId(), paperStructParams.getCultureProgramId(), paperStructParams.getCourseId(), paperStructParams.getCourseCode(), markPaper.getCourseName(), paperStructParams.getPaperNumber(), JacksonUtil.parseJson(paperStructParams.getPaperStruct()), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
             tcPaperStructService.save(tcPaperStructDb);
         } else {

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

@@ -138,7 +138,7 @@ public class TRBasicInfoController {
         if (Objects.isNull(tcPaperStruct) || Objects.isNull(tcPaperStruct.getPaperStructDimension())) {
             throw ExceptionResultEnum.ERROR.exception("未找到试卷蓝图信息");
         }
-        MarkPaper markPaper = printCommonService.getMarkPaper(null, basicCourse.getCode(), tcPaperStruct.getPaperNumber(), courseId);
+        MarkPaper markPaper = printCommonService.getMarkPaper(null, tcPaperStruct.getPaperNumber(), courseId);
         if (Objects.isNull(trBasicInfo)) {
             trBasicInfo = trBasicInfoService.getReportView(trBasicInfo, markPaper, sysUser.getId(),
                     obeCourseWeightResult, cultureProgramId, courseId);
@@ -199,7 +199,7 @@ public class TRBasicInfoController {
             if (Objects.isNull(trBasicInfoDb)) {
                 trBasicInfoDb = new TRBasicInfo(trBasicInfo, sysUser.getId());
                 TCPaperStruct tcPaperStruct = tcPaperStructService.queryPaperStruct(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId(), trBasicInfo.getPaperNumber());
-                MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), trBasicInfo.getCourseCode(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber(), trBasicInfo.getCourseId());
+                MarkPaper markPaper = printCommonService.getMarkPaper(trBasicInfo.getExamId(), Objects.nonNull(tcPaperStruct) ? tcPaperStruct.getPaperNumber() : trBasicInfo.getPaperNumber(), trBasicInfo.getCourseId());
                 ObeCourseOutline obeCourseOutline = obeCourseOutlineService.findByCultureProgramIdAndCourseId(trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
                 trBasicInfoDb = trBasicInfoService.getReportView(trBasicInfoDb, markPaper, sysUser.getId(), trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId()), trBasicInfo.getCultureProgramId(), trBasicInfo.getCourseId());
             } else {

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/mapper/TBTaskMapper.java

@@ -23,7 +23,7 @@ public interface TBTaskMapper extends BaseMapper<TBTask> {
                                        @Param("schoolId") Long schoolId,
                                        @Param("semesterId") Long semesterId,
                                        @Param("examId") Long examId,
-                                       @Param("courseCode") String courseCode,
+                                       @Param("courseId") Long courseId,
                                        @Param("paperNumber") String paperNumber,
                                        @Param("printPlanId") Long printPlanId,
                                        @Param("status") String status,

+ 2 - 2
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/TBTaskService.java

@@ -111,7 +111,7 @@ public interface TBTaskService extends IService<TBTask> {
     public IPage<TaskListResult> query(IPage<Map> iPage,
                                        Long semesterId,
                                        Long examId,
-                                       String courseCode,
+                                       Long courseId,
                                        String paperNumber,
                                        Long schoolId,
                                        Long printPlanId,
@@ -130,5 +130,5 @@ public interface TBTaskService extends IService<TBTask> {
      */
     public TBTask saveTaskCommon(BasicAttachment basicAttachment, TaskTypeEnum taskTypeEnum, Map map, SysUser sysUser);
 
-    IPage<TaskListResult> queryResult(Page<Map> iPage, Long semesterId, Long examId, String courseCode, String paperNumber, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result);
+    IPage<TaskListResult> queryResult(Page<Map> iPage, Long semesterId, Long examId, Long courseId, String paperNumber, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result);
 }

+ 4 - 4
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TBTaskServiceImpl.java

@@ -212,10 +212,10 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
      * @return
      */
     @Override
-    public IPage<TaskListResult> query(IPage<Map> iPage, Long semesterId, Long examId, String courseCode, String paperNumber, Long schoolId, Long printPlanId, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result) {
+    public IPage<TaskListResult> query(IPage<Map> iPage, Long semesterId, Long examId, Long courseId, String paperNumber, Long schoolId, Long printPlanId, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        return tbTaskMapper.query(iPage, schoolId, semesterId, examId, courseCode, paperNumber, printPlanId, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, Objects.nonNull(result) ? result.name() : null, dpr);
+        return tbTaskMapper.query(iPage, schoolId, semesterId, examId, courseId, paperNumber, printPlanId, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, Objects.nonNull(result) ? result.name() : null, dpr);
     }
 
 
@@ -247,10 +247,10 @@ public class TBTaskServiceImpl extends ServiceImpl<TBTaskMapper, TBTask> impleme
     }
 
     @Override
-    public IPage<TaskListResult> queryResult(Page<Map> iPage, Long semesterId, Long examId, String courseCode, String paperNumber, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result) {
+    public IPage<TaskListResult> queryResult(Page<Map> iPage, Long semesterId, Long examId, Long courseId, String paperNumber, TaskStatusEnum status, TaskTypeEnum type, TaskResultEnum result) {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, sysUser.getId(), ServletUtil.getRequest().getServletPath());
-        return tbTaskMapper.query(iPage, schoolId, semesterId, examId, courseCode, paperNumber, null, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, Objects.nonNull(result) ? result.name() : null, dpr);
+        return tbTaskMapper.query(iPage, schoolId, semesterId, examId, courseId, paperNumber, null, Objects.nonNull(status) ? status.name() : null, Objects.nonNull(type) ? type.name() : null, Objects.nonNull(result) ? result.name() : null, dpr);
     }
 }

+ 2 - 2
teachcloud-common/src/main/resources/mapper/TBTaskMapper.xml

@@ -44,8 +44,8 @@
             <if test="examId != null and examId != ''">
                 and tbt.exam_id = #{examId}
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                and tbt.course_code = #{courseCode}
+            <if test="courseId != null">
+                and tbt.course_id = #{courseId}
             </if>
             <if test="paperNumber != null and paperNumber != ''">
                 and tbt.paper_number = #{paperNumber}

+ 1 - 1
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCFinalScoreServiceImpl.java

@@ -111,7 +111,7 @@ public class TCFinalScoreServiceImpl extends ServiceImpl<TCFinalScoreMapper, TCF
         long start = System.currentTimeMillis();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
-            printCommonService.scoreImportExcelValid(file, examId, null, paperNumber, courseId);
+            printCommonService.scoreImportExcelValid(file, examId, paperNumber, courseId);
             Double totalScore = 100d;
 
             StringJoiner errorData = new StringJoiner("");

+ 2 - 2
teachcloud-obe/src/main/java/com/qmth/teachcloud/obe/service/impl/TCPaperStructServiceImpl.java

@@ -107,7 +107,7 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
         long start = System.currentTimeMillis();
         Map<String, String> messageMap = new LinkedHashMap<>();
         try {
-            MarkPaper markPaper = printCommonService.scoreImportExcelValid(file, cultureProgramId, null, paperNumber, courseId);
+            MarkPaper markPaper = printCommonService.scoreImportExcelValid(file, cultureProgramId, paperNumber, courseId);
             StringJoiner errorData = new StringJoiner("");
             StringJoiner successData = new StringJoiner("");
 
@@ -249,7 +249,7 @@ public class TCPaperStructServiceImpl extends ServiceImpl<TCPaperStructMapper, T
                 tcPaperStruct.updateInfo(sysUser.getId());
             } else {
                 tcPaperStructService.remove(cultureProgramId, courseId, paperNumber);
-                MarkPaper markPaper = printCommonService.getMarkPaper(examId, null, paperNumber, courseId);
+                MarkPaper markPaper = printCommonService.getMarkPaper(examId, paperNumber, courseId);
                 ObeCourseWeightResult obeCourseWeightResult = trBasicInfoService.findCourseWeightResultRmi(obeCourseOutline.getId());
                 tcPaperStruct = new TCPaperStruct(examId, cultureProgramId, courseId, markPaper.getCourseCode(), markPaper.getCourseName(), paperNumber, JacksonUtil.parseJson(paperStructDimensionResultList), sysUser.getId(), obeCourseWeightResult.getDimensionSign());
                 List<MarkQuestion> markQuestionList = markQuestionService.listQuestionByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);