Browse Source

Merge remote-tracking branch 'origin/master'

ct 1 ngày trước cách đây
mục cha
commit
b5e8ee9711
21 tập tin đã thay đổi với 566 bổ sung25 xóa
  1. 84 0
      fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java
  2. 23 0
      fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerController.java
  3. 40 0
      fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerLevelController.java
  4. 23 23
      fs-company/src/main/java/com/fs/company/controller/qw/QwExternalContactController.java
  5. 28 0
      fs-service/src/main/java/com/fs/crm/domain/CrmCustomerLevel.java
  6. 18 0
      fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerLevelMapper.java
  7. 3 0
      fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerMapper.java
  8. 26 0
      fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelParm.java
  9. 11 0
      fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelQueryParam.java
  10. 2 1
      fs-service/src/main/java/com/fs/crm/param/CrmMyCustomerListQueryParam.java
  11. 40 0
      fs-service/src/main/java/com/fs/crm/service/ICrmCustomerLevelService.java
  12. 2 0
      fs-service/src/main/java/com/fs/crm/service/ICrmCustomerService.java
  13. 102 0
      fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerLevelServiceImpl.java
  14. 28 0
      fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerServiceImpl.java
  15. 23 0
      fs-service/src/main/java/com/fs/crm/vo/CrmCustomerLevelVO.java
  16. 19 0
      fs-service/src/main/java/com/fs/crm/vo/CrmMyCustomerListQueryVO.java
  17. 1 0
      fs-service/src/main/java/com/fs/qw/param/ResignedTransferParam.java
  18. 1 0
      fs-service/src/main/java/com/fs/qw/param/TransferParam.java
  19. 1 1
      fs-service/src/main/resources/application-dev.yml
  20. 17 0
      fs-service/src/main/resources/mapper/crm/CrmCustomerLevelMapper.xml
  21. 74 0
      fs-service/src/main/resources/mapper/crm/CrmCustomerMapper.xml

+ 84 - 0
fs-admin/src/main/java/com/fs/crm/controller/CrmCustomerLevelController.java

@@ -0,0 +1,84 @@
+package com.fs.crm.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+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.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+import com.fs.his.vo.OptionsVO;
+import lombok.AllArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/crm/customerLevel")
+@AllArgsConstructor
+public class CrmCustomerLevelController extends BaseController {
+
+    private final ICrmCustomerLevelService customerLevelService;
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CrmCustomerLevelQueryParam param) {
+        startPage();
+        List<CrmCustomerLevelVO> list = customerLevelService.selectCrmCustomerLevelVOList(param);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:add')")
+    @Log(title = "客户级别", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.saveCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:edit')")
+    @Log(title = "客户级别", businessType = BusinessType.UPDATE)
+    @PutMapping("/edit")
+    public AjaxResult edit(@Valid @RequestBody CrmCustomerLevelParm param) {
+        return toAjax(customerLevelService.editCustomerLevel(param));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable Long id) {
+        return AjaxResult.success(customerLevelService.selectCrmCustomerLevelVOById(id));
+    }
+
+    @PreAuthorize("@ss.hasPermi('crm:customerLevel:delete')")
+    @Log(title = "客户", businessType = BusinessType.DELETE)
+    @DeleteMapping("/delete/{ids}")
+    public AjaxResult delete(@PathVariable Long[] ids) {
+        customerLevelService.removeByIds(Arrays.asList(ids));
+        return AjaxResult.success();
+    }
+
+    @GetMapping("/getCustomerLevelOption")
+    public R getCustomerLevelOption(Integer status) {
+        LambdaQueryWrapper<CrmCustomerLevel> wrapper = Wrappers.lambdaQuery();
+        if (Objects.nonNull(status)) {
+            wrapper.eq(CrmCustomerLevel::getStatus, status);
+        }
+        List<OptionsVO> options = customerLevelService.list(wrapper).stream().map(l -> {
+            OptionsVO vo = new OptionsVO();
+            vo.setDictLabel(l.getName());
+            vo.setDictValue(l.getId());
+            return vo;
+        }).collect(Collectors.toList());
+        return R.ok().put("data", options);
+    }
+}

+ 23 - 0
fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerController.java

@@ -112,6 +112,29 @@ public class CrmCustomerController extends BaseController
         }
         return R.ok().put("rows", list);
     }
