Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

吴树波 1 hete
szülő
commit
e02b58f687

+ 1 - 0
README.en.md

@@ -34,3 +34,4 @@ Software architecture description
 4.  The most valuable open source project [GVP](https://gitee.com/gvp)
 5.  The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
 6.  The most popular members  [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+1

+ 5 - 1
fs-admin/pom.xml

@@ -44,7 +44,11 @@
             <artifactId>fs-framework</artifactId>
         </dependency>
 
-
+        <!-- 企微 qwTask Bean,Quartz 调用目标如 qwTask.processQwSopCourseMaterialTimer -->
+        <dependency>
+            <groupId>com.fs</groupId>
+            <artifactId>fs-qw-api</artifactId>
+        </dependency>
 
         <!-- 定时任务-->
         <dependency>

+ 53 - 0
fs-company/src/main/java/com/fs/company/controller/crm/CustomerAllController.java

@@ -0,0 +1,53 @@
+package com.fs.company.controller.crm;
+
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.utils.ServletUtils;
+import com.fs.crm.param.CrmCustomerAllListQueryParam;
+import com.fs.crm.service.ICrmCustomerService;
+import com.fs.crm.vo.CrmCustomerAllListQueryVO;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
+import com.github.pagehelper.PageHelper;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author MixLiu
+ * @date 2026/5/18 13:44
+ * @description 全部客户(含已分配)
+ */
+@RestController
+@RequestMapping("/crm/customerAll")
+public class CustomerAllController extends BaseController {
+
+    @Autowired
+    private ICrmCustomerService crmCustomerService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    @ApiOperation("获取全部客户列表(含已分配)")
+    @PreAuthorize("@ss.hasPermi('crm:customerAll:list')")
+    @GetMapping("/getList")
+    public TableDataInfo getList(CrmCustomerAllListQueryParam param) {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<CrmCustomerAllListQueryVO> list = crmCustomerService.selectCrmCustomerAllListQuery(param);
+        if (list != null) {
+            for (CrmCustomerAllListQueryVO vo : list) {
+                if (vo.getMobile() != null) {
+                    vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            }
+        }
+        return getDataTable(list);
+    }
+}

+ 65 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java

@@ -1022,4 +1022,69 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
 
     @Select("select mobile from crm_customer where customer_id = #{customerId} limit 1")
     String selectCrmCustomerPhoneByCustomerId(Long customerId);
+
+    @Select({"<script> " +
+            "select c.*,u.nick_name as company_user_nick_name,ccu.start_time as startTime,ca.attrition_level,ca.intention_degree,ca.customer_focus_json " +
+            "from crm_customer c " +
+            "left join company_user u on u.user_id=c.receive_user_id " +
+            "left join crm_customer_user ccu on c.customer_user_id = ccu.customer_user_id " +
+            "LEFT JOIN LATERAL ( SELECT attrition_level, intention_degree,customer_focus_json FROM crm_customer_analyze WHERE customer_id = c.customer_id " +
+            "   ORDER BY create_time DESC " +
+            "   LIMIT 1 " +
+            ") ca ON TRUE " +
+            "where c.is_del=0 " +
+            "<if test = 'maps.companyId != null     '> " +
+            "and c.company_id =#{maps.companyId} " +
+            "</if>" +
+            "<if test = 'maps.customerCode != null and  maps.customerCode !=\"\"    '> " +
+            "and c.customer_code like CONCAT('%',#{maps.customerCode},'%') " +
+            "</if>" +
+            "<if test = 'maps.customerName != null and  maps.customerName !=\"\"    '> " +
+            "and c.customer_name like CONCAT('%',#{maps.customerName},'%') " +
+            "</if>" +
+            "<if test = 'maps.mobile != null and  maps.mobile !=\"\"    '> " +
+            "and c.mobile like CONCAT('%',#{maps.mobile},'%') " +
+            "</if>" +
+            "<if test = 'maps.status != null and maps.status !=\"\"     '> " +
+            "and c.status =#{maps.status} " +
+            "</if>" +
+            "<if test = 'maps.customerType != null      '> " +
+            "and c.customer_type =#{maps.customerType} " +
+            "</if>" +
+            "<if test = 'maps.source != null and maps.source !=\"\"      '> " +
+            "and c.source =#{maps.source} " +
+            "</if>" +
+            "<if test = 'maps.isReceive != null      '> " +
+            "and c.is_receive =#{maps.isReceive} " +
+            "</if>" +
+            "<if test = 'maps.isDuplicate != null and maps.isDuplicate == 1      '> " +
+            "and c.is_duplicate =1 " +
+            "</if>" +
+            "<if test = 'maps.isDuplicate != null and maps.isDuplicate == 2      '> " +
+            "and (c.is_duplicate =0 or c.is_duplicate is null) " +
+            "</if>" +
+            "<if test = 'maps.tags != null      '> " +
+            "and  " +
+            "<foreach collection=\"maps.tags.split(',')\" item=\"tag\"   open=\"(\" close=\")\" separator=\"OR\">" +
+            "find_in_set(#{tag},c.tags)" +
+            "</foreach> " +
+            "</if>" +
+            "<if test = 'maps.companyUserNickName != null and  maps.companyUserNickName !=\"\"    '> " +
+            "and u.nick_name like CONCAT(#{maps.companyUserNickName},'%') " +
+            "</if>" +
+            "<if test = 'maps.attritionLevel != null'> " +
+            "and ca.attrition_level = #{maps.attritionLevel} " +
+            "</if>" +
+            "<if test = 'maps.intentionDegree != null and maps.intentionDegree != \"\" ' > " +
+            "and ca.intention_degree = #{maps.intentionDegree} " +
+            "</if>" +
+            "<if test = 'maps.beginTime != null and maps.beginTime != \"\" '> " +
+            "and date_format(c.create_time,'%y%m%d') &gt;= date_format(#{maps.beginTime},'%y%m%d') " +
+            "</if>" +
+            "<if test = 'maps.endTime != null and maps.endTime != \"\" '> " +
+            "and date_format(c.create_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d') " +
+            "</if>" +
+            " order by c.customer_id desc "+
+            "</script>"})
+    List<CrmCustomerAllListQueryVO> selectCrmCustomerAllListQuery(@Param("maps") CrmCustomerAllListQueryParam param);
 }

+ 63 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerAllListQueryParam.java

@@ -0,0 +1,63 @@
+package com.fs.crm.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class CrmCustomerAllListQueryParam extends BaseQueryParam {
+
+    Long companyId;
+
+    private Long customerId;
+
+    private String customerCode;
+
+    private String customerName;
+
+    private String mobile;
+
+    private Integer sex;
+
+    private String weixin;
+
+    private Long userId;
+
+    private Long customerUserId;
+
+    private String address;
+
+    private String location;
+
+    private String detailAddress;
+
+    private String lng;
+
+    private String lat;
+
+    private String status;
+
+    private Long isReceive;
+
+    private Long deptId;
+
+    private Integer isDel;
+
+    private Integer customerType;
+
+    private Integer isDuplicate;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    private String source;
+
+    private String tags;
+
+    private Integer attritionLevel;
+
+    private String intentionDegree;
+
+    private String companyUserNickName;
+}

+ 2 - 0
fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java

@@ -167,4 +167,6 @@ public interface ICrmCustomerService
     void computePayMoney();
 
     List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param);
+
+    List<CrmCustomerAllListQueryVO> selectCrmCustomerAllListQuery(CrmCustomerAllListQueryParam param);
 }

