Browse Source

查找待打卡sop更新

wangliang 1 year ago
parent
commit
b97f9778c6

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/TBSopInfoMapper.java

@@ -110,9 +110,10 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * 根据crmNo查询在途的sop信息
      *
      * @param crmNo
+     * @param userId
      * @return
      */
-    List<String> findFlowPassageByCrmNo(@Param("crmNo") String crmNo);
+    List<String> findFlowPassageByCrmNo(@Param("crmNo") String crmNo,@Param("userId") Long userId);
 
     /**
      * 根据serviceId查询所有sop信息

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1443,7 +1443,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
     @Override
     public List<String> findFlowPassageByCrmNo(String crmNo) {
         Optional.ofNullable(crmNo).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
-        return this.baseMapper.findFlowPassageByCrmNo(crmNo);
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        return this.baseMapper.findFlowPassageByCrmNo(crmNo, sysUser.getId());
     }
 
     /**

+ 7 - 2
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -214,8 +214,13 @@
         join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
         join t_b_crm_detail tbcd on tbcd.sop_no = tfcfe.code
         join t_b_user_archives_allocation tbuaa on tbuaa.crm_detail_id = tbcd.id
-        where tbuaa.sop_role_type = 'ENGINEER' and (tffa.status in ('START', 'DRAFT', 'AUDITING', 'REJECT', 'CANCEL') or (tffa.status = 'FINISH' and (t.datediff <![CDATA[ >= ]]> -1 and t.datediff <![CDATA[ <= ]]> 0)))
-    </select>
+        <where> 1 = 1
+            <if test="userId != null and userId != ''">
+                and tbuaa.user_id = #{userId}
+            </if>
+                and tbuaa.sop_role_type = 'ENGINEER' and (tffa.status in ('START', 'DRAFT', 'AUDITING', 'REJECT', 'CANCEL') or (tffa.status = 'FINISH' and (t.datediff <![CDATA[ >= ]]> -1 and t.datediff <![CDATA[ <= ]]> 0)))
+        </where>
+   </select>
 
     <select id="findFlowByServiceId" resultType="com.qmth.sop.business.bean.result.SopInfoResult">
         select t.* from(SELECT