소스 검색

印刷任务管理

xiaof 4 년 전
부모
커밋
bc68f834b4

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

@@ -0,0 +1,161 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+/**
+ * @Date: 2021/3/29.
+ */
+public class PrintTaskDto {
+
+    private String printPlanId;
+    private String printPlanName;
+    private String examDate;
+    private String examTime;
+    private String courseNameCode;
+    private String paperNumber;
+    private String examPlace;
+    private String examRoom;
+    private String pageA3;
+    private String pageA4;
+    private Integer totalSubjects;
+    private Integer totalPages;
+    private String status;
+    private Boolean validate;
+    private Long printStartTime;
+    private Long printEndTime;
+    private String packageCode;
+
+    public String getPrintPlanId() {
+        return printPlanId;
+    }
+
+    public void setPrintPlanId(String printPlanId) {
+        this.printPlanId = printPlanId;
+    }
+
+    public String getPrintPlanName() {
+        return printPlanName;
+    }
+
+    public void setPrintPlanName(String printPlanName) {
+        this.printPlanName = printPlanName;
+    }
+
+    public String getExamDate() {
+        return examDate;
+    }
+
+    public void setExamDate(String examDate) {
+        this.examDate = examDate;
+    }
+
+    public String getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(String examTime) {
+        this.examTime = examTime;
+    }
+
+    public String getCourseNameCode() {
+        return courseNameCode;
+    }
+
+    public void setCourseNameCode(String courseNameCode) {
+        this.courseNameCode = courseNameCode;
+    }
+
+    public String getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(String paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public String getExamPlace() {
+        return examPlace;
+    }
+
+    public void setExamPlace(String examPlace) {
+        this.examPlace = examPlace;
+    }
+
+    public String getExamRoom() {
+        return examRoom;
+    }
+
+    public void setExamRoom(String examRoom) {
+        this.examRoom = examRoom;
+    }
+
+    public String getPageA3() {
+        return pageA3;
+    }
+
+    public void setPageA3(String pageA3) {
+        this.pageA3 = pageA3;
+    }
+
+    public String getPageA4() {
+        return pageA4;
+    }
+
+    public void setPageA4(String pageA4) {
+        this.pageA4 = pageA4;
+    }
+
+    public Integer getTotalSubjects() {
+        return totalSubjects;
+    }
+
+    public void setTotalSubjects(Integer totalSubjects) {
+        this.totalSubjects = totalSubjects;
+    }
+
+    public Integer getTotalPages() {
+        return totalPages;
+    }
+
+    public void setTotalPages(Integer totalPages) {
+        this.totalPages = totalPages;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Boolean getValidate() {
+        return validate;
+    }
+
+    public void setValidate(Boolean validate) {
+        this.validate = validate;
+    }
+
+    public Long getPrintStartTime() {
+        return printStartTime;
+    }
+
+    public void setPrintStartTime(Long printStartTime) {
+        this.printStartTime = printStartTime;
+    }
+
+    public Long getPrintEndTime() {
+        return printEndTime;
+    }
+
+    public void setPrintEndTime(Long printEndTime) {
+        this.printEndTime = printEndTime;
+    }
+
+    public String getPackageCode() {
+        return packageCode;
+    }
+
+    public void setPackageCode(String packageCode) {
+        this.packageCode = packageCode;
+    }
+}

+ 62 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/PrintTaskTotalDto.java

@@ -0,0 +1,62 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+/**
+ * @Date: 2021/3/29.
+ */
+public class PrintTaskTotalDto {
+
+    private String totalSubjects;
+    private String packageCount;
+    private String pageA3;
+    private String pageA4;
+    private String pageA3Left;
+    private String pageA4Left;
+
+    public String getTotalSubjects() {
+        return totalSubjects;
+    }
+
+    public void setTotalSubjects(String totalSubjects) {
+        this.totalSubjects = totalSubjects;
+    }
+
+    public String getPackageCount() {
+        return packageCount;
+    }
+
+    public void setPackageCount(String packageCount) {
+        this.packageCount = packageCount;
+    }
+
+    public String getPageA3() {
+        return pageA3;
+    }
+
+    public void setPageA3(String pageA3) {
+        this.pageA3 = pageA3;
+    }
+
+    public String getPageA4() {
+        return pageA4;
+    }
+
+    public void setPageA4(String pageA4) {
+        this.pageA4 = pageA4;
+    }
+
+    public String getPageA3Left() {
+        return pageA3Left;
+    }
+
+    public void setPageA3Left(String pageA3Left) {
+        this.pageA3Left = pageA3Left;
+    }
+
+    public String getPageA4Left() {
+        return pageA4Left;
+    }
+
+    public void setPageA4Left(String pageA4Left) {
+        this.pageA4Left = pageA4Left;
+    }
+}

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

@@ -3,7 +3,7 @@ package com.qmth.distributed.print.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
 import com.qmth.distributed.print.business.bean.result.ExaminationDetailResult;
 import com.qmth.distributed.print.business.bean.result.ExaminationResult;
 import com.qmth.distributed.print.business.entity.ExamDetail;
@@ -19,7 +19,7 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
 
-    IPage<ExamTaskDetailDto> listPrintTask(Page<ExamTaskDetailDto> page, @Param("schoolId") Long schoolId, @Param("printPlanName") String printPlanName, @Param("status") String status, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examStartTime") Long examStartTime, @Param("examEndTime") Long examEndTime);
+    IPage<PrintTaskDto> listPrintTask(Page<PrintTaskDto> page, @Param("schoolId") Long schoolId, @Param("printPlanId") Long 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);
 
     IPage<ExaminationResult> findBriefPage(@Param("page") Page<ExaminationResult> page,
                                            @Param("schoolId") Long schoolId,
@@ -32,7 +32,7 @@ public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
 
     IPage<ExaminationDetailResult> findDetailPage(@Param("page") Page<ExaminationDetailResult> page,
                                                   @Param("printPlanId") Long printPlanId,
-                                                  @Param("courseCode")  String courseCode,
+                                                  @Param("courseCode") String courseCode,
                                                   @Param("paperNumber") String paperNumber,
                                                   @Param("examPlace") String examPlace,
                                                   @Param("examRoom") String examRoom,

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

@@ -90,4 +90,11 @@ public interface CommonService {
      * @return
      */
     public String filePreview(String path);
+
+    /**
+     * 题卡html文件上传,读取文件内容
+     * @param path
+     * @return
+     */
+    public String readFileContent(String path);
 }

+ 36 - 28
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -2,17 +2,16 @@ package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.bean.dto.FieldsDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto;
 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.ExamPrintPlan;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.util.List;
 import java.util.Map;
 
@@ -27,6 +26,7 @@ import java.util.Map;
 public interface ExamDetailService extends IService<ExamDetail> {
     /**
      * 计算印刷计划下的总科次
+     *
      * @param printPlanId 印刷计划id
      * @return 该印刷计划下总科次
      */
@@ -34,19 +34,21 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     /**
      * 计算印刷计划下的总卷袋数
+     *
      * @param printPlanId 印刷计划id
      * @return 该印刷计划下总卷袋数
      */
     double calculateTotalPackages(Long printPlanId);
 
-    IPage<ExamTaskDetailDto> listPrintTask(String printPlanName, String status, String courseCode, String paperNumber, String examPlace, Long examStartTime, Long examEndTime, Integer pageNumber, Integer pageSize);
+    IPage<PrintTaskDto> listPrintTask(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Integer pageNumber, Integer pageSize);
 
-    Map<String, Object> taskTotalData(String printPlanName, String status, String courseCode, String paperNumber, String examPlace, Long examStartTime, Long examEndTime);
+    PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime);
 
     String taskViewPDF(Long id);
 
     /**
      * 查询有效的考务字段
+     *
      * @param schoolId 学校id
      * @return 考务字段
      */
@@ -54,6 +56,7 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     /**
      * 考务数据模板下载
+     *
      * @param schoolId 学校id
      * @return 是否成功
      */
@@ -62,58 +65,63 @@ public interface ExamDetailService extends IService<ExamDetail> {
 
     /**
      * 查询考务数据-简略
-     * @param schoolId 学校id
+     *
+     * @param schoolId    学校id
      * @param printPlanId 印刷计划id
-     * @param courseCode 课程代码
+     * @param courseCode  课程代码
      * @param paperNumber 试卷编号
-     * @param examPlace 考点
-     * @param examRoom 考场
+     * @param examPlace   考点
+     * @param examRoom    考场
      * @param packageCode 卷袋编号
-     * @param pageNumber 分页页码
-     * @param pageSize 分页数量
+     * @param pageNumber  分页页码
+     * @param pageSize    分页数量
      * @return 查询结果
      */
-    IPage<ExaminationResult> findExaminationBriefPage(Long schoolId,Long printPlanId,String courseCode,String paperNumber,
-                                                      String examPlace,String examRoom,String packageCode,int pageNumber,int pageSize);
+    IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, Long printPlanId, String courseCode, String paperNumber,
+                                                      String examPlace, String examRoom, String packageCode, int pageNumber, int pageSize);
 
     /**
      * 查询考务数据-汇总数据查询
-     * @param schoolId 学校id
+     *
+     * @param schoolId    学校id
      * @param printPlanId 印刷计划id
-     * @param courseCode 课程代码
+     * @param courseCode  课程代码
      * @param paperNumber 试卷编号
-     * @param examPlace 考点
-     * @param examRoom 考场
+     * @param examPlace   考点
+     * @param examRoom    考场
      * @param packageCode 卷袋编号
      * @return 查询结果
      */
-    SummarizedDataResult findSummarizedData(Long schoolId,Long printPlanId,String courseCode,String paperNumber,
-                                            String examPlace,String examRoom,String packageCode);
+    SummarizedDataResult findSummarizedData(Long schoolId, Long printPlanId, String courseCode, String paperNumber,
+                                            String examPlace, String examRoom, String packageCode);
 
 
     /**
      * 查询考务数据-明细
-     * @param printPlanId 印刷计划id
-     * @param courseCode 课程代码
-     * @param paperNumber 试卷编号
-     * @param examPlace 考点
-     * @param examRoom 考场
+     *
+     * @param printPlanId  印刷计划id
+     * @param courseCode   课程代码
+     * @param paperNumber  试卷编号
+     * @param examPlace    考点
+     * @param examRoom     考场
      * @param studentParam 学生查询参数
-     * @param pageNumber 分页页码
-     * @param pageSize 分页数量
+     * @param pageNumber   分页页码
+     * @param pageSize     分页数量
      * @return 查询结果
      */
-    IPage<ExaminationDetailResult> findExaminationDetail(Long printPlanId,String courseCode,String paperNumber,String examPlace,
-                                                         String examRoom,String studentParam,int pageNumber,int pageSize);
+    IPage<ExaminationDetailResult> findExaminationDetail(Long printPlanId, String courseCode, String paperNumber, String examPlace,
+                                                         String examRoom, String studentParam, int pageNumber, int pageSize);
 
     /**
      * 查询印刷计划下考点数据源
+     *
      * @return 考点集合
      */
     List<String> findExamPlaceDatasource();
 
     /**
      * 查询印刷计划下考场数据源
+     *
      * @return 考场集合
      */
     List<String> findExamRoomDatasource();

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

@@ -3,12 +3,10 @@ package com.qmth.distributed.print.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
-import com.qmth.distributed.print.business.bean.params.ExamCardParams;
 import com.qmth.distributed.print.business.bean.params.RelatePaperParam;
 import com.qmth.distributed.print.business.entity.ExamTaskDetail;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>

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

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.service.impl;
 
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -22,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.io.*;
 import java.util.List;
 import java.util.Objects;
 
@@ -49,10 +47,6 @@ public class BasicTemplateServiceImpl extends ServiceImpl<BasicTemplateMapper, B
     @Autowired
     private ExamCardService examCardService;
 
-    @Autowired
-    private OssUtil ossUtil;
-
-
     @Override
     public IPage<TemplateDto> list(Boolean enable, String type, String name, Long startTime, Long endTime, Integer pageNumber, Integer pageSize) {
         Page<TemplateDto> page = new Page<>(pageNumber, pageSize);
@@ -124,7 +118,7 @@ public class BasicTemplateServiceImpl extends ServiceImpl<BasicTemplateMapper, B
         examCardParams.setType(CardTypeEnum.GENERIC); // 默认GENERIC
         examCardParams.setTemplateId(template.getId());
         examCardParams.setStatus(CardStatusEnum.SUBMIT); // 默认SUBMIT
-        examCardParams.setHtmlContent(readFileByAttachmentId(attachment.getPath()));
+        examCardParams.setHtmlContent(commonService.readFileContent(attachment.getPath()));
         examCardService.saveExamCard(examCardParams);
         return isSuccess;
     }
@@ -155,32 +149,4 @@ public class BasicTemplateServiceImpl extends ServiceImpl<BasicTemplateMapper, B
         return basicTemplate;
     }
 
-    /**
-     * 读取附件内容
-     *
-     * @return
-     */
-    private String readFileByAttachmentId(String path) {
-        // 解析path
-        JSONObject object = JSONObject.parseObject(path);
-        String filePath = object.getString(SystemConstant.PATH);
-        String type = object.getString(SystemConstant.TYPE);
-        StringBuffer sb = new StringBuffer();
-        try {
-            byte[] bytes = null;
-            if (type.equals(SystemConstant.OSS)) {
-                bytes = ossUtil.ossDownload(filePath);
-            }
-            InputStream fis = new ByteArrayInputStream(bytes);
-            BufferedReader br = new BufferedReader(new InputStreamReader(fis));
-            String s;
-            while ((s = br.readLine()) != null) {
-                sb.append(s).append("\n");
-            }
-        } catch (IOException e) {
-            throw ExceptionResultEnum.ERROR.exception("文件读取异常");
-        }
-        return sb.toString();
-    }
-
 }

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

@@ -28,7 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
-import java.io.File;
+import java.io.*;
 import java.security.NoSuchAlgorithmException;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -319,4 +319,38 @@ public class CommonServiceImpl implements CommonService {
         }
         return url;
     }
+
+    @Override
+    public String readFileContent(String path) {
+        // 解析path
+        JSONObject object = JSONObject.parseObject(path);
+        String filePath = object.getString(SystemConstant.PATH);
+        String type = object.getString(SystemConstant.TYPE);
+        if(filePath.endsWith(".html")) {
+            StringBuffer sb = new StringBuffer();
+            try {
+                InputStream fis;
+                if (type.equals(SystemConstant.OSS)) {
+                    byte[] bytes = ossUtil.ossDownload(filePath);
+                    fis = new ByteArrayInputStream(bytes);
+                } else {
+                    String url = SystemConstant.HTTP + dictionaryConfig.sysDomain().getFileHost() + File.separator + filePath;
+                    File file = new File(url);
+                    if (!file.exists()) {
+                        throw ExceptionResultEnum.ERROR.exception("附件文件不存在");
+                    }
+                    fis = new FileInputStream(file);
+                }
+                BufferedReader br = new BufferedReader(new InputStreamReader(fis));
+                String s;
+                while ((s = br.readLine()) != null) {
+                    sb.append(s).append("\n");
+                }
+            } catch (IOException e) {
+                throw ExceptionResultEnum.ERROR.exception("文件读取异常");
+            }
+            return sb.toString();
+        }
+        return null;
+    }
 }

+ 7 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -2,20 +2,18 @@ package com.qmth.distributed.print.business.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.bean.dto.FieldsDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto;
 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.BasicExamRule;
 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.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
 import com.qmth.distributed.print.business.service.BasicExamRuleService;
 import com.qmth.distributed.print.business.service.CacheService;
@@ -35,7 +33,6 @@ import javax.annotation.Resource;
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
@@ -83,15 +80,15 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     }
 
     @Override
