Przeglądaj źródła

关联试卷管理

xiaof 4 lat temu
rodzic
commit
a8381bae31
17 zmienionych plików z 252 dodań i 225 usunięć
  1. 0 161
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamDetailDto.java
  2. 54 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailDto.java
  3. 64 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/RelatePaperDto.java
  4. 1 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailMapper.java
  5. 1 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskDetailMapper.java
  6. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskMapper.java
  7. 1 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java
  8. 7 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskDetailService.java
  9. 3 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskService.java
  10. 1 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  11. 27 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java
  12. 21 8
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  13. 0 3
      distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml
  14. 53 0
      distributed-print-business/src/main/resources/mapper/ExamTaskDetailMapper.xml
  15. 13 0
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  16. 2 33
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java
  17. 1 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskDetailController.java

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

@@ -1,161 +0,0 @@
-package com.qmth.distributed.print.business.bean.dto;
-
-/**
- * @Date: 2021/4/3.
- */
-public class ExamDetailDto {
-
-    private String id;
-    private String examPrintId;
-    private String examPrintName;
-    private String paperNumber;
-    private String courseCode;
-    private String courseName;
-    private String specialty;
-    private String cardRuleId;
-    private String cardRuleName;
-    private String userId;
-    private String userName;
-    private String createId;
-    private Long createTime;
-    private String relatePaperType;
-    private String exposedPaperType;
-    private String unexposedPaperType;
-    private Integer totalSubjects;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getExamPrintId() {
-        return examPrintId;
-    }
-
-    public void setExamPrintId(String examPrintId) {
-        this.examPrintId = examPrintId;
-    }
-
-    public String getExamPrintName() {
-        return examPrintName;
-    }
-
-    public void setExamPrintName(String examPrintName) {
-        this.examPrintName = examPrintName;
-    }
-
-    public String getPaperNumber() {
-        return paperNumber;
-    }
-
-    public void setPaperNumber(String paperNumber) {
-        this.paperNumber = paperNumber;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getSpecialty() {
-        return specialty;
-    }
-
-    public void setSpecialty(String specialty) {
-        this.specialty = specialty;
-    }
-
-    public String getCardRuleId() {
-        return cardRuleId;
-    }
-
-    public void setCardRuleId(String cardRuleId) {
-        this.cardRuleId = cardRuleId;
-    }
-
-    public String getCardRuleName() {
-        return cardRuleName;
-    }
-
-    public void setCardRuleName(String cardRuleName) {
-        this.cardRuleName = cardRuleName;
-    }
-
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    public String getUserName() {
-        return userName;
-    }
-
-    public void setUserName(String userName) {
-        this.userName = userName;
-    }
-
-    public String getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(String createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getRelatePaperType() {
-        return relatePaperType;
-    }
-
-    public void setRelatePaperType(String relatePaperType) {
-        this.relatePaperType = relatePaperType;
-    }
-
-    public String getExposedPaperType() {
-        return exposedPaperType;
-    }
-
-    public void setExposedPaperType(String exposedPaperType) {
-        this.exposedPaperType = exposedPaperType;
-    }
-
-    public String getUnexposedPaperType() {
-        return unexposedPaperType;
-    }
-
-    public void setUnexposedPaperType(String unexposedPaperType) {
-        this.unexposedPaperType = unexposedPaperType;
-    }
-
-    public Integer getTotalSubjects() {
-        return totalSubjects;
-    }
-
-    public void setTotalSubjects(Integer totalSubjects) {
-        this.totalSubjects = totalSubjects;
-    }
-}

+ 54 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskDetailDto.java

@@ -6,18 +6,24 @@ package com.qmth.distributed.print.business.bean.dto;
 public class ExamTaskDetailDto {
 
     private String id;
+    private String examPrintId;
+    private String examPrintName;
     private String paperNumber;
     private String courseCode;
     private String courseName;
     private String specialty;
+    private String cardRuleId;
+    private String cardRuleName;
     private String userId;
     private String userName;
     private String status;
     private Boolean enable;
     private String createId;
     private Long createTime;
+    private String relatePaperType;
     private String exposedPaperType;
     private String unexposedPaperType;
+    private Integer totalSubjects;
 
     public String getId() {
         return id;
@@ -27,6 +33,22 @@ public class ExamTaskDetailDto {
         this.id = id;
     }
 
+    public String getExamPrintId() {
+        return examPrintId;
+    }
+
+    public void setExamPrintId(String examPrintId) {
+        this.examPrintId = examPrintId;
+    }
+
+    public String getExamPrintName() {
+        return examPrintName;
+    }
+
+    public void setExamPrintName(String examPrintName) {
+        this.examPrintName = examPrintName;
+    }
+
     public String getPaperNumber() {
         return paperNumber;
     }
@@ -59,6 +81,22 @@ public class ExamTaskDetailDto {
         this.specialty = specialty;
     }
 
+    public String getCardRuleId() {
+        return cardRuleId;
+    }
+
+    public void setCardRuleId(String cardRuleId) {
+        this.cardRuleId = cardRuleId;
+    }
+
+    public String getCardRuleName() {
+        return cardRuleName;
+    }
+
+    public void setCardRuleName(String cardRuleName) {
+        this.cardRuleName = cardRuleName;
+    }
+
     public String getUserId() {
         return userId;
     }
@@ -107,6 +145,14 @@ public class ExamTaskDetailDto {
         this.createTime = createTime;
     }
 
+    public String getRelatePaperType() {
+        return relatePaperType;
+    }
+
+    public void setRelatePaperType(String relatePaperType) {
+        this.relatePaperType = relatePaperType;
+    }
+
     public String getExposedPaperType() {
         return exposedPaperType;
     }
@@ -122,4 +168,12 @@ public class ExamTaskDetailDto {
     public void setUnexposedPaperType(String unexposedPaperType) {
         this.unexposedPaperType = unexposedPaperType;
     }
+
+    public Integer getTotalSubjects() {
+        return totalSubjects;
+    }
+
+    public void setTotalSubjects(Integer totalSubjects) {
+        this.totalSubjects = totalSubjects;
+    }
 }

+ 64 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/RelatePaperDto.java

@@ -0,0 +1,64 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+import java.util.List;
+
+/**
+ * @Date: 2021/3/29.
+ */
+public class RelatePaperDto {
+
+    private String id;
+    private String schoolId;
+    private String courseCode;
+    private String courseName;
+    private String paperNumber;
+    private List<String> paperTypes;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(String schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(String paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public List<String> getPaperTypes() {
+        return paperTypes;
+    }
+
+    public void setPaperTypes(List<String> paperTypes) {
+        this.paperTypes = paperTypes;
+    }
+}

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

@@ -3,7 +3,7 @@ package com.qmth.distributed.print.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.distributed.print.business.bean.dto.ExamDetailDto;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import org.apache.ibatis.annotations.Param;
 
@@ -17,5 +17,4 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
 
-    IPage<ExamDetailDto> listPage(Page<ExamDetailDto> page, @Param("schoolId") Long schoolId, @Param("relateType") String relateType, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);
 }

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

@@ -16,4 +16,5 @@ import org.apache.ibatis.annotations.Param;
  * @since 2021-03-23
  */
 public interface ExamTaskDetailMapper extends BaseMapper<ExamTaskDetail> {
+    IPage<ExamTaskDetailDto> listPage(Page<ExamTaskDetailDto> page, @Param("schoolId") Long schoolId, @Param("relateType") String relateType, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);
 }

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

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.qmth.distributed.print.business.bean.dto.BlurryUserDto;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskDto;
+import com.qmth.distributed.print.business.bean.dto.RelatePaperDto;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.ExamTaskDetail;
 import org.apache.ibatis.annotations.Param;
@@ -33,4 +34,6 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
     IPage<ExamTaskDto> listTaskReviewAudited(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("reviewStatus") String reviewStatus, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("userId") Long userId, @Param("cardRuleId") Long cardRuleId, @Param("startTime") Long startTime, @Param("endTime") Long endTime);
 
     IPage<ExamTaskDetailDto> listTaskPaper(Page<ExamTaskDetailDto> page, Long schoolId, String courseCode, String paperNumber, Long startTime, Long endTime);
+
+    List<RelatePaperDto> listPaperNumbers(@Param("schoolId") Long schoolId, @Param("courseCode") String courseCode);
 }

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

@@ -2,7 +2,7 @@ package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.bean.dto.ExamDetailDto;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 
 /**
@@ -28,5 +28,4 @@ public interface ExamDetailService extends IService<ExamDetail> {
      */
     double calculateTotalPackages(Long printPlanId);
 
-    IPage<ExamDetailDto> list(Long schoolId, String relateType, Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);
 }

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

@@ -1,9 +1,13 @@
 package com.qmth.distributed.print.business.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.ExamTaskDetail;
 
+import java.util.Map;
+
 /**
  * <p>
  * 命题任务明细表(入库申请) 服务类
@@ -20,4 +24,6 @@ public interface ExamTaskDetailService extends IService<ExamTaskDetail> {
 
     boolean enable(ExamTaskDetail examTaskDetail);
 
-}
+    boolean updatePaper(Map<String, String> map);
+
+    IPage<ExamTaskDetailDto> list(Long schoolId, String relateType, Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);}

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

@@ -3,10 +3,7 @@ package com.qmth.distributed.print.business.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.bean.ApiUser;
-import com.qmth.distributed.print.business.bean.dto.BlurryUserDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskImportDto;
+import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.ExamTaskReviewLog;
 import org.springframework.web.multipart.MultipartFile;
@@ -52,4 +49,6 @@ public interface ExamTaskService extends IService<ExamTask> {
     boolean taskReviewSaveBatch(ExamTaskReviewLog taskReviewLog);
 
     IPage<ExamTaskDetailDto> listTaskPaper(Long schoolId, String courseCode, String paperNumber, Long startTime, Long endTime, Integer pageNumber, Integer pageSize);
+
+    List<RelatePaperDto> listPaperTypes(Long schoolId, String courseCode);
 }

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

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.dto.ExamDetailDto;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
 import com.qmth.distributed.print.business.service.ExamDetailCourseService;
@@ -47,12 +47,4 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         }
         return result;
     }
-
-
-    @Override
-    public IPage<ExamDetailDto> list(Long schoolId, String relateType, Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
-        Page<ExamDetailDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamDetailDto> examDetailDtoIPage = this.baseMapper.listPage(page, schoolId, relateType, printPlanId, courseCode, paperNumber);
-        return examDetailDtoIPage;
-    }
 }

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

@@ -17,6 +17,9 @@ 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 java.util.Map;
 
 /**
  * <p>
@@ -79,4 +82,28 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
         return this.update(updateWrapper);
     }
 
+    @Transactional
+    @Override
+    public boolean updatePaper(Map<String, String> map) {
+        // 更新试卷编号
+        UpdateWrapper<ExamTask> examTaskUpdateWrapper = new UpdateWrapper<>();
+        examTaskUpdateWrapper.lambda().set(ExamTask::getPaperNumber, map.get("paperNumber"));
+        examTaskService.update(examTaskUpdateWrapper);
+
+        // 更新关联卷型
+        UpdateWrapper<ExamTaskDetail> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(ExamTaskDetail::getRelatePaperType, map.get("relatePaperType")).eq(ExamTaskDetail::getExamTaskId, map.get("examTaskId"));
+        this.update(updateWrapper);
+
+        // todo 更新卷型曝光类型
+        return true;
+    }
+
+    @Override
+    public IPage<ExamTaskDetailDto> list(Long schoolId, String relateType, Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
+        Page<ExamTaskDetailDto> page = new Page<>(pageNumber, pageSize);
+        IPage<ExamTaskDetailDto> examDetailDtoIPage = this.baseMapper.listPage(page, schoolId, relateType, printPlanId, courseCode, paperNumber);
+        return examDetailDtoIPage;
+    }
+
 }

+ 21 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -6,17 +6,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.bean.ApiUser;
-import com.qmth.distributed.print.business.bean.dto.BlurryUserDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskImportDto;
+import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
-import com.qmth.distributed.print.business.service.BasicExamRuleService;
-import com.qmth.distributed.print.business.service.ExamTaskReviewLogService;
-import com.qmth.distributed.print.business.service.ExamTaskService;
-import com.qmth.distributed.print.business.service.ExamTaskTempService;
+import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.common.enums.ExceptionResultEnum;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -48,6 +43,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Autowired
     private ExamTaskReviewLogService examTaskReviewLogService;
 
+    @Autowired
+    private ExamTaskDetailService examTaskDetailService;
+
     @Override
     public List<ExamTask> listByCourseCode(Long schoolId, String code) {
         QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
@@ -210,4 +208,19 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         IPage<ExamTaskDetailDto> examTaskDtoIPage = this.baseMapper.listTaskPaper(page, schoolId, courseCode, paperNumber, startTime, endTime);
         return examTaskDtoIPage;
     }
+
+    @Override
+    public List<RelatePaperDto> listPaperTypes(Long schoolId, String courseCode) {
+        List<RelatePaperDto> list = this.baseMapper.listPaperNumbers(schoolId, courseCode);
+        for (RelatePaperDto relatePaperDto : list) {
+            QueryWrapper<ExamTaskDetail> queryWrapper = new QueryWrapper<>();
+            queryWrapper.lambda().eq(ExamTaskDetail::getExamTaskId, relatePaperDto.getId()).eq(ExamTaskDetail::getEnable, true);
+            ExamTaskDetail examTaskDetail = this.examTaskDetailService.getOne(queryWrapper);
+            if (examTaskDetail != null){
+                String unexposedPaperType = examTaskDetail.getUnexposedPaperType();
+                relatePaperDto.setPaperTypes(StringUtils.isBlank(unexposedPaperType) ? null : Arrays.asList(unexposedPaperType.split("/")));
+            }
+        }
+        return list;
+    }
 }

+ 0 - 3
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -26,8 +26,5 @@
         id,
         school_id, print_plan_id, print_plan_name, exam_name, exam_start_time, exam_end_time, exam_place, total_subjects, exam_room, print_progress, print_user, package_code, create_id, create_time
     </sql>
-    <select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamDetailDto">
-
-    </select>
 
 </mapper>

+ 53 - 0
distributed-print-business/src/main/resources/mapper/ExamTaskDetailMapper.xml

@@ -21,4 +21,57 @@
         id,
         exam_task_id, paper_type, paper_attachment_ids, card_id, paper_confirm_attachment_ids, remark, exposed_paper_type, relate_paper_type, unexposed_paper_type
     </sql>
+    <select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto">
+        SELECT
+            c.id,
+            a.school_id schoolId,
+            a.print_plan_id printPlanId,
+            a.print_plan_name printPlanName,
+            c.course_code courseCode,
+            c.course_name courseName,
+            c.paper_number paperNumber,
+            e.id cardRuleId,
+            e.name cardRuleName,
+            c.user_id userId,
+            f.real_name userName,
+            d.exposed_paper_type exposedPaperType,
+            d.unexposed_paper_type unexposedPaperType,
+            d.relate_paper_type relatePaperType,
+            b.total_subjects totalSubjects
+        FROM
+            exam_detail a
+                LEFT JOIN
+            exam_detail_course b ON a.id = b.exam_detail_id
+                LEFT JOIN
+            exam_task c ON a.school_id = c.school_id
+                AND b.course_code = c.course_code
+                LEFT JOIN
+            exam_task_detail d ON c.id = d.exam_task_id
+                LEFT JOIN
+            basic_card_rule e ON c.card_rule_id = e.id
+                LEFT JOIN
+            sys_user f ON c.user_id = f.id
+        <where>
+            <if test="schoolId != null and schoolId != ''">
+               and a.school_id = #{schoolId}
+            </if>
+            <if test="relateType != null and relateType != ''">
+                <if test="relateType == 'RELATE'">
+                   and d.relate_paper_type is not null
+                </if>
+                <if test="relateType == 'NOT_RELATE'">
+                    and d.relate_paper_type is null
+                </if>
+            </if>
+            <if test="printPlanId != null and printPlanId != ''">
+                and a.print_plan_id = #{printPlanId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and c.course_code = #{courseCode}
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                and c.paper_number = #{paperNumber}
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -297,5 +297,18 @@
             </if>
         </where>
     </select>
+    <select id="listPaperNumbers" resultType="com.qmth.distributed.print.business.bean.dto.RelatePaperDto">
+        SELECT
+            id,
+            school_id schoolId,
+            course_code courseCode,
+            course_name courseName,
+            paper_number paperNumber
+        FROM
+            exam_task
+        <where>
+            school_id = #{schoolId} and course_code = #{courseCode}
+        </where>
+    </select>
 
 </mapper>

+ 2 - 33
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamDetailController.java

@@ -1,24 +1,10 @@
 package com.qmth.distributed.print.api;
 
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.qmth.distributed.print.business.bean.ApiUser;
-import com.qmth.distributed.print.business.bean.dto.ExamDetailDto;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
-import com.qmth.distributed.print.business.service.ExamDetailService;
-import com.qmth.distributed.print.business.util.RequestUtils;
-import com.qmth.distributed.print.common.util.Result;
-import com.qmth.distributed.print.common.util.ResultUtil;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.qmth.boot.api.constant.ApiConstant;
 import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
-
 /**
  * <p>
  * 考务数据 前端控制器
@@ -28,25 +14,8 @@ import javax.servlet.http.HttpServletRequest;
  * @since 2021-03-23
  */
 @RestController
-@RequestMapping("/examDetail")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.exam}/print_relate")
 public class ExamDetailController {
 
-    @Autowired
-    private ExamDetailService examDetailService;
-
-    @ApiOperation(value = "查询")
-    @RequestMapping(value = "/list", method = RequestMethod.POST)
-    public Result list(HttpServletRequest request,
-                       @RequestParam String relateType,
-                       @RequestParam Long printPlanId,
-                       @RequestParam String courseCode,
-                       @RequestParam String paperNumber,
-                       @RequestParam Integer pageNumber,
-                       @RequestParam Integer pageSize) {
-        ApiUser apiUser = RequestUtils.getApiUser(request);
-        IPage<ExamDetailDto> examTasks = examDetailService.list(apiUser.getSchoolId(), relateType, printPlanId, courseCode, paperNumber, pageNumber, pageSize);
-        return ResultUtil.ok(examTasks);
-    }
-
 }
 

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

@@ -2,7 +2,6 @@ package com.qmth.distributed.print.api;
 
 
 import org.springframework.web.bind.annotation.RequestMapping;
-
 import org.springframework.web.bind.annotation.RestController;
 
 /**
@@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
  * @since 2021-03-23
  */
 @RestController
-@RequestMapping("/examTaskDetail")
+@RequestMapping("examTaskDetail")
 public class ExamTaskDetailController {
 
 }