Prechádzať zdrojové kódy

遍历sop 加 条件 11

三七 2 dní pred
rodič
commit
38e79ffa32

+ 1 - 0
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -284,6 +284,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             log.info("没有需要处理的 SOP 用户日志。");
             return;
         }
+
         String[] array = sopUserLogsVos.stream().map(SopUserLogsVo::getChatId).filter(StringUtils::isNotEmpty).toArray(String[]::new);
         Map<String, QwGroupChat> groupChatMap = new HashMap<>();
         if (array.length > 0) {

+ 25 - 25
fs-service/src/main/resources/mapper/sop/QwSopMapper.xml

@@ -55,14 +55,13 @@
         FROM
             qw_sop qs
                 LEFT JOIN
-            qw_sop_temp qst ON qs.temp_id = qst.id
+            qw_sop_temp qst ON qs.temp_id = qst.id AND qst.status = '1'
         WHERE
-            FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
-          AND qs.corp_id = #{map.corpId}
-          AND qst.status = '1'
+          qs.corp_id = #{map.corpId}
           AND qs.status IN (2, 3, 4)
+          AND qs.send_type in (2,11)
           AND qs.is_auto_sop = 1
-          AND qs.send_type = #{map.sendType}
+          AND FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
           AND (
            <foreach collection='map.tagsIdsSelectList' item='item' index='index' separator=' or '>
                      find_in_set( #{item}, TRIM(REGEXP_REPLACE(qs.tags, '[\"\\\\[\\\\]]', '')))
@@ -85,13 +84,12 @@
         FROM
         qw_sop qs
         LEFT JOIN
-        qw_sop_temp qst ON qs.temp_id = qst.id
+        qw_sop_temp qst ON qs.temp_id = qst.id AND qst.status = '1'
         WHERE
-            FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
-        AND qs.corp_id = #{map.corpId}
-        AND qst.status = '1'
+        qs.corp_id = #{map.corpId}
         AND qs.status IN (2, 3, 4)
-        AND qs.send_type = #{map.sendType}
+        AND qs.send_type IN (2,11)
+        AND FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
         AND (
             <foreach collection='map.tagsIdsSelectList' item='item' index='index' separator=' or '>
                 find_in_set( #{item}, TRIM(REGEXP_REPLACE(qs.tags, '[\"\\\\[\\\\]]', '')) )
@@ -113,13 +111,12 @@
         FROM
         qw_sop qs
         LEFT JOIN
-        qw_sop_temp qst ON qs.temp_id = qst.id
+        qw_sop_temp qst ON qs.temp_id = qst.id  AND qst.status = '1'
         WHERE
-        FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
-        AND qs.corp_id = #{map.corpId}
-        AND qst.status = '1'
+         qs.corp_id = #{map.corpId}
         AND qs.status IN (2, 3, 4)
-        AND qs.send_type = #{map.sendType}
+        AND qs.send_type IN (2,11)
+        AND FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
         AND (
         <foreach collection='map.tagsIdsSelectList' item='item' index='index' separator=' and '>
           NOT find_in_set( #{item}, TRIM(REGEXP_REPLACE(qs.tags, '[\"\\\\[\\\\]]', '')) )
@@ -141,13 +138,12 @@
         FROM
         qw_sop qs
         LEFT JOIN
-        qw_sop_temp qst ON qs.temp_id = qst.id
+        qw_sop_temp qst ON qs.temp_id = qst.id  AND qst.status = '1'
         WHERE
-             FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
-        AND qs.corp_id = #{map.corpId}
-        AND qst.status = '1'
+         qs.corp_id = #{map.corpId}
         AND qs.status IN (2, 3, 4)
         AND qs.send_type = 4
+        AND FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
         AND (
         <foreach collection='map.tagsIdsSelectList' item='item' index='index' separator=' or '>
             find_in_set( #{item}, TRIM(REGEXP_REPLACE(qs.tags, '[\"\\\\[\\\\]]', '')) )
@@ -161,13 +157,12 @@
         FROM
             qw_sop qs
                 LEFT JOIN
-            qw_sop_temp qst ON qs.temp_id = qst.id
+            qw_sop_temp qst ON qs.temp_id = qst.id  AND qst.status = '1'
         WHERE
-            FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
-          AND qs.corp_id = #{map.corpId}
-          AND qst.status = '1'
+           qs.corp_id = #{map.corpId}
           AND qs.status IN (2, 3, 4)
-          AND qs.send_type = #{map.sendType}
+          AND qs.send_type IN (2,11)
+          AND FIND_IN_SET(#{map.qwUserId}, COALESCE(qs.qw_user_ids, '')) > 0
     </select>
 
 
@@ -246,12 +241,14 @@
             and status != 6
          order by create_time desc
     </select>
+
     <select id="selectQwSopByIsRating" parameterType="QwSop" resultMap="QwSopResult">
         <include refid="selectQwSopVo"/>
         where is_rating = 1
-        and send_type in(2,3)
+        and send_type in(2,3,11)
         order by create_time desc
     </select>
+
     <select id="selectQwSopById" parameterType="String" resultType="com.fs.sop.domain.QwSop">
         <include refid="selectQwSopVo"/>
         where id = #{id}
@@ -395,13 +392,16 @@
         </where>
         order by create_time desc
     </select>
+
     <select id="selectByTemplateId" resultType="com.fs.sop.domain.QwSop">
         select * from qw_sop where temp_id = #{tempId}
     </select>
+
     <select id="selectWxSop" resultType="com.fs.sop.domain.QwSop">
         select a.* from qw_sop a
         where a.send_type != 4 and a.status in (2,3) and a.type = 1
     </select>
+
     <update id="updateQwSop" parameterType="QwSop" useGeneratedKeys="false" keyProperty="id" >
         UPDATE  qw_sop
         <trim prefix="SET" suffixOverrides=",">