+
+    @ApiOperation("获取我的协作客户列表")
+    @PreAuthorize("@ss.hasPermi('crm:customer:assistList')")
+    @GetMapping("/getMyAssistList")
+    public TableDataInfo getMyAssistList(CrmMyCustomerListQueryParam param){
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        PageHelper.startPage(param.getPageNum(), param.getPageSize());
+        param.setCompanyUserId(loginUser.getUser().getUserId());
+        param.setCompanyId(loginUser.getCompany().getCompanyId());
+        if(!StringUtils.isEmpty(param.getCreateTimeRange())){
+            param.setCustomerCreateTime(param.getCreateTimeRange().split("--"));
+        }
+        List<CrmMyCustomerListQueryVO> list = crmCustomerService.selectCrmMyAssistListQuery(param);
+        if (list != null) {
+            for (CrmMyCustomerListQueryVO vo : list) {
+                if(vo.getMobile()!=null){
+                    vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+                }
+            }
+        }
+        return getDataTable(list);
+
+    }
     @ApiOperation("获取我的客户列表")
     @PreAuthorize("@ss.hasPermi('crm:customer:myList')")
     @GetMapping("/getMyCustomerList")

+ 40 - 0
fs-company/src/main/java/com/fs/company/controller/crm/CrmCustomerLevelController.java

@@ -0,0 +1,40 @@
+package com.fs.company.controller.crm;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.his.vo.OptionsVO;
+import lombok.AllArgsConstructor;
+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;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/crm/customerLevel")
+@AllArgsConstructor
+public class CrmCustomerLevelController extends BaseController {
+
+    private final ICrmCustomerLevelService customerLevelService;
+
+    @GetMapping("/getCustomerLevelOption")
+    public R getCustomerLevelOption(Integer status) {
+        LambdaQueryWrapper<CrmCustomerLevel> wrapper = Wrappers.lambdaQuery();
+        if (Objects.nonNull(status)) {
+            wrapper.eq(CrmCustomerLevel::getStatus, status);
+        }
+        List<OptionsVO> options = customerLevelService.list(wrapper).stream().map(l -> {
+            OptionsVO vo = new OptionsVO();
+            vo.setDictLabel(l.getName());
+            vo.setDictValue(l.getId());
+            return vo;
+        }).collect(Collectors.toList());
+        return R.ok().put("data", options);
+    }
+}

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

@@ -369,18 +369,18 @@ public class QwExternalContactController extends BaseController
     @PutMapping("/resignedTransfer")
     public R resignedTransfer(@RequestBody ResignedTransferParam 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);
-//            }
-//        }
+        if (ObjectUtil.isNotEmpty(param.getQwUserName())&&ObjectUtil.isNotEmpty(param.getType())&&param.getType().equals("1")){
+            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.resignedTransfer(param);
     }
@@ -393,17 +393,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);
-//            }
-//        }
+        if (ObjectUtil.isNotEmpty(param.getQwUserName())&&ObjectUtil.isNotEmpty(param.getType())&&param.getType().equals("1")){
+            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);
     }
     /**

+ 28 - 0
fs-service/src/main/java/com/fs/crm/domain/CrmCustomerLevel.java

@@ -0,0 +1,28 @@
+package com.fs.crm.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+@TableName("crm_customer_level")
+@Data
+public class CrmCustomerLevel {
+    /**
+     * 主键ID
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+    /**
+     * 级别名称
+     */
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 18 - 0
fs-service/src/main/java/com/fs/crm/mapper/CrmCustomerLevelMapper.java

@@ -0,0 +1,18 @@
+package com.fs.crm.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+
+import java.util.List;
+
+public interface CrmCustomerLevelMapper extends BaseMapper<CrmCustomerLevel> {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param);
+}

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

@@ -956,4 +956,7 @@ public interface CrmCustomerMapper extends BaseMapper<CrmCustomer> {
      */
     @Select("select user_id  from  fs_user where phone=#{remarkMobile} limit 1")
     Long selectFsUserByCrmMobile(String remarkMobile);
+
+    List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(@Param("maps") CrmMyCustomerListQueryParam param);
+
 }

+ 26 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelParm.java

