Browse Source

1、任务记录需要增加根据员工手机号搜索调整逻辑

yfh 1 week ago
parent
commit
2bc44c6696

+ 3 - 0
fs-service/src/main/java/com/fs/sop/params/QwSopLogsParam.java

@@ -3,6 +3,8 @@ package com.fs.sop.params;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class QwSopLogsParam {
     /**
@@ -16,6 +18,7 @@ public class QwSopLogsParam {
     private String qwUserName;
 
     private String qwUserid;
+    private List<String> qwUseridByList;
 
     /**
      * 客户昵称

+ 7 - 2
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -41,6 +41,7 @@ import com.fs.sop.vo.QwSopLogsDoSendListTVO;
 import com.fs.sop.vo.QwSopLogsListCVO;
 import com.fs.system.service.ISysConfigService;
 import com.fs.voice.utils.StringUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -159,8 +160,12 @@ public class QwSopLogsServiceImpl implements IQwSopLogsService
                 if (companyUser == null) {
                     return Collections.emptyList();
                 }
-                if (StringUtils.isEmpty(param.getQwUserid())) {
-                    param.setQwUserid(companyUser.getQwUserId());
+                QwUser qwUser = new QwUser();
+                qwUser.setCompanyUserId(companyUser.getUserId());
+                List<QwUser> qwUsers = qwUserMapper.selectQwUserList(qwUser);
+                if (CollectionUtils.isNotEmpty(qwUsers)){
+                    List<String> qwUserIds = qwUsers.stream().map(QwUser::getQwUserId).collect(Collectors.toList());
+                    param.setQwUseridByList(qwUserIds);
                 }
             } catch (Exception e) {
                 logger.error("根据手机号查询企业用户出现异常,手机号: {}, 异常信息: {}", param.getPhone(), e.getMessage(), e);

+ 4 - 0
fs-service/src/main/resources/mapper/sop/QwSopLogsMapper.xml

@@ -181,6 +181,10 @@
             <if test="map.externalUserName != null and map.externalUserName!= '' ">AND external_user_name = #{map.externalUserName}</if>
             <if test="map.scheduleStartTime != null">AND send_time &gt;= #{map.scheduleStartTime}</if>
             <if test="map.scheduleEndTime != null">AND send_time &lt;=  #{map.scheduleEndTime}</if>
+            <if test="map.qwUseridByList != null">AND qw_userid IN
+                <foreach collection="map.qwUseridByList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach></if>
         </where>
         ORDER BY send_time desc,real_send_time desc