Guo1B0 1 năm trước cách đây
mục cha
commit
f18c2900e3
23 tập tin đã thay đổi với 726 bổ sung30 xóa
  1. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ActionLogController.java
  2. 8 5
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java
  3. 6 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  4. 23 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  5. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/UploadFileController.java
  6. 68 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ActionLog.java
  7. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java
  8. 26 2
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java
  9. 73 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/UploadFile.java
  10. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ActionLogMapper.java
  11. 14 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/CustomMapper.java
  12. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/UploadFileMapper.java
  13. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ActionLogService.java
  14. 7 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java
  15. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/UploadFileService.java
  16. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ActionLogServiceImpl.java
  17. 13 8
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  18. 71 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java
  19. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UploadFileServiceImpl.java
  20. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ActionLogMapper.xml
  21. 8 8
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml
  22. 220 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml
  23. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/UploadFileMapper.xml

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ActionLogController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@RestController
+@RequestMapping("/action-log")
+public class ActionLogController {
+
+}
+

+ 8 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/BusinessOpportunityController.java

@@ -58,7 +58,7 @@ public class BusinessOpportunityController {
     }
 
     @RequestMapping("list")
-    public HashMap<Object, Object> list(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+    public HttpRespMsg list(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
         HashMap<Object, Object> r = new HashMap<>();
         User user = userMapper.selectById(request.getHeader("Token"));
         bo.setIsDelete(0);
@@ -78,11 +78,13 @@ public class BusinessOpportunityController {
         }
         r.put("data", list);
         r.put("total",i);
-        return r;
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(r);
+        return msg;
 
     }
     @RequestMapping("deleterList")
-    public HashMap<Object, Object> deleterList(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
+    public HttpRespMsg deleterList(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
         HashMap<Object, Object> r = new HashMap<>();
         User user = userMapper.selectById(request.getHeader("Token"));
         bo.setIsDelete(1);
@@ -102,8 +104,9 @@ public class BusinessOpportunityController {
         }
         r.put("data", list);
         r.put("total",i);
-        return r;
-
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(r);
+        return msg;
     }
 
 

+ 6 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -87,7 +87,9 @@ public class ClueController {
         HashMap<Object, Object> map = new HashMap<>();
         map.put("data", list);
         map.put("total", i);
-        return map;
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(map);
+        return msg;
     }
 
     @RequestMapping("listDeleterClue")
@@ -115,7 +117,9 @@ public class ClueController {
         HashMap<Object, Object> map = new HashMap<>();
         map.put("data", list);
         map.put("total",i);
-        return map;
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.setData(map);
+        return httpRespMsg;
     }
 
     @RequestMapping("/insertAndUpdate")

+ 23 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java

@@ -3,6 +3,8 @@ package com.management.platform.controller;
 
 import com.management.platform.entity.Clue;
 import com.management.platform.entity.Custom;
+import com.management.platform.entity.User;
+import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.CustomService;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,12 +30,23 @@ public class CustomController {
 
     @Autowired
     private CustomService customService;
+    @Autowired
+    private UserMapper userMapper;
+
+    @RequestMapping("list")
+    public HttpRespMsg list(Custom custom , HttpServletRequest request){
+        return customService.getList(custom,request);
+    }
 
 
     @RequestMapping("insertAndUpdate")
     public HttpRespMsg insertAndUpdate(Custom custom , HttpServletRequest request){
         return customService.insertAndUpdate(custom,request);
     }
+    @RequestMapping("getInfo")
+    public HttpRespMsg getInfo(Custom custom , HttpServletRequest request){
+        return customService.getInfo(custom,request);
+    }
     // 批量放入回收站
     @RequestMapping("deleter")
     public Object delete(Custom custom) {
@@ -89,6 +102,16 @@ public class CustomController {
         return msg;
     }
 
+    // 认领&转移线索
+    @RequestMapping("claim")
+    public Object claim( Custom custom, HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setMsg("操作成功");
+        customService.getAndTransfer(custom, user);
+        return msg;
+    }
+
 
 }
 

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/UploadFileController.java

@@ -0,0 +1,21 @@
+package com.management.platform.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@RestController
+@RequestMapping("/upload-file")
+public class UploadFileController {
+
+}
+

+ 68 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ActionLog.java

@@ -0,0 +1,68 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ActionLog extends Model<ActionLog> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId("id")
+    private Long id;
+
+    /**
+     * 模块id
+     */
+    @TableField("item_id")
+    private Integer itemId;
+
+    /**
+     * 操作时间
+     */
+    @TableField("creat_time")
+    private Date creatTime;
+
+    /**
+     * 操作内容
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 创建人id
+     */
+    @TableField("user_id")
+    private String userId;
+
+    /**
+     * 模块代码
+     */
+    @TableField("code")
+    private String code;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 2 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java

@@ -161,9 +161,9 @@ public class Clue extends Model<Clue> {
     @TableField(exist = false)
     private Integer pageFrom;
     @TableField(exist = false)
-    private List<ClueLog> clueLogList;
+    private List<ActionLog> clueLogList;
     @TableField(exist = false)
-    private List<ClueUploadfile> clueUploadfileList;
+    private List<UploadFile> files;
 
 
 

+ 26 - 2
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java

@@ -3,8 +3,11 @@ package com.management.platform.entity;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
+
 import java.time.LocalDateTime;
+
 import com.baomidou.mybatisplus.annotation.TableField;
+
 import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
@@ -15,7 +18,7 @@ import lombok.experimental.Accessors;
 
 /**
  * <p>
- * 
+ *
  * </p>
  *
  * @author Seyason
@@ -26,7 +29,7 @@ import lombok.experimental.Accessors;
 @Accessors(chain = true)
 public class Custom extends Model<Custom> {
 
-    private static final long serialVersionUID=1L;
+    private static final long serialVersionUID = 1L;
 
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
@@ -44,6 +47,7 @@ public class Custom extends Model<Custom> {
      */
     @TableField("incharger_id")
     private String inchargerId;
+    private String inchargerName;
 
     /**
      * 公司电话
@@ -56,18 +60,24 @@ public class Custom extends Model<Custom> {
      */
     @TableField("custom_source_id")
     private Integer customSourceId;
+    @TableField(exist = false)
+    private String customSourceValue;
 
     /**
      * 客户行业id
      */
     @TableField("customer_industry_id")
     private Integer customerIndustryId;
+    @TableField(exist = false)
+    private Integer customerIndustryValue;
 
     /**
      * 客户级别id
      */
     @TableField("customer_level_id")
     private Integer customerLevelId;
+    @TableField(exist = false)
+    private String customerLevelValue;
 
     /**
      * 邮箱
@@ -104,6 +114,8 @@ public class Custom extends Model<Custom> {
      */
     @TableField("country_billing")
     private String countryBilling;
+    @TableField(exist = false)
+    private String userId;
 
     /**
      * 开单地址-省/市
@@ -202,6 +214,18 @@ public class Custom extends Model<Custom> {
     private Integer isDelete;
     @TableField(exist = false)
     private String ids;
+    @TableField(exist = false)
+    private String startTime;
+    @TableField(exist = false)
+    private String endTime;
+    @TableField(exist = false)
+    private Integer pageIndex;
+    @TableField(exist = false)
+    private Integer pageFrom;
+    @TableField(exist = false)
+    private List<UploadFile> files;
+    @TableField(exist = false)
+    private List<BusinessOpportunity> BusinessOpportunitys;
 
 
     @Override

+ 73 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/UploadFile.java

@@ -0,0 +1,73 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class UploadFile extends Model<UploadFile> {
+
+    private static final long serialVersionUID=1L;
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 名称
+     */
+    @TableField("name")
+    private String name;
+
+    /**
+     * 文件地址
+     */
+    @TableField("path")
+    private String path;
+
+    /**
+     * 对应模块id
+     */
+    @TableField("item_id")
+    private Integer itemId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    /**
+     * 创建人id
+     */
+    @TableField("create_id")
+    private String createId;
+
+    /**
+     * 模块码clue线索 business商户 custom客户
+     */
+    @TableField("code")
+    private String code;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ActionLogMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.ActionLog;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+public interface ActionLogMapper extends BaseMapper<ActionLog> {
+
+}

+ 14 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/CustomMapper.java

@@ -1,8 +1,11 @@
 package com.management.platform.mapper;
 
+import com.management.platform.entity.Clue;
 import com.management.platform.entity.Custom;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  *  Mapper 接口
@@ -13,4 +16,15 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface CustomMapper extends BaseMapper<Custom> {
 
+    List<Custom> getList(Custom custom);
+
+    int getTotal(Custom custom);
+
+    List<Custom> getList1(Custom custom);
+
+    int getTotal1(Custom custom);
+
+    List<Custom> getList2(Custom custom);
+
+    int getTotal2(Custom custom);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/UploadFileMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.UploadFile;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+public interface UploadFileMapper extends BaseMapper<UploadFile> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ActionLogService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.ActionLog;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+public interface ActionLogService extends IService<ActionLog> {
+
+}

+ 7 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java

@@ -2,6 +2,7 @@ package com.management.platform.service;
 
 import com.management.platform.entity.Custom;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.management.platform.entity.User;
 import com.management.platform.util.HttpRespMsg;
 
 import javax.servlet.http.HttpServletRequest;
@@ -25,4 +26,10 @@ public interface CustomService extends IService<Custom> {
     void isRollback(List<Integer> ids);
 
     void isReallyDelete(List<Integer> ids);
+
+    void getAndTransfer(Custom custom, User user);
+
+    HttpRespMsg getInfo(Custom custom, HttpServletRequest request);
+
+    HttpRespMsg getList(Custom custom, HttpServletRequest request);
 }

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/UploadFileService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.UploadFile;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+public interface UploadFileService extends IService<UploadFile> {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ActionLogServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.ActionLog;
+import com.management.platform.mapper.ActionLogMapper;
+import com.management.platform.service.ActionLogService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@Service
+public class ActionLogServiceImpl extends ServiceImpl<ActionLogMapper, ActionLog> implements ActionLogService {
+
+}

+ 13 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java

@@ -52,11 +52,15 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     @Autowired
     private ClueLogMapper clueLogMapper;
     @Autowired
+    private UploadFileMapper uploadFileMapper;
+    @Autowired
     private SysFormMapper SysFormMapper;
     @Autowired
     private UserMapper userMapper;
     @Autowired
     private UserService userService;
+    @Autowired
+    private ActionLogMapper actionLogMapper;
     @Resource
     private ExcelExportServiceImpl excelExportService;
 
@@ -151,11 +155,11 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     @Override
     public Clue getInfo(Clue clue) {
         Clue clue1 = clueMapper.selectById(clue.getId());
-        clue1.setClueLogList(clueLogMapper.selectList(
-                new QueryWrapper<ClueLog>().eq("clue_id", clue.getId())
+        clue1.setClueLogList(actionLogMapper.selectList(
+                new QueryWrapper<ActionLog>().eq("item_id", clue.getId()).eq("code","clue")
         ));
-        clue1.setClueUploadfileList(clueUploadfileMapper.selectList(
-                    new QueryWrapper<ClueUploadfile>().eq("clue_id", clue.getId())));
+        clue1.setFiles(uploadFileMapper.selectList(
+                    new QueryWrapper<UploadFile>().eq("code","clue").eq("item_id", clue.getId())));
         return clue1;
     }
 
@@ -180,20 +184,21 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
         updateWrapper.eq("id", clue.getId());
         String inchargerId = clue.getInchargerId();
-        ClueLog clueLog = new ClueLog();
+        ActionLog clueLog = new ActionLog();
         clueLog.setUserId(user.getId());
-        clueLog.setClueId(clue.getId());
+        clueLog.setItemId(clue.getId());
         clueLog.setCreatTime(new Date());
+        clueLog.setCode("clue");
         if (inchargerId == null) {
             //认领
             clueLog.setName("认领了线索");
             clue.setInchargerId(user.getId());
-            clueLogMapper.insert(clueLog);
+            actionLogMapper.insert(clueLog);
         } else {
             //转移
             clueLog.setName("转移了线索");
             clue.setInchargerId(clue.getInchargerId());
-            clueLogMapper.insert(clueLog);
+            actionLogMapper.insert(clueLog);
         }
         clueMapper.update(clue, updateWrapper);
 

+ 71 - 3
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -2,20 +2,23 @@ package com.management.platform.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.management.platform.entity.Clue;
-import com.management.platform.entity.Custom;
-import com.management.platform.entity.User;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.BusinessOpportunityMapper;
 import com.management.platform.mapper.CustomMapper;
+import com.management.platform.mapper.UploadFileMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.CustomService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.management.platform.service.SysFunctionService;
 import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -33,6 +36,14 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
     @Autowired
     private CustomMapper customMapper;
 
+    @Autowired
+    private UploadFileMapper uploadFileMapper;
+
+    @Autowired
+    private BusinessOpportunityMapper businessOpportunityMapper;
+    @Autowired
+    private SysFunctionService sysFunctionService;
+
     @Override
     public HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
@@ -102,6 +113,63 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         customMapper.deleteBatchIds(ids);
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void getAndTransfer(Custom custom, User user) {
+        UpdateWrapper<Custom> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", custom.getId());
+        String inchargerId = custom.getInchargerId();
+        if (inchargerId == null) {
+            //认领
+        } else {
+            //转移
+        }
+        customMapper.update(custom, updateWrapper);
+    }
+
+    @Override
+    public HttpRespMsg getInfo(Custom custom, HttpServletRequest request) {
+        Custom custom1 = customMapper.selectById(custom.getId());
+        custom1.setFiles(uploadFileMapper.selectList(new QueryWrapper<UploadFile>().eq("code", "custom").eq("item_id",custom1.getId())));
+        custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        httpRespMsg.setData(custom1);
+        return httpRespMsg;
+    }
+
+    @Override
+    public HttpRespMsg getList(Custom custom, HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("Token"));
+        custom.setCompanyId(user.getCompanyId());
+        custom.setIsDelete(0);
+        custom.setUserId(user.getId());
+        custom.setEndTime(custom.getEndTime() + " 23:59:59");
+        custom.setPageIndex((custom.getPageIndex()-1) * custom.getPageFrom() );
+        boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部客户");
+        boolean isNotAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看负责部门客户");
+        List<Custom> list = new ArrayList<>();
+        int i = 0;
+        if (!isAll) {
+            //查看全部线索
+            list = customMapper.getList(custom);
+            i = customMapper.getTotal(custom);
+        } else if (!isNotAll) {
+            //查看负责部门线索 找出所处部门下所有的负责人
+            list = customMapper.getList1(custom);
+            i = customMapper.getTotal1(custom);
+        } else {
+            // 查看负责人为 自己 和 null的数据
+            list = customMapper.getList2(custom);
+            i = customMapper.getTotal2(custom);
+        }
+        HashMap<Object, Object> map = new HashMap<>();
+        map.put("data", list);
+        map.put("total", i);
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.setData(map);
+        return msg;
+    }
+
 
     private Custom setNull(Custom clue) {
         if (clue.getPlate1() == "") {

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/UploadFileServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.UploadFile;
+import com.management.platform.mapper.UploadFileMapper;
+import com.management.platform.service.UploadFileService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-26
+ */
+@Service
+public class UploadFileServiceImpl extends ServiceImpl<UploadFileMapper, UploadFile> implements UploadFileService {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ActionLogMapper.xml

@@ -0,0 +1,20 @@
+<?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.management.platform.mapper.ActionLogMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.ActionLog">
+        <id column="id" property="id" />
+        <result column="item_id" property="itemId" />
+        <result column="creat_time" property="creatTime" />
+        <result column="name" property="name" />
+        <result column="user_id" property="userId" />
+        <result column="code" property="code" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, item_id, creat_time, name, user_id, code
+    </sql>
+
+</mapper>

+ 8 - 8
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml

@@ -56,7 +56,7 @@
                (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
                (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
                (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
-        from Clue c
+        from clue c
         where
             c.company_id = #{companyId} and is_delete = #{isDelete}
         <if test="inchargerId != null and inchargerId != ''  ">
@@ -111,7 +111,7 @@
         (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
         (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
         (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
-        from Clue c
+        from clue c
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         and c.incharger_id in
@@ -169,7 +169,7 @@
         (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
         (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
         (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
-        from Clue c
+        from clue c
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         and c.incharger_id = #{userId} or c.incharger_id is null
@@ -225,7 +225,7 @@
         (select name from sys_dict where c.clue_source_id = id and code = 'ClueSources') clueSourceValue,
         (select name from sys_dict where c.customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
         (select name from sys_dict where c.customer_level_id = id and code = 'CustomLevel') customerLevelValue
-        from Clue c
+        from clue c
         where
             c.company_id = #{companyId} and is_delete = 1
         <if test="startTime != null and endTime != null ">
@@ -247,7 +247,7 @@
     </select>
     <select id="getTotal" resultType="java.lang.Integer">
         select count(*)
-        from Clue c
+        from clue c
         where
         c.company_id = #{companyId} and is_delete = #{isDelete}
         <if test="clue.startTime != null and clue.endTime != null ">
@@ -268,7 +268,7 @@
     </select>
     <select id="getDeleterTotal" resultType="java.lang.Integer">
         select count(*)
-        from Clue c
+        from clue c
         where
         c.company_id = #{companyId} and is_delete = 1
         <if test="inchargerId != null and inchargerId != ''  ">
@@ -290,7 +290,7 @@
     <select id="getTotal1" resultType="java.lang.Integer">
         select c.id,
         COUNT(c.company_id)
-        from Clue c
+        from clue c
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         and c.incharger_id in
@@ -324,7 +324,7 @@
     <select id="getTotal2" resultType="java.lang.Integer">
         select
         COUNT(c.id)
-        from Clue c
+        from clue c
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         <if test="clue.inchargerId != null and clue.inchargerId != ''  ">

+ 220 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml

@@ -38,5 +38,225 @@
     <sql id="Base_Column_List">
         id, company_id, custom_name, custom_source_id, customer_industry_id, customer_level_id, email, owner_id, custom_code, tel_phone, fax, country_billing, province_billing, city_billing, street_billing, country_delivery, province_delivery, city_delivery, street_delivery, create_time, plate1, plate2, plate3, plate4, plate5, creator_id, custom_desc, is_delete
     </sql>
+    <select id="getList" resultType="com.management.platform.entity.Custom">
+        select id,
+        custom_name,
+        email,
+        company_phone,
+        create_time,
+        (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
+        (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
+        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
+        (select `name` from `user` where id = incharger_id) inchargerName,
+        (select `name` from `user` where id = creator_id) creatorName
+        from custom
+        where company_id = #{companyId}
+          and is_delete =#{isDelete}
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+          <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+        Limit #{pageIndex},#{pageFrom}
+    </select>
+    <select id="getTotal" resultType="java.lang.Integer">
+        select count(id)
+        from custom
+        where company_id = #{companyId}
+        and is_delete =#{isDelete}
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+        <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+    </select>
+    <select id="getList1" resultType="com.management.platform.entity.Custom">
+        select id,
+        custom_name,
+        email,
+        company_phone,
+        create_time,
+        (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
+        (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
+        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
+        (select `name` from `user` where id = incharger_id) inchargerName,
+        (select `name` from `user` where id = creator_id) creatorName
+        from custom
+        where company_id = #{companyId}
+        and is_delete =#{isDelete}
+        and incharger_id in
+        (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
+        or incharger_id is null
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+        <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+        Limit #{pageIndex},#{pageFrom}
+    </select>
+    <select id="getTotal1" resultType="java.lang.Integer">
+        select count(id)
+        from custom
+        where company_id = #{companyId}
+        and is_delete =#{isDelete}
+        and incharger_id in
+        (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
+        or incharger_id is null
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+        <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+    </select>
+    <select id="getList2" resultType="com.management.platform.entity.Custom">
+        select id,
+        custom_name,
+        email,
+        company_phone,
+        create_time,
+        (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
+        (select name from sys_dict where customer_industry_id = id and code = 'CustomIndustry') customerIndustryValue,
+        (select name from sys_dict where custom_source_id = id and code = 'CustomSources') customSourceValue,
+        (select `name` from `user` where id = incharger_id) inchargerName,
+        (select `name` from `user` where id = creator_id) creatorName
+        from custom
+        where company_id = #{companyId}
+        and is_delete =#{isDelete}
+        and incharger_id = #{inchargerId}
+        or incharger_id is null
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+        <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+        Limit #{pageIndex},#{pageFrom}
+    </select>
+    <select id="getTotal2" resultType="java.lang.Integer">
+        select count(id)
+        from custom
+        where company_id = #{companyId}
+        and is_delete = #{isDelete}
+        and incharger_id = #{inchargerId}
+        or incharger_id is null
+        <if test="inchargerId != null and inchargerId != ''  ">
+            and incharger_id =#{inchargerId}
+        </if>
+        <if test="startTime != null and endTime != null ">
+            and create_time BETWEEN #{startTime} and #{endTime}
+        </if>
+        <if test="customName != null and customName != '' ">
+            and custom_name = #{customName}
+        </if>
+        <if test="email != null and email != '' ">
+            and email = #{email}
+        </if>
+        <if test="companyPhone != null ">
+            and company_phone = #{companyPhone}
+        </if>
+        <if test="customerLevelId != null ">
+            and customer_level_id = #{customerLevelId}
+        </if>
+        <if test="customSourceId != null ">
+            and custom_source_id = #{customSourceId}
+        </if>
+        <if test="customerIndustryId != null ">
+            and customer_industry_id = #{customerIndustryId}
+        </if>
+    </select>
 
 </mapper>

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/UploadFileMapper.xml

@@ -0,0 +1,21 @@
+<?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.management.platform.mapper.UploadFileMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.UploadFile">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="path" property="path" />
+        <result column="item_id" property="itemId" />
+        <result column="create_time" property="createTime" />
+        <result column="create_id" property="createId" />
+        <result column="code" property="code" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, name, path, item_id, create_time, create_id, code
+    </sql>
+
+</mapper>