Explorar o código

入库审核未审核修改

wangliang %!s(int64=3) %!d(string=hai) anos
pai
achega
c72849908e

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

@@ -31,7 +31,7 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
 
     IPage<ExamTaskDto> listTaskApply(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("auditStatus") String auditStatus, @Param("reviewStatus") String reviewStatus, @Param("cardRuleId") Long cardRuleId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userId") Long userId, @Param("orgIds") Set<Long> orgIds, @Param("userName") String userName);
 
-    IPage<ExamTaskDto> listTaskReviewUnaudited(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("userId") Long userId, @Param("cardRuleId") Long cardRuleId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("orgIds") Set<Long> orgIds, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime, @Param("createName") String createName, @Param("myselfFlowIds") List<Long> myselfFlowIds, @Param("notMyselfFlowIds") List<Long> notMyselfFlowIds);
+    IPage<ExamTaskDto> listTaskReviewUnaudited(Page<ExamTaskDto> page, @Param("schoolId") Long schoolId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber, @Param("userId") Long userId, @Param("cardRuleId") Long cardRuleId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("orgIds") Set<Long> orgIds, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime, @Param("createName") String createName, @Param("currentUserId") Long currentUserId);
 
     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, @Param("orgIds") Set<Long> orgIds, @Param("startCreateTime") Long startCreateTime, @Param("endCreateTime") Long endCreateTime, @Param("createName") String createName);
 
