Pārlūkot izejas kodu

3.0.1-下载管理

xiaof 3 gadi atpakaļ
vecāks
revīzija
fb4a3fa560

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

@@ -150,4 +150,6 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
     String getProcessDefinitionIdByMaxVersion(@Param("key") String key);
 
     ExamTaskDto getByExamTaskId(Long examTaskId);
+
+    IPage<ExamTaskDetailDto> listExamTaskDetailDownload(@Param("page") Page<ExamTaskDetailDto> page, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseName") String courseName, @Param("orgIds") Set<Long> orgIds);
 }

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

@@ -3,6 +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.dto.BasicExamDto;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
 import com.qmth.teachcloud.common.entity.BasicExam;
 
 import java.util.List;
@@ -13,4 +14,5 @@ import java.util.List;
  * </p>
  */
 public interface DownloadService {
+    IPage<ExamTaskDetailDto> page(Long semesterId, Long examId, Long orgId, String courseName, Integer pageNumber, Integer pageSize);
 }

+ 24 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/DownloadServiceImpl.java

@@ -1,8 +1,32 @@
 package com.qmth.distributed.print.business.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
+import com.qmth.distributed.print.business.mapper.ExamTaskMapper;
 import com.qmth.distributed.print.business.service.DownloadService;
+import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import java.util.Set;
+
 @Service
 public class DownloadServiceImpl implements DownloadService {
+
+    @Resource
+    TeachcloudCommonService teachcloudCommonService;
+
+    @Resource
+    ExamTaskMapper examTaskMapper;
+
+    @Override
+    public IPage<ExamTaskDetailDto> page(Long semesterId, Long examId, Long orgId, String courseName, Integer pageNumber, Integer pageSize) {
+        Page<ExamTaskDetailDto> page = new Page<>(pageNumber, pageSize);
+        Set<Long> orgIds = null;
+        if(orgId != null){
+            orgIds = teachcloudCommonService.listSubOrgIds(orgId);
+        }
+        return examTaskMapper.listExamTaskDetailDownload(page, semesterId, examId, courseName, orgIds);
+    }
 }

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

@@ -1292,4 +1292,52 @@
             t_f_flow_approve e ON a.flow_id = e.flow_id
         where a.id = #{examTaskId}
     </select>
+    <select id="listExamTaskDetailDownload"
+            resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto">
+        SELECT
+            a.id,
+            be.name examName,
+            bs.name semesterName,
+            a.course_code courseCode,
+            a.course_name courseName,
+            a.paper_number paperNumber,
+            b.enable,
+            b.paper_type paperType,
+            b.exposed_paper_type exposedPaperType,
+            b.unexposed_paper_type unexposedPaperType
+        FROM
+            exam_task a
+                LEFT JOIN
+            exam_task_detail b ON a.id = b.exam_task_id
+                LEFT JOIN
+            basic_course bc ON a.school_id = bc.school_id and a.course_code = b.code
+                LEFT JOIN
+            basic_card_rule e ON a.card_rule_id = e.id
+                LEFT JOIN
+            basic_exam be ON a.exam_id = be.id
+                LEFT JOIN
+            basic_semester bs ON be.semester_id = bs.id
+                LEFT JOIN
+            t_f_flow_approve g ON g.flow_id = a.flow_id
+        <where>
+            a.status = 'SUBMIT'
+          AND (a.review = 0
+            OR (a.review = 1 AND g.status = 'FINISH'))
+            <if test="semesterId != null and semesterId != ''">
+                and be.semester_id = #{semesterId}
+            </if>
+            <if test="examId != null and examId != ''">
+                and a.exam_id = #{examId}
+            </if>
+            <if test="courseName != null and courseName != ''">
+                and a.course_name like concat('%', #{courseName}, '%')
+            </if>
+            <if test="orgIds != null">
+                and bc.teaching_room_id in
+                <foreach collection="orgIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
 </mapper>

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

@@ -41,11 +41,11 @@ public class DownloadController {
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = TaskListResult.class)})
     public Object page(@ApiParam(value = "学期ID", required = false) @RequestParam(required = false) Long semesterId,
                        @ApiParam(value = "考试ID", required = false) @RequestParam(required = false) Long examId,
-                       @ApiParam(value = "学院", required = false) @RequestParam(required = false) String collegeName,
+                       @ApiParam(value = "学院ID", required = false) @RequestParam(required = false) Long orgId,
                        @ApiParam(value = "课程名称", required = false) @RequestParam(required = false) String courseName,
                        @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return null;
+        return downloadService.page(semesterId, examId, orgId, courseName, pageNumber, pageSize);
     }
 
     /**