Преглед на файлове

feat:叮当-企微客户添加重粉记录展示

caoliqin преди 2 седмици
родител
ревизия
ddd4dd4015

+ 12 - 0
fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java

@@ -35,6 +35,7 @@ import com.fs.qw.param.*;
 import com.fs.qw.service.*;
 import com.fs.qw.vo.QwExternalContactVO;
 import com.fs.qw.vo.QwFsUserVO;
+import com.fs.qw.vo.QwRepeatRecordListVO;
 import com.fs.qw.vo.QwUserDelLossLogVO;
 import com.fs.voice.utils.StringUtil;
 import com.github.pagehelper.PageHelper;
@@ -945,6 +946,7 @@ public class QwExternalContactController extends BaseController
     public R getRepeat(RepeatParam param){
         return  qwExternalContactService.getRepeat(param);
     }
+
     /**
      * 重粉看课记录查询
      */
@@ -957,4 +959,14 @@ public class QwExternalContactController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 同主体下外部联系人全部销售记录(含当前)
+     */
+    @GetMapping("/getRepeatRecordList")
+    public TableDataInfo getRepeatRecordList(RepeatRecordListParam param) {
+        startPage();
+        List<QwRepeatRecordListVO> list = qwExternalContactService.selectRepeatRecordList(param);
+        return getDataTable(list);
+    }
+
 }

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

@@ -675,4 +675,9 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
             "and remark_mobiles LIKE concat('%',#{phone},'%') " +
             "limit 1")
     QwExternalContact queryQwUserIdIsAddContact(@Param("qwUserId") Long qwUserId, @Param("phone") String phone, @Param("addWay") int addWay);
+
+    /**
+     * 同主体下指定外部联系人的全部跟进记录
+     */
+    List<QwRepeatRecordListVO> selectRepeatRecordList(RepeatRecordListParam param);
 }

+ 26 - 0
fs-service/src/main/java/com/fs/qw/param/RepeatRecordListParam.java

@@ -0,0 +1,26 @@
+package com.fs.qw.param;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * 重粉跟进记录列表查询参数
+ */
+@Data
+public class RepeatRecordListParam {
+
+    /** 企微主体id(必填) */
+    @NotBlank(message = "企微主体id不能为空")
+    private String corpId;
+
+    /** 外部联系人ID(必填) */
+    @NotBlank(message = "外部联系人id不能为空")
+    private String externalUserId;
+
+    /** 企微销售id(可选) */
+    private String qwUserId;
+
+    /** 企微销售昵称(可选,模糊) */
+    private String qwUserName;
+}

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

@@ -253,6 +253,11 @@ public interface IQwExternalContactService extends IService<QwExternalContact> {
     void updateQwExternalContactStatusById(QwExternalContact qwExternalContact);
 
     R getRepeat(RepeatParam param);
+
+    /**
+     * 同主体下指定外部联系人的全部跟进记录(分页由调用方 startPage)
+     */
+    List<QwRepeatRecordListVO> selectRepeatRecordList(RepeatRecordListParam param);
     List<QwExternalContactVO> selectQwExternalContactListVONewSys(QwExternalContactParam qwExternalContact);
     /**
      * 根据qw_user_id+crop_id+external_user_id查询外部联系人信息

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

@@ -6034,6 +6034,11 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
         return qwExternalContactMapper.selectQwExternalContactByExternalUserIdSidebar(param);
     }
 
+    @Override
+    public List<QwRepeatRecordListVO> selectRepeatRecordList(RepeatRecordListParam param) {
+        return qwExternalContactMapper.selectRepeatRecordList(param);
+    }
+
     @Override
     public R getRepeat(RepeatParam param) {
         List<QwExternalContact> list = qwExternalContactMapper.selectList(new QueryWrapper<QwExternalContact>().eq("external_user_id", param.getExternalUserId()));

+ 33 - 0
fs-service/src/main/java/com/fs/qw/vo/QwRepeatRecordListVO.java

@@ -0,0 +1,33 @@
+package com.fs.qw.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 外部联系人跟进记录列表
+ */
+@Data
+public class QwRepeatRecordListVO {
+
+    private String corpId;
+
+    private String externalUserId;
+
+    /** 企微客户昵称 */
+    private String externalUserName;
+
+    private String qwUserId;
+
+    private String qwUserName;
+
+    /** 企微部门名称 */
+    private String deptName;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date registerTime;
+}

+ 25 - 0
fs-service/src/main/resources/mapper/qw/QwExternalContactMapper.xml

@@ -829,4 +829,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and fs_user_id is not null and company_user_id is not null and qw_user_id is not null
         limit 1
     </select>
+
+    <select id="selectRepeatRecordList" resultType="com.fs.qw.vo.QwRepeatRecordListVO">
+        select ec.corp_id as corpId,
+               ec.external_user_id as externalUserId,
+               ec.name as externalUserName,
+               qu.qw_user_id as qwUserId,
+               qu.qw_user_name as qwUserName,
+               qd.dept_name as deptName,
+               ec.create_time as createTime,
+               ec.register_time as registerTime
+        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
+        <where>
+            ec.corp_id = #{corpId}
+            and ec.external_user_id = #{externalUserId}
+            <if test="qwUserId != null and qwUserId != ''">
+                and ec.user_id = #{qwUserId}
+            </if>
+            <if test="qwUserName != null and qwUserName != ''">
+                and qu.qw_user_name like concat('%', #{qwUserName}, '%')
+            </if>
+        </where>
+        order by ec.create_time desc
+    </select>
 </mapper>