+ 5 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java

@@ -1089,4 +1089,9 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
         return vos;
     }
 
+    @Override
+    public List<CrmCustomerAllListQueryVO> selectCrmCustomerAllListQuery(CrmCustomerAllListQueryParam param) {
+        return crmCustomerMapper.selectCrmCustomerAllListQuery(param);
+    }
+
 }

+ 103 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmCustomerAllListQueryVO.java

@@ -0,0 +1,103 @@
+package com.fs.crm.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Data
+public class CrmCustomerAllListQueryVO implements Serializable {
+
+    private Long customerId;
+
+    private String customerCode;
+
+    private String customerName;
+
+    private String mobile;
+
+    private Integer sex;
+
+    private String weixin;
+
+    private Long userId;
+
+    private Long customerUserId;
+
+    private String address;
+
+    private String location;
+
+    private String detailAddress;
+
+    private String lng;
+
+    private String lat;
+
+    private Long status;
+
+    private Long isReceive;
+
+    private Long deptId;
+
+    private Integer customerType;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date receiveTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date poolTime;
+
+    private Long companyId;
+
+    private String source;
+
+    private Integer visitStatus;
+
+    private String tags;
+
+    private String deptName;
+
+    private String remark;
+
+    private String registerDate;
+
+    private String registerLinkUrl;
+
+    private String registerDesc;
+
+    private String registerSubmitTime;
+
+    private String registerType;
+
+    private String sourceCode;
+
+    private String pushTime;
+
+    private String pushCode;
+
+    private Integer isLine;
+
+    private Integer isDuplicate;
+
+    private Long dCustomerId;
+
+    private Long attritionLevel;
+
+    private String intentionDegree;
+
+    private String customerFocusJson;
+
+    private String companyUserNickName;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    private Long receiveUserId;
+
+    private Integer isPool;
+}

+ 7 - 0
pom.xml

@@ -248,6 +248,13 @@
                 <version>${fs.version}</version>
             </dependency>
 
+            <!-- 企微接口与 qwTask 等 Bean,供定时任务 invokeTarget(如 qwTask.xxx)-->
+            <dependency>
+                <groupId>com.fs</groupId>
+                <artifactId>fs-qw-api</artifactId>
+                <version>${fs.version}</version>
+            </dependency>
+
             <dependency>
                 <groupId>com.github.javen205</groupId>
                 <artifactId>IJPay-All</artifactId>