xiaofei 1 éve
szülő
commit
a249cb9c35
26 módosított fájl, 1039 hozzáadás és 1274 törlés
  1. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/PrintTaskDto.java
  2. 23 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ClientMapper.java
  3. 4 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java
  4. 0 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailMapper.java
  5. 0 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamPrintPlanMapper.java
  6. 0 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  7. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ClientService.java
  8. 1 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  9. 0 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamPrintPlanService.java
  10. 0 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskDetailService.java
  11. 0 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  12. 188 43
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  13. 5 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java
  14. 1 101
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  15. 0 84
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java
  16. 3 40
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  17. 7 27
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  18. 361 0
      distributed-print-business/src/main/resources/mapper/ClientMapper.xml
  19. 81 0
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  20. 52 83
      distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml
  21. 0 252
      distributed-print-business/src/main/resources/mapper/ExamPrintPlanMapper.xml
  22. 0 74
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  23. 0 526
      distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java
  24. 3 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java
  25. 306 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/client/PrintController.java
  26. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/client/ScanController.java

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/PrintTaskDto.java

@@ -179,7 +179,7 @@ public class PrintTaskDto {
     }
 
     public String getStatusDisplay() {
-        return statusDisplay;
+        return status == null ? "-" : status.getName();
     }
 
     public void setStatusDisplay(String statusDisplay) {

+ 23 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ClientMapper.java

@@ -0,0 +1,23 @@
+package com.qmth.distributed.print.business.mapper;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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 com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ClientMapper {
+    IPage<ClientExamTaskDto> pageTryTask(@Param("page") Page<ClientExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
+    List<ClientExamTaskDto> pageTryTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
+
+    IPage<ClientPrintTaskDto> listClientPrintTask(@Param("page") Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String 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("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String 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("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+
+    ClientPrintTaskTotalDto clientTaskTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @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("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
+
+    IPage<ClientExamStudentDto> listClientExamStudentPage(Page<ClientExamStudentDto> page, Long schoolId, Long examDetailId, String studentCode, String studentName, String courseCode);
+}

+ 4 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -34,4 +34,8 @@ public interface ConditionMapper {
     List<BasicClazz> listClazz(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("clazzName") String clazzName, @Param("dpr") DataPermissionRule dpr);
 
     List<PrintPlanBrief> listPrintPlanForClient(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("examDetailStatus") String[] examDetailStatus);
+
+    List<BasicCourse> listCourseForPlanTask(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberPlanTask(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("courseCode") String courseCode, @Param("dpr") DataPermissionRule dpr);
 }

+ 0 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailMapper.java

@@ -89,8 +89,6 @@ public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
                                     @Param("printHouseId") Long printHouseId,
                                     @Param("dpr") DataPermissionRule dpr);
 
-    IPage<ClientExamStudentDto> listClientExamStudentPage(Page<ClientExamStudentDto> page, @Param("schoolId") Long schoolId, @Param("examDetailId") Long examDetailId, @Param("studentCode") String studentCode, @Param("studentName") String studentName, @Param("courseCode") String courseCode);
-
     @SuppressWarnings("MybatisXMapperMethodInspection")
     List<Map> listStudentByExamDetailCourseId(@Param("schoolId") Long schoolId, @Param("examDetailCourseId") Long examDetailCourseId, @Param("studentCode") String studentCode, @Param("type") String type);
 
@@ -108,8 +106,6 @@ public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
                         @Param("printHouseId") Long printHouseId,
                         @Param("dpr") DataPermissionRule dpr);
 
-    List<ExamDetailCourse> listSyncPaperNumberByPrintPlanId(@Param("printPlanId") Long printPlanId);
-
     /**
      * 根据id下载examDetail
      *

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

@@ -35,12 +35,6 @@ public interface ExamPrintPlanMapper extends BaseMapper<ExamPrintPlan> {
 
     List<PrintPlanBrief> list(@Param("schoolId") Long schoolId, @Param("source") String source, @Param("module") String module, @Param("status") String[] status, @Param("dpr") DataPermissionRule dpr);
 
-    IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String 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("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
-
-    List<ClientPrintTaskDto> listClientPrintTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String 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("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
-
-    ClientPrintTaskTotalDto clientTaskTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @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("machineCode") String machineCode, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
-
     IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") String printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);
 
     ClientPrintStatisticsTotalDto clientStatisticsTotalData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanId") Long printPlanId, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("orgId") Long orgId, @Param("examDetailStatus") String[] examDetailStatus);

+ 0 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java

@@ -43,10 +43,6 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
 
     ExamTaskDetailCardDto applyGetOne(@Param("examTaskId") Long examTaskId, @Param("source") String source);
 
-    IPage<ClientExamTaskDto> listClientExamTaskPage(Page<ClientExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("orgId") Long orgId, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
-
-    List<ClientExamTaskDto> listClientExamTaskPage(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("machineCode") String machineCode, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("isTry") Boolean isTry, @Param("isPass") Boolean isPass, @Param("orgId") Long orgId, @Param("printPlanStatus") String printPlanStatus, @Param("examDetailStatus") String[] examDetailStatus);
-
     List<ExamTask> listExamTaskExpire(@Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("status") String[] status);
 
     List<ExamTask> listExamTaskAuditExpire(@Param("startTime") Long startTime, @Param("endTime") Long endTime);

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

@@ -45,11 +45,11 @@ public interface ClientService {
 
     ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);
 
-    void checkPrivilege(Long id);
-
     boolean updatePassword(Long userId, String password);
 
     List<SchoolDto> listSchool(String code);
 
+    List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId);
+
     Set<String> getRoleByUserId(Long id);
 }

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

@@ -9,10 +9,7 @@ import com.qmth.distributed.print.business.bean.examRule.FieldsDto;
 import com.qmth.distributed.print.business.bean.result.ExaminationDetailResult;
 import com.qmth.distributed.print.business.bean.result.ExaminationResult;
 import com.qmth.distributed.print.business.bean.result.SummarizedDataResult;
-import com.qmth.distributed.print.business.entity.ExamDetail;
-import com.qmth.distributed.print.business.entity.ExamDetailCourse;
-import com.qmth.distributed.print.business.entity.ExamPrintPlan;
-import com.qmth.distributed.print.business.entity.ExamStudent;
+import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDataSourceEnum;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
@@ -193,16 +190,10 @@ public interface ExamDetailService extends IService<ExamDetail> {
      */
     List<ExaminationExportDto> findExaminationExportDtoDatasource(Map<String, Object> map);
 
-    Boolean updatePrintProgress(Long schoolId, Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint);
-
-    IPage<ClientExamStudentDto> listStudent(Long schoolId, Long examDetailId, String studentCode, String studentName, String courseCode, Integer pageNumber, Integer pageSize);
-
     List<Map> listStudentByExamDetailCourseId(Long schoolId, Long examDetailCourseId, String ticketNumber, String type);
 
     List<ExamDetail> listByCourseCodeAndPaperNumber(Long schoolId, Long examId, String courseCode, String paperNumber);
 
-    List<ExamDetailCourse> listSyncPaperNumberByPrintPlanId(Long printPlanId);
-
     boolean taskNormal(ExamDetail examDetail);
 
     /**
@@ -241,16 +232,12 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     TBTask importData(String printPlanId, MultipartFile file);
 
-    void startInitTask(Long schoolId) throws Exception;
-
     void deleteExaminationDataByExamDetailIds(List<Long> examDetailIdList);
 
     void resetExamDetail(Long entityId, CreatePdfTypeEnum type, ExamDetailStatusEnum reject, boolean clearPaperType);
 
     List<ExamDetailCourseInitMarkDto> listPrintFinishExamDetailCourse(String printStatus, long startTime, String markStatus);
 
-    List<ExamDetail> listByExamAndPackage(Long examId, String packageCode);
-
     ExamDetail getByExamDetailCourseId(Long examDetailId);
 
     int countMakeupUsedByExamIdAndPaperNumber(Long examId, String paperNumber);

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

@@ -80,12 +80,6 @@ public interface ExamPrintPlanService extends IService<ExamPrintPlan> {
 
     List<Map<String, String>> tempalteView(Long printPlanId);
 
-    IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, Long schoolId, Long semesterId, Long examId, String machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Long orgId);
-
-    List<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long semesterId, Long examId, String machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Long orgId);
-
-    ClientPrintTaskTotalDto clientTaskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode);
-
     IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Long orgId);
 
     ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, Long semesterId, Long examId, Long printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);

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

@@ -30,8 +30,6 @@ public interface ExamTaskDetailService extends IService<ExamTaskDetail> {
 
     void resetCardId(Long id);
 
-    List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId);
-
     Map<String, Object> paperUpdate(ExamTaskDetail examTaskDetail);
 
     /**

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

@@ -79,10 +79,6 @@ public interface ExamTaskService extends IService<ExamTask> {
 
     ExamTask getByCourseCodeAndPaperNumber(Long schoolId, Long examId, String courseCode, String paperNumber);
 
-    IPage<ClientExamTaskDto> listTryTask(Long schoolId, Long semesterId, Long examId, String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);
-
-    List<ClientExamTaskDto> listTryTask(Long schoolId, Long semesterId, Long examId, String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass);
-
     /**
      * 根据考务-考场检验该考场下的所有命题任务是否已经完成,全部完成则生成pdf
      *

+ 188 - 43
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -8,21 +8,26 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
+import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
+import com.qmth.distributed.print.business.mapper.ClientMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.bean.dto.SchoolDto;
+import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.SysPrivilege;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ClassifyEnum;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.RoleTypeEnum;
 import com.qmth.teachcloud.common.service.*;
+import com.qmth.teachcloud.common.util.ExamTaskUtil;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
+import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
@@ -37,45 +42,41 @@ import java.util.stream.Collectors;
 public class ClientServiceImpl implements ClientService {
 
     @Resource
-    ExamTaskService examTaskService;
-
+    private ExamTaskService examTaskService;
     @Resource
-    ExamTaskDetailService examTaskDetailService;
-
+    private ExamTaskDetailService examTaskDetailService;
     @Resource
-    ClientStatusService clientStatusService;
-
+    private ClientStatusService clientStatusService;
     @Resource
-    ExamDetailService examDetailService;
-
+    private ExamDetailService examDetailService;
     @Resource
-    ExamDetailCourseService examDetailCourseService;
-
+    private ExamDetailCourseService examDetailCourseService;
     @Resource
-    BasicAttachmentService basicAttachmentService;
-
+    private ClientPrintDataService clientPrintDataService;
     @Resource
-    ExamPrintPlanService examPrintPlanService;
-
+    private BasicAttachmentService basicAttachmentService;
     @Resource
-    ExamStudentService examStudentService;
-
+    private ExamPrintPlanService examPrintPlanService;
     @Resource
-    TeachcloudCommonService teachcloudCommonService;
-
+    private ExamStudentService examStudentService;
     @Resource
-    SysPrivilegeService sysPrivilegeService;
-
+    private TeachcloudCommonService teachcloudCommonService;
     @Resource
-    SysUserService sysUserService;
-
+    private SysPrivilegeService sysPrivilegeService;
+    @Resource
+    private SysUserService sysUserService;
+    @Resource
+    private BasicSchoolService basicSchoolService;
     @Resource
-    BasicSchoolService basicSchoolService;
+    private ClientMapper clientMapper;
 
     @Override
     public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        return examTaskService.listTryTask(schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
+        Page<ClientExamTaskDto> page = new Page<>(pageNumber, pageSize);
+        // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
+        String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        return clientMapper.pageTryTask(page, schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
     }
 
     @Override
@@ -91,7 +92,7 @@ public class ClientServiceImpl implements ClientService {
             map.put("courseCode", examTask.getCourseCode());
             map.put("courseName", examTask.getCourseName());
             map.put("paperNumber", examTask.getPaperNumber());
-            List<Map<String, String>> mapList = examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
+            List<Map<String, String>> mapList = this.getPaperUrl(schoolId, printPlanId, examTaskId);
             map.put("list", mapList);
             finalList.add(map);
         }
@@ -107,13 +108,62 @@ public class ClientServiceImpl implements ClientService {
     @Override
     public Boolean updatePrintProgress(Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        return examDetailService.updatePrintProgress(schoolId, examDetailId, machineCode, printProgress, isPrint);
+        ExamDetail examDetail = examDetailService.getById(examDetailId);
+        // 撤回提示
+        if (ExamDetailStatusEnum.NEW.name().equals(examDetail.getStatus())
+                || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
+            throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
+        }
+
+        if (isPrint) {
+            // 更新考场进度、状态、打印结束时间
+            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.lambda().set(ExamDetail::getPrintProgress, printProgress).set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).set(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH).eq(ExamDetail::getId, examDetailId);
+            examDetailService.update(updateWrapper);
+
+            // 所有考场打印完成,更新印刷计划状态
+            QueryWrapper<ExamDetail> examDetailQueryWrapper = new QueryWrapper<>();
+            examDetailQueryWrapper.lambda().eq(ExamDetail::getPrintPlanId, examDetail.getPrintPlanId()).ne(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH);
+            int count = examDetailService.count(examDetailQueryWrapper);
+            if (count == 0) {
+                UpdateWrapper<ExamPrintPlan> examPrintPlanUpdateWrapper = new UpdateWrapper<>();
+                examPrintPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.FINISH).eq(ExamPrintPlan::getId, examDetail.getPrintPlanId());
+                examPrintPlanService.update(examPrintPlanUpdateWrapper);
+            }
+
+            // 记录机器打印数量
+            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+            ClientPrintData clientPrintData = new ClientPrintData();
+            clientPrintData.setId(SystemConstant.getDbUuid());
+            clientPrintData.setSchoolId(schoolId);
+            clientPrintData.setExamDetailId(examDetailId);
+            clientPrintData.setMachineCode(machineCode);
+            clientPrintData.setPaperPages(examDetail.getPaperPages());
+            clientPrintData.setCardPages(examDetail.getCardPages());
+            clientPrintData.setPagesA4(examDetail.getPagesA4());
+            clientPrintData.setCreateId(sysUser.getId());
+            clientPrintData.setCreateTime(System.currentTimeMillis());
+            clientPrintDataService.save(clientPrintData);
+        } else {
+            // 更新打印结束时间
+            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.lambda().set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).eq(ExamDetail::getId, examDetailId);
+            examDetailService.update(updateWrapper);
+        }
+        return true;
     }
 
     @Override
     public IPage<ClientExamStudentDto> listStudent(Long examDetailId, String studentCode, String studentName, String courseCode, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        return examDetailService.listStudent(schoolId, examDetailId, studentCode, studentName, courseCode, pageNumber, pageSize);
+        // 撤回提示
+        ExamDetail examDetail = examDetailService.getById(examDetailId);
+        if (ExamDetailStatusEnum.NEW.name().equals(examDetail.getStatus())
+                || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
+            throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
+        }
+        Page<ClientExamStudentDto> page = new Page<>(pageNumber, pageSize);
+        return clientMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(studentCode), SystemConstant.translateSpecificSign(studentName), courseCode);
     }
 
 
@@ -170,7 +220,46 @@ public class ClientServiceImpl implements ClientService {
     public IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<ClientPrintTaskDto> page = new Page<>(pageNumber, pageSize);
-        return examPrintPlanService.listClientPrintTask(page, schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId);
+        // 以下状态考场状态不可查询
+        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        IPage<ClientPrintTaskDto> clientPrintTaskDtoIPage = clientMapper.listClientPrintTask(page, schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
+        for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
+            // 试卷、题卡
+            String printContent = record.getPrintContent();
+            record.setIncluedPaper(!StringUtils.isBlank(printContent) && printContent.contains("PAPER"));
+            record.setIncluedCard(!StringUtils.isBlank(printContent) && printContent.contains("CARD"));
+
+            //印品
+            String variableContent = record.getVariableContent();
+            List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
+            record.setIncluedSign(false);
+            record.setIncluedPackage(false);
+            for (Map map : variableList) {
+                String type = map.get("type").toString();
+                String templateId = map.get("templateId").toString();
+                if (ClassifyEnum.SIGN.name().equals(type) && StringUtils.isNotBlank(templateId)) {
+                    record.setIncluedSign(true);
+                }
+                if (ClassifyEnum.PACKAGE.name().equals(type) && StringUtils.isNotBlank(templateId)) {
+                    record.setIncluedPackage(true);
+                }
+            }
+            String ordinaryContent = record.getOrdinaryContent();
+            List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
+            record.setIncluedCheckin(false);
+            for (Map map : ordinaryList) {
+                String type = map.get("type").toString();
+                String templateId = map.get("templateId").toString();
+                if (ClassifyEnum.CHECK_IN.name().equals(type) && StringUtils.isNotBlank(templateId)) {
+                    record.setIncluedCheckin(true);
+                }
+            }
+
+            if (StringUtils.isNotBlank(record.getClassName())) {
+                record.setClassName(String.join(",", new HashSet<>(Arrays.asList(record.getClassName().split(",")))));
+            }
+        }
+        return clientPrintTaskDtoIPage;
     }
 
     @Transactional
@@ -368,7 +457,9 @@ public class ClientServiceImpl implements ClientService {
     public List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
 //        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        List<ClientPrintTaskDto> pirntTaskDtoList = examPrintPlanService.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId);
+        // 以下状态考场状态不可查询
+        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        List<ClientPrintTaskDto> pirntTaskDtoList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
         // 撤回
         long count = pirntTaskDtoList.stream().map(m -> {
             ExamDetail examDetail = examDetailService.getById(m.getExamDetailId());
@@ -552,7 +643,9 @@ public class ClientServiceImpl implements ClientService {
     @Override
     public List<Map<String, Object>> getBatchUrl(String machineCode, Long orgId, Long semesterId, Long examId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        List<ClientExamTaskDto> clientExamTaskDtos = examTaskService.listTryTask(schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass);
+        // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
+        String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        List<ClientExamTaskDto> clientExamTaskDtos = clientMapper.pageTryTask(schoolId, semesterId, examId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
         List<Map<String, Object>> list = new ArrayList<>();
         for (ClientExamTaskDto clientExamTaskDto : clientExamTaskDtos) {
             Map<String, Object> map = new HashMap<>();
@@ -560,7 +653,7 @@ public class ClientServiceImpl implements ClientService {
             map.put("courseCode", clientExamTaskDto.getCourseCode());
             map.put("courseName", clientExamTaskDto.getCourseName());
             map.put("paperNumber", clientExamTaskDto.getPaperNumber());
-            List<Map<String, String>> mapList = examTaskDetailService.getPaperUrl(schoolId, Long.valueOf(clientExamTaskDto.getPrintPlanId()), Long.valueOf(clientExamTaskDto.getExamTaskId()));
+            List<Map<String, String>> mapList = this.getPaperUrl(schoolId, Long.valueOf(clientExamTaskDto.getPrintPlanId()), Long.valueOf(clientExamTaskDto.getExamTaskId()));
             map.put("list", mapList);
             list.add(map);
         }
@@ -570,7 +663,9 @@ public class ClientServiceImpl implements ClientService {
     @Override
     public void exportClientPrintTask(HttpServletResponse response, String machineCode, Long orgId, Long semesterId, Long examId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate) throws Exception {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        List<ClientPrintTaskDto> printTaskDtoIList = examPrintPlanService.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId);
+        // 以下状态考场状态不可查询
+        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        List<ClientPrintTaskDto> printTaskDtoIList = clientMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         printTaskDtoIList = printTaskDtoIList.stream().map(m -> {
             if (m.getExamStartTime() != null) {
@@ -599,7 +694,31 @@ public class ClientServiceImpl implements ClientService {
 
     @Override
     public ClientPrintTaskTotalDto taskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode) {
-        return examPrintPlanService.clientTaskTotalData(semesterId, examId, printPlanId, orgId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
+        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
+        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientMapper.clientTaskTotalData(schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode, orgId, examDetailStatus);
+        if (clientPrintTaskTotalDto != null) {
+            // 累计a3,a4
+            List<ClientPrintData> list = clientPrintDataService.listBySchoolIdAndMachineCode(schoolId, machineCode);
+            if (!list.isEmpty()) {
+                int paperPages = list.stream().filter(m -> m.getPaperPages() != null).mapToInt(ClientPrintData::getPaperPages).sum();
+                clientPrintTaskTotalDto.setHostPaperPages(paperPages / 2);
+                int cardPages = list.stream().filter(m -> m.getCardPages() != null).mapToInt(ClientPrintData::getCardPages).sum();
+                clientPrintTaskTotalDto.setHostCardPages(cardPages / 2);
+                int pagesA4 = list.stream().filter(m -> m.getPagesA4() != null).mapToInt(ClientPrintData::getPagesA4).sum();
+                clientPrintTaskTotalDto.setHostPagesA4(pagesA4 / 2);
+            }
+
+            // 试卷总计
+            String paperNumberStrs = clientPrintTaskTotalDto.getPaperNumberAndType();
+            if (StringUtils.isNotBlank(paperNumberStrs)) {
+                String[] paperNumbers = paperNumberStrs.split(",");
+                Set<String> paperNumberSet = new HashSet<>(Arrays.asList(paperNumbers));
+                clientPrintTaskTotalDto.setPaperCount(paperNumberSet.size());
+            }
+        }
+
+        return clientPrintTaskTotalDto;
     }
 
     @Override
@@ -614,15 +733,6 @@ public class ClientServiceImpl implements ClientService {
         return examPrintPlanService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
     }
 
-    @Override
-    public void checkPrivilege(Long userId) {
-        List<SysPrivilege> sysPrivileges = sysPrivilegeService.getClientUrlByUserId(userId);
-        long count = sysPrivileges.stream().filter(m -> "打印端".equals(m.getName()) && "client".equals(m.getUrl())).count();
-        if (count == 0) {
-            throw ExceptionResultEnum.ERROR.exception("用户没有客户端权限");
-        }
-    }
-
     @Override
     public boolean updatePassword(Long userId, String password) {
         SysUser sysUser = sysUserService.getById(userId);
@@ -783,6 +893,41 @@ public class ClientServiceImpl implements ClientService {
         return clientPrintDataDtos;
     }
 
+    @Override
+    public List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId) {
+        ExamTask examTask = examTaskService.getById(examTaskId);
+        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, examTask.getCourseCode(), examTask.getPaperNumber());
+        if (CollectionUtils.isNotEmpty(examDetailCourses)) {
+            Set<String> relatePaperTypes = examDetailCourses.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).map(m -> m.getPaperType()).collect(Collectors.toSet());
+            List<Map<String, String>> paperList = new ArrayList<>();
+            ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTaskId);
+            if (CollectionUtils.isEmpty(relatePaperTypes)) {
+                throw ExceptionResultEnum.ERROR.exception("未找到关联的试卷卷型");
+            }
+            List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetail.getPaperAttachmentIds());
+            if (CollectionUtils.isEmpty(paperInfoVoList)) {
+                throw ExceptionResultEnum.ERROR.exception("未找到关联的试卷文件");
+            }
+
+            Map<String, String> paperMap = paperInfoVoList.stream().collect(Collectors.toMap(m -> m.getName(), m -> String.valueOf(m.getAttachmentId())));
+            for (String relatePaperType : relatePaperTypes) {
+                String[] paperTypes = relatePaperType.split(",");
+                for (String paperType : paperTypes) {
+                    if (!paperMap.containsKey(paperType)) {
+                        continue;
+                    }
+                    String attachmentId = paperMap.get(paperType);
+                    if (StringUtils.isNotBlank(attachmentId)) {
+                        paperList.add(teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(attachmentId), false));
+                    }
+                }
+            }
+            paperList = paperList.stream().distinct().collect(Collectors.toList());
+            return paperList;
+        }
+        return null;
+    }
+
     /**
      * new ClientPrintDataDto
      *

+ 5 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -90,6 +90,9 @@ public class ConditionServiceImpl implements ConditionService {
         // 入库审核菜单
         else if ("41".equals(privilegeIdString)) {
             return conditionMapper.listCourseForAudit(semesterId, examId, enable);
+        } else if("47".equals(privilegeIdString)){
+            dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
+            return conditionMapper.listCourseForPlanTask(semesterId, examId, printPlanIds, dpr);
         }
         // 成绩查询
         else if ("487".equals(privilegeIdString)) {
@@ -127,6 +130,8 @@ public class ConditionServiceImpl implements ConditionService {
         // 入库审核菜单
         else if ("41".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberAudit(semesterId, examId, courseCode);
+        } else if("47".equals(privilegeIdString)){
+            return conditionMapper.listPaperNumberPlanTask(semesterId, examId, printPlanIds, courseCode, dpr);
         } else {
             return conditionMapper.listPaperNumber(semesterId, examId, courseCode, printPlanIds, dpr);
         }

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

@@ -173,11 +173,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(), ServletUtil.getRequest().getServletPath());
         Page<PrintTaskDto> page = new Page<>(pageNumber, pageSize);
-        IPage<PrintTaskDto> printTaskDtoIPage = this.baseMapper.listPrintTask(page, schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, dpr);
-        for (PrintTaskDto record : printTaskDtoIPage.getRecords()) {
-            record.setStatusDisplay(record.getStatus().getName());
-        }
-        return printTaskDtoIPage;
+        return this.baseMapper.listPrintTask(page, schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, dpr);
     }
 
     @Override
@@ -864,67 +860,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return examinationExportDtoList;
     }
 
-    @Transactional
-    @Override
-    public Boolean updatePrintProgress(Long schoolId, Long examDetailId, String machineCode, Integer printProgress, Boolean isPrint) {
-
-        ExamDetail examDetail = this.getById(examDetailId);
-        // 撤回提示
-        if (ExamDetailStatusEnum.NEW.name().equals(examDetail.getStatus())
-                || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
-            throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
-        }
-
-        if (isPrint) {
-            // 更新考场进度、状态、打印结束时间
-            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamDetail::getPrintProgress, printProgress).set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).set(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH).eq(ExamDetail::getId, examDetailId);
-            this.update(updateWrapper);
-
-            // 所有考场打印完成,更新印刷计划状态
-            QueryWrapper<ExamDetail> examDetailQueryWrapper = new QueryWrapper<>();
-            examDetailQueryWrapper.lambda().eq(ExamDetail::getPrintPlanId, examDetail.getPrintPlanId()).ne(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH);
-            int count = this.count(examDetailQueryWrapper);
-            if (count == 0) {
-                UpdateWrapper<ExamPrintPlan> examPrintPlanUpdateWrapper = new UpdateWrapper<>();
-                examPrintPlanUpdateWrapper.lambda().set(ExamPrintPlan::getStatus, PrintPlanStatusEnum.FINISH).eq(ExamPrintPlan::getId, examDetail.getPrintPlanId());
-                examPrintPlanService.update(examPrintPlanUpdateWrapper);
-            }
-
-            // 记录机器打印数量
-            SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-            ClientPrintData clientPrintData = new ClientPrintData();
-            clientPrintData.setId(SystemConstant.getDbUuid());
-            clientPrintData.setSchoolId(schoolId);
-            clientPrintData.setExamDetailId(examDetailId);
-            clientPrintData.setMachineCode(machineCode);
-            clientPrintData.setPaperPages(examDetail.getPaperPages());
-            clientPrintData.setCardPages(examDetail.getCardPages());
-            clientPrintData.setPagesA4(examDetail.getPagesA4());
-            clientPrintData.setCreateId(sysUser.getId());
-            clientPrintData.setCreateTime(System.currentTimeMillis());
-            clientPrintDataService.save(clientPrintData);
-        } else {
-            // 更新打印结束时间
-            UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().set(ExamDetail::getPrintEndTime, System.currentTimeMillis()).eq(ExamDetail::getId, examDetailId);
-            this.update(updateWrapper);
-        }
-        return true;
-    }
-
-    @Override
-    public IPage<ClientExamStudentDto> listStudent(Long schoolId, Long examDetailId, String studentCode, String studentName, String courseCode, Integer pageNumber, Integer pageSize) {
-        // 撤回提示
-        ExamDetail examDetail = this.getById(examDetailId);
-        if (ExamDetailStatusEnum.NEW.name().equals(examDetail.getStatus())
-                || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
-            throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
-        }
-        Page<ClientExamStudentDto> page = new Page<>(pageNumber, pageSize);
-        return this.baseMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(studentCode), SystemConstant.translateSpecificSign(studentName), courseCode);
-    }
-
     @Override
     public List<Map> listStudentByExamDetailCourseId(Long schoolId, Long examDetailCourseId, String studentCode, String type) {
         return this.baseMapper.listStudentByExamDetailCourseId(schoolId, examDetailCourseId, studentCode, type);
@@ -941,11 +876,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return null;
     }
 
-    @Override
-    public List<ExamDetailCourse> listSyncPaperNumberByPrintPlanId(Long printPlanId) {
-        return this.baseMapper.listSyncPaperNumberByPrintPlanId(printPlanId);
-    }
-
     @Override
     public boolean taskNormal(ExamDetail examDetail) {
         // 已扫描过,不能作废
@@ -1116,27 +1046,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         }
     }
 
-    @Override
-    public void startInitTask(Long schoolId) throws Exception {
-        QueryWrapper<TBTask> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(TBTask::getSchoolId, schoolId)
-                .eq(TBTask::getType, TaskTypeEnum.EXAMINATION_IMPORT)
-                .eq(TBTask::getStatus, TaskStatusEnum.INIT)
-                .orderByAsc(TBTask::getCreateTime);
-        List<TBTask> tbTasks = tbTaskService.list(queryWrapper);
-        if (!CollectionUtils.isEmpty(tbTasks)) {
-            TBTask tbTask = tbTasks.get(0);
-            SysUser sysUser = sysUserService.getById(tbTask.getCreateId());
-            Map<String, Object> map = new HashMap<>();
-
-            map.computeIfAbsent(SystemConstant.TASK, v -> tbTask);
-            map.computeIfAbsent(SystemConstant.USER, v -> sysUser);
-            map.computeIfAbsent(SystemConstant.TB_TASK_ID, v -> tbTask.getId());
-            asyncExaminationImportTemplateService.importTask(map);
-        }
-
-    }
-
     @Transactional
     @Override
     public void deleteExaminationDataByExamDetailIds(List<Long> examDetailIdList) {
@@ -1298,15 +1207,6 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return new ArrayList<>(clazzNameSet);
     }
 
-    @Override
-    public List<ExamDetail> listByExamAndPackage(Long examId, String packageCode) {
-        QueryWrapper<ExamDetail> wrapper = new QueryWrapper<>();
-        LambdaQueryWrapper<ExamDetail> lw = wrapper.lambda();
-        lw.eq(ExamDetail::getExamId, examId);
-        lw.eq(ExamDetail::getPackageCode, packageCode);
-        return this.list(wrapper);
-    }
-
     @Override
     public ExamDetail getByExamDetailCourseId(Long examDetailCourseId) {
         ExamDetailCourse examDetailCourse = examDetailCourseService.getById(examDetailCourseId);

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

@@ -304,90 +304,6 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         return finalList;
     }
 
-    @Override
-    public IPage<ClientPrintTaskDto> listClientPrintTask(Page<ClientPrintTaskDto> page, Long schoolId, Long semesterId, Long examId, String machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Long orgId) {
-        // 以下状态考场状态不可查询
-        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        IPage<ClientPrintTaskDto> clientPrintTaskDtoIPage = this.baseMapper.listClientPrintTask(page, schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
-        for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
-            // 试卷、题卡
-            String printContent = record.getPrintContent();
-            record.setIncluedPaper(!StringUtils.isBlank(printContent) && printContent.contains("PAPER"));
-            record.setIncluedCard(!StringUtils.isBlank(printContent) && printContent.contains("CARD"));
-
-            //印品
-            String variableContent = record.getVariableContent();
-            List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
-            record.setIncluedSign(false);
-            record.setIncluedPackage(false);
-            for (Map map : variableList) {
-                String type = map.get("type").toString();
-                String templateId = map.get("templateId").toString();
-                if (ClassifyEnum.SIGN.name().equals(type) && StringUtils.isNotBlank(templateId)) {
-                    record.setIncluedSign(true);
-                }
-                if (ClassifyEnum.PACKAGE.name().equals(type) && StringUtils.isNotBlank(templateId)) {
-                    record.setIncluedPackage(true);
-                }
-            }
-            String ordinaryContent = record.getOrdinaryContent();
-            List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
-            record.setIncluedCheckin(false);
-            for (Map map : ordinaryList) {
-                String type = map.get("type").toString();
-                String templateId = map.get("templateId").toString();
-                if (ClassifyEnum.CHECK_IN.name().equals(type) && StringUtils.isNotBlank(templateId)) {
-                    record.setIncluedCheckin(true);
-                }
-            }
-
-            if (StringUtils.isNotBlank(record.getClassName())) {
-                record.setClassName(String.join(",", new HashSet<>(Arrays.asList(record.getClassName().split(",")))));
-            }
-        }
-        return clientPrintTaskDtoIPage;
-    }
-
-
-    @Override
-    public List<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long semesterId, Long examId, String machineCode, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Long orgId) {
-        // 以下状态考场状态不可查询
-        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        return this.baseMapper.listClientPrintTask(schoolId, semesterId, examId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId, examDetailStatus);
-    }
-
-    @Override
-    public ClientPrintTaskTotalDto clientTaskTotalData(Long semesterId, Long examId, String printPlanId, Long orgId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, String machineCode) {
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-//        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        // 以下状态考场状态不可查询
-        String[] examDetailStatus = new String[]{ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        ClientPrintTaskTotalDto clientPrintTaskTotalDto = this.baseMapper.clientTaskTotalData(schoolId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode, orgId, examDetailStatus);
-
-        if (clientPrintTaskTotalDto != null) {
-            // 累计a3,a4
-            List<ClientPrintData> list = clientPrintDataService.listBySchoolIdAndMachineCode(schoolId, machineCode);
-            if (!list.isEmpty()) {
-                int paperPages = list.stream().filter(m -> m.getPaperPages() != null).mapToInt(ClientPrintData::getPaperPages).sum();
-                clientPrintTaskTotalDto.setHostPaperPages(paperPages / 2);
-                int cardPages = list.stream().filter(m -> m.getCardPages() != null).mapToInt(ClientPrintData::getCardPages).sum();
-                clientPrintTaskTotalDto.setHostCardPages(cardPages / 2);
-                int pagesA4 = list.stream().filter(m -> m.getPagesA4() != null).mapToInt(ClientPrintData::getPagesA4).sum();
-                clientPrintTaskTotalDto.setHostPagesA4(pagesA4 / 2);
-            }
-
-            // 试卷总计
-            String paperNumberStrs = clientPrintTaskTotalDto.getPaperNumberAndType();
-            if (StringUtils.isNotBlank(paperNumberStrs)) {
-                String[] paperNumbers = paperNumberStrs.split(",");
-                Set<String> paperNumberSet = new HashSet<>(Arrays.asList(paperNumbers));
-                clientPrintTaskTotalDto.setPaperCount(paperNumberSet.size());
-            }
-        }
-
-        return clientPrintTaskTotalDto;
-    }
-
     @Override
     public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Page<ClientPrintStatisticsDto> page, Long schoolId, Long semesterId, Long examId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Long orgId) {
         // 以下状态考场状态不可查询

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

@@ -300,46 +300,6 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         }
     }
 
-    @Override
-    public List<Map<String, String>> getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId) {
-        ExamTask examTask = examTaskService.getById(examTaskId);
-        List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByPrintPlanIdAndCourseCodeAndPaperNumber(schoolId, printPlanId, examTask.getCourseCode(), examTask.getPaperNumber());
-        if (CollectionUtils.isNotEmpty(examDetailCourses)) {
-            Set<String> relatePaperTypes = examDetailCourses.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).map(m -> m.getPaperType()).collect(Collectors.toSet());
-            List<Map<String, String>> paperList = new ArrayList<>();
-            QueryWrapper<ExamTaskDetail> examTaskDetailQueryWrapper = new QueryWrapper<>();
-            examTaskDetailQueryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId);
-            ExamTaskDetail examTaskDetail = this.getOne(examTaskDetailQueryWrapper);
-            if (Objects.isNull(examTaskDetail)) {
-                throw ExceptionResultEnum.ERROR.exception("未查询到卷库中的试卷");
-            }
-            if (CollectionUtils.isEmpty(relatePaperTypes)) {
-                throw ExceptionResultEnum.ERROR.exception("未找到关联的试卷卷型");
-            }
-            List<PaperInfoVo> paperInfoVoList = ExamTaskUtil.parsePaperAttachmentPath(examTaskDetail.getPaperAttachmentIds());
-            if (CollectionUtils.isEmpty(paperInfoVoList)) {
-                throw ExceptionResultEnum.ERROR.exception("未找到关联的试卷文件");
-            }
-
-            Map<String, String> paperMap = paperInfoVoList.stream().collect(Collectors.toMap(m -> m.getName(), m -> String.valueOf(m.getAttachmentId())));
-            for (String relatePaperType : relatePaperTypes) {
-                String[] paperTypes = relatePaperType.split(",");
-                for (String paperType : paperTypes) {
-                    if (!paperMap.containsKey(paperType)) {
-                        continue;
-                    }
-                    String attachmentId = paperMap.get(paperType);
-                    if (StringUtils.isNotBlank(attachmentId)) {
-                        paperList.add(teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(attachmentId), false));
-                    }
-                }
-            }
-            paperList = paperList.stream().distinct().collect(Collectors.toList());
-            return paperList;
-        }
-        return null;
-    }
-
     @Override
     @Transactional
     public Map<String, Object> paperUpdate(ExamTaskDetail examTaskDetail) {
@@ -575,6 +535,9 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     @Override
     public ExamTaskDetail getByExamTaskId(Long examTaskId) {
         ExamTask examTask = examTaskService.getById(examTaskId);
+        if (examTask == null) {
+            throw ExceptionResultEnum.ERROR.exception("命题任务不存在");
+        }
         QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId);
         ExamTaskDetail examTaskDetail = this.getOne(queryWrapper);

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

@@ -25,7 +25,6 @@ import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.execute.AsyncPaperReviewPdfExportService;
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
-import com.qmth.teachcloud.common.util.HtmlToPdfUtil;
 import com.qmth.teachcloud.common.bean.dto.AssignTeacherDto;
 import com.qmth.teachcloud.common.bean.dto.BlurryUserDto;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
@@ -780,9 +779,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 .eq(ExamTask::getId, examTask.getId());
         this.update(updateWrapper);
 
-        QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskDetail.getExamTaskId());
-        ExamTaskDetail detail = examTaskDetailService.getOne(queryWrapper);
+        ExamTaskDetail detail = examTaskDetailService.getByExamTaskId(examTaskDetail.getExamTaskId());
         if (detail != null) {
             examTaskDetail.setId(detail.getId());
             // 已曝光试卷和未曝光试卷赋值
@@ -985,23 +982,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         return this.getOne(queryWrapper);
     }
 
-    @Override
-    public IPage<ClientExamTaskDto> listTryTask(Long schoolId, Long semesterId, Long examId, String machineCode, Long orgId, Long
-            printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
-        Page<ClientExamTaskDto> page = new Page<>(pageNumber, pageSize);
-        // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
-        String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        return this.baseMapper.listClientExamTaskPage(page, schoolId, semesterId, examId, machineCode, printPlanId, courseCode, paperNumber, isTry, isPass, orgId, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
-    }
-
-    @Override
-    public List<ClientExamTaskDto> listTryTask(Long schoolId, Long semesterId, Long examId, String machineCode, Long orgId, Long
-            printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass) {
-        // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
-        String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name(), ExamDetailStatusEnum.CANCEL.name()};
-        return this.baseMapper.listClientExamTaskPage(schoolId, semesterId, examId, machineCode, printPlanId, courseCode, paperNumber, isTry, isPass, orgId, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
-    }
-
     @Override
     public void checkDataByExamination(Long printPlanId, List<Long> examDetailIdList, SysUser user) {
         Set<String> stringSet = new HashSet<>();
@@ -2090,10 +2070,10 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
     @Override
     public IPage<MakeupExamTaskDto> listMakeupExamTask(Long printPlanId, Long semesterId, Long examId, Long collegeId, String courseCode, String paperNumber, String userName, Integer pageNumber, Integer pageSize) {
-        if(semesterId == null){
+        if (semesterId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
         }
-        if(examId == null){
+        if (examId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
         Page<MakeupExamTaskDto> page = new Page<>(pageNumber, pageSize);
@@ -2112,8 +2092,8 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             if (makeupExamTaskParam.getExamDetailId() == null) {
                 // 课程是否在其它补考计划已创建任务
                 int count = examDetailService.countMakeupUsedByExamIdAndPaperNumber(makeupExamTaskParam.getExamId(), makeupExamTaskParam.getPaperNumber());
-                if(count > 0){
-                    throw ExceptionResultEnum.ERROR.exception("试卷编号["+makeupExamTaskParam.getPaperNumber()+"]已在其它计划中提交");
+                if (count > 0) {
+                    throw ExceptionResultEnum.ERROR.exception("试卷编号[" + makeupExamTaskParam.getPaperNumber() + "]已在其它计划中提交");
                 }
 
                 examDetail = new ExamDetail();
@@ -2125,8 +2105,8 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 examDetail.setPrintPlanName(examPrintPlan.getName());
                 examDetail.setExamId(makeupExamTaskParam.getExamId());
                 examDetail.setStatus(ExamDetailStatusEnum.NEW);
-                examDetail.setExamStartTime(DateDisposeUtils.parseDate(DateDisposeUtils.getDate()+" 00:00:00").getTime());
-                examDetail.setExamEndTime(DateDisposeUtils.parseDate(DateDisposeUtils.getDate()+" 23:59:00").getTime());
+                examDetail.setExamStartTime(DateDisposeUtils.parseDate(DateDisposeUtils.getDate() + " 00:00:00").getTime());
+                examDetail.setExamEndTime(DateDisposeUtils.parseDate(DateDisposeUtils.getDate() + " 23:59:00").getTime());
                 examDetail.setTotalSubjects(makeupExamTaskParam.getTotalSubjects());
                 examDetail.setExamDataSource(ExamDataSourceEnum.EXAM_TASK);
                 examDetail.setNormal(true);

+ 361 - 0
distributed-print-business/src/main/resources/mapper/ClientMapper.xml

@@ -0,0 +1,361 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.qmth.distributed.print.business.mapper.ClientMapper">
+    <select id="pageTryTask" resultType="com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto">
+        SELECT
+            distinct a.school_id schoolId,
+            a.exam_id examId,
+            a.id printPlanId,
+            a.name printPlanName,
+            c.course_code courseCode,
+            c.course_name courseName,
+            c.paper_number paperNumber,
+            d.id examTaskId,
+            d.specialty,
+            d.user_id userId,
+            f.real_name userName,
+            ifnull(e.is_try, false) isTry,
+            ifnull(e.is_pass, false) isPass,
+            e.try_time tryTime
+        FROM
+            (select epp.id, epp.school_id, epp.exam_id, epp.name, epp.status from exam_print_plan  epp
+        LEFT JOIN
+        basic_exam be ON epp.exam_id = be.id
+        <where>
+            and epp.school_id = #{schoolId}
+            and be.enable = true
+            and be.semester_id = #{semesterId}
+            <if test="examId != null">
+                and be.id = #{examId}
+            </if>
+            and epp.status = #{printPlanStatus}
+            and LOCATE('PAPER', epp.print_content) > 0
+        </where>) a
+        JOIN
+            exam_detail b ON a.id = b.print_plan_id
+        JOIN
+            exam_detail_course c ON b.id = c.exam_detail_id
+        JOIN
+            exam_task d ON d.school_id = c.school_id
+            AND d.exam_id = b.exam_id
+            AND d.course_code = c.course_code
+            AND d.paper_number = c.paper_number
+        LEFT JOIN
+            client_status e ON e.school_id = d.school_id
+            AND b.id = e.exam_detail_id
+            AND a.id = e.print_plan_id
+            AND e.course_code = d.course_code
+            AND e.paper_number = d.paper_number
+            and e.machine_code = #{machineCode}
+        LEFT JOIN
+            sys_user f ON d.user_id = f.id
+        <where>
+            and b.status not in
+            <foreach item="item" collection="examDetailStatus" separator="," open="(" close=")" index="">
+                #{item}
+            </foreach>
+            <if test="printPlanId != null and printPlanId != ''">
+                and a.id = #{printPlanId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and c.course_code = #{courseCode}
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                and c.paper_number = #{paperNumber}
+            </if>
+            <if test="isTry != null">
+                and IFNULL(e.is_try, FALSE) = #{isTry}
+            </if>
+            <if test="isPass != null">
+                and IFNULL(e.is_pass, FALSE) = #{isPass}
+            </if>
+            <if test="orgId != null">
+                AND (b.print_house_id = #{orgId} or b.print_house_id is null)
+            </if>
+        </where>
+    </select>
+    <select id="listClientPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto">
+        SELECT
+        b.id examDetailId,
+        b.package_code packageCode,
+        a.id printPlanId,
+        a.NAME printPlanName,
+        a.print_content printContent,
+        a.variable_content variableContent,
+        a.ordinary_content ordinaryContent,
+        b.exam_start_time examStartTime,
+        b.exam_end_time examEndTime,
+        c.courseNameCode,
+        c.paperNumber,
+        c.classId,
+        c.className,
+        b.exam_place examPlace,
+        b.exam_room examRoom,
+        b.total_subjects totalSubjects,
+        IFNULL(b.paper_pages, 0) paperPages,
+        IFNULL(b.card_pages, 0) cardPages,
+        IFNULL(b.pages_a4, 0) pagesA4,
+        CASE b.STATUS
+        WHEN 'FINISH' THEN IFNULL(b.paper_pages, 0) + IFNULL(b.card_pages, 0) + IFNULL(b.pages_a4, 0)
+        ELSE 0
+        END totalPrint,
+        c.singlePagesA3,
+        b.STATUS,
+        IFNULL(b.validate, FALSE) validate,
+        CASE c.isDownload
+        WHEN 0 THEN TRUE
+        ELSE FALSE
+        END download,
+        b.print_user printUser,
+        b.print_start_time printStartTime,
+        b.print_end_time printEndTime,
+        CASE c.isTry
+        WHEN 0 THEN TRUE
+        ELSE FALSE
+        END isTry,
+        CASE c.isPass
+        WHEN 0 THEN TRUE
+        ELSE FALSE
+        END isPass
+        FROM
+        (SELECT
+        epp.school_id,
+        epp.id,
+        epp.exam_id,
+        epp.NAME,
+        epp.print_content,
+        epp.variable_content,
+        epp.ordinary_content,
+        epp.STATUS
+        FROM
+        exam_print_plan epp
+        JOIN basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
+        <where>
+            and epp.school_id = #{schoolId}
+            and be.semester_id = #{semesterId}
+            <if test="examId != null">
+                and epp.exam_id = #{examId}
+            </if>
+            <if test="printPlanId != null">
+                and epp.id = #{printPlanId}
+            </if>
+        </where>) a
+        JOIN
+        (SELECT *
+        from exam_detail t
+        <where>
+            and t.normal = 1
+            <choose>
+                <when test="status != null and status != ''">
+                    and t.status = #{status}
+                </when>
+                <otherwise>
+                    AND t.status not IN
+                    <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </otherwise>
+            </choose>
+            <if test="examPlace != null and examPlace != ''">
+                and t.exam_place = #{examPlace}
+            </if>
+            <if test="examRoom != null and examRoom != ''">
+                and t.exam_room = #{examRoom}
+            </if>
+            <if test="examStartTime != null and examStartTime != ''">
+                and t.exam_start_time &gt; #{examStartTime}
+            </if>
+            <if test="examEndTime != null and examEndTime != ''">
+                and t.exam_end_time &lt; #{examEndTime}
+            </if>
+            <if test="validate != null">
+                and ifnull(t.validate, false) = #{validate}
+            </if>
+            <if test="orgId != null">
+                AND (t.print_house_id = #{orgId} or t.print_house_id is null)
+            </if>
+        </where>
+        ) b ON a.id = b.print_plan_id
+        JOIN
+        (SELECT
+        a.exam_detail_id,
+        GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
+        GROUP_CONCAT(a.paper_number) paperNumber,
+        GROUP_CONCAT(a.clazz_id) classId,
+        GROUP_CONCAT(a.clazz_name) className,
+        GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
+        SUM(CASE b.is_download
+        WHEN TRUE THEN 0
+        ELSE 1
+        END) isDownload,
+        SUM(CASE b.is_try
+        WHEN TRUE THEN 0
+        ELSE 1
+        END) isTry,
+        SUM(CASE b.is_pass
+        WHEN TRUE THEN 0
+        ELSE 1
+        END) isPass
+        FROM
+        exam_detail_course a
+        LEFT JOIN client_status b ON a.school_id = b.school_id
+        AND a.exam_detail_id = b.exam_detail_id
+        AND a.course_code = b.course_code
+        AND a.paper_number = b.paper_number
+        AND b.machine_code = #{machineCode}
+        GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
+        <where>
+            <if test="courseCode != null and courseCode != ''">
+                and c.courseNameCode like concat('%',#{courseCode},'%')
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                and c.paperNumber like concat('%',#{paperNumber},'%')
+            </if>
+            <if test="isDownload != null">
+                <if test="isDownload == true">
+                    and c.isDownload = 0
+                </if>
+                <if test="isDownload == false">
+                    and c.isDownload > 0
+                </if>
+            </if>
+        </where>
+        ORDER BY a.id DESC , b.id DESC
+    </select>
+    <select id="clientTaskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto">
+        SELECT
+        ifnull(count(b.package_code), 0) packageCount,
+        ifnull(sum(b.total_subjects), 0) totalSubjects,
+        ifnull(sum(ifnull(b.paper_pages, 0)), 0)/2 paperPages,
+        ifnull(sum(ifnull(b.card_pages, 0)), 0)/2 cardPages,
+        ifnull(sum(ifnull(b.pages_a4, 0)), 0) /2 pagesA4,
+        ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.paper_pages, 0) end),0)/2 paperPagesLeft,
+        ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.card_pages, 0) end),0)/2 cardPagesLeft,
+        ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.pages_a4, 0) end),0)/2 pagesA4Left,
+        GROUP_CONCAT(c.paperType) paperNumberAndType
+        FROM
+        (select epp.id from exam_print_plan epp
+        JOIN
+        basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
+        <where>
+            and epp.school_id = #{schoolId}
+            and be.semester_id = #{semesterId}
+            <if test="examId != null">
+                and epp.exam_id = #{examId}
+            </if>
+            <if test="printPlanId != null">
+                and epp.id = #{printPlanId}
+            </if>
+        </where>) a
+        JOIN
+        (SELECT *
+        from exam_detail t
+        <where>
+            <choose>
+                <when test="status != null and status != ''">
+                    and t.status = #{status}
+                </when>
+                <otherwise>
+                    AND t.status not IN
+                    <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </otherwise>
+            </choose>
+            <if test="examPlace != null and examPlace != ''">
+                and t.exam_place = #{examPlace}
+            </if>
+            <if test="examRoom != null and examRoom != ''">
+                and t.exam_room = #{examRoom}
+            </if>
+            <if test="examStartTime != null and examStartTime != ''">
+                and t.exam_start_time &gt; #{examStartTime}
+            </if>
+            <if test="examEndTime != null and examEndTime != ''">
+                and t.exam_end_time &lt; #{examEndTime}
+            </if>
+            <if test="validate != null">
+                and ifnull(t.validate, false) = #{validate}
+            </if>
+            <if test="orgId != null">
+                AND (t.print_house_id = #{orgId} or t.print_house_id is null)
+            </if>
+        </where>
+        ) b ON a.id = b.print_plan_id
+        JOIN
+        (SELECT
+        a.exam_detail_id,
+        GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
+        GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paperType,
+        GROUP_CONCAT(a.paper_number) paperNumber,
+        GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
+        SUM(CASE b.is_download
+        WHEN true THEN 0
+        ELSE 1
+        END) isDownload,
+        SUM(CASE b.is_try
+        WHEN true THEN 0
+        ELSE 1
+        END) isTry,
+        SUM(CASE b.is_pass
+        WHEN true THEN 0
+        ELSE 1
+        END) isPass
+        FROM
+        exam_detail_course a
+        LEFT JOIN client_status b ON a.school_id = b.school_id
+        AND a.exam_detail_id = b.exam_detail_id
+        AND a.course_code = b.course_code
+        AND a.paper_number = b.paper_number
+        AND b.machine_code = #{machineCode}
+        GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
+        <where>
+            <if test="courseCode != null and courseCode != ''">
+                and c.courseNameCode like concat('%',#{courseCode},'%')
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                and c.paperNumber like concat('%',#{paperNumber},'%')
+            </if>
+            <if test="isDownload != null">
+                <if test="isDownload == true">
+                    and c.isDownload = 0
+                </if>
+                <if test="isDownload == false">
+                    and c.isDownload > 0
+                </if>
+            </if>
+        </where>
+    </select>
+    <select id="listClientExamStudentPage"
+            resultType="com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto">
+        SELECT
+            a.id examDetailId,
+            b.course_code courseCode,
+            b.course_name courseName,
+            b.paper_number paperNumber,
+            c.student_code studentCode,
+            c.ticket_number ticketNumber,
+            c.student_name studentName,
+            c.site_number siteNumber
+        FROM
+        exam_detail a
+        JOIN
+        exam_detail_course b ON a.id = b.exam_detail_id
+        JOIN
+        exam_student c ON b.id = c.exam_detail_course_id
+        <where>
+            and a.school_id = #{schoolId}
+            and a.id = #{examDetailId}
+            <if test="studentCode != null and studentCode != ''">
+                and c.student_code like concat('%', #{studentCode}, '%')
+            </if>
+            <if test="studentName != null and studentName != ''">
+                and c.student_name like concat('%', #{studentName}, '%')
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and b.course_code = #{courseCode}
+            </if>
+        </where>
+        order by c.student_code
+    </select>
+</mapper>

+ 81 - 0
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -308,4 +308,85 @@
             </foreach>
         </where>
     </select>
+    <select id="listCourseForPlanTask" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        SELECT
+            distinct c.course_code code, c.course_name name
+        FROM
+        exam_print_plan a
+        JOIN
+        exam_detail b ON a.id = b.print_plan_id
+        JOIN
+        exam_detail_course c ON b.id = c.exam_detail_id
+        JOIN
+        sys_user d ON a.create_id = d.id
+        JOIN
+        basic_exam e ON a.exam_id = e.id
+        <where>
+            <if test="semesterId != null and semesterId != ''">
+                and e.semester_id = #{semesterId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and e.id = #{examId}
+            </if>
+            <if test="printPlanIds != null and printPlanIds.size >0">
+                and a.id in
+                <foreach collection="printPlanIds" separator="," open="(" close=")" item="printPlanId">
+                    #{printPlanId}
+                </foreach>
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND a.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND d.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
+    <select id="listPaperNumberPlanTask" resultType="java.lang.String">
+        SELECT
+            distinct c.paper_number
+        FROM
+        exam_print_plan a
+        JOIN
+        exam_detail b ON a.id = b.print_plan_id
+        JOIN
+        exam_detail_course c ON b.id = c.exam_detail_id
+        JOIN
+        sys_user d ON a.create_id = d.id
+        JOIN
+        basic_exam e ON a.exam_id = e.id
+        <where>
+            <if test="semesterId != null and semesterId != ''">
+                and e.semester_id = #{semesterId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and e.id = #{examId}
+            </if>
+            <if test="printPlanIds != null and printPlanIds.size >0">
+                and a.id in
+                <foreach collection="printPlanIds" separator="," open="(" close=")" item="printPlanId">
+                    #{printPlanId}
+                </foreach>
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and c.course_code = #{courseCode}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND a.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND d.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+    </select>
 </mapper>

+ 52 - 83
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -63,7 +63,6 @@
                 LEFT JOIN
                 basic_semester bs ON bs.id = be.semester_id
             <where>
-                and be.enable = true
                 <if test="schoolId != null">
                     and epp.school_id = #{schoolId}
                 </if>
@@ -89,7 +88,33 @@
                 </if>
             </where>) a
                  JOIN
-            exam_detail b ON a.id = b.print_plan_id
+            (select * from exam_detail
+        <where>
+            <if test="status != null and status != ''">
+                and status = #{status}
+            </if>
+            <if test="examPlace != null and examPlace != ''">
+                and exam_place = #{examPlace}
+            </if>
+            <if test="examRoom != null and examRoom != ''">
+                and exam_room = #{examRoom}
+            </if>
+            <if test="examStartTime != null and examStartTime != ''">
+                and exam_start_time &gt; #{examStartTime}
+            </if>
+            <if test="examEndTime != null and examEndTime != ''">
+                and exam_end_time &lt; #{examEndTime}
+            </if>
+            <if test="printStartTime != null and printStartTime != ''">
+                and print_start_time &gt; #{printStartTime}
+            </if>
+            <if test="printEndTime != null and printEndTime != ''">
+                and print_start_time &lt; #{printEndTime}
+            </if>
+            <if test="printHouseId != null and printHouseId != ''">
+                and print_house_id = #{printHouseId}
+            </if>
+        </where>) b ON a.id = b.print_plan_id
                  JOIN
             (SELECT
                 exam_detail_id,
@@ -109,32 +134,6 @@
             GROUP BY exam_detail_id) c ON b.id = c.exam_detail_id
                 LEFT JOIN
             sys_org e ON b.print_house_id = e.id
-            <where>
-                <if test="status != null and status != ''">
-                    and b.status = #{status}
-                </if>
-                <if test="examPlace != null and examPlace != ''">
-                    and b.exam_place = #{examPlace}
-                </if>
-                <if test="examRoom != null and examRoom != ''">
-                    and b.exam_room = #{examRoom}
-                </if>
-                <if test="examStartTime != null and examStartTime != ''">
-                    and b.exam_start_time &gt; #{examStartTime}
-                </if>
-                <if test="examEndTime != null and examEndTime != ''">
-                    and b.exam_end_time &lt; #{examEndTime}
-                </if>
-                <if test="printStartTime != null and printStartTime != ''">
-                    and b.print_start_time &gt; #{printStartTime}
-                </if>
-                <if test="printEndTime != null and printEndTime != ''">
-                    and b.print_start_time &lt; #{printEndTime}
-                </if>
-                <if test="printHouseId != null and printHouseId != ''">
-                    and b.print_house_id = #{printHouseId}
-                </if>
-            </where>
         ORDER BY b.id desc
     </select>
 
@@ -415,65 +414,43 @@
                 </if>
             </where>) a
          JOIN
-            exam_detail b ON a.id = b.print_plan_id
+            (select * from exam_detail ed
         <where>
             <if test="status != null and status != ''">
-                and b.status = #{status}
+                and ed.status = #{status}
             </if>
             <if test="examPlace != null and examPlace != ''">
-                and b.exam_place = #{examPlace}
+                and ed.exam_place = #{examPlace}
             </if>
             <if test="examRoom != null and examRoom != ''">
-                and b.exam_room = #{examRoom}
+                and ed.exam_room = #{examRoom}
             </if>
             <if test="examStartTime != null and examStartTime != ''">
-                and b.exam_start_time &gt; #{examStartTime}
+                and ed.exam_start_time &gt; #{examStartTime}
             </if>
             <if test="examEndTime != null and examEndTime != ''">
-                and b.exam_end_time &lt; #{examEndTime}
+                and ed.exam_end_time &lt; #{examEndTime}
             </if>
             <if test="printStartTime != null and printStartTime != ''">
-                and b.print_start_time &gt; #{printStartTime}
+                and ed.print_start_time &gt; #{printStartTime}
             </if>
             <if test="printEndTime != null and printEndTime != ''">
-                and b.print_start_time &lt; #{printEndTime}
+                and ed.print_start_time &lt; #{printEndTime}
             </if>
             <if test="printHouseId != null and printHouseId != ''">
-                and b.print_house_id = #{printHouseId}
-            </if>
-        </where>
-    </select>
-    <select id="listClientExamStudentPage"
-            resultType="com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto">
-        SELECT
-            a.id examDetailId,
-            b.course_code courseCode,
-            b.course_name courseName,
-            b.paper_number paperNumber,
-            c.student_code studentCode,
-            c.ticket_number ticketNumber,
-            c.student_name studentName,
-            c.site_number siteNumber
-        FROM
-            exam_detail a
-                JOIN
-            exam_detail_course b ON a.id = b.exam_detail_id
-                JOIN
-            exam_student c ON b.id = c.exam_detail_course_id
-        <where>
-            and a.school_id = #{schoolId}
-            and a.id = #{examDetailId}
-            <if test="studentCode != null and studentCode != ''">
-                and c.student_code like concat('%', #{studentCode}, '%')
+                and ed.print_house_id = #{printHouseId}
             </if>
-            <if test="studentName != null and studentName != ''">
-                and c.student_name like concat('%', #{studentName}, '%')
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and b.course_code = #{courseCode}
+            <if test="courseCode != null or paperNumber != null">
+                and exists (select 1 from exam_detail_course edc where ed.id = edc.exam_detail_id
+                <if test="courseCode != null">
+                    and edc.course_code = #{courseCode}
+                </if>
+                <if test="paperNumber != null">
+                    and edc.paper_number = #{paperNumber}
+                </if>
+                )
             </if>
-        </where>
-        order by c.student_code
+        </where>) b ON a.id = b.print_plan_id
     </select>
     <select id="listStudentByExamDetailCourseId" resultType="java.util.Map">
         SELECT
@@ -529,6 +506,12 @@
             <if test="status != null and status != ''">
                 and b.status = #{status}
             </if>
+            <if test="courseCode != null and courseCode != ''">
+                and c.course_code = #{courseCode}
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                and c.paper_number = #{paperNumber}
+            </if>
             <if test="examPlace != null and examPlace != ''">
                 and b.exam_place = #{examPlace}
             </if>
@@ -557,20 +540,6 @@
             </if>
         </where>
     </select>
-    <select id="listSyncPaperNumberByPrintPlanId"
-            resultType="com.qmth.distributed.print.business.entity.ExamDetailCourse">
-        SELECT DISTINCT
-            b.school_id schoolId,
-            b.course_code courseCode,
-            b.paper_number paperNumber,
-            b.paper_type paperType
-        FROM
-            exam_detail a
-                LEFT JOIN
-            exam_detail_course b ON a.id = b.exam_detail_id
-        WHERE
-            a.print_plan_id = #{printPlanId}
-    </select>
 
     <select id="findPdfDownload" resultType="com.qmth.distributed.print.business.bean.dto.ExamDetailPdfDownloadDto">
         select

+ 0 - 252
distributed-print-business/src/main/resources/mapper/ExamPrintPlanMapper.xml

@@ -147,258 +147,6 @@
             </if>
         </where>
     </select>
-    <select id="listClientPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto">
-        SELECT
-            b.id examDetailId,
-            b.package_code packageCode,
-            a.id printPlanId,
-            a.NAME printPlanName,
-            a.print_content printContent,
-            a.variable_content variableContent,
-            a.ordinary_content ordinaryContent,
-            b.exam_start_time examStartTime,
-            b.exam_end_time examEndTime,
-            c.courseNameCode,
-            c.paperNumber,
-            c.classId,
-            c.className,
-            b.exam_place examPlace,
-            b.exam_room examRoom,
-            b.total_subjects totalSubjects,
-            IFNULL(b.paper_pages, 0) paperPages,
-            IFNULL(b.card_pages, 0) cardPages,
-            IFNULL(b.pages_a4, 0) pagesA4,
-            CASE b.STATUS
-                WHEN 'FINISH' THEN IFNULL(b.paper_pages, 0) + IFNULL(b.card_pages, 0) + IFNULL(b.pages_a4, 0)
-                ELSE 0
-                END totalPrint,
-            c.singlePagesA3,
-            b.STATUS,
-            IFNULL(b.validate, FALSE) validate,
-            CASE c.isDownload
-                WHEN 0 THEN TRUE
-                ELSE FALSE
-                END download,
-            b.print_user printUser,
-            b.print_start_time printStartTime,
-            b.print_end_time printEndTime,
-            CASE c.isTry
-                WHEN 0 THEN TRUE
-                ELSE FALSE
-                END isTry,
-            CASE c.isPass
-                WHEN 0 THEN TRUE
-                ELSE FALSE
-                END isPass
-        FROM
-            (SELECT
-                 epp.school_id,
-                 epp.id,
-                 epp.exam_id,
-                 epp.NAME,
-                 epp.print_content,
-                 epp.variable_content,
-                 epp.ordinary_content,
-                 epp.STATUS
-             FROM
-                 exam_print_plan epp
-                     JOIN basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
-                <where>
-                    and epp.school_id = #{schoolId}
-                    and be.semester_id = #{semesterId}
-                    <if test="examId != null">
-                        and epp.exam_id = #{examId}
-                    </if>
-                    <if test="printPlanId != null">
-                        and epp.id = #{printPlanId}
-                    </if>
-                </where>) a
-                JOIN
-                (SELECT *
-                    from exam_detail t
-                    <where>
-                        and t.normal = 1
-                        <choose>
-                            <when test="status != null and status != ''">
-                                and t.status = #{status}
-                            </when>
-                            <otherwise>
-                                AND t.status not IN
-                                <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
-                                    #{item}
-                                </foreach>
-                            </otherwise>
-                        </choose>
-                        <if test="examPlace != null and examPlace != ''">
-                            and t.exam_place = #{examPlace}
-                        </if>
-                        <if test="examRoom != null and examRoom != ''">
-                            and t.exam_room = #{examRoom}
-                        </if>
-                        <if test="examStartTime != null and examStartTime != ''">
-                            and t.exam_start_time &gt; #{examStartTime}
-                        </if>
-                        <if test="examEndTime != null and examEndTime != ''">
-                            and t.exam_end_time &lt; #{examEndTime}
-                        </if>
-                        <if test="validate != null">
-                            and ifnull(t.validate, false) = #{validate}
-                        </if>
-                        <if test="orgId != null">
-                            AND (t.print_house_id = #{orgId} or t.print_house_id is null)
-                        </if>
-                    </where>
-                    ) b ON a.id = b.print_plan_id
-                JOIN
-            (SELECT
-                 a.exam_detail_id,
-                 GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
-                 GROUP_CONCAT(a.paper_number) paperNumber,
-                 GROUP_CONCAT(a.clazz_id) classId,
-                 GROUP_CONCAT(a.clazz_name) className,
-                 GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
-                 SUM(CASE b.is_download
-                         WHEN TRUE THEN 0
-                         ELSE 1
-                     END) isDownload,
-                 SUM(CASE b.is_try
-                         WHEN TRUE THEN 0
-                         ELSE 1
-                     END) isTry,
-                 SUM(CASE b.is_pass
-                         WHEN TRUE THEN 0
-                         ELSE 1
-                     END) isPass
-             FROM
-                 exam_detail_course a
-                     LEFT JOIN client_status b ON a.school_id = b.school_id
-                     AND a.exam_detail_id = b.exam_detail_id
-                     AND a.course_code = b.course_code
-                     AND a.paper_number = b.paper_number
-                     AND b.machine_code = #{machineCode}
-             GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
-            <where>
-                <if test="courseCode != null and courseCode != ''">
-                    and c.courseNameCode like concat('%',#{courseCode},'%')
-                </if>
-                <if test="paperNumber != null and paperNumber != ''">
-                    and c.paperNumber like concat('%',#{paperNumber},'%')
-                </if>
-                <if test="isDownload != null">
-                    <if test="isDownload == true">
-                        and c.isDownload = 0
-                    </if>
-                    <if test="isDownload == false">
-                        and c.isDownload > 0
-                    </if>
-                </if>
-            </where>
-        ORDER BY a.id DESC , b.id DESC
-    </select>
-    <select id="clientTaskTotalData" resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintTaskTotalDto">
-        SELECT
-            ifnull(count(b.package_code), 0) packageCount,
-            ifnull(sum(b.total_subjects), 0) totalSubjects,
-            ifnull(sum(ifnull(b.paper_pages, 0)), 0)/2 paperPages,
-            ifnull(sum(ifnull(b.card_pages, 0)), 0)/2 cardPages,
-            ifnull(sum(ifnull(b.pages_a4, 0)), 0) /2 pagesA4,
-            ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.paper_pages, 0) end),0)/2 paperPagesLeft,
-            ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.card_pages, 0) end),0)/2 cardPagesLeft,
-            ifnull(sum(case b.status when 'FINISH' then 0 else ifnull(b.pages_a4, 0) end),0)/2 pagesA4Left,
-            GROUP_CONCAT(c.paperType) paperNumberAndType
-        FROM
-            (select epp.id from exam_print_plan epp
-                 JOIN
-                basic_exam be ON epp.exam_id = be.id AND be.ENABLE = TRUE
-            <where>
-                and epp.school_id = #{schoolId}
-                and be.semester_id = #{semesterId}
-                <if test="examId != null">
-                    and epp.exam_id = #{examId}
-                </if>
-                <if test="printPlanId != null">
-                    and epp.id = #{printPlanId}
-                </if>
-            </where>) a
-        JOIN
-            (SELECT *
-                from exam_detail t
-                <where>
-                    <choose>
-                        <when test="status != null and status != ''">
-                            and t.status = #{status}
-                        </when>
-                        <otherwise>
-                            AND t.status not IN
-                            <foreach collection="examDetailStatus" item="item" index="index" open="(" separator="," close=")">
-                                #{item}
-                            </foreach>
-                        </otherwise>
-                    </choose>
-                    <if test="examPlace != null and examPlace != ''">
-                        and t.exam_place = #{examPlace}
-                    </if>
-                    <if test="examRoom != null and examRoom != ''">
-                        and t.exam_room = #{examRoom}
-                    </if>
-                    <if test="examStartTime != null and examStartTime != ''">
-                        and t.exam_start_time &gt; #{examStartTime}
-                    </if>
-                    <if test="examEndTime != null and examEndTime != ''">
-                        and t.exam_end_time &lt; #{examEndTime}
-                    </if>
-                    <if test="validate != null">
-                        and ifnull(t.validate, false) = #{validate}
-                    </if>
-                    <if test="orgId != null">
-                        AND (t.print_house_id = #{orgId} or t.print_house_id is null)
-                    </if>
-                </where>
-                ) b ON a.id = b.print_plan_id
-            JOIN
-            (SELECT
-                a.exam_detail_id,
-                GROUP_CONCAT(CONCAT(a.course_name, '(', a.course_code, ')')) courseNameCode,
-                GROUP_CONCAT(CONCAT(a.paper_number, ':', a.paper_type)) paperType,
-                GROUP_CONCAT(a.paper_number) paperNumber,
-                GROUP_CONCAT(IFNULL(a.paper_pages_a3, 0) + IFNULL(a.card_pages_a3, 0)) singlePagesA3,
-                SUM(CASE b.is_download
-                    WHEN true THEN 0
-                    ELSE 1
-                    END) isDownload,
-                SUM(CASE b.is_try
-                    WHEN true THEN 0
-                    ELSE 1
-                    END) isTry,
-                SUM(CASE b.is_pass
-                    WHEN true THEN 0
-                    ELSE 1
-                    END) isPass
-        FROM
-            exam_detail_course a
-                LEFT JOIN client_status b ON a.school_id = b.school_id
-                AND a.exam_detail_id = b.exam_detail_id
-                AND a.course_code = b.course_code
-                AND a.paper_number = b.paper_number
-                AND b.machine_code = #{machineCode}
-        GROUP BY a.exam_detail_id) c ON b.id = c.exam_detail_id
-        <where>
-            <if test="courseCode != null and courseCode != ''">
-                and c.courseNameCode like concat('%',#{courseCode},'%')
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and c.paperNumber like concat('%',#{paperNumber},'%')
-            </if>
-            <if test="isDownload != null">
-                <if test="isDownload == true">
-                    and c.isDownload = 0
-                </if>
-                <if test="isDownload == false">
-                    and c.isDownload > 0
-                </if>
-            </if>
-        </where>
-    </select>
     <select id="listClientPrintStatistics"
             resultType="com.qmth.distributed.print.business.bean.dto.ClientPrintStatisticsDto">
         SELECT

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

@@ -648,80 +648,6 @@
         where e.id = #{examTaskId}
     </select>
 
-    <select id="listClientExamTaskPage"
-            resultType="com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto">
-        SELECT
-            distinct a.school_id schoolId,
-            a.exam_id examId,
-            a.id printPlanId,
-            a.name printPlanName,
-            c.course_code courseCode,
-            c.course_name courseName,
-            c.paper_number paperNumber,
-            d.id examTaskId,
-            d.specialty,
-            d.user_id userId,
-            f.real_name userName,
-            ifnull(e.is_try, false) isTry,
-            ifnull(e.is_pass, false) isPass,
-            e.try_time tryTime
-        FROM
-            (select epp.id, epp.school_id, epp.exam_id, epp.name, epp.status from exam_print_plan  epp
-                LEFT JOIN
-                basic_exam be ON epp.exam_id = be.id
-            <where>
-                and epp.school_id = #{schoolId}
-                and be.enable = true
-                and be.semester_id = #{semesterId}
-                <if test="examId != null">
-                    and be.id = #{examId}
-                </if>
-                and epp.status = #{printPlanStatus}
-                and LOCATE('PAPER', epp.print_content) > 0
-            </where>) a
-        JOIN
-            exam_detail b ON a.id = b.print_plan_id
-        JOIN
-            exam_detail_course c ON b.id = c.exam_detail_id
-        JOIN
-            exam_task d ON d.school_id = c.school_id
-            AND d.exam_id = b.exam_id
-            AND d.course_code = c.course_code
-            AND d.paper_number = c.paper_number
-        LEFT JOIN
-        client_status e ON e.school_id = d.school_id
-            AND b.id = e.exam_detail_id
-            AND a.id = e.print_plan_id
-            AND e.course_code = d.course_code
-            AND e.paper_number = d.paper_number
-            and e.machine_code = #{machineCode}
-        LEFT JOIN
-            sys_user f ON d.user_id = f.id
-        <where>
-            and b.status not in
-            <foreach item="item" collection="examDetailStatus" separator="," open="(" close=")" index="">
-                #{item}
-            </foreach>
-            <if test="printPlanId != null and printPlanId != ''">
-                and a.id = #{printPlanId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and c.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and c.paper_number = #{paperNumber}
-            </if>
-            <if test="isTry != null">
-                and IFNULL(e.is_try, FALSE) = #{isTry}
-            </if>
-            <if test="isPass != null">
-                and IFNULL(e.is_pass, FALSE) = #{isPass}
-            </if>
-            <if test="orgId != null">
-                AND (b.print_house_id = #{orgId} or b.print_house_id is null)
-            </if>
-        </where>
-    </select>
     <select id="listExamTaskExpire" resultMap="BaseResultMap">
         select * from exam_task a
         <where>

+ 0 - 526
distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java

@@ -1,526 +0,0 @@
-package com.qmth.distributed.print.api;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.qmth.boot.api.annotation.Aac;
-import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.distributed.print.business.bean.dto.*;
-import com.qmth.distributed.print.business.bean.params.ClientLoginParam;
-import com.qmth.distributed.print.business.service.ClientService;
-import com.qmth.teachcloud.common.bean.dto.SchoolDto;
-import com.qmth.teachcloud.common.bean.result.LoginClientResult;
-import com.qmth.teachcloud.common.bean.result.LoginResult;
-import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicSchool;
-import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.AppSourceEnum;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.service.CommonCacheService;
-import com.qmth.teachcloud.common.service.SysUserService;
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
-import com.qmth.teachcloud.common.util.Result;
-import com.qmth.teachcloud.common.util.ResultUtil;
-import io.swagger.annotations.*;
-import org.apache.commons.collections4.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.validation.BindingResult;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
-import javax.validation.Valid;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.stream.Collectors;
-
-/**
- * 客户端接口(打印端)
- */
-@Api(tags = "客户端Controller")
-@RestController
-@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_CLIENT)
-//@Validated
-public class ClientController {
-
-    @Resource
-    ClientService clientService;
-
-    @Resource
-    SysUserService sysUserService;
-
-    @Resource
-    CommonCacheService commonCacheService;
-
-    @Resource
-    TeachcloudCommonService teachcloudCommonService;
-
-//    /**
-//     * 登录
-//     *
-//     * @param login 登录参数
-//     */
-//    @ApiOperation(value = "登录")
-//    @PostMapping("/user/login")
-//    @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = LoginResult.class)})
-//    @Aac(auth = false)
-//    public Result login(@ApiParam(value = "用户信息", required = true) @Valid @RequestBody ClientLoginParam login, BindingResult bindingResult) throws NoSuchAlgorithmException {
-//        if (bindingResult.hasErrors()) {
-//            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-//        }
-//        BasicSchool basicSchool = commonCacheService.schoolCache(login.getSchoolCode());
-//        if (Objects.isNull(basicSchool)) {
-//            throw ExceptionResultEnum.SCHOOL_NO_DATA.exception();
-//        }
-//        QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
-//        wrapper.lambda().eq(SysUser::getSchoolId, basicSchool.getId()).eq(SysUser::getLoginName, login.getLoginName());
-//        SysUser sysUser = sysUserService.getOne(wrapper);
-//        // 用户不存在
-//        if (Objects.isNull(sysUser)) {
-//            throw ExceptionResultEnum.USER_NO_DATA.exception();
-//        }
-//        // 校验密码
-//        if (!Objects.equals(sysUser.getPassword(), login.getPassword())) {
-//            throw ExceptionResultEnum.USER_NO_DATA.exception();
-//        }
-//        // 是否有客户端权限
-//        clientService.checkPrivilege(sysUser.getId());
-//
-//        LoginResult loginResult = teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM);
-//        return ResultUtil.ok(new LoginClientResult(sysUser, loginResult));
-//    }
-
-    /**
-     * 试卷打样-列表
-     *
-     * @param machineCode 机器唯一码
-     * @param orgId       机构ID
-     * @param printPlanId 印刷计划ID
-     * @param courseCode  课程代码
-     * @param paperNumber 试卷编号
-     * @param isTry       是否打样
-     * @param isPass      是否合格
-     * @param pageNumber  分页参数
-     * @param pageSize    分页参数
-     */
-    @ApiOperation(value = "试卷打样-列表")
-    @PostMapping("/paper_try/list")
-    public Result paperTryList(@RequestParam("machineCode") String machineCode,
-                               @RequestParam("orgId") Long orgId,
-                               @RequestParam(value = "semesterId", required = false) Long semesterId,
-                               @RequestParam(value = "examId", required = false) Long examId,
-                               @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                               @RequestParam(value = "courseCode", required = false) String courseCode,
-                               @RequestParam(value = "paperNumber", required = false) String paperNumber,
-                               @RequestParam(value = "isTry", required = false) Boolean isTry,
-                               @RequestParam(value = "isPass", required = false) Boolean isPass,
-                               @RequestParam Integer pageNumber,
-                               @RequestParam Integer pageSize) {
-        IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
-        return ResultUtil.ok(examTasks);
-    }
-
-    /**
-     * 试卷打样-查看/试印/重印
-     *
-     * @param data 多任务集合
-     */
-    @ApiOperation(value = "试卷打样-查看/试印/重印")
-    @PostMapping("/paper_try/print")
-    public Result paperTryPrint(@RequestParam("data") String data) {
-        List<JSONObject> objects = JSON.parseArray(data, JSONObject.class);
-        List<Map<String, Object>> list = clientService.getPaperUrl(objects);
-        return ResultUtil.ok(list);
-    }
-
-    /**
-     * 试卷打样-批量试印
-     *
-     * @param machineCode 机器码
-     * @param orgId       机构ID
-     * @param printPlanId 印刷计划ID
-     * @param courseCode  课程代码
-     * @param paperNumber 试卷编号
-     * @param isTry       是否打样
-     * @param isPass      是否通过
-     */
-    @ApiOperation(value = "试卷打样-批量试印")
-    @PostMapping("/paper_try/print_batch")
-    public Result printBatch(@RequestParam("machineCode") String machineCode,
-                             @RequestParam("orgId") Long orgId,
-                             @RequestParam(value = "semesterId", required = false) Long semesterId,
-                             @RequestParam(value = "examId", required = false) Long examId,
-                             @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                             @RequestParam(value = "courseCode", required = false) String courseCode,
-                             @RequestParam(value = "paperNumber", required = false) String paperNumber,
-                             @RequestParam(value = "isTry", required = false) Boolean isTry,
-                             @RequestParam(value = "isPass", required = false) Boolean isPass) {
-        List<Map<String, Object>> urls = clientService.getBatchUrl(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass);
-        return ResultUtil.ok(urls);
-    }
-
-    /**
-     * 试卷打样-标记合格状态
-     *
-     * @param machineCode 机器码
-     * @param isPass      是否通过
-     * @param userId      用户Id
-     */
-    @ApiOperation(value = "试卷打样-标记合格状态")
-    @PostMapping("/paper_try/tag_pass")
-    public Result paperTryTagPass(@RequestParam("printPlanId") Long printPlanId,
-                                  @RequestParam("courseCode") String courseCode,
-                                  @RequestParam("courseName") String courseName,
-                                  @RequestParam("paperNumber") String paperNumber,
-                                  @RequestParam("machineCode") String machineCode,
-                                  @RequestParam("isPass") Boolean isPass,
-                                  @RequestParam("userId") Long userId) {
-        Boolean isSuccess = clientService.tagPass(printPlanId, courseCode, courseName, paperNumber, machineCode, isPass, userId);
-        return ResultUtil.ok(isSuccess);
-    }
-
-    /**
-     * 印刷管理-查询列表
-     *
-     * @param machineCode   机器码
-     * @param orgId         机构ID
-     * @param printPlanId   印刷计划ID
-     * @param status        状态
-     * @param courseCode    课程代码
-     * @param paperNumber   试卷编号
-     * @param examPlace     考点
-     * @param examRoom      考场
-     * @param examStartTime 考试时间(开始)
-     * @param examEndTime   考试时间(结束)
-     * @param isDownload    是否缓存
-     * @param validate      是否校验
-     * @param pageNumber    分页参数
-     * @param pageSize      分页参数
-     */
-    @ApiOperation(value = "印刷管理-查询列表")
-    @PostMapping("/print/task_list")
-    public Result printTaskList(@RequestParam("machineCode") String machineCode,
-                                @RequestParam("orgId") Long orgId,
-                                @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                @RequestParam(value = "examId", required = false) Long examId,
-                                @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,
-                                @RequestParam Integer pageNumber,
-                                @RequestParam Integer pageSize) {
-        IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
-        return ResultUtil.ok(printTaskDtoIPage);
-    }
-
-
-    /**
-     * 印刷管理-导出
-     *
-     * @param response      response
-     * @param machineCode   机器码
-     * @param orgId         机构ID
-     * @param printPlanId   印刷计划ID
-     * @param status        状态
-     * @param courseCode    课程代码
-     * @param paperNumber   试卷编号
-     * @param examPlace     考点
-     * @param examRoom      考场
-     * @param examStartTime 考试时间(开始)
-     * @param examEndTime   考试时间(结束)
-     * @param isDownload    是否缓存
-     * @param validate      是否核验
-     */
-    @ApiOperation(value = "印刷管理-导出")
-    @PostMapping("/print/task_list_export")
-    public void printTaskListExport(HttpServletResponse response,
-                                    @RequestParam("machineCode") String machineCode,
-                                    @RequestParam("orgId") Long orgId,
-                                    @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                    @RequestParam(value = "examId", required = false) Long examId,
-                                    @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) throws Exception {
-        clientService.exportClientPrintTask(response, machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
-    }
-
-    /**
-     * 印刷管理-汇总数据查询
-     *
-     * @param machineCode   机器码
-     * @param orgId         机构ID
-     * @param printPlanId   印刷计划ID
-     * @param status        状态
-     * @param courseCode    课程代码
-     * @param paperNumber   试卷编号
-     * @param examPlace     考点
-     * @param examRoom      考场
-     * @param examStartTime 考试时间(开始)
-     * @param examEndTime   考试时间(结束)
-     * @param isDownload    是否缓存
-     * @param validate      是否校验
-     */
-    @ApiOperation(value = "印刷管理-汇总数据查询")
-    @PostMapping("/print/task_total_data")
-    public Result printTaskTotalData(@RequestParam("machineCode") String machineCode,
-                                     @RequestParam("orgId") Long orgId,
-                                     @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                     @RequestParam(value = "examId", required = false) Long examId,
-                                     @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) {
-        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientService.taskTotalData(semesterId, examId, printPlanId, orgId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
-        return ResultUtil.ok(clientPrintTaskTotalDto);
-    }
-
-
-    /**
-     * 印刷管理-查看
-     *
-     * @param examDetailId 命题任务ID
-     */
-    @ApiOperation(value = "印刷管理-查看")
-    @PostMapping("/print/preview")
-    public Result printPreview(@RequestParam("examDetailId") Long examDetailId) {
-        Map<String, Object> map = clientService.getUrlByExamDetailId(examDetailId);
-        return ResultUtil.ok(map);
-    }
-
-    /**
-     * 印刷管理-印刷/缓存数据
-     *
-     * @param examDetailId 考场ID
-     * @param machineCode  机器码
-     * @param printUser    打印员
-     */
-    @ApiOperation(value = "印刷管理-印刷/缓存数据")
-    @PostMapping("/print/get_print_data")
-    public Result printGetPrintData(@RequestParam("examDetailId") String examDetailId,
-                                    @RequestParam("machineCode") String machineCode,
-                                    @RequestParam("isPrint") Boolean isPrint,
-                                    @RequestParam(value = "printUser", required = false) String printUser) {
-        List<Map<String, Object>> mapList = clientService.getPrintData(examDetailId, machineCode, isPrint, printUser);
-        return ResultUtil.ok(mapList);
-    }
-
-    /**
-     * 印刷管理-批量缓存数据
-     *
-     * @param orgId       机构ID
-     * @param machineCode 机器码
-     */
-    @ApiOperation(value = "印刷管理-批量缓存数据")
-    @PostMapping("/print/get_print_data_batch")
-    public Result printGetPrintDataBatch(@RequestParam("machineCode") String machineCode,
-                                         @RequestParam("orgId") Long orgId,
-                                         @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                         @RequestParam(value = "examId", required = false) Long examId,
-                                         @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(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
-        return ResultUtil.ok(list);
-    }
-
-    /**
-     * @param examDetailId 考场ID
-     * @param machineCode  机器码
-     * @param isDownload   是否缓存
-     */
-    @ApiOperation(value = "印刷管理-缓存后更新状态")
-    @PostMapping("/print/update_download")
-    public Result updateDownload(@RequestParam("examDetailId") Long examDetailId,
-                                 @RequestParam("machineCode") String machineCode,
-                                 @RequestParam("isDownload") Boolean isDownload) {
-        Boolean isSuccess = clientService.updateDownload(examDetailId, machineCode, isDownload);
-        return ResultUtil.ok(isSuccess);
-    }
-
-    /**
-     * 印刷管理-校验
-     *
-     * @param examDetailId 考场ID
-     * @param packageCode  机器码
-     * @param lastCode     校验条码号
-     */
-    @ApiOperation(value = "印刷管理-校验")
-    @PostMapping("/print/validate_data")
-    public Result dataCheck(@RequestParam("examDetailId") Long examDetailId,
-                            @RequestParam("packageCode") String packageCode,
-                            @RequestParam("lastCode") String lastCode) {
-        Boolean isSuccess = clientService.validateData(examDetailId, packageCode, lastCode);
-        return ResultUtil.ok(isSuccess);
-    }
-
-    /**
-     * 印刷管理-更新打印进度
-     *
-     * @param examDetailId  考场ID
-     * @param machineCode   机器码
-     * @param printProgress 打印进度
-     */
-    @ApiOperation(value = "印刷管理-更新打印进度")
-    @PostMapping("/print/update_progress")
-    public Result updateProgress(@RequestParam("examDetailId") Long examDetailId,
-                                 @RequestParam("machineCode") String machineCode,
-                                 @RequestParam("printProgress") Integer printProgress,
-                                 @RequestParam(value = "isPrint", required = false) Boolean isPrint) {
-        Boolean isSuccess = clientService.updatePrintProgress(examDetailId, machineCode, printProgress, isPrint);
-        return ResultUtil.ok(isSuccess);
-    }
-
-    /**
-     * 重打-查询考生列表
-     *
-     * @param examDetailId 考场ID
-     * @param studentCode  学号
-     * @param studentName  学号
-     * @param courseCode   课程代码
-     */
-    @ApiOperation(value = "重打-查询考生列表")
-    @PostMapping("/print/list_student")
-    public Result listStudent(@RequestParam("examDetailId") Long examDetailId,
-                              @RequestParam(value = "studentCode", required = false) String studentCode,
-                              @RequestParam(value = "studentName", required = false) String studentName,
-                              @RequestParam(value = "courseCode", required = false) String courseCode,
-                              @RequestParam Integer pageNumber,
-                              @RequestParam Integer pageSize) {
-        IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(examDetailId, studentCode, studentName, courseCode, pageNumber, pageSize);
-        return ResultUtil.ok(examStudentDtoIPage);
-    }
-
-    /**
-     * 重打-内容查询
-     *
-     * @param examDetailId 考场ID
-     * @param studentCode  学号
-     * @param type         类型
-     */
-    @ApiOperation(value = "重打-内容查询")
-    @PostMapping("/print/get_reprint_data")
-    public Result getReprintData(@RequestParam("examDetailId") Long examDetailId,
-                                 @RequestParam("studentCode") String studentCode,
-                                 @RequestParam("type") String type) {
-        Map<String, Object> map = clientService.getReprintData(examDetailId, studentCode, type);
-        return ResultUtil.ok(map);
-    }
-
-    /**
-     * 统计查询-查询列表
-     *
-     * @param orgId         机构ID
-     * @param printPlanId   印刷计划ID
-     * @param examPlace     考点
-     * @param examStartTime 考试时间(开始)
-     * @param examEndTime   考试时间(结束)
-     * @param courseCode    课程代码
-     * @param paperNumber   试卷编号
-     * @param pageNumber    分页参数
-     * @param pageSize      分页参数
-     */
-    @ApiOperation(value = "统计查询-查询列表")
-    @PostMapping("/print/statistics_list")
-    public Result printStatisticsList(@RequestParam("orgId") Long orgId,
-                                      @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                      @RequestParam(value = "examId", required = false) Long examId,
-                                      @RequestParam(value = "printPlanId", required = false) String printPlanId,
-                                      @RequestParam(value = "examPlace", required = false) String examPlace,
-                                      @RequestParam(value = "examStartTime", required = false) Long examStartTime,
-                                      @RequestParam(value = "examEndTime", required = false) Long examEndTime,
-                                      @RequestParam(value = "courseCode", required = false) String courseCode,
-                                      @RequestParam(value = "paperNumber", required = false) String paperNumber,
-                                      @RequestParam Integer pageNumber,
-                                      @RequestParam Integer pageSize) {
-        IPage<ClientPrintStatisticsDto> statisticsDtoIPage = clientService.listClientPrintStatistics(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, pageNumber, pageSize);
-        return ResultUtil.ok(statisticsDtoIPage);
-    }
-
-    /**
-     * 统计查询-汇总数据查询
-     *
-     * @param orgId         机构ID
-     * @param printPlanId   印刷计划Id
-     * @param examPlace     考点
-     * @param examStartTime 考试时间(开始)
-     * @param examEndTime   考试时间(结束)
-     * @param courseCode    课程代码
-     * @param paperNumber   试卷编号
-     */
-    @ApiOperation(value = "统计查询-汇总数据查询")
-    @PostMapping("/print/statistics_total_data")
-    public Result printStatisticsTotalData(@RequestParam("orgId") Long orgId,
-                                           @RequestParam(value = "semesterId", required = false) Long semesterId,
-                                           @RequestParam(value = "examId", required = false) Long examId,
-                                           @RequestParam(value = "printPlanId", required = false) Long printPlanId,
-                                           @RequestParam(value = "examPlace", required = false) String examPlace,
-                                           @RequestParam(value = "examStartTime", required = false) Long examStartTime,
-                                           @RequestParam(value = "examEndTime", required = false) Long examEndTime,
-                                           @RequestParam(value = "courseCode", required = false) String courseCode,
-                                           @RequestParam(value = "paperNumber", required = false) String paperNumber) {
-        ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
-        return ResultUtil.ok(statisticsTotalDto);
-    }
-
-    /**
-     * 学校查询
-     *
-     * @return
-     */
-    @ApiOperation(value = "查询")
-    @RequestMapping(value = "/school/list", method = RequestMethod.POST)
-    @Aac(strict = false, auth = false)
-    public Result list(@RequestParam(required = false) String code) {
-        List<SchoolDto> list = clientService.listSchool(code);
-        // 指定code后,只返回code对应学校,否则查默认学校,没有默认,返回所有
-        if (CollectionUtils.isNotEmpty(list) && StringUtils.isBlank(code)) {
-            List<SchoolDto> defaultSchools = list.stream().filter(m -> m.getDefaultSchool() != null && m.getDefaultSchool()).collect(Collectors.toList());
-            if (CollectionUtils.isNotEmpty(defaultSchools)) {
-                return ResultUtil.ok(defaultSchools);
-            }
-        }
-        return ResultUtil.ok(list);
-    }
-
-    /**
-     * 修改密码
-     *
-     * @return
-     */
-    @ApiOperation(value = "修改密码")
-    @RequestMapping(value = "/user/update_password", method = RequestMethod.POST)
-    @Aac(strict = false, auth = false)
-    public Result updatePassword(@RequestParam Long userId,
-                                 @RequestParam String password) {
-        return ResultUtil.ok(clientService.updatePassword(userId, password));
-    }
-}

+ 3 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java

@@ -92,6 +92,9 @@ public class ExamPrintTaskController {
         if (semesterId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择学期");
         }
+        if (examId == null) {
+            throw ExceptionResultEnum.ERROR.exception("请选择考试");
+        }
         IPage<PrintTaskDto> examTasks = examDetailService.listPrintTask(SystemConstant.convertIdToLong(semesterId), SystemConstant.convertIdToLong(examId), printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, SystemConstant.convertIdToLong(printHouseId), pageNumber, pageSize);
         return ResultUtil.ok(examTasks);
     }

+ 306 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/client/PrintController.java

@@ -0,0 +1,306 @@
+package com.qmth.distributed.print.api.client;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.distributed.print.business.service.ClientService;
+import com.qmth.teachcloud.common.bean.dto.SchoolDto;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.util.Result;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * 客户端接口(打印端)
+ */
+@Api(tags = "客户端Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_CLIENT)
+//@Validated
+public class PrintController {
+
+    @Resource
+    ClientService clientService;
+
+    @ApiOperation(value = "试卷打样-列表")
+    @PostMapping("/paper_try/list")
+    public Result paperTryList(@ApiParam(value = "机器唯一码", required = true) @RequestParam("machineCode") String machineCode,
+                               @ApiParam(value = "机构ID") @RequestParam("orgId") Long orgId,
+                               @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                               @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                               @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
+                               @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                               @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                               @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
+                               @ApiParam(value = "是否合格") @RequestParam(value = "isPass", required = false) Boolean isPass,
+                               @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
+                               @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
+        IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
+        return ResultUtil.ok(examTasks);
+    }
+
+    @ApiOperation(value = "试卷打样-查看/试印/重印")
+    @PostMapping("/paper_try/print")
+    public Result paperTryPrint(@ApiParam(value = "多任务集合", required = true) @RequestParam("data") String data) {
+        List<JSONObject> objects = JSON.parseArray(data, JSONObject.class);
+        List<Map<String, Object>> list = clientService.getPaperUrl(objects);
+        return ResultUtil.ok(list);
+    }
+
+    @ApiOperation(value = "试卷打样-批量试印")
+    @PostMapping("/paper_try/print_batch")
+    public Result printBatch(@ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                             @ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                             @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                             @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                             @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
+                             @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                             @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                             @ApiParam(value = "是否打样") @RequestParam(value = "isTry", required = false) Boolean isTry,
+                             @ApiParam(value = "是否通过") @RequestParam(value = "isPass", required = false) Boolean isPass) {
+        List<Map<String, Object>> urls = clientService.getBatchUrl(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass);
+        return ResultUtil.ok(urls);
+    }
+
+    @ApiOperation(value = "试卷打样-标记合格状态")
+    @PostMapping("/paper_try/tag_pass")
+    public Result paperTryTagPass(@ApiParam(value = "印刷计划ID", required = true) @RequestParam("printPlanId") Long printPlanId,
+                                  @ApiParam(value = "课程代码", required = true) @RequestParam("courseCode") String courseCode,
+                                  @ApiParam(value = "课程名称", required = true) @RequestParam("courseName") String courseName,
+                                  @ApiParam(value = "试卷编号", required = true) @RequestParam("paperNumber") String paperNumber,
+                                  @ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                  @ApiParam(value = "是否通过", required = true) @RequestParam("isPass") Boolean isPass,
+                                  @ApiParam(value = "用户ID", required = true) @RequestParam("userId") Long userId) {
+        Boolean isSuccess = clientService.tagPass(printPlanId, courseCode, courseName, paperNumber, machineCode, isPass, userId);
+        return ResultUtil.ok(isSuccess);
+    }
+
+    @ApiOperation(value = "印刷管理-查询列表")
+    @PostMapping("/print/task_list")
+    public Result printTaskList(@ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                @ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
+                                @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
+                                @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
+                                @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate,
+                                @ApiParam(value = "分页参数") @RequestParam Integer pageNumber,
+                                @ApiParam(value = "分页参数") @RequestParam Integer pageSize) {
+        IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
+        return ResultUtil.ok(printTaskDtoIPage);
+    }
+
+    @ApiOperation(value = "印刷管理-导出")
+    @PostMapping("/print/task_list_export")
+    public void printTaskListExport(HttpServletResponse response,
+                                    @ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                    @ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                    @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                    @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                    @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                    @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
+                                    @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                    @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                    @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                    @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
+                                    @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                    @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                    @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
+                                    @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) throws Exception {
+        clientService.exportClientPrintTask(response, machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+    }
+
+    @ApiOperation(value = "印刷管理-汇总数据查询")
+    @PostMapping("/print/task_total_data")
+    public Result printTaskTotalData(@ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                     @ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                     @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                     @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                     @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                     @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
+                                     @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                     @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                     @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                     @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
+                                     @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                     @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                     @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
+                                     @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
+        ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientService.taskTotalData(semesterId, examId, printPlanId, orgId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
+        return ResultUtil.ok(clientPrintTaskTotalDto);
+    }
+
+    @ApiOperation(value = "印刷管理-查看")
+    @PostMapping("/print/preview")
+    public Result printPreview(@ApiParam(value = "命题任务ID", required = true) @RequestParam("examDetailId") Long examDetailId) {
+        Map<String, Object> map = clientService.getUrlByExamDetailId(examDetailId);
+        return ResultUtil.ok(map);
+    }
+
+    @ApiOperation(value = "印刷管理-印刷/缓存数据")
+    @PostMapping("/print/get_print_data")
+    public Result printGetPrintData(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") String examDetailId,
+                                    @ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                    @ApiParam(value = "是否打印", required = true) @RequestParam("isPrint") Boolean isPrint,
+                                    @ApiParam(value = "打印员") @RequestParam(value = "printUser", required = false) String printUser) {
+        List<Map<String, Object>> mapList = clientService.getPrintData(examDetailId, machineCode, isPrint, printUser);
+        return ResultUtil.ok(mapList);
+    }
+
+    @ApiOperation(value = "印刷管理-批量缓存数据")
+    @PostMapping("/print/get_print_data_batch")
+    public Result printGetPrintDataBatch(@ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                         @ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                         @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                         @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                         @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                         @ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
+                                         @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                         @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                         @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                         @ApiParam(value = "考场") @RequestParam(value = "examRoom", required = false) String examRoom,
+                                         @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                         @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                         @ApiParam(value = "是否缓存") @RequestParam(value = "isDownload", required = false) Boolean isDownload,
+                                         @ApiParam(value = "是否校验") @RequestParam(value = "validate", required = false) Boolean validate) {
+        List<Map<String, Object>> list = clientService.getPrintDataBatch(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+        return ResultUtil.ok(list);
+    }
+
+    @ApiOperation(value = "印刷管理-缓存后更新状态")
+    @PostMapping("/print/update_download")
+    public Result updateDownload(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
+                                 @ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                 @ApiParam(value = "是否缓存", required = true) @RequestParam("isDownload") Boolean isDownload) {
+        Boolean isSuccess = clientService.updateDownload(examDetailId, machineCode, isDownload);
+        return ResultUtil.ok(isSuccess);
+    }
+
+    @ApiOperation(value = "印刷管理-校验")
+    @PostMapping("/print/validate_data")
+    public Result dataCheck(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
+                            @ApiParam(value = "机器码", required = true) @RequestParam("packageCode") String packageCode,
+                            @ApiParam(value = "校验条码号", required = true) @RequestParam("lastCode") String lastCode) {
+        Boolean isSuccess = clientService.validateData(examDetailId, packageCode, lastCode);
+        return ResultUtil.ok(isSuccess);
+    }
+
+    @ApiOperation(value = "印刷管理-更新打印进度")
+    @PostMapping("/print/update_progress")
+    public Result updateProgress(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
+                                 @ApiParam(value = "机器码", required = true) @RequestParam("machineCode") String machineCode,
+                                 @ApiParam(value = "打印进度", required = true) @RequestParam("printProgress") Integer printProgress,
+                                 @ApiParam(value = "是否打印") @RequestParam(value = "isPrint", required = false) Boolean isPrint) {
+        Boolean isSuccess = clientService.updatePrintProgress(examDetailId, machineCode, printProgress, isPrint);
+        return ResultUtil.ok(isSuccess);
+    }
+
+    @ApiOperation(value = "重打-查询考生列表")
+    @PostMapping("/print/list_student")
+    public Result listStudent(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
+                              @ApiParam(value = "学号") @RequestParam(value = "studentCode", required = false) String studentCode,
+                              @ApiParam(value = "学生姓名") @RequestParam(value = "studentName", required = false) String studentName,
+                              @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                              @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
+                              @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
+        IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(examDetailId, studentCode, studentName, courseCode, pageNumber, pageSize);
+        return ResultUtil.ok(examStudentDtoIPage);
+    }
+
+    @ApiOperation(value = "重打-内容查询")
+    @PostMapping("/print/get_reprint_data")
+    public Result getReprintData(@ApiParam(value = "考场ID", required = true) @RequestParam("examDetailId") Long examDetailId,
+                                 @ApiParam(value = "学号", required = true) @RequestParam("studentCode") String studentCode,
+                                 @ApiParam(value = "类型", required = true) @RequestParam("type") String type) {
+        Map<String, Object> map = clientService.getReprintData(examDetailId, studentCode, type);
+        return ResultUtil.ok(map);
+    }
+
+    @ApiOperation(value = "统计查询-查询列表")
+    @PostMapping("/print/statistics_list")
+    public Result printStatisticsList(@ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                      @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                      @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                      @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) String printPlanId,
+                                      @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                      @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                      @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                      @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                      @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber,
+                                      @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageNumber,
+                                      @ApiParam(value = "分页参数", required = true) @RequestParam Integer pageSize) {
+        IPage<ClientPrintStatisticsDto> statisticsDtoIPage = clientService.listClientPrintStatistics(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, pageNumber, pageSize);
+        return ResultUtil.ok(statisticsDtoIPage);
+    }
+
+    @ApiOperation(value = "统计查询-汇总数据查询")
+    @PostMapping("/print/statistics_total_data")
+    public Result printStatisticsTotalData(@ApiParam(value = "机构ID", required = true) @RequestParam("orgId") Long orgId,
+                                           @ApiParam(value = "学期ID") @RequestParam(value = "semesterId", required = false) Long semesterId,
+                                           @ApiParam(value = "考试ID") @RequestParam(value = "examId", required = false) Long examId,
+                                           @ApiParam(value = "印刷计划ID") @RequestParam(value = "printPlanId", required = false) Long printPlanId,
+                                           @ApiParam(value = "考点") @RequestParam(value = "examPlace", required = false) String examPlace,
+                                           @ApiParam(value = "考试时间(开始)") @RequestParam(value = "examStartTime", required = false) Long examStartTime,
+                                           @ApiParam(value = "考试时间(结束)") @RequestParam(value = "examEndTime", required = false) Long examEndTime,
+                                           @ApiParam(value = "课程代码") @RequestParam(value = "courseCode", required = false) String courseCode,
+                                           @ApiParam(value = "试卷编号") @RequestParam(value = "paperNumber", required = false) String paperNumber) {
+        ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
+        return ResultUtil.ok(statisticsTotalDto);
+    }
+
+    @ApiOperation(value = "学校查询")
+    @RequestMapping(value = "/school/list", method = RequestMethod.POST)
+    @Aac(strict = false, auth = false)
+    public Result list(@ApiParam(value = "学校Code") @RequestParam(required = false) String code) {
+        List<SchoolDto> list = clientService.listSchool(code);
+        // 指定code后,只返回code对应学校,否则查默认学校,没有默认,返回所有
+        if (CollectionUtils.isNotEmpty(list) && StringUtils.isBlank(code)) {
+            List<SchoolDto> defaultSchools = list.stream().filter(m -> m.getDefaultSchool() != null && m.getDefaultSchool()).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(defaultSchools)) {
+                return ResultUtil.ok(defaultSchools);
+            }
+        }
+        return ResultUtil.ok(list);
+    }
+
+    @ApiOperation(value = "修改密码")
+    @RequestMapping(value = "/user/update_password", method = RequestMethod.POST)
+    @Aac(strict = false, auth = false)
+    public Result updatePassword(@ApiParam(value = "用户ID", required = true) @RequestParam Long userId,
+                                 @ApiParam(value = "密码", required = true) @RequestParam String password) {
+        return ResultUtil.ok(clientService.updatePassword(userId, password));
+    }
+
+//    /**
+//     * 单文件打印
+//     *
+//     * @param examDetailId 命题任务ID
+//     */
+//    @ApiOperation(value = "单文件打印")
+//    @PostMapping("/print/single")
+//    public Result printSingleFile(@ApiParam(value = "考场ID") @RequestParam("examDetailId") Long examDetailId) {
+//        Map<String, Object> map = clientService.getUrlByExamDetailId(examDetailId);
+//        return ResultUtil.ok(map);
+//    }
+}

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/ScanController.java → distributed-print/src/main/java/com/qmth/distributed/print/api/client/ScanController.java

@@ -1,4 +1,4 @@
-package com.qmth.distributed.print.api.mark;
+package com.qmth.distributed.print.api.client;
 
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;