@@ -0,0 +1,26 @@
+package com.fs.crm.param;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class CrmCustomerLevelParm {
+    /**
+     * 主键ID
+     */
+    private Long id;
+    /**
+     * 级别名称
+     */
+    @NotBlank(message = "级别名称不能为空")
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 11 - 0
fs-service/src/main/java/com/fs/crm/param/CrmCustomerLevelQueryParam.java

@@ -0,0 +1,11 @@
+package com.fs.crm.param;
+
+import lombok.Data;
+
+@Data
+public class CrmCustomerLevelQueryParam {
+    /**
+     * 级别名称
+     */
+    private String name;
+}

+ 2 - 1
fs-service/src/main/java/com/fs/crm/param/CrmMyCustomerListQueryParam.java

@@ -93,5 +93,6 @@ public class CrmMyCustomerListQueryParam extends BaseQueryParam
     private Integer isHisOrder;
 
     private String corpId;
-
+    /** 客户级别 */
+    private Long customerLevel;
 }

+ 40 - 0
fs-service/src/main/java/com/fs/crm/service/ICrmCustomerLevelService.java

@@ -0,0 +1,40 @@
+package com.fs.crm.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+
+import java.util.List;
+
+public interface ICrmCustomerLevelService extends IService<CrmCustomerLevel> {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param);
+
+    /**
+     * 新增客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    int saveCustomerLevel(CrmCustomerLevelParm param);
+
+    /**
+     * 修改客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    int editCustomerLevel(CrmCustomerLevelParm param);
+
+    /**
+     * 根据ID查询
+     * @param id id
+     * @return CrmCustomerLevelVO
+     */
+    CrmCustomerLevelVO selectCrmCustomerLevelVOById(Long id);
+}

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

@@ -163,4 +163,6 @@ public interface ICrmCustomerService
     List<JSONObject> selectCrmCustomerCycleCounts(Map<String, Object> map);
 
     void computePayMoney();
+
+    List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param);
 }

+ 102 - 0
fs-service/src/main/java/com/fs/crm/service/impl/CrmCustomerLevelServiceImpl.java

@@ -0,0 +1,102 @@
+package com.fs.crm.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.exception.CustomException;
+import com.fs.common.utils.bean.BeanUtils;
+import com.fs.crm.domain.CrmCustomerLevel;
+import com.fs.crm.mapper.CrmCustomerLevelMapper;
+import com.fs.crm.param.CrmCustomerLevelParm;
+import com.fs.crm.param.CrmCustomerLevelQueryParam;
+import com.fs.crm.service.ICrmCustomerLevelService;
+import com.fs.crm.vo.CrmCustomerLevelVO;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+
+@Service
+public class CrmCustomerLevelServiceImpl extends ServiceImpl<CrmCustomerLevelMapper, CrmCustomerLevel> implements ICrmCustomerLevelService {
+
+    /**
+     * 查询客户级别列表
+     * @param param 参数
+     * @return  list
+     */
+    @Override
+    public List<CrmCustomerLevelVO> selectCrmCustomerLevelVOList(CrmCustomerLevelQueryParam param) {
+        return baseMapper.selectCrmCustomerLevelVOList(param);
+    }
+
+    /**
+     * 新增客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    @Override
+    public int saveCustomerLevel(CrmCustomerLevelParm param) {
+        CrmCustomerLevel crmCustomerLevel = getCustomerLevelByName(param.getName());
+        if (Objects.nonNull(crmCustomerLevel)) {
+            throw new CustomException("级别名称已存在");
+        }
+
+        crmCustomerLevel = new CrmCustomerLevel();
+        BeanUtils.copyProperties(param, crmCustomerLevel, "id");
+        return baseMapper.insert(crmCustomerLevel);
+    }
+
+    /**
+     * 根据名称查询客户级别
+     * @param name 名称
+     * @return CrmCustomerLevel
+     */
+    private CrmCustomerLevel getCustomerLevelByName(String name) {
+        Wrapper<CrmCustomerLevel> queryWrapper = Wrappers.<CrmCustomerLevel>lambdaQuery()
+                .eq(CrmCustomerLevel::getName, name)
+                .last("limit 1");
+        return getOne(queryWrapper);
+    }
+
+    /**
+     * 修改客户级别
+     * @param param 参数
+     * @return 受影响行数
+     */
+    @Override
+    public int editCustomerLevel(CrmCustomerLevelParm param) {
+        if (Objects.isNull(param.getId())) {
+            throw new CustomException("ID不能为空");
+        }
+
+        CrmCustomerLevel customerLevel = getById(param.getId());
+        if (Objects.isNull(customerLevel)) {
+            throw new CustomException("记录不存在");
+        }
+
+        CrmCustomerLevel levelByName = getCustomerLevelByName(param.getName());
+        if (Objects.nonNull(levelByName) && !levelByName.getId().equals(customerLevel.getId())) {
+            throw new CustomException("级别名称已存在");
+        }
+
+        BeanUtils.copyProperties(param, customerLevel, "id");
+        return baseMapper.updateById(customerLevel);
+    }
+
+    /**
+     * 根据ID查询
+     * @param id id
+     * @return CrmCustomerLevelVO
+     */
+    @Override
+    public CrmCustomerLevelVO selectCrmCustomerLevelVOById(Long id) {
+        CrmCustomerLevel customerLevel = getById(id);
+        if (Objects.isNull(customerLevel)) {
+            throw new CustomException("记录不存在");
+        }
+
+        CrmCustomerLevelVO crmCustomerLevelVO = new CrmCustomerLevelVO();
+        BeanUtils.copyProperties(customerLevel, crmCustomerLevelVO);
+        return crmCustomerLevelVO;
+    }
+}

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