@@ -116,16 +116,16 @@ public interface ExamTaskMapper extends BaseMapper<ExamTask> {
     /**
      * 获取自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
-    List<Long> findFlowIdToMySelf(@Param("userId") Long userId);
+    List<Long> findFlowIdToMySelf(@Param("currentUserId") Long currentUserId);
 
     /**
      * 获取不是自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
-    List<Long> findFlowIdToNotMySelf(@Param("userId") Long userId);
+    List<Long> findFlowIdToNotMySelf(@Param("currentUserId") Long currentUserId);
 }

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

@@ -192,16 +192,16 @@ public interface ExamTaskService extends IService<ExamTask> {
     /**
      * 获取自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
-    List<Long> findFlowIdToMySelf(Long userId);
+    List<Long> findFlowIdToMySelf(Long currentUserId);
 
     /**
      * 获取不是自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
-    List<Long> findFlowIdToNotMySelf(Long userId);
+    List<Long> findFlowIdToNotMySelf(Long currentUserId);
 }

+ 9 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -603,8 +603,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        Page<ExamTaskDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(page, schoolId, auditStatus, reviewStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, sysUser.getId(), orgIds, userName);
+        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskApply(new Page<>(pageNumber, pageSize), schoolId, auditStatus, reviewStatus, cardRuleId, courseCode, paperNumber, startTime, endTime, sysUser.getId(), orgIds, userName);
         return examTaskDtoIPage;
     }
 
@@ -615,9 +614,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         createName = SystemConstant.translateSpecificSign(createName);
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        List<Long> myselfFlowIds = this.findFlowIdToMySelf(sysUser.getId());
-        List<Long> notMyselfFlowIds = this.findFlowIdToNotMySelf(sysUser.getId());
-        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskReviewUnaudited(new Page<>(pageNumber, pageSize), schoolId, courseCode, paperNumber, userId, cardRuleId, startTime, endTime, orgIds, startCreateTime, endCreateTime, createName, myselfFlowIds, notMyselfFlowIds);
+        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskReviewUnaudited(new Page<>(pageNumber, pageSize), schoolId, courseCode, paperNumber, userId, cardRuleId, startTime, endTime, orgIds, startCreateTime, endCreateTime, createName, sysUser.getId());
         return examTaskDtoIPage;
     }
 
@@ -627,8 +624,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         createName = SystemConstant.translateSpecificSign(createName);
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
-        Page<ExamTaskDto> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskReviewAudited(page, schoolId, reviewStatus, courseCode, paperNumber, userId, cardRuleId, startTime, endTime, orgIds, startCreateTime, endCreateTime, createName);
+        IPage<ExamTaskDto> examTaskDtoIPage = this.baseMapper.listTaskReviewAudited(new Page<>(pageNumber, pageSize), schoolId, reviewStatus, courseCode, paperNumber, userId, cardRuleId, startTime, endTime, orgIds, startCreateTime, endCreateTime, createName);
         return examTaskDtoIPage;
     }
 
@@ -1483,22 +1479,22 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     /**
      * 获取自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
     @Override
-    public List<Long> findFlowIdToMySelf(Long userId) {
-        return examTaskMapper.findFlowIdToMySelf(userId);
+    public List<Long> findFlowIdToMySelf(Long currentUserId) {
+        return examTaskMapper.findFlowIdToMySelf(currentUserId);
     }
 
     /**
      * 获取不是自己可以审核的流程id集合
      *
-     * @param userId
+     * @param currentUserId
      * @return
      */
     @Override
-    public List<Long> findFlowIdToNotMySelf(Long userId) {
-        return examTaskMapper.findFlowIdToNotMySelf(userId);
+    public List<Long> findFlowIdToNotMySelf(Long currentUserId) {
+        return examTaskMapper.findFlowIdToNotMySelf(currentUserId);
     }
 }

+ 22 - 19
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -276,12 +276,9 @@
         <where>
             a.enable = true
             AND a.review = true
-            <if test="myselfFlowIds != null and myselfFlowIds.size > 0">
-                AND a.flow_id IN
-                <foreach collection="myselfFlowIds" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
+            and EXISTS(
+            <include refid="findFlowIdToMySelfSql" />
+            and art.PROC_INST_ID_ = a.flow_id)
             <if test="schoolId != null and schoolId != ''">
                 and a.school_id = #{schoolId}
             </if>
@@ -357,12 +354,10 @@
         <where>
             a.enable = true
             AND a.review = true
-            <if test="notMyselfFlowIds != null and notMyselfFlowIds.size > 0">
-                AND a.flow_id IN
-                <foreach collection="notMyselfFlowIds" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
+            and EXISTS(
+            select * from(
+            <include refid="findFlowIdToNotMySelfSql" />
+            ) t where t.flowId = a.flow_id)
             <if test="schoolId != null and schoolId != ''">
                 and a.school_id = #{schoolId}
             </if>
@@ -987,11 +982,15 @@
     </select>
 
     <select id="findFlowIdToMySelf" resultType="java.lang.Long">
-     select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
+     <include refid="findFlowIdToMySelfSql" />
+    </select>
+
+    <sql id="findFlowIdToMySelfSql">
+        select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
         from
             ACT_RU_TASK art
         where
-             art.ASSIGNEE_ = cast(#{userId} as char)
+             art.ASSIGNEE_ = cast(#{currentUserId} as char)
         UNION all
           select
             art.PROC_INST_ID_ as flowId
@@ -1001,11 +1000,11 @@
             ari.TASK_ID_ = art.ID_
         where
             art.ASSIGNEE_ is null
-            and ari.USER_ID_ = cast(#{userId} as char)
+            and ari.USER_ID_ = cast(#{currentUserId} as char)
             and ari.TYPE_ = 'candidate'
-    </select>
+    </sql>
 
-    <select id="findFlowIdToNotMySelf" resultType="java.lang.Long">
+    <sql id="findFlowIdToNotMySelfSql">
         select
             cast(t.flowId as Decimal(24)) as flowId
         from
@@ -1035,7 +1034,7 @@
                 from
                     ACT_RU_TASK art
                 where
-                    art.ASSIGNEE_ = cast(#{userId} as char)
+                    art.ASSIGNEE_ = cast(#{currentUserId} as char)
             UNION all
                 select
                     art.PROC_INST_ID_ as flowId
@@ -1045,10 +1044,14 @@
                     ari.TASK_ID_ = art.ID_
                 where
                     art.ASSIGNEE_ is null
-                    and ari.USER_ID_ = cast(#{userId} as char)
+                    and ari.USER_ID_ = cast(#{currentUserId} as char)
                     and ari.TYPE_ = 'candidate') temp
             where
                 t.flowId = temp.flowId)
+    </sql>
+
+    <select id="findFlowIdToNotMySelf" resultType="java.lang.Long">
+        <include refid="findFlowIdToNotMySelfSql" />
     </select>
 
     <select id="findByFlowStatus" resultType="com.qmth.distributed.print.business.entity.ExamTask">