xiaof 4 vuotta sitten
vanhempi
commit
ec5560aeae
16 muutettua tiedostoa jossa 209 lisäystä ja 31 poistoa
  1. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java
  2. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamStudentMapper.java
  3. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ClientService.java
  4. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  5. 5 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java
  6. 1 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskDetailService.java
  7. 52 14
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java
  8. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  9. 2 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  10. 28 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  11. 56 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  12. 5 1
      distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml
  13. 23 0
      distributed-print-business/src/main/resources/mapper/ExamStudentMapper.xml
  14. 2 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java
  15. 15 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java
  16. 13 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

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

@@ -17,7 +17,7 @@ import java.util.Map;
  */
 public interface ExamDetailCourseMapper extends BaseMapper<ExamDetailCourse> {
 
-    List<Map<String, String>> listByExamDetailId(@Param("examDetailId") Long examDetailId, @Param("status") String status);
+    List<Map<String, Object>> listByExamDetailId(@Param("examDetailId") Long examDetailId, @Param("status") String status);
 
     List<ExamDetailCourse> listByExamDetailIdAndStatus(@Param("examDetailId") Long examDetailId, @Param("status") String status);
 }

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

@@ -3,6 +3,8 @@ package com.qmth.distributed.print.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 
+import java.util.Map;
+
 /**
  * <p>
  * 考生 Mapper 接口
@@ -13,4 +15,5 @@ import com.qmth.distributed.print.business.entity.ExamStudent;
  */
 public interface ExamStudentMapper extends BaseMapper<ExamStudent> {
 
+    Map<String, Object> getStudentDetail(Long id);
 }

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

@@ -27,7 +27,7 @@ public interface ClientService {
 
     IPage<ClientPrintTaskDto> listClientPrintTask(Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);
 
-    Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, String printUser);
+    Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, Boolean isPrint, String printUser);
 
     List<Map<String, Object>> getPrintDataBatch(Long schoolId, Long machineCode, String orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);
 

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

@@ -23,7 +23,7 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
      */
     double calculatePackagesByDetailId(Long examDetailId);
 
-    List<Map<String, String>> listByExamDetailId(Long examDetailId);
+    List<Map<String, Object>> listByExamDetailId(Long examDetailId);
 
     List<ExamDetailCourse> listDetailCourseByCourseCodeAndPaperNumber(Long schoolId, String courseCode, String paperNumber);
 

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

@@ -5,6 +5,7 @@ import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -17,4 +18,8 @@ import java.util.List;
 public interface ExamStudentService extends IService<ExamStudent> {
 
     void updatePaperType(List<ExamDetailCourse> examDetailCourses, String relatePaperType);
+
+    List<String> listByExamDetailCourseId(String examDetailCourseId);
+
+    Map<String, Object> getStudentDetail(Long id);
 }

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

@@ -36,4 +36,5 @@ public interface ExamTaskDetailService extends IService<ExamTaskDetail> {
 
     Map<String, String>  getUrl(Long schoolId, Long examTaskId);
 
+    boolean paperUpdate(ExamTaskDetail examTaskDetail);
 }

+ 52 - 14
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.*;
+import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.util.ExcelUtil;
 import com.qmth.distributed.print.common.contant.SystemConstant;
@@ -14,6 +15,7 @@ import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
 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 javax.servlet.http.HttpServletResponse;
 import java.util.*;
