xiaof преди 4 години
родител
ревизия
a34bff2cec
променени са 20 файла, в които са добавени 131 реда и са изтрити 77 реда
  1. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java
  2. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPrintPlanMapper.java
  3. 4 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ClientService.java
  4. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  5. 2 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPrintPlanService.java
  6. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  7. 62 45
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  8. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/CommonServiceImpl.java
  9. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  10. 7 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java
  11. 3 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  12. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  13. 8 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  14. 11 3
      distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml
  15. 1 1
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  16. 1 0
      distributed-print-business/src/main/resources/mapper/SysUserMapper.xml
  17. 1 0
      distributed-print-common/src/main/java/com/qmth/distributed/print/common/contant/SystemConstant.java
  18. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicExamRuleController.java
  19. 15 9
      distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java
  20. 3 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java

@@ -5,6 +5,7 @@ import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -16,5 +17,5 @@ import java.util.List;
  */
 public interface ExamDetailCourseMapper extends BaseMapper<ExamDetailCourse> {
 
-    List<ExamDetailCourse> listByExamDetailId(@Param("examDetailId") Long examDetailId, @Param("status") String status);
+    List<Map<String, String>> listByExamDetailId(@Param("examDetailId") Long examDetailId, @Param("status") String status);
 }

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPrintPlanMapper.java

@@ -33,4 +33,6 @@ public interface ExamPrintPlanMapper extends BaseMapper<ExamPrintPlan> {
     List<PrintPlanBrief> list(@Param("schoolId") Long schoolId, @Param("orgIds") Set<Long> orgIds);
 
     IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("machineCode") Long machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgIds") Set<Long> orgIds);
+
+    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("machineCode") Long machineCode, @Param("printPlanId") String printPlanId, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("isDownload") Boolean isDownload, @Param("validate") Boolean validate, @Param("orgIds") Set<Long> orgIds);
 }

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

@@ -5,6 +5,7 @@ import com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto;
 import com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto;
 import com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -25,5 +26,7 @@ public interface ClientService {
 
     IPage<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);
 
-    Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, Boolean isForceTry, String printUser);
+    Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, String printUser);
+
+    List<Map<String, Object>> getPrintDataBatch(Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);
 }

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -22,7 +23,7 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
      */
     double calculatePackagesByDetailId(Long examDetailId);
 
-    List<ExamDetailCourse> listByExamDetailId(Long examDetailId);
+    List<Map<String, String>> listByExamDetailId(Long examDetailId);
 
     List<ExamDetailCourse> listDetailCourseByCourseCodeAndPaperNumber(Long schoolId, String courseCode, String paperNumber);
 

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

@@ -76,4 +76,6 @@ public interface ExamPrintPlanService extends IService<ExamPrintPlan> {
     List<Map<String, String>> tempalteView(Long printPlanId);
 
     IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, Long schoolId, Long machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Set<Long> orgIds);
+
+    List<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Set<Long> orgIds);
 }

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