@@ -35,11 +35,13 @@ import com.fs.system.service.ISysDictTypeService;
 import lombok.Synchronized;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -57,6 +59,9 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
     private CrmCustomerLogsMapper logsMapper;
     @Autowired
     private ISysDictDataService dictDataService;
+
+    @Autowired
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
     @Autowired
     private CompanyMapper companyMapper;
 
@@ -1003,4 +1008,27 @@ public class CrmCustomerServiceImpl extends ServiceImpl<CrmCustomerMapper, CrmCu
             }
         }
     }
+
+    @Override
+    public List<CrmMyCustomerListQueryVO> selectCrmMyAssistListQuery(CrmMyCustomerListQueryParam param) {
+        List<CrmMyCustomerListQueryVO> vos = crmCustomerMapper.selectCrmMyAssistListQuery(param);
+
+        if (vos != null && !vos.isEmpty()){
+            List<CompletableFuture<Void>> futures = new ArrayList<>();
+            vos.forEach(vo -> {
+                CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
+                    CompanyUser companyUser = companyUserMapper.selectCompanyUserById(vo.getCompanyUserId());
+                    ArrayList<String> list = new ArrayList<>();
+                    list.add(companyUser.getNickName()+"(" + companyUser.getUserId() + ")");
+                    vo.setAssistUser(list);
+                }, threadPoolTaskExecutor);
+                futures.add(future);
+            });
+            // 等待所有任务完成
+            CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
+        }
+
+        return vos;
+    }
+
 }

+ 23 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmCustomerLevelVO.java

@@ -0,0 +1,23 @@
+package com.fs.crm.vo;
+
+import lombok.Data;
+
+@Data
+public class CrmCustomerLevelVO {
+    /**
+     * 主键ID
+     */
+    private Long id;
+    /**
+     * 级别名称
+     */
+    private String name;
+    /**
+     * 状态 0显示 1停用
+     */
+    private Integer status;
+    /**
+     * 序号
+     */
+    private Integer sort;
+}

+ 19 - 0
fs-service/src/main/java/com/fs/crm/vo/CrmMyCustomerListQueryVO.java

@@ -5,7 +5,9 @@ import com.fs.common.annotation.Excel;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 @Data
 public class CrmMyCustomerListQueryVO implements Serializable
@@ -118,5 +120,22 @@ public class CrmMyCustomerListQueryVO implements Serializable
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date receiveTime;
+    private List<String> assistUser;
+    private Long companyUserId;
 
+    /** 客户级别 */
+    private Long customerLevel;
+
+    private BigDecimal payMoney;
+
+    @Excel(name = "订单最新成交类型",dictType="store_order_type")
+    private String orderType;
+
+    @Excel(name = "订单最新成交时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date orderTime;
+
+
+    @Excel(name = "最新跟进内容")
+    private String visitContent;
 }

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

