Browse Source

3.2.7 update

xiaofei 1 year ago
parent
commit
0a9948ee72

+ 8 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -42,4 +42,12 @@ public interface ConditionMapper {
     List<BasicCourse> listCourseForEntrance(@Param("examId") Long examId, @Param("userId") Long userId,  @Param("status") String status);
 
     List<String> listPaperNumberForEntrance(@Param("examId") Long examId, @Param("userId") Long userId, @Param("courseCode") String courseCode, @Param("status") String status);
+
+    List<BasicCourse> listCourseFromMarkPaper(@Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberFromMarkPaper(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("dpr") DataPermissionRule dpr);
+
+    List<BasicCourse> listCourseFromExamTask(@Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberFromExamTask(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("dpr") DataPermissionRule dpr);
 }

+ 17 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -89,8 +89,11 @@ public class ConditionServiceImpl implements ConditionService {
         // 未找到权限菜单,默认为本人权限
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
 
+        if ("39".equals(privilegeIdString)) {
+            return conditionMapper.listCourseFromExamTask(examId, dpr);
+        }
         // 入库申请菜单
-        if ("40".equals(privilegeIdString)) {
+        else if ("40".equals(privilegeIdString)) {
             return conditionMapper.listCourseForApply(semesterId, examId, enable, sysUser.getId());
         }
         // 入库审核菜单
@@ -110,6 +113,11 @@ public class ConditionServiceImpl implements ConditionService {
             return conditionMapper.listCourseForScore(semesterId, examId, basicCourses, MarkPaperStatus.FINISH.name(), dpr);
         } else if ("491".equals(privilegeIdString)) {
             return conditionMapper.listCourseForEntrance(examId, sysUser.getId(), MarkPaperStatus.FORMAL.name());
+        }
+        // 评卷设置(897)、评卷管理(917)、成绩检查(946)
+        else if ("897".equals(privilegeIdString) || "917".equals(privilegeIdString) || "946".equals(privilegeIdString)) {
+            dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
+            return conditionMapper.listCourseFromMarkPaper(examId, dpr);
         } else {
             dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
             return conditionMapper.listCourse(semesterId, examId, enable, printPlanIds, dpr);
@@ -132,8 +140,11 @@ public class ConditionServiceImpl implements ConditionService {
             dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
         }
 
+        if ("39".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberFromExamTask(examId, courseCode, dpr);
+        }
         // 入库申请菜单
-        if ("40".equals(privilegeIdString)) {
+        else if ("40".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForApply(semesterId, examId, courseCode, sysUser.getId());
         }
         // 入库审核菜单
@@ -143,6 +154,10 @@ public class ConditionServiceImpl implements ConditionService {
             return conditionMapper.listPaperNumberPlanTask(semesterId, examId, printPlanIds, courseCode, dpr);
         } else if ("491".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForEntrance(examId, sysUser.getId(), courseCode, MarkPaperStatus.FORMAL.name());
+        }
+        // 评卷设置(897)、评卷管理(917)、成绩检查(946)
+        else if ("897".equals(privilegeIdString) || "917".equals(privilegeIdString) || "946".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberFromMarkPaper(examId, courseCode, dpr);
         } else {
             return conditionMapper.listPaperNumber(semesterId, examId, courseCode, printPlanIds, dpr);
         }

+ 100 - 2
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -406,7 +406,7 @@
                 and exists (select 1 from mark_paper mp where mp.exam_id = mg.exam_id and mp.paper_number = mg.paper_number and mp.status = #{status})
             </if>
         </where>
-        order by mg.course_code
+        order by mug.id desc
     </select>
     <select id="listPaperNumberForEntrance" resultType="java.lang.String">
         SELECT
@@ -427,6 +427,104 @@
                 and exists (select 1 from mark_paper mp where mp.exam_id = mg.exam_id and mp.paper_number = mg.paper_number and mp.status = #{status})
             </if>
         </where>
-        order by mg.paper_number
+        order by mug.id desc
+    </select>
+    <select id="listCourseFromMarkPaper" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        SELECT
+            mp.course_code code,
+            mp.course_name name
+        FROM
+            mark_paper mp
+            LEFT JOIN sys_user su ON mp.user_id = su.id
+        where mp.exam_id = #{examId}
+        <if test="dpr != null">
+            <if test="dpr.requestUserId != null">
+                AND mp.user_id = #{dpr.requestUserId}
+            </if>
+            <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                AND su.org_id IN
+                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </if>
+        order by mp.id desc
+    </select>
+    <select id="listPaperNumberFromMarkPaper" resultType="java.lang.String">
+        SELECT
+        mp.paper_number paperNumber
+        FROM
+        mark_paper mp
+        LEFT JOIN sys_user su ON mp.user_id = su.id
+        where mp.exam_id = #{examId}
+        <if test="courseCode != null and courseCode != ''">
+            AND mp.course_code = #{courseCode}
+        </if>
+        <if test="dpr != null">
+            <if test="dpr.requestUserId != null">
+                AND mp.user_id = #{dpr.requestUserId}
+            </if>
+            <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                AND su.org_id IN
+                <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </if>
+        order by mp.id desc
+    </select>
+    <select id="listCourseFromExamTask" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        SELECT
+            distinct a.course_code code,
+            a.course_name name
+        FROM
+        exam_task a
+        LEFT JOIN
+        sys_user d ON a.create_id = d.id
+        <where>
+            <if test="examId != null">
+                and a.exam_id = #{examId}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND a.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND d.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+        order by a.create_time desc
+    </select>
+    <select id="listPaperNumberFromExamTask" resultType="java.lang.String">
+        SELECT
+            a.paper_number paperNumber
+            FROM
+            exam_task a
+                LEFT JOIN
+            sys_user d ON a.create_id = d.id
+        <where>
+            <if test="examId != null">
+                and a.exam_id = #{examId}
+            </if>
+            <if test="courseCode != null and courseCode != ''">
+                and a.course_code = #{courseCode}
+            </if>
+            <if test="dpr != null">
+                <if test="dpr.requestUserId != null">
+                    AND a.create_id = #{dpr.requestUserId}
+                </if>
+                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
+                    AND d.org_id IN
+                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+            </if>
+        </where>
+        order by a.create_time desc
     </select>
 </mapper>

+ 0 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkSettingController.java

@@ -70,7 +70,6 @@ public class MarkSettingController {
     public Result list(@ApiParam(value = "考试ID", required = true) @RequestParam Long examId, @ApiParam(value = "课程代码") @RequestParam(required = false) String courseCode,
                        @ApiParam(value = "试卷编号") @RequestParam(required = false) String paperNumber, @ApiParam(value = "提交状态") @RequestParam(required = false) Boolean groupStatus,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber, @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        Long schoolId = Long.parseLong(ServletUtil.getRequestHeaderSchoolId().toString());
         IPage<MarkSettingDto> markSettingDtoIPage = markPaperService.listPaperSetting(examId, courseCode, paperNumber,
                 groupStatus, pageNumber, pageSize);
         for (MarkSettingDto record : markSettingDtoIPage.getRecords()) {