-    public IPage<ExamTaskDetailDto> listPrintTask(String printPlanName, String status, String courseCode, String paperNumber, String examPlace, Long examStartTime, Long examEndTime, Integer pageNumber, Integer pageSize) {
+    public IPage<PrintTaskDto> listPrintTask(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        Page<ExamTaskDetailDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamTaskDetailDto> examTaskDetailDtoIPage = this.baseMapper.listPrintTask(page, schoolId, printPlanName,status, courseCode, paperNumber, examPlace, examStartTime, examEndTime);
-        return examTaskDetailDtoIPage;
+        Page<PrintTaskDto> page = new Page<>(pageNumber, pageSize);
+        IPage<PrintTaskDto> pirntTaskDtoIPage = this.baseMapper.listPrintTask(page, schoolId, printPlanId,status, courseCode, paperNumber, examPlace,examRoom, examStartTime, examEndTime);
+        return pirntTaskDtoIPage;
     }
 
     @Override
-    public Map<String, Object> taskTotalData(String printPlanName, String status, String courseCode, String paperNumber, String examPlace, Long examStartTime, Long examEndTime) {
+    public PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime) {
         return null;
     }
 

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

@@ -127,7 +127,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }
         UpdateWrapper<ExamTask> updateWrapper = new UpdateWrapper<>();
         // 启用时,后续状态清空
