Browse Source

3.0.0-bug修改

xiaof 3 years ago
parent
commit
4be85924d6

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailCardDto.java

@@ -27,6 +27,7 @@ public class ExamTaskDetailCardDto {
     // 审核流程taskId
     private String flowTaskId;
     private String examId;
+    private String examModel;
     private String examName;
     private String semesterName;
 
@@ -185,6 +186,14 @@ public class ExamTaskDetailCardDto {
         this.examName = examName;
     }
 
+    public String getExamModel() {
+        return examModel;
+    }
+
+    public void setExamModel(String examModel) {
+        this.examModel = examModel;
+    }
+
     public String getSemesterName() {
         return semesterName;
     }

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

@@ -7,13 +7,10 @@ import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 
-/**
- * @Date: 2021/4/20.
- */
 public interface ClientService {
     IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);
 
-    List<Map<String, String>> getUrl(Long printPlanId, Long examTaskId);
+    List<Map<String, String>> getPaperUrl(Long printPlanId, Long examTaskId);
 
     Boolean tagPass(Long printPlanId, String courseCode, String courseName, String paperNumber, String machineCode, Boolean isPass, Long userId);
 

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

@@ -35,7 +35,7 @@ public interface ExamTaskDetailService extends IService<ExamTaskDetail> {
 
     List<ExamTaskDetail> listByTemplateId(Long templateId);
 
-    List<Map<String, String>>  getUrl(Long schoolId, Long printPlanId, Long examTaskId);
+    List<Map<String, String>>  getPaperUrl(Long schoolId, Long printPlanId, Long examTaskId);
 
     boolean paperUpdate(ExamTaskDetail examTaskDetail);
 

+ 36 - 46
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -19,7 +19,6 @@ import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -31,43 +30,43 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 /**
- * @Date: 2021/4/20.
+ * 客户端
  */
 @Service
 public class ClientServiceImpl implements ClientService {
 
-    @Autowired
-    private ExamTaskService examTaskService;
-
-    @Autowired
-    private ExamTaskDetailService examTaskDetailService;
+    @Resource
+    ExamTaskService examTaskService;
 
-    @Autowired
-    private ClientStatusService clientStatusService;
+    @Resource
+    ExamTaskDetailService examTaskDetailService;
 
-    @Autowired
-    private ExamDetailService examDetailService;
+    @Resource
+    ClientStatusService clientStatusService;
 
-    @Autowired
-    private ExamDetailCourseService examDetailCourseService;
+    @Resource
+    ExamDetailService examDetailService;
 
-    @Autowired
-    private BasicAttachmentService basicAttachmentService;
+    @Resource
+    ExamDetailCourseService examDetailCourseService;
 
-    @Autowired
-    private PrintCommonService printCommonService;
+    @Resource
+    BasicAttachmentService basicAttachmentService;
 
-    @Autowired
-    private ExamPrintPlanService examPrintPlanService;
+    @Resource
+    ExamPrintPlanService examPrintPlanService;
 
-    @Autowired
-    private ExamStudentService examStudentService;
+    @Resource
+    ExamStudentService examStudentService;
 
     @Resource
     TeachcloudCommonService teachcloudCommonService;
 
-    @Autowired
-    private SysPrivilegeService sysPrivilegeService;
+    @Resource
+    SysPrivilegeService sysPrivilegeService;
+
+    @Resource
+    BasicExamService basicExamService;
 
     @Override
     public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
@@ -76,9 +75,9 @@ public class ClientServiceImpl implements ClientService {
     }
 
     @Override
-    public List<Map<String, String>> getUrl(Long printPlanId, Long examTaskId) {
+    public List<Map<String, String>> getPaperUrl(Long printPlanId, Long examTaskId) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        return examTaskDetailService.getUrl(schoolId, printPlanId, examTaskId);
+        return examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
     }
 
     @Override
@@ -156,8 +155,7 @@ public class ClientServiceImpl implements ClientService {
     public IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<ClientPrintTaskDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ClientPrintTaskDto> pirntTaskDtoIPage = examPrintPlanService.listClientPrintTask(page, schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId);
-        return pirntTaskDtoIPage;
+        return examPrintPlanService.listClientPrintTask(page, schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgId);
     }
 
     @Transactional
@@ -165,8 +163,7 @@ public class ClientServiceImpl implements ClientService {
     public Map<String, Object> getPrintData(Long examDetailId, String machineCode, Boolean isPrint, String printUser) {
         ExamDetail examDetail = examDetailService.getById(examDetailId);
         // 撤回提示
-        if (ExamDetailStatusEnum.NEW.name().equals(examDetail.getStatus())
-                || ExamDetailStatusEnum.READY.name().equals(examDetail.getStatus())) {
+        if (ExamDetailStatusEnum.NEW.equals(examDetail.getStatus()) || ExamDetailStatusEnum.READY.equals(examDetail.getStatus())) {
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
         }
         if (isPrint && StringUtils.isBlank(printUser)) {
@@ -176,8 +173,9 @@ public class ClientServiceImpl implements ClientService {
             throw ExceptionResultEnum.ERROR.exception("该任务已被[" + examDetail.getPrintUser() + "]占用");
         }
 
-        Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        // 课程、试卷信息
         List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+
         Map<String, Object> finalMap = new HashMap<>();
         ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
         // 2.取生成的完整的pdf
@@ -189,12 +187,12 @@ public class ClientServiceImpl implements ClientService {
             // 备用试卷、备用题卡map
             Map<String, Object> backupMap = new HashMap<>();
             // 备份数量
-            int backupCount = examPrintPlan.getBackupCount().intValue();
+            int backupCount = examPrintPlan.getBackupCount();
             // 取考生列表
-            List<Map> studentList = examDetailService.listStudentByExamDetailId(schoolId, examDetailId, "1", "1");
+            List<Map> studentList = examDetailService.listStudentByExamDetailId(examDetail.getSchoolId(), examDetailId, null, null);
             if (printContent.contains("PAPER")) {
                 if (examDetail.getAttachmentId() == null) {
-                    throw ExceptionResultEnum.ERROR.exception("考场pdf未生成");
+                    throw ExceptionResultEnum.ERROR.exception("考场pdf文件未生成");
                 }
 
                 BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
@@ -377,9 +375,7 @@ public class ClientServiceImpl implements ClientService {
         finalMap.put("cardTotal", cardAttachment == null ? null : teachcloudCommonService.filePreviewByAttachmentId(cardAttachment.getId(), false));
 
         ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
-        String variableContent = examPrintPlan.getVariableContent();
-        String ordinaryContent = examPrintPlan.getOrdinaryContent();
-        List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
+
         List<Map> otherList = new ArrayList<>();
         //印品附件信息
         String attachmentPath = examDetail.getAttachmentPath();
@@ -388,10 +384,11 @@ public class ClientServiceImpl implements ClientService {
             String pathString = jsonObject.getString("path");
             List<Map> pathList = JSONObject.parseArray(pathString, Map.class);
             if (!pathList.isEmpty()) {
+                List<Map> variableList = JSONObject.parseArray(examPrintPlan.getVariableContent(), Map.class);
                 for (Map contentMap : variableList) {
                     spliceOtherContent(otherList, pathList, contentMap);
                 }
-                List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
+                List<Map> ordinaryList = JSONObject.parseArray(examPrintPlan.getOrdinaryContent(), Map.class);
                 for (Map contentMap : ordinaryList) {
                     spliceOtherContent(otherList, pathList, contentMap);
                 }
@@ -538,7 +535,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.getUrl(schoolId, Long.valueOf(clientExamTaskDto.getPrintPlanId()), Long.valueOf(clientExamTaskDto.getExamTaskId()));
+            List<Map<String, String>> mapList = examTaskDetailService.getPaperUrl(schoolId, Long.valueOf(clientExamTaskDto.getPrintPlanId()), Long.valueOf(clientExamTaskDto.getExamTaskId()));
             map.put("list", mapList);
             list.add(map);
         }
@@ -584,10 +581,8 @@ public class ClientServiceImpl implements ClientService {
     @Override
     public IPage<ClientPrintStatisticsDto> listClientPrintStatistics(Long orgId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-//        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         Page<ClientPrintStatisticsDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ClientPrintStatisticsDto> statisticsDtoIPage = examPrintPlanService.listClientPrintStatistics(page, schoolId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, orgId);
-        return statisticsDtoIPage;
+        return examPrintPlanService.listClientPrintStatistics(page, schoolId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, orgId);
     }
 
     @Override
@@ -606,8 +601,6 @@ public class ClientServiceImpl implements ClientService {
 
     /**
      * 根据考场生成试卷map
-     *
-     * @return
      */
     public Map<String, Map<String, String>> mapCourseUrl(List<Map<String, Object>> mapList) {
         Map<String, Map<String, String>> map = new HashMap<>();
@@ -658,7 +651,6 @@ public class ClientServiceImpl implements ClientService {
      *
      * @param studentList
      * @param map
-     * @return
      */
     private List<ClientPrintDataDto> splicePaperContent(List<Map> studentList, Map<String, Map<String, String>> map) {
         List<ClientPrintDataDto> paperList = studentList.stream().map(m -> {
@@ -676,7 +668,6 @@ public class ClientServiceImpl implements ClientService {
      * 生成题卡url公共方法
      *
      * @param studentList
-     * @return
      */
     private List<ClientPrintDataDto> spliceCardContent(List<Map> studentList) {
         List<ClientPrintDataDto> cardList = studentList.stream().map(m -> {
@@ -693,7 +684,6 @@ public class ClientServiceImpl implements ClientService {
      * new ClientPrintDataDto
      *
      * @param m
-     * @return
      */
     private ClientPrintDataDto newClientPrintDataDto(Map m) {
         ClientPrintDataDto printDataDto = new ClientPrintDataDto();

+ 31 - 38
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -121,34 +121,28 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Transactional(rollbackFor = Exception.class)
     @Override
     public double calculateTotalPackages(Long printPlanId) {
-        double result = 0;
         List<ExamDetail> examDetailList = this.list(new QueryWrapper<ExamDetail>().lambda().eq(ExamDetail::getPrintPlanId, printPlanId));
-//        for (ExamDetail examDetail : examDetailList) {
-//            double count = examDetailCourseService.calculatePackagesByDetailId(examDetail.getId());
-//            result = result + count;
-//        }
         return examDetailList.size();
     }
 
     @Override
-    public IPage<PrintTaskDto> listPrintTask(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime,Long printHouseId, Integer pageNumber, Integer pageSize) {
+    public IPage<PrintTaskDto> listPrintTask(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         Page<PrintTaskDto> page = new Page<>(pageNumber, pageSize);
-        IPage<PrintTaskDto> pirntTaskDtoIPage = this.baseMapper.listPrintTask(page, schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime,printStartTime, printEndTime,printHouseId,  orgIds);
-        return pirntTaskDtoIPage;
+        return this.baseMapper.listPrintTask(page, schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, orgIds);
     }
 
     @Override
-    public PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime,Long printHouseId) {
+    public PrintTaskTotalDto taskTotalData(Long printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Long printStartTime, Long printEndTime, Long printHouseId) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        PrintTaskTotalDto printTaskTotalDto = this.baseMapper.taskTotalData(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime,printHouseId, orgIds);
+        PrintTaskTotalDto printTaskTotalDto = this.baseMapper.taskTotalData(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printStartTime, printEndTime, printHouseId, orgIds);
 
         if (printTaskTotalDto != null) {
             // 试卷总计
-            Integer paperCount = this.baseMapper.selectPaperCount(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime,printHouseId, orgIds);
-            printTaskTotalDto.setPaperCount(paperCount == null ? 0 : paperCount.intValue());
+            Integer paperCount = this.baseMapper.selectPaperCount(schoolId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, printHouseId, orgIds);
+            printTaskTotalDto.setPaperCount(paperCount == null ? 0 : paperCount);
         }
         return printTaskTotalDto;
     }
@@ -161,14 +155,14 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("type", PdfTypeEnum.ALL_A3);
             BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
-            jsonObject.put("url",attachment == null ? null : teachcloudCommonService.filePreview(attachment.getPath()));
+            jsonObject.put("url", attachment == null ? null : teachcloudCommonService.filePreview(attachment.getPath()));
             list.add(jsonObject);
         }
         if (examDetail.getCardAttachmentId() != null) {
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("type", PdfTypeEnum.CARD_A3);
             BasicAttachment attachment = basicAttachmentService.getById(examDetail.getCardAttachmentId());
-            jsonObject.put("url",attachment == null ? null : teachcloudCommonService.filePreview(attachment.getPath()));
+            jsonObject.put("url", attachment == null ? null : teachcloudCommonService.filePreview(attachment.getPath()));
             list.add(jsonObject);
         }
         return list;
@@ -251,8 +245,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode,Long startDate,Long endDate, int pageNumber, int pageSize, Set<Long> orgIds) {
-        IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode,startDate,endDate, orgIds);
+    public IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, int pageNumber, int pageSize, Set<Long> orgIds) {
+        IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, orgIds);
         List<ExaminationResult> list = page.getRecords();
         for (ExaminationResult examinationResult : list) {
             String examDetailCourseIds = examinationResult.getExamDetailCourseIds();
@@ -292,8 +286,8 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public SummarizedDataResult findSummarizedData(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode,Long startDate,Long endDate, Set<Long> orgIds) {
-        IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode,startDate,endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, orgIds);
+    public SummarizedDataResult findSummarizedData(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, Set<Long> orgIds) {
+        IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, orgIds);
         List<ExaminationResult> list = page.getRecords();
         int totalSubjects = 0;
         for (ExaminationResult examinationResult : list) {
@@ -309,9 +303,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public IPage<ExaminationDetailResult> findExaminationDetail(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String studentParams,Long startDate,Long endDate, int pageNumber, int pageSize) {
+    public IPage<ExaminationDetailResult> findExaminationDetail(Long schoolId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String studentParams, Long startDate, Long endDate, int pageNumber, int pageSize) {
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        return examDetailMapper.findDetailPage(new Page<>(pageNumber, pageSize), schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, SystemConstant.translateSpecificSign(studentParams),startDate,endDate, orgIds);
+        return examDetailMapper.findDetailPage(new Page<>(pageNumber, pageSize), schoolId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, SystemConstant.translateSpecificSign(studentParams), startDate, endDate, orgIds);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -474,7 +468,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         // 同一任务是否有多个校区
         Map<String, List<Map<String, Object>>> stringListMap = examDetailKeyList.stream().collect(Collectors.groupingBy(m -> m.get("schoolId") + "#" + m.get("printPlanId") + "#" + m.get("printPlanName") + "#" + m.get("examPlace") + "#" + m.get("examRoom") + "#" + m.get("examStartTime") + "#" + m.get("examEndTime")));
         for (Map.Entry<String, List<Map<String, Object>>> entry : stringListMap.entrySet()) {
-            if(entry.getValue().size() > 1){
+            if (entry.getValue().size() > 1) {
                 throw ExceptionResultEnum.ERROR.exception("同一考场对应校区指派的印刷室只能为一个");
             }
         }
@@ -662,15 +656,15 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             basicStudentParams.setStudentCode(studentCode);
             basicStudentParams.setStudentName(studentName);
             basicStudentParams.setCampusId(basicCampusService.getOne(new QueryWrapper<BasicCampus>()
-                    .lambda()
-                    .eq(BasicCampus::getSchoolId,schoolId)
-                    .eq(BasicCampus::getCampusName,campusName))
+                            .lambda()
+                            .eq(BasicCampus::getSchoolId, schoolId)
+                            .eq(BasicCampus::getCampusName, campusName))
                     .getId());
             basicStudentParamsList.add(basicStudentParams);
         }
         examStudentService.saveBatch(examStudentList);
         // 更新基础学生表数据
-        basicStudentService.saveOrUpdateBasicStudentBatch(basicStudentParamsList,sysUser);
+        basicStudentService.saveOrUpdateBasicStudentBatch(basicStudentParamsList, sysUser);
     }
 
     @Override
@@ -735,7 +729,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         Long schoolId = tbTask.getSchoolId();
 
         List<ExaminationResult> examinationResultList = this.findExaminationBriefPage(schoolId,
-                printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode,startDate,endDate,
+                printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate,
                 SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, orgIds).getRecords();
         int index = 0;
         List<ExaminationExportDto> examinationExportDtoList = new ArrayList<>();
@@ -814,8 +808,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
         }
         Page<ClientExamStudentDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ClientExamStudentDto> examStudentDtoIPage = this.baseMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(ticketNumber), SystemConstant.translateSpecificSign(studentName), courseCode);
-        return examStudentDtoIPage;
+        return this.baseMapper.listClientExamStudentPage(page, schoolId, examDetailId, SystemConstant.translateSpecificSign(ticketNumber), SystemConstant.translateSpecificSign(studentName), courseCode);
     }
 
     @Override
@@ -827,10 +820,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     public List<ExamDetail> listByCourseCodeAndPaperNumberAndPaperTypeIsNull(Long schoolId, String courseCode, String paperNumber) {
         List<ExamDetailCourse> examDetailCourses = examDetailCourseService.listByCourseCodeAndPaperNumber(schoolId, courseCode, paperNumber);
         examDetailCourses = examDetailCourses.stream().filter(m -> StringUtils.isBlank(m.getPaperType())).collect(Collectors.toList());
-        if (examDetailCourses != null && examDetailCourses.size() > 0) {
-            Set<Long> examDetailIds = examDetailCourses.stream().map(m -> m.getExamDetailId()).collect(Collectors.toSet());
-            List<ExamDetail> examDetails = this.listByIds(examDetailIds);
-            return examDetails;
+        if (examDetailCourses.size() > 0) {
+            Set<Long> examDetailIds = examDetailCourses.stream().map(ExamDetailCourse::getExamDetailId).collect(Collectors.toSet());
+            return this.listByIds(examDetailIds);
         }
         return null;
     }
@@ -863,7 +855,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         if (!SystemConstant.strNotNull(separator)) {
             separator = ",";
         }
-        if(StringUtils.isBlank(clazzIds)){
+        if (StringUtils.isBlank(clazzIds)) {
             return null;
         }
         String[] strArr = clazzIds.split(separator);
@@ -879,7 +871,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         }
         Set<Long> clazzIdSet = new HashSet<>(clazzIdList);
         List<String> clazzNameList = this.findClazzNamesByClazzIdSet(clazzIdSet);
-        return String.join(separator,clazzNameList);
+        return String.join(separator, clazzNameList);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -933,14 +925,15 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
 
     /**
      * 根据clazzIdSet集合查询班级名称集合
+     *
      * @param clazzIdSet 班级idset
      * @return 班级名称集合
      */
-    private List<String> findClazzNamesByClazzIdSet(Set<Long> clazzIdSet){
+    private List<String> findClazzNamesByClazzIdSet(Set<Long> clazzIdSet) {
         Set<String> clazzNameSet = new HashSet<>();
-        if (clazzIdSet.size() > 0){
-            Set<String> basicClazzSet = basicClazzService.list(new QueryWrapper<BasicClazz>().lambda().in(BasicClazz::getId,clazzIdSet)).stream().map(BasicClazz::getClazzName).collect(Collectors.toSet());
-            Set<String> teachClazzSet = teachClazzService.list(new QueryWrapper<TeachClazz>().lambda().in(TeachClazz::getId,clazzIdSet)).stream().map(TeachClazz::getTeachClazzName).collect(Collectors.toSet());
+        if (clazzIdSet.size() > 0) {
+            Set<String> basicClazzSet = basicClazzService.list(new QueryWrapper<BasicClazz>().lambda().in(BasicClazz::getId, clazzIdSet)).stream().map(BasicClazz::getClazzName).collect(Collectors.toSet());
+            Set<String> teachClazzSet = teachClazzService.list(new QueryWrapper<TeachClazz>().lambda().in(TeachClazz::getId, clazzIdSet)).stream().map(TeachClazz::getTeachClazzName).collect(Collectors.toSet());
             clazzNameSet.addAll(basicClazzSet);
             clazzNameSet.addAll(teachClazzSet);
         }

+ 4 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamPrintPlanServiceImpl.java

@@ -339,9 +339,10 @@ public class ExamPrintPlanServiceImpl extends ServiceImpl<ExamPrintPlanMapper, E
         for (ClientPrintTaskDto record : clientPrintTaskDtoIPage.getRecords()) {
             // 试卷、题卡
             String printContent = record.getPrintContent();
-            record.setIncluedPaper(StringUtils.isBlank(printContent) ? false : printContent.contains("PAPER"));
-            record.setIncluedCard(StringUtils.isBlank(printContent) ? false : printContent.contains("CARD"));
-            //
+            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);

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

@@ -291,7 +291,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
     }
 
     @Override
-    public List<Map<String, String>> getUrl(Long schoolId, Long printPlanId, Long examTaskId) {
+    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.isEmpty(examDetailCourses)) {

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

@@ -1069,8 +1069,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
     @Override
     public ExamTaskDetailCardDto applyGetOne(Long examTaskId, String source) {
-        ExamTaskDetailCardDto examTaskDetailDto = this.baseMapper.applyGetOne(examTaskId, source);
-        return examTaskDetailDto;
+        return this.baseMapper.applyGetOne(examTaskId, source);
     }
 
     /**
@@ -1193,18 +1192,15 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     public IPage<ClientExamTaskDto> listTryTask(Long schoolId, String machineCode, Long orgId, Long
             printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer
                                                         pageSize) {
-//        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(orgId);
         Page<ClientExamTaskDto> page = new Page<>(pageNumber, pageSize);
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
-        String[] examDetailstatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name()};
-        IPage<ClientExamTaskDto> examTaskDtoIPage = this.baseMapper.listClientExamTaskPage(page, schoolId, machineCode, printPlanId, courseCode, paperNumber, isTry, isPass, orgId, PrintPlanStatusEnum.PRINTING.name(), examDetailstatus);
-        return examTaskDtoIPage;
+        String[] examDetailStatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name()};
+        return this.baseMapper.listClientExamTaskPage(page, schoolId, machineCode, printPlanId, courseCode, paperNumber, isTry, isPass, orgId, PrintPlanStatusEnum.PRINTING.name(), examDetailStatus);
     }
 
     @Override
     public List<ClientExamTaskDto> listTryTask(Long schoolId, String machineCode, Long orgId, Long
             printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass) {
-//        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(orgId);
         // 印刷任务状态为印刷中(PRINTING),考场状态为待打印(WAITING)
         String[] examDetailstatus = {ExamDetailStatusEnum.NEW.name(), ExamDetailStatusEnum.READY.name()};
         List<ClientExamTaskDto> examTaskDtoIPage = this.baseMapper.listClientExamTaskPage(schoolId, machineCode, printPlanId, courseCode, paperNumber, isTry, isPass, orgId, PrintPlanStatusEnum.PRINTING.name(), examDetailstatus);

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

@@ -584,6 +584,7 @@
             e.id examTaskId,
             e.exam_id examId,
             g.name examName,
+            g.exam_model examModel,
             h.name semesterName,
             case #{source} when 'REVIEW' then ifnull(c.paper_type, a.paper_type) else a.paper_type end paperType,
             case #{source} when 'REVIEW' then ifnull(c.paper_attachment_ids, a.paper_attachment_ids) else a.paper_attachment_ids end paperAttachmentIds,

+ 95 - 114
distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java

@@ -19,7 +19,6 @@ 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.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
@@ -32,7 +31,7 @@ import java.util.Map;
 import java.util.Objects;
 
 /**
- * @Date: 2021/4/19.
+ * 客户端接口(打印端)
  */
 @Api(tags = "客户端Controller")
 @RestController
@@ -40,8 +39,8 @@ import java.util.Objects;
 //@Validated
 public class ClientController {
 
-    @Autowired
-    private ClientService clientService;
+    @Resource
+    ClientService clientService;
 
     @Resource
     SysUserService sysUserService;
@@ -55,8 +54,7 @@ public class ClientController {
     /**
      * 登录
      *
-     * @param login
-     * @return
+     * @param login 登录参数
      */
     @ApiOperation(value = "登录")
     @RequestMapping(value = "/user/login", method = RequestMethod.POST)
@@ -95,9 +93,8 @@ public class ClientController {
      * @param paperNumber 试卷编号
      * @param isTry       是否打样
      * @param isPass      是否合格
-     * @param pageNumber
-     * @param pageSize
-     * @return
+     * @param pageNumber  分页参数
+     * @param pageSize    分页参数
      */
     @ApiOperation(value = "试卷打样-列表")
     @RequestMapping(value = "/paper_try/list", method = RequestMethod.POST)
@@ -117,28 +114,26 @@ public class ClientController {
     /**
      * 试卷打样-查看/试印/重印
      *
-     * @param examTaskId
-     * @return
+     * @param examTaskId 命题任务ID
      */
     @ApiOperation(value = "试卷打样-查看/试印/重印")
     @RequestMapping(value = "/paper_try/print", method = RequestMethod.POST)
     public Result paperTryPrint(@RequestParam("printPlanId") Long printPlanId,
                                 @RequestParam("examTaskId") Long examTaskId) {
-        List<Map<String, String>> list = clientService.getUrl(printPlanId, examTaskId);
+        List<Map<String, String>> list = clientService.getPaperUrl(printPlanId, examTaskId);
         return ResultUtil.ok(list);
     }
 
     /**
      * 试卷打样-批量试印
      *
-     * @param machineCode
-     * @param orgId
-     * @param printPlanId
-     * @param courseCode
-     * @param paperNumber
-     * @param isTry
-     * @param isPass
-     * @return
+     * @param machineCode 机器码
+     * @param orgId       机构ID
+     * @param printPlanId 印刷计划ID
+     * @param courseCode  课程代码
+     * @param paperNumber 试卷编号
+     * @param isTry       是否打样
+     * @param isPass      是否通过
      */
     @ApiOperation(value = "试卷打样-批量试印")
     @RequestMapping(value = "/paper_try/print_batch", method = RequestMethod.POST)
@@ -156,10 +151,9 @@ public class ClientController {
     /**
      * 试卷打样-标记合格状态
      *
-     * @param machineCode
-     * @param isPass
-     * @param userId
-     * @return
+     * @param machineCode 机器码
+     * @param isPass      是否通过
+     * @param userId      用户Id
      */
     @ApiOperation(value = "试卷打样-标记合格状态")
     @RequestMapping(value = "/paper_try/tag_pass", method = RequestMethod.POST)
@@ -177,21 +171,20 @@ public class ClientController {
     /**
      * 印刷管理-查询列表
      *
-     * @param machineCode
-     * @param orgId
-     * @param printPlanId
-     * @param status
-     * @param courseCode
-     * @param paperNumber
-     * @param examPlace
-     * @param examRoom
-     * @param examStartTime
-     * @param examEndTime
-     * @param isDownload
-     * @param validate
-     * @param pageNumber
-     * @param pageSize
-     * @return
+     * @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 = "印刷管理-查询列表")
     @RequestMapping(value = "/print/task_list", method = RequestMethod.POST)
@@ -217,20 +210,19 @@ public class ClientController {
     /**
      * 印刷管理-导出
      *
-     * @param response
-     * @param machineCode
-     * @param orgId
-     * @param printPlanId
-     * @param status
-     * @param courseCode
-     * @param paperNumber
-     * @param examPlace
-     * @param examRoom
-     * @param examStartTime
-     * @param examEndTime
-     * @param isDownload
-     * @param validate
-     * @return
+     * @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 = "印刷管理-导出")
     @RequestMapping(value = "/print/task_list_export", method = RequestMethod.POST)
@@ -253,19 +245,18 @@ public class ClientController {
     /**
      * 印刷管理-汇总数据查询
      *
-     * @param machineCode
-     * @param orgId
-     * @param printPlanId
-     * @param status
-     * @param courseCode
-     * @param paperNumber
-     * @param examPlace
-     * @param examRoom
-     * @param examStartTime
-     * @param examEndTime
-     * @param isDownload
-     * @param validate
-     * @return
+     * @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 = "印刷管理-汇总数据查询")
     @RequestMapping(value = "/print/task_total_data", method = RequestMethod.POST)
@@ -289,8 +280,7 @@ public class ClientController {
     /**
      * 印刷管理-查看
      *
-     * @param examDetailId
-     * @return
+     * @param examDetailId 命题任务ID
      */
     @ApiOperation(value = "印刷管理-查看")
     @RequestMapping(value = "/print/preview", method = RequestMethod.POST)
@@ -302,10 +292,9 @@ public class ClientController {
     /**
      * 印刷管理-印刷/缓存数据
      *
-     * @param examDetailId
-     * @param machineCode
-     * @param printUser
-     * @return
+     * @param examDetailId 考场ID
+     * @param machineCode  机器码
+     * @param printUser    打印员
      */
     @ApiOperation(value = "印刷管理-印刷/缓存数据")
     @RequestMapping(value = "/print/get_print_data", method = RequestMethod.POST)
@@ -320,9 +309,8 @@ public class ClientController {
     /**
      * 印刷管理-批量缓存数据
      *
-     * @param orgId
-     * @param machineCode
-     * @return
+     * @param orgId       机构ID
+     * @param machineCode 机器码
      */
     @ApiOperation(value = "印刷管理-批量缓存数据")
     @RequestMapping(value = "/print/get_print_data_batch", method = RequestMethod.POST)
@@ -343,10 +331,9 @@ public class ClientController {
     }
 
     /**
-     * @param examDetailId
-     * @param machineCode
-     * @param isDownload
-     * @return
+     * @param examDetailId 考场ID
+     * @param machineCode  机器码
+     * @param isDownload   是否缓存
      */
     @ApiOperation(value = "印刷管理-缓存后更新状态")
     @RequestMapping(value = "/print/update_download", method = RequestMethod.POST)
@@ -360,10 +347,9 @@ public class ClientController {
     /**
      * 印刷管理-校验
      *
-     * @param examDetailId
-     * @param packageCode
-     * @param lastCode
-     * @return
+     * @param examDetailId 考场ID
+     * @param packageCode  机器码
+     * @param lastCode     校验条码号
      */
     @ApiOperation(value = "印刷管理-校验")
     @RequestMapping(value = "/print/validate_data", method = RequestMethod.POST)
@@ -377,10 +363,9 @@ public class ClientController {
     /**
      * 印刷管理-更新打印进度
      *
-     * @param examDetailId
-     * @param machineCode
-     * @param printProgress
-     * @return
+     * @param examDetailId  考场ID
+     * @param machineCode   机器码
+     * @param printProgress 打印进度
      */
     @ApiOperation(value = "印刷管理-更新打印进度")
     @RequestMapping(value = "/print/update_progress", method = RequestMethod.POST)
@@ -395,11 +380,10 @@ public class ClientController {
     /**
      * 重打-查询考生列表
      *
-     * @param examDetailId
-     * @param ticketNumber
-     * @param studentName
-     * @param courseCode
-     * @return
+     * @param examDetailId 考场ID
+     * @param ticketNumber 准考证号
+     * @param studentName  学号
+     * @param courseCode   课程代码
      */
     @ApiOperation(value = "重打-查询考生列表")
     @RequestMapping(value = "/print/list_student", method = RequestMethod.POST)
@@ -416,10 +400,9 @@ public class ClientController {
     /**
      * 重打-内容查询
      *
-     * @param examDetailId
-     * @param ticketNumber
-     * @param type
-     * @return
+     * @param examDetailId 考场ID
+     * @param ticketNumber 准考证号
+     * @param type         类型
      */
     @ApiOperation(value = "重打-内容查询")
     @RequestMapping(value = "/print/get_reprint_data", method = RequestMethod.POST)
@@ -433,16 +416,15 @@ public class ClientController {
     /**
      * 统计查询-查询列表
      *
-     * @param orgId
-     * @param printPlanId
-     * @param examPlace
-     * @param examStartTime
-     * @param examEndTime
-     * @param courseCode
-     * @param paperNumber
-     * @param pageNumber
-     * @param pageSize
-     * @return
+     * @param orgId         机构ID
+     * @param printPlanId   印刷计划ID
+     * @param examPlace     考点
+     * @param examStartTime 考试时间(开始)
+     * @param examEndTime   考试时间(结束)
+     * @param courseCode    课程代码
+     * @param paperNumber   试卷编号
+     * @param pageNumber    分页参数
+     * @param pageSize      分页参数
      */
     @ApiOperation(value = "统计查询-查询列表")
     @RequestMapping(value = "/print/statistics_list", method = RequestMethod.POST)
@@ -462,14 +444,13 @@ public class ClientController {
     /**
      * 统计查询-汇总数据查询
      *
-     * @param orgId
-     * @param printPlanId
-     * @param examPlace
-     * @param examStartTime
-     * @param examEndTime
-     * @param courseCode
-     * @param paperNumber
-     * @return
+     * @param orgId         机构ID
+     * @param printPlanId   印刷计划Id
+     * @param examPlace     考点
+     * @param examStartTime 考试时间(开始)
+     * @param examEndTime   考试时间(结束)
+     * @param courseCode    课程代码
+     * @param paperNumber   试卷编号
      */
     @ApiOperation(value = "统计查询-汇总数据查询")
     @RequestMapping(value = "/print/statistics_total_data", method = RequestMethod.POST)

+ 0 - 11
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/TeachcloudCommonServiceImpl.java

@@ -9,8 +9,6 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.google.common.reflect.TypeToken;
 import com.google.gson.Gson;
 import com.qmth.boot.core.enums.Platform;
-import com.qmth.boot.tools.signature.SignatureType;
-import com.qmth.teachcloud.common.SignatureEntityTest;
 import com.qmth.teachcloud.common.bean.auth.AuthBean;
 import com.qmth.teachcloud.common.bean.auth.ExpireTimeBean;
 import com.qmth.teachcloud.common.bean.dto.MenuDto;
@@ -651,14 +649,7 @@ public class TeachcloudCommonServiceImpl implements TeachcloudCommonService {
         if (Objects.equals(attachmentType, SystemConstant.LOCAL)) {
             pathUrl = SystemConstant.HTTP + dictionaryConfig.sysDomain().getFileHost() + File.separator + filePath;
         } else {
-//            if (isExpire) {
-//                pathUrl = ossUtil.getPrivateUrl(filePath);
             pathUrl = fileStoreUtil.getPrivateUrl(filePath, uploadFileEnum.getFssType());
-//            } else {
-//                pathUrl = dictionaryConfig.aliYunOssDomain().getUrl() + File.separator + filePath;
-//                pathUrl = fileStoreUtil.getPrivateUrl(filePath, uploadFileEnum.getFssType());
-//            }
-
         }
         map.put("url", pathUrl);
         if (attachment.getType().equals(".html")) {
@@ -683,8 +674,6 @@ public class TeachcloudCommonServiceImpl implements TeachcloudCommonService {
             try {
                 InputStream fis;
                 if (type.equals(SystemConstant.OSS)) {
-//                    byte[] bytes = ossUtil.ossDownload(filePath);
-//                    fis = new ByteArrayInputStream(bytes);
                     fis = fileStoreUtil.ossDownloadIs(filePath, uploadType.getFssType());
                 } else {
                     String url = SystemConstant.HTTP + dictionaryConfig.sysDomain().getFileHost() + File.separator + filePath;