@@ -10,4 +10,5 @@ public class ResignedTransferParam {
     Long  userId;
     String corpId;
     String  qwUserName;
+    String type;
 }

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

@@ -11,4 +11,5 @@ public class TransferParam {
     String  qwUserName;
     String corpId;
     String content;
+    String type;
 }

+ 1 - 1
fs-service/src/main/resources/application-dev.yml

@@ -43,7 +43,7 @@ spring:
             druid:
                 # 主库数据源
                 master:
-                    url: jdbc:mysql://139.186.77.83:3306/ylrz_his_scrm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                    url: jdbc:mysql://139.186.77.83:3306/zk_target_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: Rtroot
                     password: Rtroot
                 # 初始连接数

+ 17 - 0
fs-service/src/main/resources/mapper/crm/CrmCustomerLevelMapper.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.crm.mapper.CrmCustomerLevelMapper">
+
+    <select id="selectCrmCustomerLevelVOList" resultType="com.fs.crm.vo.CrmCustomerLevelVO">
+        select
+            ccl.*
+        from crm_customer_level ccl
+        <where>
+            <if test="name != null and name != ''">
+                and ccl.name like concat('%', #{name}, '%')
+            </if>
+        </where>
+    </select>
+</mapper>

+ 74 - 0
fs-service/src/main/resources/mapper/crm/CrmCustomerMapper.xml

@@ -361,4 +361,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ) t
         GROUP BY t.type
     </select>
+
+
+
+    <select id="selectCrmMyAssistListQuery" resultType="com.fs.crm.vo.CrmMyCustomerListQueryVO">
+        select cu.*,c.create_time as customer_create_time,c.visit_status,c.remark,c.register_desc,c.register_submit_time,
+        c.customer_code,c.customer_name,c.mobile,c.sex,c.weixin,c.address,c.is_receive,c.customer_type,c.source,
+        c.tags,c.receive_time, c.customer_level
+        from crm_customer_assist ca
+        LEFT JOIN  crm_customer c on c.customer_id=ca.customer_id
+        LEFT JOIN crm_customer_user cu on c.customer_user_id=cu.customer_user_id
+        where c.is_pool=0  and c.is_del = 0
+        <if test="maps.companyId != null">
+            and ca.company_id =#{maps.companyId}
+        </if>
+        <if test="maps.companyUserId != null">
+            and ca.company_user_id =#{maps.companyUserId}
+        </if>
+        <if test="maps.customerLevel != null">
+            and c.customer_level =#{maps.customerLevel}
+        </if>
+        <if test="maps.address != null and  maps.address != ''">
+            and c.address like CONCAT('%',#{maps.address},'%')
+        </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.visit_status IN
+            <foreach collection="maps.status.split(',')" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.isHisOrder != null and  maps.isHisOrder == 1">
+            and (select ifnull(count(1),0) from crm_customer_his_order h where h.customer_id=c.customer_id )  &gt; 0
+        </if>
+        <if test="maps.isHisOrder != null and  maps.isHisOrder == 0">
+            and (select ifnull(count(1),0) from crm_customer_his_order h where h.customer_id=c.customer_id )  = 0
+        </if>
+        <if test="maps.customerType != null">
+            and c.customer_type IN
+            <foreach collection="maps.customerType.split(',')" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.source != null and  maps.source != ''">
+            and c.source IN
+            <foreach collection="maps.source.split(',')" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="maps.tags != null and  maps.tags != ''">
+            and
+            <foreach collection="maps.tags.split(',')" item="tag" open="(" separator="OR" close=")">
+                find_in_set(#{tag},c.tags)
+            </foreach>
+        </if>
+        <if test="maps.customerCreateTime != null">
+            AND date_format(c.create_time,'%y%m%d') &gt;= date_format(#{maps.customerCreateTime[0]},'%y%m%d')
+            AND date_format(c.create_time,'%y%m%d') &lt;= date_format(#{maps.customerCreateTime[1]},'%y%m%d')
+        </if>
+        <if test="maps.beginTime != null and maps.beginTime != ''">
+            and date_format(c.receive_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.receive_time,'%y%m%d') &lt;= date_format(#{maps.endTime},'%y%m%d')
+        </if>
+        order by cu.customer_user_id desc
+    </select>
 </mapper>