Sfoglia il codice sorgente

SOP营期标签修改

吴树波 2 settimane fa
parent
commit
dea42ad845

+ 16 - 1
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsInfoController.java

@@ -1,6 +1,7 @@
 package com.fs.company.controller.qw;
 
 
+import com.alibaba.fastjson.JSON;
 import com.fs.common.annotation.Log;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.controller.BaseController;
@@ -8,8 +9,11 @@ import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
 import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.qw.domain.QwGroupChatUser;
+import com.fs.qw.domain.QwTag;
+import com.fs.qw.mapper.QwTagMapper;
 import com.fs.qw.param.QwExternalContactVOTime;
 import com.fs.qw.param.QwTagSearchParam;
 import com.fs.qw.param.SopExternalContactInfo;
@@ -54,6 +58,8 @@ public class SopUserLogsInfoController extends BaseController
     @Autowired
     private IQwTagService iQwTagService;
     @Autowired
+    private QwTagMapper qwTagMapper;
+    @Autowired
     private IQwGroupChatUserService qwGroupChatUserService;
 
     private static final Gson GSON = new Gson();
@@ -85,7 +91,16 @@ public class SopUserLogsInfoController extends BaseController
                                 QwExternalContactVOTime::getId,
                                 item -> new SopExternalContactInfo(item.getCreateTime(), item.getTagIds(), item.getRemark())
                         ));
-
+                List<String> tagIds = qwExternalContactVOTimes.stream().map(QwExternalContactVOTime::getTagIds).filter(StringUtils::isNotEmpty).flatMap(e -> JSON.parseArray(e, String.class).stream()).collect(Collectors.toList());
+                if(!tagIds.isEmpty()){
+                    List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIdsNew(tagIds);
+                    Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
+                    qwExternalContactVOTimes.forEach(e -> {
+                        List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);
+                        List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
+                        e.setTagIdsName(tagNameList);
+                    });
+                }
                 // 设置联系信息
                 list.forEach(item -> {
                     SopExternalContactInfo info = externalContactInfoMap.getOrDefault(

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwTagMapper.java

@@ -91,5 +91,5 @@ public interface QwTagMapper
             "</script>")
     List<String> selectQwTagListNameByTagIds(@Param("date") QwTagSearchParam param);
 
-    List<QwTag> selectQwTagListByTagIds(@Param("tagIds") List<String> tagIds);
+    List<QwTag> selectQwTagListByTagIdsNew(@Param("tagIds") List<String> tagIds);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -297,7 +297,7 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
         List<QwExternalContactVOTime> list = qwExternalContactMapper.selectQwExternalContactListVOByUserIds(ids);
         List<String> tagIds = list.stream().map(QwExternalContactVOTime::getTagIds).filter(StringUtils::isNotEmpty).flatMap(e -> JSON.parseArray(e, String.class).stream()).collect(Collectors.toList());
         if(!tagIds.isEmpty()){
-            List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIds(tagIds);
+            List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIdsNew(tagIds);
             Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
             list.forEach(e -> {
                 List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);

+ 0 - 10
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -176,16 +176,6 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     @Override
     public List<SopUserLogsInfo> selectSopUserLogsInfoList(SopUserLogsInfo info) {
         List<SopUserLogsInfo> list = sopUserLogsInfoMapper.selectSopUserLogsInfoList(info);
-        List<String> tagIds = list.stream().map(SopUserLogsInfo::getTagIds).filter(StringUtils::isNotEmpty).flatMap(e -> JSON.parseArray(e, String.class).stream()).collect(Collectors.toList());
-        if(!tagIds.isEmpty()){
-            List<QwTag> tagList = qwTagMapper.selectQwTagListByTagIds(tagIds);
-            Map<String, QwTag> tagMap = PubFun.listToMapByGroupObject(tagList, QwTag::getTagId);
-            list.forEach(e -> {
-                List<String> tagId = JSON.parseArray(e.getTagIds(), String.class);
-                List<String> tagNameList = tagId.stream().filter(tagMap::containsKey).map(t -> tagMap.get(t).getName()).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
-                e.setTagIdsName(tagNameList);
-            });
-        }
         return list;
     }
     @Override

+ 6 - 6
fs-service/src/main/resources/mapper/qw/QwTagMapper.xml

@@ -38,12 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectQwTagVo"/>
         where id = #{id}
     </select>
-<!--    <select id="selectQwTagListByTagIds" resultType="com.fs.qw.domain.QwTag">-->
-<!--        SELECT * FROM qw_tag WHERE tag_id IN-->
-<!--        <foreach collection='tagIds' item='tagId' open='(' separator=',' close=')'>-->
-<!--            #{tagId}-->
-<!--        </foreach>-->
-<!--    </select>-->
+    <select id="selectQwTagListByTagIdsNew" resultType="com.fs.qw.domain.QwTag">
+        SELECT * FROM qw_tag WHERE tag_id IN
+        <foreach collection='tagIds' item='tagId' open='(' separator=',' close=')'>
+            #{tagId}
+        </foreach>
+    </select>
 
     <insert id="insertQwTag" parameterType="QwTag">
         insert into qw_tag

+ 2 - 1
fs-service/src/main/resources/mapper/sop/SopUserLogsInfoMapper.xml

@@ -18,10 +18,11 @@
         <result property="createTime" column="create_time" jdbcType="VARCHAR" />
         <result property="crtTime" column="crt_Time"  />
         <result property="updateTime" column="update_time" jdbcType="VARCHAR" />
+        <result property="tagIds" column="tag_ids" jdbcType="VARCHAR" />
     </resultMap>
 
     <sql id="selectSopUserLogsInfoVo">
-        select id, sop_id, user_logs_id, external_contact_id,qw_user_id,corp_id,external_id, fs_user_id, external_user_name,create_time,crt_Time,update_time
+        select *
         from sop_user_logs_info
     </sql>