@@ -57,7 +57,7 @@ public interface ExamTaskService extends IService<ExamTask> {
 
     IPage<ExamTaskDetailDto> listTaskPaper(String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize);
 
-    List<RelatePaperDto> listPaperTypes(Long examTaskId, Long printPlanId);
+    List<RelatePaperDto> listPaperTypes(Long examTaskId, Long printPlanId, String courseCode);
 
     boolean saveExamTaskDetail(ExamTaskDetail examTaskDetail) throws IOException;
 

+ 62 - 45
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.google.gson.JsonObject;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.service.*;
+import com.qmth.distributed.print.common.contant.SystemConstant;
 import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -75,7 +77,8 @@ public class ClientServiceImpl implements ClientService {
     public Map<String, Object> getReprintData(Long schoolId, Long examDetailId, String ticketNumber, String type) {
         Map<String, Object> finalMap = new HashMap<>();
         // 取试卷
-        Map<String, String> map = mapCourseUrl(schoolId, examDetailId);
+        List<Map<String, String>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+        Map<String, String> map = mapCourseUrl(examDetailCourses);
         // 取考生
         List<Map<String, String>> studentList = examDetailService.listStudentByExamDetailId(schoolId, examDetailId, ticketNumber, type);
         // 生成试卷List
@@ -93,7 +96,7 @@ public class ClientServiceImpl implements ClientService {
             printDataDto.setStudentCode(studentCode);
             printDataDto.setPaperType(paperType);
 
-            StringJoiner sj = new StringJoiner(":");
+            StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
             String key = sj.add(courseCode).add(paperNumber).add(paperType).toString();
             printDataDto.setUrl(map.get(key));
             return printDataDto;
@@ -155,27 +158,8 @@ public class ClientServiceImpl implements ClientService {
     }
 
     @Override
-    public Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, Boolean isForceTry, String printUser) {
-        // 1.校验是否打样
-        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
-        if(isForceTry){
-            for (ExamDetailCourse examDetailCours : examDetailCourses) {
-                QueryWrapper<ClientStatus> queryWrapper = new QueryWrapper<>();
-                queryWrapper.lambda().eq(ClientStatus::getSchoolId, schoolId)
-                        .eq(ClientStatus::getCourseCode, examDetailCours.getCourseCode())
-                        .eq(ClientStatus::getPaperNumber, examDetailCours.getPaperNumber())
-                        .eq(ClientStatus::getMachineCode, machineCode);
-                ClientStatus clientStatuse = clientStatusService.getOne(queryWrapper);
-                if(clientStatuse == null){
-                    throw ExceptionResultEnum.ERROR.exception("该机器没有打样");
-                } else {
-                    if (!clientStatuse.getPass()) {
-                        throw ExceptionResultEnum.ERROR.exception("该机器打样不合格");
-                    }
-                }
-            }
-        }
-
+    public Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, String printUser) {
+        List<Map<String, String>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
         Map<String, Object> finalMap = new HashMap<>();
         // 2.取生成的完整的pdf
         ExamDetail examDetail = examDetailService.getById(examDetailId);
@@ -199,7 +183,7 @@ public class ClientServiceImpl implements ClientService {
         // 3.取学生试卷、题卡、备用试卷、题卡,印品
         Map<String, Object> detailMap = new HashMap<>();
         // 3.1取试卷
-        Map<String, String> map = mapCourseUrl(schoolId, examDetailId);
+        Map<String, String> map = mapCourseUrl(examDetailCourses);
         // 3.2取考生
         List<Map<String, String>> studentList = examDetailService.listStudentByExamDetailId(schoolId, examDetailId, "1", "1");
         // 3.3生成试卷List
@@ -217,7 +201,7 @@ public class ClientServiceImpl implements ClientService {
             printDataDto.setStudentCode(studentCode);
             printDataDto.setPaperType(paperType);
 
-            StringJoiner sj = new StringJoiner(":");
+            StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
             String key = sj.add(courseCode).add(paperNumber).add(paperType).toString();
             printDataDto.setUrl(map.get(key));
             return printDataDto;
@@ -264,7 +248,7 @@ public class ClientServiceImpl implements ClientService {
                 clientPrintBackupDataDto.setCourseName(keyMap.get("courseName"));
                 clientPrintBackupDataDto.setPaperNumber(keyMap.get("paperNumber"));
                 clientPrintBackupDataDto.setPaperType(keyMap.get("paperType"));
-                StringJoiner sj = new StringJoiner(":");
+                StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
                 String key = sj.add(keyMap.get("courseCode")).add(keyMap.get("paperNumber")).add(keyMap.get("paperType")).toString();
                 clientPrintBackupDataDto.setUrl(map.get(key));
                 paperBackupList.add(clientPrintBackupDataDto);
@@ -273,7 +257,24 @@ public class ClientServiceImpl implements ClientService {
 
         backupMap.put("paper", paperBackupList);
 
-        // todo 备用题卡
+        // 备用题卡
+        List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
+        for (Map<String, String> examDetailCours : examDetailCourses) {
+            String attachmentIds = examDetailCours.get("attachmentIds");
+            JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
+            List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
+            for (Map backupCard : backupCards) {
+                ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
+                clientPrintBackupDataDto.setCourseCode(backupCard.get("courseCode").toString());
+                clientPrintBackupDataDto.setCourseName(backupCard.get("courseName").toString());
+                clientPrintBackupDataDto.setPaperNumber(backupCard.get("paperNumber").toString());
+                clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
+                Map<String, String> urlMap = commonService.filePreview(backupCard.get("attachmentId").toString(), false);
+                clientPrintBackupDataDto.setUrl(urlMap.get("pathUrl"));
+                cardBackupList.add(clientPrintBackupDataDto);
+            }
+        }
+        backupMap.put("card", cardBackupList);
 
         //3.5
         String variableContent = examPrintPlan.getVariableContent();
@@ -281,37 +282,53 @@ public class ClientServiceImpl implements ClientService {
         List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
         List<Map> otherList = new ArrayList<>();
         for (Map variable : variableList) {
-            Map vMap = new HashMap();
-            vMap.put("type", variable.get("type"));
-            Map<String, String> urlMap = commonService.filePreview(variable.get("attachmentId").toString(), false);
-            vMap.put("htmlUrl", urlMap.get("htmlUrl"));
-            vMap.put("pdfUrl", urlMap.get("pdfUrl"));
-            otherList.add(vMap);
+            int count = Integer.parseInt(variable.get("backupCount").toString());
+            for (int i = 0; i < count; i++) {
+                Map vMap = new HashMap();
+                vMap.put("type", variable.get("type"));
+                Map<String, String> urlMap = commonService.filePreview(variable.get("attachmentId").toString(), false);
+                vMap.put("htmlUrl", urlMap.get("htmlUrl"));
+                vMap.put("pdfUrl", urlMap.get("pdfUrl"));
+                otherList.add(vMap);
+            }
         }
         List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
         for (Map ordinary : ordinaryList) {
-            Map vMap = new HashMap();
-            vMap.put("type", ordinary.get("type"));
-            Map<String, String> urlMap = commonService.filePreview(ordinary.get("attachmentId").toString(), false);
-            vMap.put("htmlUrl", urlMap.get("htmlUrl"));
-            vMap.put("pdfUrl", urlMap.get("pdfUrl"));
-            otherList.add(vMap);
+            int count = Integer.parseInt(ordinary.get("backupCount").toString());
+            for (int i = 0; i < count; i++) {
+                Map vMap = new HashMap();
+                vMap.put("type", ordinary.get("type"));
+                Map<String, String> urlMap = commonService.filePreview(ordinary.get("attachmentId").toString(), false);
+                vMap.put("htmlUrl", urlMap.get("htmlUrl"));
+                vMap.put("pdfUrl", urlMap.get("pdfUrl"));
+                otherList.add(vMap);
+            }
+
         }
         finalMap.put("other", otherList);
         return finalMap;
     }
 
+    @Override
+    public List<Map<String, Object>> getPrintDataBatch(Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) {
+        Set<Long> orgIds = commonService.listSubOrgIds(null);
+        List<ClientPrintTaskDto> pirntTaskDtoList = examPrintPlanService.listClientPrintTask(schoolId,machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime,isDownload,validate, orgIds);
+        List<Map<String, Object>> finalList = new ArrayList<>();
+        for (ClientPrintTaskDto clientPrintTaskDto : pirntTaskDtoList) {
+            Map<String, Object> map = getPrintData(schoolId, Long.valueOf(clientPrintTaskDto.getExamDetailId()), null, null);
+            finalList.add(map);
+        }
+        return finalList;
+    }
+
     /**
      * 根据考场生成试卷map
      *
-     * @param schoolId
-     * @param examDetailId
      * @return
      */
-    public Map<String, String> mapCourseUrl(Long schoolId, Long examDetailId) {
-        List<Map<String, String>> taskDetails = examTaskDetailService.listByExamDetailId(schoolId, examDetailId);
+    public Map<String, String> mapCourseUrl(List<Map<String, String>> mapList) {
         Map<String, String> map = new HashMap<>();
-        for (Map<String, String> taskDetail : taskDetails) {
+        for (Map<String, String> taskDetail : mapList) {
             String courseCode = taskDetail.get("courseCode");
             String paperNumber = taskDetail.get("paperNumber");
             String paperAttachmentIds = taskDetail.get("paperAttachmentIds");
@@ -321,7 +338,7 @@ public class ClientServiceImpl implements ClientService {
                 String attachmentId = attaMap.get("attachmentId").toString();
                 BasicAttachment attachment = basicAttachmentService.getById(attachmentId);
                 String url = commonService.filePreview(attachment.getPath());
-                StringJoiner sj = new StringJoiner(":");
+                StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
                 String key = sj.add(courseCode).add(paperNumber).add(name).toString();
                 map.put(key, url);
             }

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

@@ -577,7 +577,7 @@ public class CommonServiceImpl implements CommonService {
             List<ExamDetail> examDetails = examDetailService.listByCourseCodeAndPaperNumber(schoolId, courseCode, paperNumber);
             if (examDetails != null && examDetails.size() > 0) {
                 // 3.检查examDetailId下有无其它课程
-                for (ExamDetail examDetail : examDetails) {
+                /*for (ExamDetail examDetail : examDetails) {
                     List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetail.getId());
                     // 4.没有未完成的命题任务
                     if (examDetailCourses.isEmpty()) {
@@ -588,7 +588,7 @@ public class CommonServiceImpl implements CommonService {
                         map.computeIfAbsent("schoolId", v -> schoolId);
                         asyncCreatePdfTempleteService.createPdf(map, null);
                     }
-                }
+                }*/
             }
         }
     }

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

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -31,7 +32,7 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
     }
 
     @Override
-    public List<ExamDetailCourse> listByExamDetailId(Long examDetailId) {
+    public List<Map<String, String>> listByExamDetailId(Long examDetailId) {
         return this.baseMapper.listByExamDetailId(examDetailId, ExamDetailStatusEnum.FINISH.name());
     }
 

+ 7 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -265,6 +265,13 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         return this.baseMapper.listClientPrintTask(page, schoolId,machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime,isDownload,validate, orgIds);
     }
 
+
+    @Override
+    public List<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Set<Long> orgIds) {
+        return this.baseMapper.listClientPrintTask(schoolId,machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime,isDownload,validate, orgIds);
+    }
+
+
     /**
      * 查找子机构
      *

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

@@ -9,6 +9,7 @@ import com.qmth.distributed.print.business.service.ExamStudentService;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -23,8 +24,9 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
 
     @Override
     public void updatePaperType(List<ExamDetailCourse> examDetailCourses, String relatePaperType) {
+        List<Long> examDetailCourseIds = examDetailCourses.stream().map(m->m.getId()).collect(Collectors.toList());
         UpdateWrapper<ExamStudent> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().set(ExamStudent::getPaperType, relatePaperType).in(ExamStudent::getExamDetailCourseId, examDetailCourses);
+        updateWrapper.lambda().set(ExamStudent::getPaperType, relatePaperType).in(ExamStudent::getExamDetailCourseId, examDetailCourseIds);
         this.update(updateWrapper);
     }
 }

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

@@ -131,7 +131,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     @Override
     public void resetCardId(Long id) {
         UpdateWrapper<ExamTaskDetail> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.lambda().set(ExamTaskDetail::getEnable, null).eq(ExamTaskDetail::getExamTaskId, id);
+        updateWrapper.lambda().set(ExamTaskDetail::getCardId, null).eq(ExamTaskDetail::getExamTaskId, id);
         this.update(updateWrapper);
     }
 

+ 8 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -539,21 +539,22 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
 
     @Override
-    public List<RelatePaperDto> listPaperTypes(Long examTaskId, Long printPlanId) {
-        /*Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+    public List<RelatePaperDto> listPaperTypes(Long examTaskId, Long printPlanId, String courseCode) {
+        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         List<RelatePaperDto> list = this.baseMapper.listPaperNumbers(schoolId, courseCode);
         for (RelatePaperDto relatePaperDto : list) {
             QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
             queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, relatePaperDto.getId()).eq(ExamTaskDetail::getEnable, true);
             ExamTaskDetail examTaskDetail = this.examTaskDetailService.getOne(queryWrapper);
             if (examTaskDetail != null) {
-                String unexposedPaperType = examTaskDetail.getUnexposedPaperType();
-                relatePaperDto.setPaperTypes(StringUtils.isBlank(unexposedPaperType) ? null : Arrays.asList(unexposedPaperType.split(",")));
+                // 所有卷型
+                String paperType = examTaskDetail.getPaperType();
+                relatePaperDto.setPaperTypes(Arrays.asList(paperType.split(",")));
             }
         }
-        return list;*/
+        return list;
 
-        QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
+        /*QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId).eq(ExamTaskDetail::getEnable, true);
         ExamTaskDetail examTaskDetail = this.examTaskDetailService.getOne(queryWrapper);
         List<RelatePaperDto> list = new ArrayList<>();
@@ -575,7 +576,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             relatePaperDto.setPaperTypes(StringUtils.isBlank(paperTypes) ? null : Arrays.asList(paperTypes.split(",")));
             list.add(relatePaperDto);
         }
-        return list;
+        return list;*/
     }
 
     @Transactional

+ 11 - 3
distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml

@@ -17,17 +17,25 @@
         id,
         school_id, exam_detail_id, course_code, course_name, paper_number
     </sql>
-    <select id="listByExamDetailId" resultMap="BaseResultMap">
+    <select id="listByExamDetailId" resultType="java.util.Map">
         SELECT
-            a.*
+            a.course_code courseCode,
+            a.course_name courseName,
+            a.paper_number paperNumber,
+            b.paper_attachment_ids paperAttachmentIds,
+            d.attachment_id attachmentIds
         FROM
             exam_detail_course a
                 LEFT JOIN
             exam_task b ON a.school_id = b.school_id
                 AND a.course_code = b.course_code
                 AND a.paper_number = b.paper_number
+                LEFT JOIN
+            exam_task_detail c ON b.id = c.exam_task_id
+                LEFT JOIN
+            exam_card_detail d ON c.card_id = d.card_id
         WHERE
-            a.exam_detail_id = #{examDetailId} AND b.status != #{status}
+            a.exam_detail_id = #{examDetailId} AND b.status = #{status}
     </select>
 
 </mapper>

+ 1 - 1
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -380,7 +380,7 @@
         FROM
             exam_task
         <where>
-            school_id = #{schoolId} and course_code = #{courseCode}
+            school_id = #{schoolId} and course_code = #{courseCode} and enable = true
         </where>
     </select>
     <select id="applyGetOne" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailCardDto">

+ 1 - 0
distributed-print-business/src/main/resources/mapper/SysUserMapper.xml

@@ -51,6 +51,7 @@
                 and a.enable = #{enable}
             </if>
         </where>
+        order by a.create_time desc
     </select>
     
     <select id="listUser" resultType="com.qmth.distributed.print.business.bean.dto.BlurryUserDto">

+ 1 - 0
distributed-print-common/src/main/java/com/qmth/distributed/print/common/contant/SystemConstant.java

@@ -59,6 +59,7 @@ public class SystemConstant {
     public static final int PAGE_NUMBER = 0;
     public static final int PAGE_SIZE = 10000000;
     public static final int ALL_CARD = -1;
+    public static final String DELIMITER = ":";
 
     /**
      * oss url过期时间

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

@@ -55,7 +55,7 @@ public class BasicExamRuleController {
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     public Result save(@RequestBody BasicExamRule examRule) {
         String id = basicExamRuleService.saveExamRule(examRule);
-        return ResultUtil.ok(id);
+        return ResultUtil.ok(id, "");
     }
 
 }

+ 15 - 9
distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java

@@ -213,7 +213,6 @@ public class ClientController {
      * @param schoolId
      * @param examDetailId
      * @param machineCode
-     * @param isForceTry
      * @param printUser
      * @return
      */
@@ -222,9 +221,8 @@ public class ClientController {
     public Result printGetPrintData(@RequestParam("schoolId") Long schoolId,
                                     @RequestParam("examDetailId") Long examDetailId,
                                     @RequestParam("machineCode") String machineCode,
-                                    @RequestParam("isForceTry") Boolean isForceTry,
                                     @RequestParam(value = "printUser", required = false) String printUser) {
-        Map<String, Object> map = clientService.getPrintData(schoolId, examDetailId, machineCode, isForceTry, printUser);
+        Map<String, Object> map = clientService.getPrintData(schoolId, examDetailId, machineCode, printUser);
         return ResultUtil.ok(map);
     }
 
@@ -233,18 +231,26 @@ public class ClientController {
      *
      * @param schoolId
      * @param orgId
-     * @param examDetailId
      * @param machineCode
      * @return
      */
     @ApiOperation(value = "印刷管理-批量缓存数据")
     @RequestMapping(value = "/print/get_print_data_batch", method = RequestMethod.POST)
     public Result printGetPrintDataBatch(@RequestParam("schoolId") Long schoolId,
-                                         @RequestParam("orgId") Long orgId,
-                                         @RequestParam("examDetailId") Long examDetailId,
-                                         @RequestParam("machineCode") String machineCode) {
-
-        return null;
+                                         @RequestParam("machineCode") Long machineCode,
+                                         @RequestParam("orgId") String orgId,
+                                         @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                         @RequestParam(value = "status", required = false) String status,
+                                         @RequestParam(value = "courseCode", required = false) String courseCode,
+                                         @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                         @RequestParam(value = "examPlace", required = false) String examPlace,
+                                         @RequestParam(value = "examRoom", required = false) String examRoom,
+                                         @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                         @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                         @RequestParam(value = "isDownload", required = false) Boolean isDownload,
+                                         @RequestParam(value = "validate", required = false) Boolean validate) {
+        List<Map<String, Object>> list = clientService.getPrintDataBatch(schoolId, machineCode, orgId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+        return ResultUtil.ok(list);
     }
 
     /**

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

@@ -168,8 +168,9 @@ public class ExamPrintPlanController {
     @ApiOperation(value = "查询所有试卷编号/关联卷型")
     @RequestMapping(value = "/relate_get_paper_numbers", method = RequestMethod.POST)
     public Result relateGetPaperNumbers(@RequestParam(value = "examTaskId", required = true) Long examTaskId,
-                                        @RequestParam(value = "printPlanId", required = true) Long printPlanId) {
-        List<RelatePaperDto> list = examTaskService.listPaperTypes(examTaskId, printPlanId);
+                                        @RequestParam(value = "printPlanId", required = true) Long printPlanId,
+                                        @RequestParam(value = "courseCode", required = true) String courseCode) {
+        List<RelatePaperDto> list = examTaskService.listPaperTypes(examTaskId, printPlanId, courseCode);
         return ResultUtil.ok(list);
     }