xiaofei 1 жил өмнө
parent
commit
3cc611f6d4

+ 7 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -19,11 +19,11 @@ public interface ConditionMapper {
 
     List<String> listPaperNumber(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("printPlanIds") List<String> printPlanIds, @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseForApply(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("enable") Boolean enable, @Param("userId") Long userId);
+    List<BasicCourse> listCourseForApply(@Param("examId") Long examId, @Param("userId") Long userId);
 
     List<BasicCourse> listCourseForAudit(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("enable") Boolean enable);
 
-    List<String> listPaperNumberForApply(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("userId") Long userId);
+    List<String> listPaperNumberForApply(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("userId") Long userId);
 
     List<String> listPaperNumberAudit(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 
@@ -39,7 +39,7 @@ public interface ConditionMapper {
 
     List<String> listPaperNumberPlanTask(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("courseCode") String courseCode, @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseForEntrance(@Param("examId") Long examId, @Param("userId") Long userId,  @Param("status") String status);
+    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);
 
@@ -50,4 +50,8 @@ public interface ConditionMapper {
     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);
+
+    List<BasicCourse> listCourseForQuery(@Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
+
+    List<String> listPaperNumberForQuery(@Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("dpr") DataPermissionRule dpr);
 }

+ 18 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -89,17 +89,23 @@ public class ConditionServiceImpl implements ConditionService {
         // 未找到权限菜单,默认为本人权限
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
 
+        // 命题任务管理(39)
         if ("39".equals(privilegeIdString)) {
             return conditionMapper.listCourseFromExamTask(examId, dpr);
         }
-        // 入库申请菜单
+        // 入库申请(40)
         else if ("40".equals(privilegeIdString)) {
-            return conditionMapper.listCourseForApply(semesterId, examId, enable, sysUser.getId());
+            return conditionMapper.listCourseForApply(examId, sysUser.getId());
         }
-        // 入库审核菜单
+        // 入库审核(41)
         else if ("41".equals(privilegeIdString)) {
             return conditionMapper.listCourseForAudit(semesterId, examId, enable);
-        } else if ("47".equals(privilegeIdString)) {
+        }// 入库审核(42)
+        else if ("42".equals(privilegeIdString)) {
+            return conditionMapper.listCourseForQuery(examId, dpr);
+        }
+        // 印刷任务管理(47)
+        else if ("47".equals(privilegeIdString)) {
             dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
             return conditionMapper.listCourseForPlanTask(semesterId, examId, printPlanIds, dpr);
         }
@@ -145,12 +151,18 @@ public class ConditionServiceImpl implements ConditionService {
         }
         // 入库申请菜单
         else if ("40".equals(privilegeIdString)) {
-            return conditionMapper.listPaperNumberForApply(semesterId, examId, courseCode, sysUser.getId());
+            return conditionMapper.listPaperNumberForApply(examId, courseCode, sysUser.getId());
         }
         // 入库审核菜单
         else if ("41".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberAudit(semesterId, examId, courseCode);
-        } else if ("47".equals(privilegeIdString)) {
+        }
+        // 入库审核(42)
+        else if ("42".equals(privilegeIdString)) {
+            return conditionMapper.listPaperNumberForQuery(examId, courseCode, dpr);
+        }
+        // 印刷任务管理(47)
+        else if ("47".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberPlanTask(semesterId, examId, printPlanIds, courseCode, dpr);
         } else if ("491".equals(privilegeIdString)) {
             return conditionMapper.listPaperNumberForEntrance(examId, sysUser.getId(), courseCode, MarkPaperStatus.FORMAL.name());

+ 77 - 34
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -87,35 +87,20 @@
     </select>
     <select id="listCourseForApply" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
         SELECT
-            bc.code code,
-            bc.name name
+            et.course_code code,
+            et.course_name name
         FROM
-            basic_course bc
-        <where>
-            EXISTS ( SELECT
-                1
-            FROM
             exam_task et
-                LEFT JOIN
-            basic_exam be ON et.exam_id = be.id
-            <where>
-                bc.school_id = et.school_id
-                AND bc.code = et.course_code
-                <if test="semesterId != null">
-                    AND be.semester_id = #{semesterId}
-                </if>
-                <if test="examId != null">
-                    AND et.exam_id = #{examId}
-                </if>
-                <if test="userId != null">
-                    AND et.user_id = #{userId}
-                </if>
-            </where>)
-            <if test="enable != null">
-                and bc.enable = #{enable}
+        <where>
+            et.enable = true
+            <if test="examId != null">
+                and et.exam_id = #{examId}
+            </if>
+            <if test="userId != null">
+                and et.user_id = #{userId}
             </if>
         </where>
-        order by bc.code
+        order by et.create_time desc
     </select>
     <select id="listCourseForAudit" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
         SELECT
@@ -148,24 +133,22 @@
     </select>
     <select id="listPaperNumberForApply" resultType="java.lang.String">
         SELECT
-            et.paper_number
+            et.paper_number paperNumber
         FROM
             exam_task et
-                LEFT JOIN
-            basic_exam be ON et.exam_id = be.id
         <where>
-            <if test="semesterId != null">
-                AND be.semester_id = #{semesterId}
+            et.enable = true
+            <if test="examId != null">
+                and et.exam_id = #{examId}
             </if>
-                AND et.exam_id = #{examId}
             <if test="courseCode != null and courseCode != ''">
-                AND et.course_code = #{courseCode}
+                and et.course_code = #{courseCode}
             </if>
             <if test="userId != null">
-                AND et.user_id = #{userId}
+                and et.user_id = #{userId}
             </if>
         </where>
-        order by et.paper_number
+        order by et.create_time desc
     </select>
     <select id="listPaperNumberAudit" resultType="java.lang.String">
         SELECT
@@ -527,4 +510,64 @@
         </where>
         order by a.create_time desc
     </select>
+    <select id="listCourseForQuery" resultType="com.qmth.teachcloud.common.entity.BasicCourse">
+        SELECT
+            distinct a.course_code code,
+            a.course_name name
+        FROM
+            exam_task a
+                LEFT JOIN
+            t_f_flow_approve g ON g.flow_id = a.flow_id
+                LEFT JOIN
+            sys_user d ON a.create_id = d.id
+        <where>
+             a.status = 'SUBMIT' and (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
+            <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 IFNULL(g.update_time, a.update_time) desc, a.paper_number desc
+    </select>
+    <select id="listPaperNumberForQuery" resultType="java.lang.String">
+        SELECT
+            a.paper_number paperNumber
+        FROM
+            exam_task a
+                LEFT JOIN
+            t_f_flow_approve g ON g.flow_id = a.flow_id
+                LEFT JOIN
+            sys_user d ON a.create_id = d.id
+        <where>
+            a.status = 'SUBMIT' and (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
+            <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 IFNULL(g.update_time, a.update_time) desc, a.paper_number desc
+    </select>
 </mapper>

+ 0 - 6
distributed-print/install/mysql/upgrade/3.3.0.sql

@@ -876,9 +876,3 @@ ALTER TABLE `basic_template`
 ALTER TABLE `basic_operation_log`
     CHANGE COLUMN `customized_operation_type` `customized_operation_type` VARCHAR(32) CHARACTER SET 'utf8' NULL COMMENT '自定义记录日志操作类型(LOGIN(\"用户登录\"),LOGOUT(\"用户登出\"),ADD(\"新增\"),DELETE(\"删除\"),UPDATE(\"修改\"),IMPORT(\"导入\"),EXPORT(\"导出\"),UN_KNOW(\"未知\"))' ;
 update basic_operation_log set customized_operation_type = null where customized_operation_type = '';
-
-ALTER TABLE `basic_template`
-    ADD COLUMN `add_blank_page` TINYINT(1) NULL DEFAULT 1 COMMENT '是否增加空白页' AFTER `update_time`,
-ADD COLUMN `line_height_times` DOUBLE NULL DEFAULT 1 COMMENT '行间距在初始值扩大倍数(默认1)' AFTER `add_blank_page`;
-
-ALTER TABLE `basic_school` ADD COLUMN `default_school` TINYINT(1) NULL DEFAULT 0 AFTER `init_password`;

+ 2 - 0
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -422,6 +422,8 @@ ALTER TABLE `teach_course`
     ADD COLUMN `course_code` VARCHAR(20) NOT NULL COMMENT '课程编号' AFTER `exam_id`,
     ADD COLUMN `weight_setting` TINYINT(1) NULL COMMENT '权重设置' AFTER `enable`,
     CHANGE COLUMN `user_id` `user_id` BIGINT NOT NULL COMMENT '任课教师id' AFTER `course_code`;
+ALTER TABLE `teach_course` CHANGE COLUMN `course_code` `course_code` VARCHAR(20) NULL COMMENT '课程编号' ;
+
 UPDATE teach_course t0
 SET
     course_code = (SELECT

+ 2 - 2
teachcloud-task/src/main/java/com/qmth/teachcloud/task/start/StartRunning.java

@@ -92,7 +92,7 @@ public class StartRunning implements CommandLineRunner {
         quartzService.addJob(BuildMarkTaskJob.class, JobEnum.BUILD_MARK_TASK.name(), JobEnum.BUILD_MARK_TASK.getGroupName(), "0 */1 * * * ?", buildMarkTaskJobMap);
         log.info("增加评卷任务生成定时任务 end");
 
-        // 每5分钟一次
+        // 每1分钟一次
         log.info("增加初始化阅卷数据定时任务 start");
         Map initMarkDataJobMap = new HashMap();
         initMarkDataJobMap.computeIfAbsent("name", v -> InitMarkDataJob.class.getName());
@@ -108,7 +108,7 @@ public class StartRunning implements CommandLineRunner {
         quartzService.addJob(ClearTimeoutTaskJob.class, JobEnum.CLEAR_TIMEOUT_TASK.name(), JobEnum.CLEAR_TIMEOUT_TASK.getGroupName(), "0 0/10 6-23 * * ?", clearTimeoutTaskJobMap);
         log.info("增加清空过期任务定时任务 end");
 
-        // 每10分钟一次
+        // 每2分钟一次
         log.info("增加PDF生成定时任务 start");
         Map createPdfJobMap = new HashMap();
         createPdfJobMap.computeIfAbsent("name", v -> CreatePdfTaskJob.class.getName());