소스 검색

fix:
1.下载管理-试卷曝光日志

caozixuan 3 년 전
부모
커밋
82ae3f9f31

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

@@ -1438,7 +1438,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
             List<ExcelError> excelErrorTemp = new ArrayList<>();
             // 校验系统中是否存在
             Map<String, SysOrg> collegeOrgMap = new HashMap<>();
-            Map<String,SysOrg> teachingRoomMap = new HashMap<>();
+            Map<String, SysOrg> teachingRoomMap = new HashMap<>();
             Map<String, BasicCourse> courseMap = new HashMap<>();
             Map<String, DictionaryResult> clazzMap = new HashMap<>();
             String batchNo = SystemConstant.getUuid();
@@ -1453,7 +1453,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     SysOrg teachingRoomOrg = this.validSysOrgExists(teachingRoomMap, statisticsImportDto.getTeachingRoomName(), sysUser.getSchoolId(), OrgTypeEnum.TEACHING_ROOM, 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();
+                    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));
@@ -1462,7 +1462,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     String clazzIds = dictionaryResultList.stream().map(e -> String.valueOf(e.getId())).collect(Collectors.joining(","));
 
 
-
                     if (excelErrorTemp.size() == 0) {
 
                         TCStatisticsTemp tcStatistics = new TCStatisticsTemp(
@@ -1487,7 +1486,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(errors));
             }
             //加入删除(根据考试id和当前登录人)
-            tcStatisticsService.removeImportData(examId,sysUser.getId());
+            tcStatisticsService.removeImportData(examId, sysUser.getId());
             tcStatisticsTempService.saveBatch(tcStatisticsImportTempList);
             map.put("dataCount", tcStatisticsImportTempList.size());
             tcStatisticsService.importJoinData(tcStatisticsImportTempList);
@@ -1641,7 +1640,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
     @Override
     public Map<String, Object> executeDownloadPaperFileBatch(Map<String, Object> map) throws Exception {
         TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
-        String specialSuccessMessage = "";
         DownloadPaperFileParam downloadPaperFileParam = (DownloadPaperFileParam) map.get("downloadPaperFileParam");
         Long schoolId = tbTask.getSchoolId();
         Long semesterId = downloadPaperFileParam.getSemesterId();
@@ -1652,6 +1650,17 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         Boolean namedByOriginalFile = downloadPaperFileParam.getNamedByOriginalFile();
         PaperFileDownloadContentEnum paperFileDownloadContent = downloadPaperFileParam.getPaperFileDownloadContentType();
         PaperFileDownloadExposureStatusEnum paperFileDownloadExposureStatus = downloadPaperFileParam.getPaperFileDownloadExposureStatus();
+        String specialSuccessMessage = "";
+        if (Objects.nonNull(paperFileDownloadExposureStatus)) {
+            switch (paperFileDownloadExposureStatus) {
+                case EXPOSED_PAPER: // 曝光的
+                    specialSuccessMessage = "所选择的命题任务中没有已曝光的试卷";
+                    break;
+                case UNEXPOSED_PAPER: // 未曝光的
+                    specialSuccessMessage = "所选择的命题任务中没有未曝光的试卷";
+                    break;
+            }
+        }
 
         String courseName = downloadPaperFileParam.getCourseName();
         Set<Long> idSet = downloadPaperFileParam.getIdSet();
@@ -1751,14 +1760,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     switch (paperFileDownloadExposureStatus) {
                         case EXPOSED_PAPER: // 曝光的
                             paperCellList = paperCellList.stream().filter(ExamTaskPaperFileDto::getExposureStatus).collect(Collectors.toList());
-                            if (paperCellList.size() == 0) {
-                                specialSuccessMessage = "所选择的命题任务中没有已曝光的试卷";
+                            if (paperCellList.size() > 0) {
+                                specialSuccessMessage = "";
                             }
                             break;
                         case UNEXPOSED_PAPER: // 未曝光的
                             paperCellList = paperCellList.stream().filter(e -> !e.getExposureStatus()).collect(Collectors.toList());
-                            if (paperCellList.size() == 0) {
-                                specialSuccessMessage = "所选择的命题任务中没有未曝光的试卷";
+                            if (paperCellList.size() > 0) {
+                                specialSuccessMessage = "";
                             }
                             break;
                         case ALL_PAPER: // 全部试卷
@@ -1858,14 +1867,14 @@ public class TaskLogicServiceImpl implements TaskLogicService {
     /**
      * 验证机构是否存在
      *
-     * @param orgMap 机构map
-     * @param key 机构名称
-     * @param schoolId 学校id
-     * @param orgTypeEnum  机构类型
+     * @param orgMap         机构map
+     * @param key            机构名称
+     * @param schoolId       学校id
+     * @param orgTypeEnum    机构类型
      * @param excelErrorTemp 错误信息
-     * @param row 行
-     * @param sheet 区
-     * @param cloumnName cloumnName
+     * @param row            
+     * @param sheet          
+     * @param cloumnName     cloumnName
      * @return 机构
      */
     private SysOrg validSysOrgExists(Map<String, SysOrg> orgMap,
@@ -1899,13 +1908,13 @@ public class TaskLogicServiceImpl implements TaskLogicService {
     /**
      * 验证课程是否存在
      *
-     * @param courseMap courseMap
-     * @param key 课程名称
-     * @param schoolId 学校id
-     * @param value 课程编号
+     * @param courseMap      courseMap
+     * @param key            课程名称
+     * @param schoolId       学校id
+     * @param value          课程编号
      * @param excelErrorTemp 错误信息
-     * @param row 行
-     * @param sheet 区
+     * @param row            
+     * @param sheet          
      * @return 基础课程
      */
     private BasicCourse validBasicCourseExists(Map<String, BasicCourse> courseMap,