Ver Fonte

1、企微客户:需要可以筛选指定销售名下客户的功能(按昵称查找或手机号查找,员工昵称查找需要支持模糊查询)
2、企微管理——-企微客户管理——-在职转接、离职转接:选择的客户人数限制打开,需要可以选择某个员工的所有客户

yfh há 1 semana atrás
pai
commit
d6251f52d3

+ 14 - 1
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java

@@ -1,5 +1,6 @@
 package com.fs.company.controller.qw;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -30,6 +31,7 @@ import com.github.pagehelper.PageHelper;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.collections.CollectionUtils;
 import org.codehaus.jettison.json.JSONException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -39,6 +41,7 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 import static com.fs.his.utils.PhoneUtil.decryptAutoPhoneMk;
 import static com.fs.his.utils.PhoneUtil.encryptPhone;
@@ -246,7 +249,17 @@ public class QwExternalContactController extends BaseController
     @PutMapping("/transfer")
     public R transfer(@RequestBody TransferParam param)
     {
-
+        if (ObjectUtil.isNotEmpty(param.getQwUserName())){
+            QwExternalContactParam qwExternalContact =new QwExternalContactParam();
+            qwExternalContact.setQwUserName(param.getQwUserName());
+            LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+            qwExternalContact.setCompanyId(loginUser.getCompany().getCompanyId());
+            List<QwExternalContactVO> list = qwExternalContactService.selectQwExternalContactListVO(qwExternalContact);
+            if (!CollectionUtils.isEmpty(list)){
+                List<Long> ids = list.stream().map(QwExternalContactVO::getId).collect(Collectors.toList());
+                param.setIds(ids);
+            }
+        }
         return qwExternalContactService.transfer(param);
     }
     /**

+ 5 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwExternalContactMapper.java

@@ -213,6 +213,7 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "select ec.*,qu.qw_user_name,qd.dept_name as departmentName from qw_external_contact ec " +
             "left join qw_user qu on ec.user_id=qu.qw_user_id and qu.corp_id=ec.corp_id " +
             "left join qw_dept qd on qd.dept_id=qu.department and qd.corp_id=qu.corp_id " +
+            "left join company_user cu on ec.company_user_id=cu.user_id " +
             "<where>  \n" +
             "            <if test=\"userId != null  and userId != ''\"> and ec.user_id   like concat( #{userId}, '%') </if>\n" +
             "            <if test=\"qwUserName != null  and qwUserName != ''\"> and qu.qw_user_name   like concat( #{qwUserName}, '%') </if>\n" +
@@ -250,6 +251,10 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "            <if test=\"delTime != null \"> and DATE(ec.del_time) = DATE(#{delTime})</if>\n" +
             "            <if test=\"sTime != null \">  and DATE(ec.create_time) &gt;= DATE(#{sTime})</if>\n" +
             "            <if test=\"eTime != null \">  and DATE(ec.create_time) &lt;= DATE(#{eTime})</if>\n" +
+
+            "<if test ='companyUser!=null'> " +
+                "and (cu.nick_name like concat('%', #{companyUser}, '%') or cu.phonenumber= #{companyUser})"+
+            "</if> " +
             "        </where>"+
             "order by ec.id desc"+
             "</script>"})

+ 6 - 0
fs-service/src/main/java/com/fs/qw/param/QwExternalContactParam.java

@@ -27,6 +27,12 @@ public class QwExternalContactParam {
 
     private Long companyUserId;
 
+    /**
+     * 销售员工信息(昵称,手机号)
+     */
+    private String companyUser;
+
+
     private Long customerId;
 
     /** 名称 */

+ 1 - 0
fs-service/src/main/java/com/fs/qw/param/TransferParam.java

@@ -8,6 +8,7 @@ import java.util.List;
 public class TransferParam {
     List<Long> ids;
     Long  userId;
+    String  qwUserName;
     String corpId;
     String content;
 }