-        if(examTask.getEnable()){
+        if (examTask.getEnable()) {
             updateWrapper.lambda().set(ExamTask::getEnable, examTask.getEnable()) // 修改启用状态
                     .set(ExamTask::getReviewStatus, null) // 清空审核状态
                     .set(ExamTask::getStatus, ExamStatusEnum.STAGE) // 更新为命题中
@@ -354,6 +354,12 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         ExamTaskDetail detail = examTaskDetailService.getOne(queryWrapper);
         if (detail != null) {
             examTaskDetail.setId(detail.getId());
+            // 已曝光试卷和未曝光试卷赋值
+            examTaskDetail.setExposedPaperType(detail.getExposedPaperType());
+            examTaskDetail.setUnexposedPaperType(detail.getUnexposedPaperType());
+        } else {
+            // 已曝光试卷和未曝光试卷赋值(新增时,已曝光试卷为null,未曝光试卷为paper_type)
+            examTaskDetail.setUnexposedPaperType(examTaskDetail.getPaperType());
         }
 
         return examTaskDetailService.saveOrUpdate(examTaskDetail);

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

@@ -26,7 +26,60 @@
         id,
         school_id, print_plan_id, print_plan_name, exam_name, exam_start_time, exam_end_time, exam_place, total_subjects, exam_room, print_progress, print_user, package_code, create_id, create_time
     </sql>
-    <select id="listPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto"></select>
+    <select id="listPrintTask" resultType="com.qmth.distributed.print.business.bean.dto.PrintTaskDto">
+        SELECT
+            b.package_code packageCode,
+            a.id printPlanId,
+            a.name printPlanName,
+            b.exam_start_time examStartTime,
+            b.exam_end_time examEndTime,
+            c.courseNameCode,
+            c.paperNumber,
+            b.exam_place examPlace,
+            b.exam_room examRoom,
+            b.total_subjects totalSubjects
+        FROM
+            exam_print_plan a
+                LEFT JOIN
+            exam_detail b ON a.id = b.print_plan_id
+                LEFT JOIN
+            (SELECT
+                exam_detail_id,
+                    GROUP_CONCAT(CONCAT(course_name, '(', course_code, ')')) courseNameCode,
+                    GROUP_CONCAT(paper_number) paperNumber
+            FROM
+                exam_detail_course
+                <where>
+                    <if test="courseCode != null and courseCode != ''">
+                        course_code = #{courseCode}
+                    </if>
+                    <if test="paperNumber != null and paperNumber != ''">
+                        paper_number = #{paperNumber}
+                    </if>
+                </where>
+            GROUP BY exam_detail_id) c ON b.id = c.exam_detail_id
+            <where>
+                <if test="printPlanId != null and printPlanId != ''">
+                    a.id = #{printPlanId}
+                </if>
+                <if test="status != null and status != ''">
+                    a.status = #{status}
+                </if>
+                <if test="examPlace != null and examPlace != ''">
+                    b.exam_place = #{examPlace}
+                </if>
+                <if test="examRoom != null and examRoom != ''">
+                    b.exam_room = #{examRoom}
+                </if>
+                <if test="examStartTime != null and examStartTime != ''">
+                    b.exam_start_time &gt; #{examStartTime}
+                </if>
+                <if test="examEndTime != null and examEndTime != ''">
+                    b.exam_end_time &lt; #{examEndTime}
+                </if>
+            </where>
+        ORDER BY a.create_time desc
+    </select>
 
     <select id="findBriefPage" resultType="com.qmth.distributed.print.business.bean.result.ExaminationResult">
         SELECT

+ 29 - 27
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

@@ -6,6 +6,8 @@ import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
+import com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto;
 import com.qmth.distributed.print.business.bean.dto.RelatePaperDto;
 import com.qmth.distributed.print.business.bean.params.DeleteParams;
 import com.qmth.distributed.print.business.bean.params.PrintPlanParams;
@@ -30,7 +32,6 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -123,10 +124,10 @@ public class ExamPrintPlanController {
      */
     @ApiOperation(value = "关联试卷管理-查询")
     @RequestMapping(value = "/relate_list", method = RequestMethod.POST)
-    public Result relateList(@RequestParam String relateType,
-                             @RequestParam Long printPlanId,
-                             @RequestParam String courseCode,
-                             @RequestParam String paperNumber,
+    public Result relateList(@RequestParam(value = "relateType", required = false) String relateType,
+                             @RequestParam(value = "printPlanId", required = false) Long printPlanId,
+                             @RequestParam(value = "courseCode", required = false) String courseCode,
+                             @RequestParam(value = "paperNumber", required = false) String paperNumber,
                              @RequestParam Integer pageNumber,
                              @RequestParam Integer pageSize) {
         IPage<ExamTaskDetailDto> examTasks = examTaskDetailService.list(relateType, printPlanId, courseCode, paperNumber, pageNumber, pageSize);
@@ -140,7 +141,7 @@ public class ExamPrintPlanController {
      * @return
      */
     @RequestMapping(value = "/relate_update", method = RequestMethod.POST)
-    public Result relateUpdate( @RequestBody RelatePaperParam paperParam) {
+    public Result relateUpdate(@RequestBody RelatePaperParam paperParam) {
         boolean isSuccess = examTaskDetailService.updatePaper(paperParam);
         return ResultUtil.ok(isSuccess);
     }
@@ -160,7 +161,7 @@ public class ExamPrintPlanController {
     /**
      * 印刷任务管理-查询
      *
-     * @param printPlanName
+     * @param printPlanId
      * @param status
      * @param courseCode
      * @param paperNumber
@@ -173,16 +174,17 @@ public class ExamPrintPlanController {
      */
     @ApiOperation(value = "印刷任务管理-查询")
     @RequestMapping(value = "/task_list", method = RequestMethod.POST)
-    public Result taskList(@RequestParam String printPlanName,
-                           @RequestParam String status,
-                           @RequestParam String courseCode,
-                           @RequestParam String paperNumber,
-                           @RequestParam String examPlace,
-                           @RequestParam Long examStartTime,
-                           @RequestParam Long examEndTime,
+    public Result taskList(@RequestParam(value = "printPlanId", required = false) Long 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 Integer pageNumber,
                            @RequestParam Integer pageSize) {
-        IPage<ExamTaskDetailDto> examTasks = examDetailService.listPrintTask(printPlanName, status, courseCode, paperNumber, examPlace, examStartTime, examEndTime, pageNumber, pageSize);
+        IPage<PrintTaskDto> examTasks = examDetailService.listPrintTask(printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, pageNumber, pageSize);
         return ResultUtil.ok(examTasks);
     }
 
@@ -211,28 +213,28 @@ public class ExamPrintPlanController {
     /**
      * 印刷任务管理-汇总数据查询
      *
-     * @param request
-     * @param printPlanName
+     * @param printPlanId
      * @param status
      * @param courseCode
      * @param paperNumber
      * @param examPlace
+     * @param examRoom
      * @param examStartTime
      * @param examEndTime
      * @return
      */
     @ApiOperation(value = "印刷任务管理-汇总数据查询")
     @RequestMapping(value = "/task_total_data", method = RequestMethod.POST)
-    public Result taskTotalData(HttpServletRequest request,
-                                @RequestParam String printPlanName,
-                                @RequestParam String status,
-                                @RequestParam String courseCode,
-                                @RequestParam String paperNumber,
-                                @RequestParam String examPlace,
-                                @RequestParam Long examStartTime,
-                                @RequestParam Long examEndTime) {
-        Map<String, Object> map = examDetailService.taskTotalData(printPlanName, status, courseCode, paperNumber, examPlace, examStartTime, examEndTime);
-        return ResultUtil.ok(map);
+    public Result taskTotalData(@RequestParam(value = "printPlanId", required = false) Long 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) {
+        PrintTaskTotalDto printTaskTotalDto = examDetailService.taskTotalData(printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime);
+        return ResultUtil.ok(printTaskTotalDto);
     }
 
     /**