xiaof 4 жил өмнө
parent
commit
96968ac8fd

+ 18 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ClientPrintTaskDto.java

@@ -1,5 +1,7 @@
 package com.qmth.distributed.print.business.bean.dto;
 package com.qmth.distributed.print.business.bean.dto;
 
 
+import com.qmth.distributed.print.business.annotation.ExcelProperty;
+
 /**
 /**
  * @Date: 2021/3/29.
  * @Date: 2021/3/29.
  */
  */
@@ -7,25 +9,41 @@ public class ClientPrintTaskDto {
 
 
     private String examDetailId;
     private String examDetailId;
     private String printPlanId;
     private String printPlanId;
+    @ExcelProperty(name = "印刷计划", width = 30, index = 2)
     private String printPlanName;
     private String printPlanName;
+    @ExcelProperty(name = "考试开始日期", width = 30, index = 3)
     private Long examStartTime;
     private Long examStartTime;
+    @ExcelProperty(name = "考试结束日期", width = 30, index = 4)
     private Long examEndTime;
     private Long examEndTime;
+    @ExcelProperty(name = "课程(代码)", width = 30, index = 5)
     private String courseNameCode;
     private String courseNameCode;
+    @ExcelProperty(name = "试卷编号", width = 30, index = 6)
     private String paperNumber;
     private String paperNumber;
+    @ExcelProperty(name = "考点", width = 30, index = 7)
     private String examPlace;
     private String examPlace;
+    @ExcelProperty(name = "考场", width = 30, index = 8)
     private String examRoom;
     private String examRoom;
+    @ExcelProperty(name = "单科次A3(页)", width = 30, index = 9)
     private String singlePagesA3;
     private String singlePagesA3;
     private Integer pagesA3;
     private Integer pagesA3;
     private Integer pagesA4;
     private Integer pagesA4;
+    @ExcelProperty(name = "科次", width = 30, index = 10)
     private Integer totalSubjects;
     private Integer totalSubjects;
+    @ExcelProperty(name = "印刷状态", width = 30, index = 11)
     private String status;
     private String status;
+    @ExcelProperty(name = "是否校验", width = 30, index = 13)
     private Boolean validate;
     private Boolean validate;
+    @ExcelProperty(name = "是否缓存", width = 30, index = 12)
     private Boolean isDownload;
     private Boolean isDownload;
     private Boolean isTry;
     private Boolean isTry;
     private Boolean isPass;
     private Boolean isPass;
+    @ExcelProperty(name = "印刷员", width = 30, index = 14)
     private String printUser;
     private String printUser;
+    @ExcelProperty(name = "印刷开始时间", width = 30, index = 15)
     private Long printStartTime;
     private Long printStartTime;
+    @ExcelProperty(name = "印刷完成时间", width = 30, index = 16)
     private Long printEndTime;
     private Long printEndTime;
+    @ExcelProperty(name = "卷袋编号", width = 30, index = 1)
     private String packageCode;
     private String packageCode;
     private Long createId;
     private Long createId;
     private Long createTime;
     private Long createTime;

+ 2 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CardRequiredFieldsEnum.java

@@ -12,13 +12,9 @@ import java.util.List;
  */
  */
 public enum CardRequiredFieldsEnum {
 public enum CardRequiredFieldsEnum {
 
 
-    STUDENT_CODE("studentCode", "学号"),
+    TICKET_NUMBER("ticketNumber", "考号"),
     STUDENT_NAME("studentName","姓名"),
     STUDENT_NAME("studentName","姓名"),
-    COURSE_CODE("courseCode","课程代码"),
-    COURSE_NAME("courseName","课程名称"),
-    EXAM_PLACE("examPlace","考点"),
-    EXAM_ROOM("examRoom","考场"),
-    PAPER_NUMBER("paperNumber","试卷编号");
+    COURSE_NAME("courseName","课程名称");
 
 
     private String code;
     private String code;
     private String desc;
     private String desc;

+ 1 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/RequiredFieldsEnum.java

@@ -12,6 +12,7 @@ import java.util.List;
 public enum RequiredFieldsEnum {
 public enum RequiredFieldsEnum {
 
 
     STUDENT_CODE("studentCode", "学号"),
     STUDENT_CODE("studentCode", "学号"),
+    TICKET_NUMBER("ticketNumber", "考号"),
     STUDENT_NAME("studentName","姓名"),
     STUDENT_NAME("studentName","姓名"),
     COURSE_CODE("courseCode","课程代码"),
     COURSE_CODE("courseCode","课程代码"),
     COURSE_NAME("courseName","课程名称"),
     COURSE_NAME("courseName","课程名称"),

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

@@ -199,4 +199,11 @@ public interface CommonService {
      * @return
      * @return
      */
      */
     public LoginResult login(String password, SysUser sysUser) throws NoSuchAlgorithmException;
     public LoginResult login(String password, SysUser sysUser) throws NoSuchAlgorithmException;
+
+    /**
+     * 生成唯一的试卷编号
+     * @param schoolId
+     * @return
+     */
+    public String createPaperNumber(Long schoolId);
 }
 }

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

@@ -1,5 +1,6 @@
 package com.qmth.distributed.print.business.service.impl;
 package com.qmth.distributed.print.business.service.impl;
 
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.ZipUtil;
 import cn.hutool.core.util.ZipUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
@@ -19,10 +20,7 @@ import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.*;
 import com.qmth.distributed.print.business.enums.*;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
 import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
-import com.qmth.distributed.print.business.util.AuthUtil;
-import com.qmth.distributed.print.business.util.OssUtil;
-import com.qmth.distributed.print.business.util.RedisUtil;
-import com.qmth.distributed.print.business.util.ServletUtil;
+import com.qmth.distributed.print.business.util.*;
 import com.qmth.distributed.print.common.SignatureEntityTest;
 import com.qmth.distributed.print.common.SignatureEntityTest;
 import com.qmth.distributed.print.common.contant.SpringContextHolder;
 import com.qmth.distributed.print.common.contant.SpringContextHolder;
 import com.qmth.distributed.print.common.contant.SystemConstant;
 import com.qmth.distributed.print.common.contant.SystemConstant;
@@ -105,6 +103,9 @@ public class CommonServiceImpl implements CommonService {
     @Autowired
     @Autowired
     private AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
     private AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
 
 
+    @Autowired
+    private ConvertUtil convertUtil;
+
     /**
     /**
      * 新增用户权限
      * 新增用户权限
      *
      *
@@ -696,6 +697,20 @@ public class CommonServiceImpl implements CommonService {
         return loginResult;
         return loginResult;
     }
     }
 
 
+    @Override
+    public String createPaperNumber(Long schoolId) {
+        String date = DateUtil.today().replace("-", "");
+        String paperNumber = convertUtil.getIncre(date, "paperNumber" + schoolId, 5);
+        QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getPaperNumber, paperNumber);
+        ExamTask examTask = examTaskService.getOne(queryWrapper);
+        if(examTask!= null){
+            return createPaperNumber(schoolId);
+        } else{
+            return paperNumber;
+        }
+    }
+
     private Set<Long> getOrgIds(Set<Long> stringSet, List<OrgDto> orgDtos, Long parentId) {
     private Set<Long> getOrgIds(Set<Long> stringSet, List<OrgDto> orgDtos, Long parentId) {
         for (OrgDto orgDto : orgDtos) {
         for (OrgDto orgDto : orgDtos) {
             Long tempParentId = orgDto.getParentId();
             Long tempParentId = orgDto.getParentId();

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

@@ -88,9 +88,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Autowired
     @Autowired
     private ExamPrintPlanService examPrintPlanService;
     private ExamPrintPlanService examPrintPlanService;
 
 
-    @Autowired
-    private ConvertUtil convertUtil;
-
     @Resource
     @Resource
     private ExamDetailService examDetailService;
     private ExamDetailService examDetailService;
 
 
@@ -233,8 +230,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             }
             }
         } else {
         } else {
             // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
             // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
-            String date = DateUtil.today().replace("-", "");
-            String paperNumber = convertUtil.getIncre(date, "paperNumber" + schoolId, 5);
+            String paperNumber = commonService.createPaperNumber(schoolId);
             examTask.setPaperNumber(paperNumber);
             examTask.setPaperNumber(paperNumber);
         }
         }
 
 
@@ -462,8 +458,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 paperNumbers.add(examTaskTemp.getPaperNumber());
                 paperNumbers.add(examTaskTemp.getPaperNumber());
             } else {
             } else {
                 // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
                 // 试卷编号生成规则:年月日(例如:20100419)+0000(例如:0001)顺序编号
-                String date = DateUtil.today().replace("-", "");
-                String paperNumber = convertUtil.getIncre(date, "paperNumber" + schoolId, 5);
+                String paperNumber = commonService.createPaperNumber(schoolId);
                 examTaskTemp.setPaperNumber(paperNumber);
                 examTaskTemp.setPaperNumber(paperNumber);
             }
             }
             examTask.setPaperNumber(examTaskTemp.getPaperNumber());
             examTask.setPaperNumber(examTaskTemp.getPaperNumber());

+ 1 - 1
distributed-print-business/src/main/resources/db/init-table.sql

@@ -278,7 +278,7 @@ CREATE TABLE `exam_detail`  (
   `create_time` bigint(20) NULL DEFAULT NULL,
   `create_time` bigint(20) NULL DEFAULT NULL,
   `update_id` bigint(20) NULL DEFAULT NULL,
   `update_id` bigint(20) NULL DEFAULT NULL,
   `update_time` bigint(20) NULL DEFAULT NULL,
   `update_time` bigint(20) NULL DEFAULT NULL,
-  `attachment_path` mediumtext COMMENT '附件路径',
+  `attachment_path` mediumtext COMMENT '印品附件路径',
   PRIMARY KEY (`id`) USING BTREE
   PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '考务数据' ROW_FORMAT = Dynamic;
 ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '考务数据' ROW_FORMAT = Dynamic;
 
 

+ 5 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java

@@ -19,6 +19,7 @@ import com.qmth.distributed.print.business.entity.TBSession;
 import com.qmth.distributed.print.business.enums.RoleTypeEnum;
 import com.qmth.distributed.print.business.enums.RoleTypeEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.util.AuthUtil;
 import com.qmth.distributed.print.business.util.AuthUtil;
+import com.qmth.distributed.print.business.util.ExcelUtil;
 import com.qmth.distributed.print.business.util.RedisUtil;
 import com.qmth.distributed.print.business.util.RedisUtil;
 import com.qmth.distributed.print.business.util.ServletUtil;
 import com.qmth.distributed.print.business.util.ServletUtil;
 import com.qmth.distributed.print.common.SignatureEntityTest;
 import com.qmth.distributed.print.common.SignatureEntityTest;
@@ -248,7 +249,7 @@ public class ClientController {
      */
      */
     @ApiOperation(value = "印刷管理-导出")
     @ApiOperation(value = "印刷管理-导出")
     @RequestMapping(value = "/print/task_list_export", method = RequestMethod.POST)
     @RequestMapping(value = "/print/task_list_export", method = RequestMethod.POST)
-    public Result printTaskListExport(HttpServletResponse response,
+    public void printTaskListExport(HttpServletResponse response,
                                       @RequestParam("schoolId") Long schoolId,
                                       @RequestParam("schoolId") Long schoolId,
                                       @RequestParam("machineCode") Long machineCode,
                                       @RequestParam("machineCode") Long machineCode,
                                       @RequestParam("orgId") String orgId,
                                       @RequestParam("orgId") String orgId,
@@ -261,9 +262,9 @@ public class ClientController {
                                       @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                       @RequestParam(value = "examStartTime", required = false) Long examStartTime,
                                       @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                       @RequestParam(value = "examEndTime", required = false) Long examEndTime,
                                       @RequestParam(value = "isDownload", required = false) Boolean isDownload,
                                       @RequestParam(value = "isDownload", required = false) Boolean isDownload,
-                                      @RequestParam(value = "validate", required = false) Boolean validate) {
-        List<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(response, schoolId, machineCode, orgId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
-        return ResultUtil.ok(printTaskDtoIPage);
+                                      @RequestParam(value = "validate", required = false) Boolean validate) throws Exception {
+        List<ClientPrintTaskDto> printTaskDtoIList = clientService.listClientPrintTask(response, schoolId, machineCode, orgId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
+        ExcelUtil.excelExport("印刷管理", ClientPrintTaskDto.class, printTaskDtoIList, response);
     }
     }
 
 
     /**
     /**