xiaofei 2 éve
szülő
commit
7f904d2f5e

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

@@ -9,6 +9,7 @@ import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
 import com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto;
 import com.qmth.distributed.print.business.bean.result.ExaminationDetailResult;
 import com.qmth.distributed.print.business.bean.result.ExaminationResult;
+import com.qmth.distributed.print.business.bean.result.SummarizedDataResult;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamDetailCourse;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
@@ -115,4 +116,6 @@ public interface ExamDetailMapper extends BaseMapper<ExamDetail> {
      * @return
      */
     List<ExamDetailPdfDownloadDto> findPdfDownload(@Param("ids") List<Long> ids);
+
+    SummarizedDataResult findSummarizedData(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIdList") List<Long> printPlanIdList, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("examPlace") String examPlace, @Param("examRoom") String examRoom, @Param("packageCode") String packageCode, @Param("startDate") Long startDate, @Param("endDate") Long endDate, @Param("dpr") DataPermissionRule dpr);
 }

+ 8 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -329,7 +329,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
     @Transactional(rollbackFor = Exception.class)
     @Override
     public SummarizedDataResult findSummarizedData(Long schoolId, Long semesterId, Long examId, List<Long> printPlanIdList, String courseCode, String paperNumber, String examPlace, String examRoom, String packageCode, Long startDate, Long endDate, DataPermissionRule dpr) {
-        IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, dpr);
+
+
+        /*IPage<ExaminationResult> page = this.findExaminationBriefPage(schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, SystemConstant.PAGE_NUMBER, SystemConstant.PAGE_SIZE, dpr);
         List<ExaminationResult> list = page.getRecords();
         int totalSubjects = 0;
         for (ExaminationResult examinationResult : list) {
@@ -340,7 +342,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         summarizedDataResult.setSchoolId(schoolId);
         summarizedDataResult.setTotalSubjects(totalSubjects);
         summarizedDataResult.setPackageCount(list.size());
-        return summarizedDataResult;
+        return summarizedDataResult;*/
+
+        return this.baseMapper.findSummarizedData(schoolId, semesterId, examId, printPlanIdList, courseCode, paperNumber, examPlace, examRoom, packageCode, startDate, endDate, dpr);
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -365,7 +369,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamDetail::getSchoolId, schoolId);
-        if(sysOrg != null && !OrgTypeEnum.PRINTING_HOUSE.equals(sysOrg.getType())){
+        if (sysOrg != null && !OrgTypeEnum.PRINTING_HOUSE.equals(sysOrg.getType())) {
             queryWrapper.lambda().in(ExamDetail::getOrgId, orgIds);
         }
         if (StringUtils.isNotBlank(param)) {
@@ -387,7 +391,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         QueryWrapper<ExamDetail> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(ExamDetail::getSchoolId, schoolId);
-        if(sysOrg != null && !OrgTypeEnum.PRINTING_HOUSE.equals(sysOrg.getType())){
+        if (sysOrg != null && !OrgTypeEnum.PRINTING_HOUSE.equals(sysOrg.getType())) {
             queryWrapper.lambda().in(ExamDetail::getOrgId, orgIds);
         }
         if (StringUtils.isNotBlank(param)) {

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

@@ -163,7 +163,6 @@
              exam_detail c ON b.exam_detail_id = c.id
                  LEFT JOIN
              exam_task et ON b.school_id = et.school_id
-                 and b.course_code = et.course_code
                  and b.paper_number = et.paper_number
                 LEFT JOIN
             sys_user su ON b.sync_user_id = su.id

+ 71 - 4
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -160,7 +160,6 @@
         exam_detail det
         INNER JOIN
         exam_detail_course cou ON det.id = cou.exam_detail_id
-        AND det.school_id = cou.school_id
         LEFT JOIN
         sys_user b on det.create_id = b.id
         LEFT JOIN
@@ -254,13 +253,10 @@
             exam_student stu
                 INNER JOIN
             exam_detail_course cou ON stu.exam_detail_course_id = cou.id
-                AND stu.school_id = cou.school_id
                 INNER JOIN
             exam_detail det ON cou.exam_detail_id = det.id
-                AND stu.school_id = det.school_id
                 LEFT JOIN
             exam_task et on cou.school_id = et.school_id
-                AND cou.course_code = et.course_code
                 AND cou.paper_number = et.paper_number
                 LEFT JOIN
             sys_user b on det.create_id = b.id
@@ -572,4 +568,75 @@
             edc.exam_detail_id
         order by bs.name
     </select>
+    <select id="findSummarizedData"
+            resultType="com.qmth.distributed.print.business.bean.result.SummarizedDataResult">
+        SELECT
+        det.school_id schoolId,
+        sum(ifnull(det.total_subjects, 0)) AS totalSubjects,
+        count(det.package_code) AS packageCount,
+        GROUP_CONCAT(cou.course_code) AS courseCodes,
+        GROUP_CONCAT(cou.paper_number) AS paperNumbers
+        FROM
+        exam_detail det
+        INNER JOIN
+        exam_detail_course cou ON det.id = cou.exam_detail_id
+        LEFT JOIN
+        exam_print_plan epp on epp.id = det.print_plan_id
+        LEFT JOIN
+        basic_exam be on be.id = epp.exam_id
+        LEFT JOIN
+        basic_semester bs on bs.id = be.semester_id
+        <where>
+            <if test="schoolId != null and schoolId > 0">
+                AND det.school_id = #{schoolId}
+            </if>
+            <if test="printPlanIdList != null and printPlanIdList != '' and printPlanIdList.size() > 0">
+                AND det.print_plan_id IN
+                <foreach collection="printPlanIdList" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="examPlace != null and examPlace != ''">
+                AND det.exam_place = #{examPlace}
+            </if>
+            <if test="examRoom != null and examRoom != ''">
+                AND det.exam_room = #{examRoom}
+            </if>
+            <if test="packageCode != null and packageCode != ''">
+                AND det.package_code = #{packageCode}
+            </if>
+            <if test="startDate != null and startDate > 0">
+                AND det.exam_start_time >= #{startDate}
+            </if>
+            <if test="endDate != null and endDate > 0">
+                AND #{endDate} >= det.exam_end_time
+            </if>
+            <if test="semesterId != null and semesterId != ''">
+                AND bs.id = #{semesterId}
+            </if>
+            <if test="examId != null and examId != ''">
+                AND be.id = #{examId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND det.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND det.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+        GROUP BY det.school_id
+        <trim prefix="having" suffixOverrides="and">
+            <if test="courseCode != null and courseCode != ''">
+                find_in_set(#{courseCode},courseCodes) and
+            </if>
+            <if test="paperNumber != null and paperNumber != ''">
+                find_in_set(#{paperNumber},paperNumbers) and
+            </if>
+        </trim>
+    </select>
 </mapper>

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

@@ -140,7 +140,7 @@
         FROM
         exam_print_plan a
         LEFT JOIN
-            basic_exam be on a.school_id = be.school_id and a.exam_id = be.id
+            basic_exam be on a.exam_id = be.id
         LEFT JOIN
         sys_user b on a.create_id = b.id
         <where>

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

@@ -60,7 +60,6 @@
         GROUP BY a.school_id , a.print_plan_id , a.print_plan_name , b.paper_number , b.course_code , b.course_name , b.paper_type) a
             LEFT JOIN
         exam_task c ON a.school_id = c.school_id
-            AND a.course_code = c.course_code
             AND a.paper_number = c.paper_number
             LEFT JOIN
         exam_task_detail d ON c.id = d.exam_task_id