@@ -52,6 +54,9 @@ public class ClientServiceImpl implements ClientService {
     @Autowired
     private ExamCardDetailService examCardDetailService;
 
+    @Autowired
+    private ExamStudentService examStudentService;
+
     @Override
     public IPage<ClientExamTaskDto> listTryTask(Long schoolId, String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
         return examTaskService.listTryTask(schoolId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
@@ -82,7 +87,7 @@ public class ClientServiceImpl implements ClientService {
     public Map<String, Object> getReprintData(Long schoolId, Long examDetailId, String ticketNumber, String type) {
         Map<String, Object> finalMap = new HashMap<>();
         // 取试卷
-        List<Map<String, String>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+        List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
         Map<String, Map<String, String>> map = mapCourseUrl(examDetailCourses);
         // 取考生
         List<Map> studentList = examDetailService.listStudentByExamDetailId(schoolId, examDetailId, ticketNumber, type);
@@ -125,9 +130,10 @@ public class ClientServiceImpl implements ClientService {
         return pirntTaskDtoIPage;
     }
 
+    @Transactional
     @Override
-    public Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, String printUser) {
-        List<Map<String, String>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+    public Map<String, Object> getPrintData(Long schoolId, Long examDetailId, String machineCode, Boolean isPrint, String printUser) {
+        List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
         Map<String, Object> finalMap = new HashMap<>();
         // 2.取生成的完整的pdf
         ExamDetail examDetail = examDetailService.getById(examDetailId);
@@ -193,15 +199,15 @@ public class ClientServiceImpl implements ClientService {
 
         // 备用题卡
         List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
-        for (Map<String, String> examDetailCours : examDetailCourses) {
-            String attachmentIds = examDetailCours.get("attachmentIds");
+        for (Map<String, Object> examDetailCours : examDetailCourses) {
+            String attachmentIds = examDetailCours.get("attachmentIds").toString();
             JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
             List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
             for (Map backupCard : backupCards) {
                 ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
-                clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode"));
-                clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName"));
-                clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber"));
+                clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode").toString());
+                clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName").toString());
+                clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber").toString());
                 clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
                 Map<String, String> urlMap = commonService.filePreviewByAttachmentId(Long.valueOf(backupCard.get("attachmentId").toString()), false);
                 clientPrintBackupDataDto.setMd5(urlMap.get("md5"));
@@ -242,6 +248,38 @@ public class ClientServiceImpl implements ClientService {
             }
         }
         finalMap.put("other", otherList);
+
+        // 更新印刷中状态,更新曝光卷型、未曝光卷型
+        if (isPrint) {
+            // 更新exam_detail状态为印刷中
+            UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
+            examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).eq(ExamDetail::getId, examDetailId);
+            examDetailService.update(examDetailUpdateWrapper);
+
+            // 更新曝光卷型、未曝光卷型
+            for (Map<String, Object> examDetailCours : examDetailCourses) {
+                String examDetailCourseId = examDetailCours.get("examDetailCourseId").toString();
+                // 考生使用卷型
+                List<String> studentPaperTypes = examStudentService.listByExamDetailCourseId(examDetailCourseId);
+                Object exposedPaperType = examDetailCours.get("exposedPaperType");
+                Set<String> exposedPaperSet = Objects.isNull(exposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(exposedPaperType.toString().split(",")));
+                Object unexposedPaperType = examDetailCours.get("unexposedPaperType").toString();
+                Set<String> unexposedPaperSet = Objects.isNull(unexposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(unexposedPaperType.toString().split(",")));
+                if (!studentPaperTypes.isEmpty()) {
+                    for (String studentPaperType : studentPaperTypes) {
+                        exposedPaperSet.add(studentPaperType);
+                        unexposedPaperSet.remove(studentPaperType);
+                    }
+                }
+                String examTaskId = examDetailCours.get("examTaskId").toString();
+                UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
+                examTaskDetailUpdateWrapper.lambda()
+                        .set(ExamTaskDetail::getExposedPaperType, String.join(",", exposedPaperSet))
+                        .set(ExamTaskDetail::getUnexposedPaperType, String.join(",", unexposedPaperSet))
+                        .eq(ExamTaskDetail::getExamTaskId, examTaskId);
+                examTaskDetailService.update(examTaskDetailUpdateWrapper);
+            }
+        }
         return finalMap;
     }
 
@@ -251,7 +289,7 @@ public class ClientServiceImpl implements ClientService {
         List<ClientPrintTaskDto> pirntTaskDtoList = examPrintPlanService.listClientPrintTask(schoolId, machineCode, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, orgIds);
         List<Map<String, Object>> finalList = new ArrayList<>();
         for (ClientPrintTaskDto clientPrintTaskDto : pirntTaskDtoList) {
-            Map<String, Object> map = getPrintData(schoolId, Long.valueOf(clientPrintTaskDto.getExamDetailId()), null, null);
+            Map<String, Object> map = getPrintData(schoolId, Long.valueOf(clientPrintTaskDto.getExamDetailId()), null, false, null);
             map.put("examDetailId", clientPrintTaskDto.getExamDetailId());
             finalList.add(map);
         }
@@ -387,12 +425,12 @@ public class ClientServiceImpl implements ClientService {
      *
      * @return
      */
-    public Map<String, Map<String, String>> mapCourseUrl(List<Map<String, String>> mapList) {
+    public Map<String, Map<String, String>> mapCourseUrl(List<Map<String, Object>> mapList) {
         Map<String, Map<String, String>> map = new HashMap<>();
-        for (Map<String, String> taskDetail : mapList) {
-            String courseCode = taskDetail.get("courseCode");
-            String paperNumber = taskDetail.get("paperNumber");
-            String paperAttachmentIds = taskDetail.get("paperAttachmentIds");
+        for (Map<String, Object> taskDetail : mapList) {
+            String courseCode = taskDetail.get("courseCode").toString();
+            String paperNumber = taskDetail.get("paperNumber").toString();
+            String paperAttachmentIds = taskDetail.get("paperAttachmentIds").toString();
             List<Map> attachementIds = JSONObject.parseArray(paperAttachmentIds, Map.class);
             for (Map attaMap : attachementIds) {
                 String name = attaMap.get("name").toString();

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

@@ -33,7 +33,7 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
     }
 
     @Override
-    public List<Map<String, String>> listByExamDetailId(Long examDetailId) {
+    public List<Map<String, Object>> listByExamDetailId(Long examDetailId) {
         return this.baseMapper.listByExamDetailId(examDetailId, ExamDetailStatusEnum.FINISH.name());
     }
 

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

@@ -210,7 +210,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Override
     public IPage<ExaminationResult> findExaminationBriefPage(Long schoolId, Long printPlanId, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, int pageNumber, int pageSize) {
         Set<Long> orgIds = commonService.listSubOrgIds(null);
-        IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, printPlanId, courseCode, paperNumber, examPlace, examRoom, packageCode,orgIds);
+        IPage<ExaminationResult> page = examDetailMapper.findBriefPage(new Page<>(pageNumber, pageSize), schoolId, printPlanId, courseCode, paperNumber, examPlace, examRoom, packageCode, orgIds);
         List<ExaminationResult> list = page.getRecords();
         for (ExaminationResult examinationResult : list) {
             String examDetailCourseIds = examinationResult.getExamDetailCourseIds();
@@ -269,7 +269,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Override
     public IPage<ExaminationDetailResult> findExaminationDetail(Long schoolId, Long printPlanId, String courseCode, String paperNumber, String examPlace, String examRoom, String studentParams, int pageNumber, int pageSize) {
         Set<Long> orgIds = commonService.listSubOrgIds(null);
-        return examDetailMapper.findDetailPage(new Page<>(pageNumber, pageSize), schoolId, printPlanId, courseCode, paperNumber, examPlace, examRoom, studentParams,orgIds);
+        return examDetailMapper.findDetailPage(new Page<>(pageNumber, pageSize), schoolId, printPlanId, courseCode, paperNumber, examPlace, examRoom, studentParams, orgIds);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -621,15 +621,12 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return examinationExportDtoList;
     }
 
-    //    @Transactional
     @Override
     public Boolean updatePrintProgress(Long schoolId, Long examDetailId, Integer printProgress) {
         // 更新考场进度、状态
         UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().set(ExamDetail::getPrintProgress, printProgress).set(ExamDetail::getStatus, ExamDetailStatusEnum.FINISH).eq(ExamDetail::getId, examDetailId);
         return this.update(updateWrapper);
-        // todo 更新考生(是否需要这个字段,待定)
-
     }
 
     @Override

+ 28 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java

@@ -1,14 +1,19 @@
 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.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.distributed.print.business.entity.ExamStudent;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
 import com.qmth.distributed.print.business.service.ExamStudentService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 /**
@@ -29,4 +34,27 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
         updateWrapper.lambda().set(ExamStudent::getPaperType, relatePaperType).in(ExamStudent::getExamDetailCourseId, examDetailCourseIds);
         this.update(updateWrapper);
     }
+
+    @Override
+    public List<String> listByExamDetailCourseId(String examDetailCourseId) {
+        QueryWrapper<ExamStudent> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamStudent::getExamDetailCourseId, examDetailCourseId);
+        List<ExamStudent> examStudents = this.list(queryWrapper);
+        if(!examStudents.isEmpty()){
+            List<String> strings = examStudents.stream().filter(m-> StringUtils.isNotBlank(m.getPaperType())).map(m->m.getPaperType()).distinct().collect(Collectors.toList());
+            return strings;
+        }
+        return null;
+    }
+
+    @Override
+    public Map<String, Object> getStudentDetail(Long id) {
+        Map<String, Object> map = this.baseMapper.getStudentDetail(id);
+        Object extendFields = map.get("extendFields");
+        if(Objects.nonNull(extendFields)){
+            List<Map> list = JSONObject.parseArray(extendFields.toString(), Map.class);
+            map.put("extendFields", list);
+        }
+        return map;
+    }
 }

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

@@ -145,19 +145,19 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         QueryWrapper<ExamTaskDetail> examTaskDetailQueryWrapper = new QueryWrapper<>();
         examTaskDetailQueryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskId);
         ExamTaskDetail examTaskDetail = this.getOne(examTaskDetailQueryWrapper);
-        if(examTaskDetail != null){
+        if (examTaskDetail != null) {
             String relatePaperType = examTaskDetail.getRelatePaperType();
-            if(StringUtils.isNotBlank(relatePaperType)){
+            if (StringUtils.isNotBlank(relatePaperType)) {
                 String paperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
                 List<Map> list = JSONObject.parseArray(paperAttachmentIds, Map.class);
                 String attachmentId = null;
                 for (Map map : list) {
                     String name = map.get("name").toString();
-                    if(relatePaperType.equals(name)){
+                    if (relatePaperType.equals(name)) {
                         attachmentId = map.get("attachmentId").toString();
                     }
                 }
-                if(StringUtils.isNotBlank(attachmentId)){
+                if (StringUtils.isNotBlank(attachmentId)) {
                     return commonService.filePreviewByAttachmentId(Long.valueOf(attachmentId), false);
                 }
             }
@@ -165,4 +165,56 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         return null;
     }
 
+    @Override
+    public boolean paperUpdate(ExamTaskDetail examTaskDetail) {
+        // todo 前置校验条件,如打印中不能修改
+        QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, examTaskDetail.getExamTaskId());
+        ExamTaskDetail examTaskDetailTemp = this.getOne(queryWrapper);
+        if (examTaskDetailTemp == null) {
+            throw ExceptionResultEnum.ERROR.exception("命题任务数据异常");
+        }
+        // 已曝光试卷不能修改
+        String exposedPaperType = examTaskDetailTemp.getExposedPaperType();
+        if (StringUtils.isNotBlank(exposedPaperType)) {
+            List<Map> oldPaperAttachmentIdsList = JSONObject.parseArray(examTaskDetailTemp.getPaperAttachmentIds(), Map.class);
+            Map<String, String> oldPaperAttachmentIdMap = oldPaperAttachmentIdsList.stream().collect(Collectors.toMap(m -> m.get("name").toString(), m -> m.get("attachmentId").toString()));
+            String[] exposedPaperTypes = exposedPaperType.split(",");
+            String newPaperAttachmentIds = examTaskDetail.getPaperAttachmentIds();
+            if (StringUtils.isBlank(newPaperAttachmentIds)) {
+                throw ExceptionResultEnum.ERROR.exception("已曝光试卷不能删除");
+            } else {
+                List<Map> newPaperAttachmentIdsList = JSONObject.parseArray(newPaperAttachmentIds, Map.class);
+                Map<String, String> newPaperAttachmentIdMap = newPaperAttachmentIdsList.stream().collect(Collectors.toMap(m -> m.get("name").toString(), m -> m.get("attachmentId").toString()));
+                for (String paperType : exposedPaperTypes) {
+                    if(!newPaperAttachmentIdMap.containsKey(paperType)){
+                        throw ExceptionResultEnum.ERROR.exception("已曝光试卷不能删除");
+                    } else {
+                        if(!oldPaperAttachmentIdMap.containsKey(paperType)){
+                            throw ExceptionResultEnum.ERROR.exception("原试卷卷型有误");
+                        }
+                        String newAttachmentId = newPaperAttachmentIdMap.get(paperType);
+                        String oldAttachmentId = oldPaperAttachmentIdMap.get(paperType);
+                        if(!newAttachmentId.equals(oldAttachmentId)){
+                            throw ExceptionResultEnum.ERROR.exception("已曝光试卷不能修改");
+                        }
+                    }
+                }
+
+            }
+
+        }
+
+        // 不需要审核,直接更新
+        ExamTask examTask = examTaskService.getById(examTaskDetail.getExamTaskId());
+        if(examTask.getReview()){
+            // todo 加入临时审核表
+        } else {
+            UpdateWrapper<ExamTaskDetail> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.lambda().set(ExamTaskDetail::getPaperAttachmentIds, examTaskDetail.getPaperAttachmentIds()).eq(ExamTaskDetail::getExamTaskId, examTaskDetail.getExamTaskId());
+            this.update(updateWrapper);
+        }
+        return false;
+    }
+
 }

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

@@ -19,11 +19,15 @@
     </sql>
     <select id="listByExamDetailId" resultType="java.util.Map">
         SELECT
+            a.id examDetailCourseId,
             a.course_code courseCode,
             a.course_name courseName,
             a.paper_number paperNumber,
             c.paper_attachment_ids paperAttachmentIds,
-            d.attachment_id attachmentIds
+            d.attachment_id attachmentIds,
+            b.id examTaskId,
+            c.exposed_paper_type exposedPaperType,
+            c.unexposed_paper_type unexposedPaperType
         FROM
             exam_detail_course a
                 LEFT JOIN

+ 23 - 0
distributed-print-business/src/main/resources/mapper/ExamStudentMapper.xml

@@ -22,5 +22,28 @@
         id,
         school_id, exam_detail_course_id, student_name, student_code, ticket_number, site_number, print_paper, print_card, extend_fields, paper_type
     </sql>
+    <select id="getStudentDetail" resultType="java.util.Map">
+        SELECT
+            a.student_name studentName,
+            a.student_code studentCode,
+            a.ticket_number ticketNumber,
+            a.site_number siteNumber,
+            a.extend_fields extendFields,
+            b.course_code courseCode,
+            b.course_name courseName,
+            b.paper_number paperNumber,
+            c.exam_start_time examStartTime,
+            c.exam_end_time examEndTime,
+            c.exam_place examPlace,
+            c.exam_room examRoom
+        FROM
+            exam_student a
+                LEFT JOIN
+            exam_detail_course b ON a.exam_detail_course_id = b.id
+                LEFT JOIN
+            exam_detail c ON b.exam_detail_id = c.id
+        WHERE
+            a.id = #{id}
+    </select>
 
 </mapper>

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

@@ -333,8 +333,9 @@ public class ClientController {
     public Result printGetPrintData(@RequestParam("schoolId") Long schoolId,
                                     @RequestParam("examDetailId") Long examDetailId,
                                     @RequestParam("machineCode") String machineCode,
+                                    @RequestParam("isPrint") Boolean isPrint,
                                     @RequestParam(value = "printUser", required = false) String printUser) {
-        Map<String, Object> map = clientService.getPrintData(schoolId, examDetailId, machineCode, printUser);
+        Map<String, Object> map = clientService.getPrintData(schoolId, examDetailId, machineCode, isPrint, printUser);
         return ResultUtil.ok(map);
     }
 

+ 15 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java

@@ -8,6 +8,7 @@ import com.qmth.distributed.print.business.bean.result.EditResult;
 import com.qmth.distributed.print.business.entity.TBTask;
 import com.qmth.distributed.print.business.enums.TaskTypeEnum;
 import com.qmth.distributed.print.business.service.ExamDetailService;
+import com.qmth.distributed.print.business.service.ExamStudentService;
 import com.qmth.distributed.print.business.service.TBTaskService;
 import com.qmth.distributed.print.business.templete.execute.AsyncExaminationExportTemplateService;
 import com.qmth.distributed.print.business.templete.execute.AsyncExaminationImportTemplateService;
@@ -16,6 +17,7 @@ import com.qmth.distributed.print.common.contant.SystemConstant;
 import com.qmth.distributed.print.common.util.Result;
 import com.qmth.distributed.print.common.util.ResultUtil;
 import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -24,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.io.IOException;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 
@@ -49,6 +52,9 @@ public class ExamDetailController {
     @Resource
     private ExamDetailService examDetailService;
 
+    @Autowired
+    private ExamStudentService examStudentService;
+
     @ApiOperation(value = "异步考务数据批量导入接口")
     @RequestMapping(value = "/data_import", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = EditResult.class)})
@@ -109,6 +115,15 @@ public class ExamDetailController {
                 courseCode, paperNumber, examPlace, examRoom, studentParams, pageNumber, pageSize));
     }
 
+    @ApiOperation(value = "查看考生明细")
+    @RequestMapping(value = "/get_student_detail", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
+    public Result getStudentDetail(@ApiParam(value = "考生表主键") @RequestParam(required = false) Long id) {
+        Map<String, Object> map = examStudentService.getStudentDetail(id);
+        return ResultUtil.ok(map);
+    }
+
+
     @ApiOperation(value = "考务数据导入-查看明细弹窗")
     @RequestMapping(value = "/data_detail_list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})

+ 13 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -426,15 +426,26 @@ public class ExamTaskController {
     /**
      * 启用/禁用
      *
-     * @param request
      * @param examTaskDetail
      * @return
      */
     @ApiOperation(value = "启用/禁用")
     @RequestMapping(value = "/paper_enable", method = RequestMethod.POST)
-    public Result taskPaperEnable(HttpServletRequest request, @RequestBody ExamTaskDetail examTaskDetail) {
+    public Result taskPaperEnable(@RequestBody ExamTaskDetail examTaskDetail) {
         boolean isSuccess = examTaskDetailService.enable(examTaskDetail);
         return ResultUtil.ok(isSuccess);
     }
+
+    /**
+     * 卷库修改
+     * @param examTaskDetail
+     * @return
+     */
+    @ApiOperation(value = "卷库修改")
+    @RequestMapping(value = "/paper_update", method = RequestMethod.POST)
+    public Result taskPaperUpdate(@RequestBody ExamTaskDetail examTaskDetail) {
+        boolean isSuccess = examTaskDetailService.paperUpdate(examTaskDetail);
+        return ResultUtil.ok(isSuccess);
+    }
 }