Ver Fonte

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min há 1 ano atrás
pai
commit
78b054d995
34 ficheiros alterados com 963 adições e 168 exclusões
  1. 55 14
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java
  2. 21 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueUploadfileController.java
  3. 73 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/CustomController.java
  4. 10 5
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java
  5. 14 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java
  6. 20 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java
  7. 68 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/ClueUploadfile.java
  8. 20 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java
  9. 7 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Order.java
  10. 4 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskExecutor.java
  11. 4 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskLog.java
  12. 17 6
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/TasKVo.java
  13. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/ClueUploadfileMapper.java
  14. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/OrderMapper.java
  15. 3 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java
  16. 16 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueUploadfileService.java
  17. 12 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/CustomService.java
  18. 2 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/TaskService.java
  19. 63 15
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueServiceImpl.java
  20. 20 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/ClueUploadfileServiceImpl.java
  21. 106 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java
  22. 207 6
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  23. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  24. 65 45
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueMapper.xml
  25. 19 0
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueUploadfileMapper.xml
  26. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml
  27. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/OrderMapper.xml
  28. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskExecutorMapper.xml
  29. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskLogMapper.xml
  30. 15 52
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml
  31. 3 0
      fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue
  32. 68 2
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/TimeType.java
  33. 7 0
      fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java
  34. 12 1
      fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/TimeTypeMapper.xml

+ 55 - 14
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueController.java

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -54,9 +55,13 @@ public class ClueController {
         return msg;
     }
 
+    @RequestMapping("exportData")
+    public Object exportData(Clue clue, HttpServletRequest request) throws Exception {
+        return clueService.exportData(clue,request);
+    }
+
     @RequestMapping("listClue")
     public Object list(Clue clue, HttpServletRequest request) {
-        //TODO token待定
         User user = userMapper.selectById(request.getHeader("Token"));
         clue.setCompanyId(user.getCompanyId());
         clue.setIsDelete(0);
@@ -86,8 +91,7 @@ public class ClueController {
     }
 
     @RequestMapping("listDeleterClue")
-    public Object listDeleterClue(@RequestBody Clue clue, HttpServletRequest request) {
-        //TODO token待定
+    public Object listDeleterClue(Clue clue, HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
         clue.setCompanyId(user.getCompanyId());
         boolean isAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部线索");
@@ -115,11 +119,14 @@ public class ClueController {
     }
 
     @RequestMapping("/insertAndUpdate")
-    public Object inserANdUpdate(@RequestBody Clue clue, HttpServletRequest request) {
+    public Object inserANdUpdate(Clue clue, HttpServletRequest request) {
         HttpRespMsg msg = new HttpRespMsg();
         //操作前校验
-        //TODO token待定
         User user = userMapper.selectById(request.getHeader("Token"));
+        if (user == null){
+            msg.setError("获取创建人失败");
+            return msg;
+        }
         clue.setCompanyId(user.getCompanyId());
         if (null == clue.getClueName() || "".equals(clue.getClueName())) {
             msg.setError("线索名称不能为空");
@@ -144,24 +151,48 @@ public class ClueController {
     }
 
 
+    // 批量放入回收站
     @RequestMapping("delete")
-    public Object delete(@RequestBody List<Integer> ids) {
+    public Object delete(Clue clue) {
         HttpRespMsg msg = new HttpRespMsg();
-        msg.setMsg("操作成功");
-        clueService.isDelete(ids);
+        String ids1 = clue.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            clueService.isDelete(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择线索");
+
+        }
         return msg;
     }
 
+    // 批量恢复
     @RequestMapping("rollback")
-    public Object rollback(@RequestBody List<Integer> ids) {
+    public Object rollback(Clue clue) {
         HttpRespMsg msg = new HttpRespMsg();
         msg.setMsg("操作成功");
-        clueService.isRollback(ids);
+        String ids1 = clue.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            clueService.isRollback(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择线索");
+
+        }
         return msg;
     }
 
+    // 认领&转移线索
     @RequestMapping("claim")
-    public Object claim(@RequestBody Clue clue, HttpServletRequest request) {
+    public Object claim( Clue clue, HttpServletRequest request) {
         User user = userMapper.selectById(request.getHeader("Token"));
         HttpRespMsg msg = new HttpRespMsg();
         msg.setMsg("操作成功");
@@ -169,11 +200,21 @@ public class ClueController {
         return msg;
     }
 
+    //回收站内删除
     @RequestMapping("deleterDelete")
-    public Object deleterDelete(@RequestBody List<Integer> ids) {
+    public Object deleterDelete( Clue clue) {
         HttpRespMsg msg = new HttpRespMsg();
-        msg.setMsg("操作成功");
-        clueService.deleterDelete(ids);
+        String ids1 = clue.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            clueService.deleterDelete(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择线索");
+        }
         return msg;
     }
 

+ 21 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/ClueUploadfileController.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-25
+ */
+@RestController
+@RequestMapping("/clue-uploadfile")
+public class ClueUploadfileController {
+
+}
+

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

@@ -1,10 +1,19 @@
 package com.management.platform.controller;
 
 
+import com.management.platform.entity.Clue;
+import com.management.platform.entity.Custom;
+import com.management.platform.service.CustomService;
+import com.management.platform.util.HttpRespMsg;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * <p>
  *  前端控制器
@@ -17,5 +26,69 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/custom")
 public class CustomController {
 
+    @Autowired
+    private CustomService customService;
+
+
+    @RequestMapping("insertAndUpdate")
+    public HttpRespMsg insertAndUpdate(Custom custom , HttpServletRequest request){
+        return customService.insertAndUpdate(custom,request);
+    }
+    // 批量放入回收站
+    @RequestMapping("deleter")
+    public Object delete(Custom custom) {
+        HttpRespMsg msg = new HttpRespMsg();
+        String ids1 = custom.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            customService.isDelete(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择客户");
+
+        }
+        return msg;
+    }
+    // 批量恢复
+    @RequestMapping("rollback")
+    public Object rollback(Custom custom) {
+        HttpRespMsg msg = new HttpRespMsg();
+        String ids1 = custom.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            customService.isRollback(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择客户");
+
+        }
+        return msg;
+    }
+    //彻底删除
+    @RequestMapping("reallyDelete")
+    public Object reallyDelete(Custom custom) {
+        HttpRespMsg msg = new HttpRespMsg();
+        String ids1 = custom.getIds();
+        List<Integer> ids = new ArrayList<>();
+        if (!ids1.isEmpty()) {
+            for (String id : ids1.split(",")) {
+                ids.add(Integer.parseInt(id));
+            }
+            customService.isReallyDelete(ids);
+            msg.setMsg("操作成功");
+        }else {
+            msg.setError("请选择客户");
+
+        }
+        return msg;
+    }
+
+
 }
 

+ 10 - 5
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java

@@ -53,22 +53,22 @@ public class TaskController {
 
 
     @RequestMapping("addTask")
-    public HttpRespMsg addTask(@RequestBody TaskDto taskDto){
+    public HttpRespMsg addTask(TaskDto taskDto){
         return taskService.addTask(taskDto, request);
     }
 
     @RequestMapping("pageTask")
-    public HttpRespMsg pageTask(@RequestBody TaskDto taskDto){
+    public HttpRespMsg pageTask(TaskDto taskDto){
         return taskService.pageTask(taskDto,request);
     }
 
     @RequestMapping("updateTask")
-    public HttpRespMsg updateTask(@RequestBody TaskDto taskDto){
+    public HttpRespMsg updateTask( TaskDto taskDto){
         return taskService.updateTask(taskDto ,request);
     }
 
     @RequestMapping("deleteTasks")
-    public HttpRespMsg deleteTasks(@RequestBody List<Integer> taskIds){
+    public HttpRespMsg deleteTasks(List<Integer> taskIds){
         return taskService.deleteTasks(taskIds);
     }
 
@@ -78,9 +78,14 @@ public class TaskController {
     }
 
     @RequestMapping("exportData")
-    public HttpRespMsg exportData(@RequestBody TaskDto taskDto) throws Exception {
+    public HttpRespMsg exportData(TaskDto taskDto) throws Exception {
         return taskService.exportData(taskDto,request);
     }
 
+    @RequestMapping("updateTaskStatus")
+    public HttpRespMsg updateTaskStatus(TaskDto taskDto) throws Exception {
+        return taskService.updateTaskStatus(taskDto,request);
+    }
+
 }
 

+ 14 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java

@@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-03-13
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -33,9 +33,7 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
     @TableField("company_id")
     private Integer companyId;
 
-    private Integer productId;
-
-
+    @TableField(exist = false)
     private String productName;
 
     /**
@@ -55,7 +53,13 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("customer_id")
     private Integer customerId;
+    @TableField(exist = false)
     private String customerName;
+    /**
+     * 产品id
+     */
+    @TableField("product_id")
+    private Integer productId;
 
     /**
      * 商机金额
@@ -80,7 +84,9 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("create_time")
     private Date createTime;
+    @TableField(exist = false)
     private Date startTime;
+    @TableField(exist = false)
     private Date endTIme;
     /**
      * 修改时间
@@ -93,12 +99,14 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("creator_id")
     private String creatorId;
+    @TableField(exist = false)
     private String creatorName;
     /**
      * 负责人
      */
     @TableField("incharger_id")
     private String inchargerId;
+    @TableField(exist = false)
     private String inchargerName;
 
     /**
@@ -112,7 +120,9 @@ public class BusinessOpportunity extends Model<BusinessOpportunity> {
      */
     @TableField("is_delete")
     private Integer isDelete;
+    @TableField(exist = false)
     private Integer pageIndex;
+    @TableField(exist = false)
     private Integer pageFrom;
 
     /**

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

@@ -8,7 +8,6 @@ import java.io.Serializable;
 import java.util.Date;
 import java.util.List;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -39,6 +38,8 @@ public class Clue extends Model<Clue> {
     //创建人
     @TableField("create_id")
     private String createId;
+    @TableField(exist = false)
+    private String createName;
 
     /**
      * 线索名称
@@ -46,6 +47,7 @@ public class Clue extends Model<Clue> {
     @TableField("clue_name")
     private String clueName;
 
+    @TableField(exist = false)
     private String companyName;
 
     /**
@@ -53,6 +55,8 @@ public class Clue extends Model<Clue> {
      */
     @TableField("clue_source_id")
     private Integer clueSourceId;
+    @TableField(exist = false)
+    private Integer clueSourceValue;
 
     /**
      * 电话
@@ -70,18 +74,24 @@ public class Clue extends Model<Clue> {
      */
     @TableField("customer_industry_id")
     private Integer customerIndustryId;
+    @TableField(exist = false)
+    private Integer customerIndustryValue;
 
     /**
      * 客户级别
      */
     @TableField("customer_level_id")
     private Integer customerLevelId;
+    @TableField(exist = false)
+    private Integer customerLevelValue;
 
     /**
      * 地址
      */
     @TableField("address")
     private String address;
+    @TableField(exist = false)
+    private String ids;
 
 
     /**
@@ -89,6 +99,8 @@ public class Clue extends Model<Clue> {
      */
     @TableField("incharger_id")
     private String inchargerId;
+    @TableField(exist = false)
+    private String inchargerName;
 
 
 //    private String tempInchargerId;
@@ -140,14 +152,18 @@ public class Clue extends Model<Clue> {
      */
     @TableField("create_time")
     private Date createTime;
+    @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<ClueLog> clueLogList;
+    @TableField(exist = false)
+    private List<ClueUploadfile> clueUploadfileList;
 
 
 

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

@@ -0,0 +1,68 @@
+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 lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-03-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class ClueUploadfile extends Model<ClueUploadfile> {
+
+    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;
+    /**
+     * 上传人
+     */
+    @TableField("create_id")
+    private String createId;
+
+    /**
+     * 线索id
+     */
+    @TableField("clue_id")
+    private Integer clueId;
+
+    /**
+     * 创建时间
+     */
+    @TableField("create_time")
+    private Date createTime;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 20 - 4
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java

@@ -6,6 +6,9 @@ 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;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -16,7 +19,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-02-28
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -36,6 +39,17 @@ public class Custom extends Model<Custom> {
      */
     @TableField("custom_name")
     private String customName;
+    /**
+     * 负责人
+     */
+    @TableField("incharger_id")
+    private String inchargerId;
+
+    /**
+     * 公司电话
+     */
+    @TableField("company_phone")
+    private String companyPhone;
 
     /**
      * 客户来源id
@@ -137,7 +151,7 @@ public class Custom extends Model<Custom> {
      * 创建时间
      */
     @TableField("create_time")
-    private LocalDateTime createTime;
+    private Date createTime;
 
     /**
      * 自定义字段存值
@@ -178,14 +192,16 @@ public class Custom extends Model<Custom> {
     /**
      * 描述
      */
-    @TableField("desc")
-    private String desc;
+    @TableField("custom_desc")
+    private String customDesc;
 
     /**
      * 回收站(是否删除) 0-否 1-是
      */
     @TableField("is_delete")
     private Integer isDelete;
+    @TableField(exist = false)
+    private String ids;
 
 
     @Override

+ 7 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Order.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-02-28
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -98,6 +98,12 @@ public class Order extends Model<Order> {
     @TableField("creator_id")
     private String creatorId;
 
+    /**
+     * 回收站(是否删除) 0-否 1-是
+     */
+    @TableField("is_delete")
+    private Integer isDelete;
+
     /**
      * 自定义字段存值
      */

+ 4 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskExecutor.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-03-08
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -27,6 +27,9 @@ public class TaskExecutor extends Model<TaskExecutor> {
     @TableId(value = "task_executor_id", type = IdType.AUTO)
     private Integer taskExecutorId;
 
+    @TableField("company_id")
+    private Integer companyId;
+
     @TableField("task_id")
     private Integer taskId;
 

+ 4 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskLog.java

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2021-05-04
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -28,6 +28,9 @@ public class TaskLog extends Model<TaskLog> {
     @TableId(value = "id", type = IdType.AUTO)
     private Integer id;
 
+    @TableField("company_id")
+    private Integer companyId;
+
     /**
      * 任务id
      */

+ 17 - 6
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/TasKVo.java

@@ -7,17 +7,28 @@ import lombok.experimental.Accessors;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 @EqualsAndHashCode(callSuper = true)
 @Data
 @Accessors(chain = true)
 public class TasKVo extends Task {
-    private Custom custom;
-    private BusinessOpportunity businessOpportunity;
-    private Order order;
-    private Clue clue;
-    private Contacts contacts;
-    private List<TaskExecutor> taskExecutors;
+//    private Custom custom;
+//    private BusinessOpportunity businessOpportunity;
+//    private Order order;
+//    private Clue clue;
+//    private Contacts contacts;
+//    private List<TaskExecutor> taskExecutors;
     private List<TaskLog> taskLogs;
 
+    private String customName;
+    private String businessName;
+    private String orderName;
+    private String clueName;
+    private String contactsName;
+    private String contactsPhone;
+
+    private List taskExecutors;
+
+
 }

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

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

+ 6 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/OrderMapper.java

@@ -2,6 +2,10 @@ package com.management.platform.mapper;
 
 import com.management.platform.entity.Order;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.management.platform.entity.User;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface OrderMapper extends BaseMapper<Order> {
 
+    @Select("select * from `order` WHERE company_id = #{companyId} AND is_delete = 0 ")
+    List<Order> getList(User user);
 }

+ 3 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/ClueService.java

@@ -3,6 +3,7 @@ package com.management.platform.service;
 import com.management.platform.entity.Clue;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.management.platform.entity.User;
+import com.management.platform.util.HttpRespMsg;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
@@ -40,4 +41,6 @@ public interface ClueService extends IService<Clue> {
 
     int getTotal1(Clue clue, User user);
     int getTotal2(Clue clue, User user);
+
+    HttpRespMsg exportData(Clue clue, HttpServletRequest request) throws Exception;
 }

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

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

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

@@ -2,6 +2,10 @@ package com.management.platform.service;
 
 import com.management.platform.entity.Custom;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.management.platform.util.HttpRespMsg;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface CustomService extends IService<Custom> {
 
+    HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request);
+
+
+    void isDelete(List<Integer> ids);
+
+    void isRollback(List<Integer> ids);
+
+    void isReallyDelete(List<Integer> ids);
 }

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/TaskService.java

@@ -33,4 +33,6 @@ public interface TaskService extends IService<Task> {
     HttpRespMsg importData(MultipartFile multipartFile, HttpServletRequest request);
 
     HttpRespMsg exportData(TaskDto taskDto, HttpServletRequest request) throws Exception;
+
+    HttpRespMsg updateTaskStatus(TaskDto taskDto, HttpServletRequest request);
 }

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

@@ -1,24 +1,34 @@
 package com.management.platform.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.ClueLog;
-import com.management.platform.entity.User;
-import com.management.platform.mapper.ClueLogMapper;
-import com.management.platform.mapper.ClueMapper;
+import com.management.platform.entity.*;
+import com.management.platform.entity.vo.TasKVo;
+import com.management.platform.mapper.*;
 import com.management.platform.service.ClueService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.SysFunctionService;
 import com.management.platform.service.UserService;
+import com.management.platform.service.WxCorpInfoService;
+import com.management.platform.util.HttpRespMsg;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.beans.Transient;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.StringJoiner;
 
 /**
  * <p>
@@ -36,9 +46,20 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     @Autowired
     private ClueMapper clueMapper;
     @Autowired
+    private ClueUploadfileMapper clueUploadfileMapper;
+    @Resource
+    private WxCorpInfoService wxCorpInfoService;
+    @Autowired
     private ClueLogMapper clueLogMapper;
     @Autowired
+    private SysFormMapper SysFormMapper;
+    @Autowired
+    private UserMapper userMapper;
+    @Autowired
     private UserService userService;
+    @Resource
+    private ExcelExportServiceImpl excelExportService;
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -130,10 +151,11 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     @Override
     public Clue getInfo(Clue clue) {
         Clue clue1 = clueMapper.selectById(clue.getId());
-        QueryWrapper<ClueLog> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("clue_id", clue.getId());
-        List<ClueLog> logs = clueLogMapper.selectList(queryWrapper);
-        clue1.setClueLogList(logs);
+        clue1.setClueLogList(clueLogMapper.selectList(
+                new QueryWrapper<ClueLog>().eq("clue_id", clue.getId())
+        ));
+        clue1.setClueUploadfileList(clueUploadfileMapper.selectList(
+                    new QueryWrapper<ClueUploadfile>().eq("clue_id", clue.getId())));
         return clue1;
     }
 
@@ -154,20 +176,20 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
     }
 
     @Override
-    public void getAndTransfer(Clue clue,User user) {
+    public void getAndTransfer(Clue clue, User user) {
         UpdateWrapper<Clue> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("id",clue.getId());
+        updateWrapper.eq("id", clue.getId());
         String inchargerId = clue.getInchargerId();
         ClueLog clueLog = new ClueLog();
         clueLog.setUserId(user.getId());
         clueLog.setClueId(clue.getId());
         clueLog.setCreatTime(new Date());
-        if (inchargerId == null ){
+        if (inchargerId == null) {
             //认领
             clueLog.setName("认领了线索");
             clue.setInchargerId(user.getId());
             clueLogMapper.insert(clueLog);
-        }else {
+        } else {
             //转移
             clueLog.setName("转移了线索");
             clue.setInchargerId(clue.getInchargerId());
@@ -179,13 +201,39 @@ public class ClueServiceImpl extends ServiceImpl<ClueMapper, Clue> implements Cl
 
     @Override
     public int getTotal1(Clue clue, User user) {
-        return clueMapper.getTotal1(clue,user.getId());
+        return clueMapper.getTotal1(clue, user.getId());
     }
 
     @Override
     public int getTotal2(Clue clue, User user) {
-        return clueMapper.getTotal2(clue,user.getId());
+        return clueMapper.getTotal2(clue, user.getId());
+
+    }
+
+    @Value(value = "${upload.path}")
+    private String path;
+
+    @Override
+    public HttpRespMsg exportData(Clue clue, HttpServletRequest request) throws Exception {
+        User user = userMapper.selectById(request.getHeader("token"));
+        SysForm sysForm = SysFormMapper.selectOne(new LambdaQueryWrapper<SysForm>().eq(SysForm::getCompanyId, user.getCompanyId()).eq(SysForm::getCode, "Clue").eq(SysForm::getIsCurrent, 1));
+        WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new LambdaQueryWrapper<WxCorpInfo>().eq(WxCorpInfo::getCompanyId, user.getCompanyId()));
+        String config = sysForm.getConfig();
+        JSONObject configOb = JSON.parseObject(config);
+        JSONArray configObJSONArray = configOb.getJSONArray("list");
+        List<List<String>> dataList = new ArrayList<>();
+        List<String> titleList = new ArrayList<>();
+        for (int i = 0; i < configObJSONArray.size(); i++) {
+            JSONObject item = configObJSONArray.getJSONObject(i);
+            titleList.add(item.getString("label"));
+        }
+        dataList.add(titleList);//设置表头
+
+
+        clue.setCompanyId(user.getCompanyId());
 
+        String fileName = "线索表导出_" + System.currentTimeMillis();
+        return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo, fileName, dataList, path);
     }
 
 

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

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

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

@@ -1,14 +1,26 @@
 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.mapper.CustomMapper;
+import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.CustomService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+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.Date;
+import java.util.List;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author Seyason
@@ -16,5 +28,98 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> implements CustomService {
+    @Autowired
+    private UserMapper userMapper;
+    @Autowired
+    private CustomMapper customMapper;
+
+    @Override
+    public HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request) {
+        HttpRespMsg msg = new HttpRespMsg();
+        if (custom.getCustomName().isEmpty()) {
+            msg.setError("请填写客户名称");
+            return msg;
+        }
+        User user = userMapper.selectById(request.getHeader("Token"));
+        custom.setCompanyId(user.getCompanyId());
+        setNull(custom);
+        if (custom.getId() != null) {
+            Custom custom1 = customMapper.selectById(custom.getId());
+            if (customMapper.selectCount(new QueryWrapper<Custom>()
+                    .eq("custom_name", custom.getCustomName())
+                    .ne("custom_name", custom1.getCustomName())) > 0) {
+                msg.setError("客户名称重复了");
+                return msg;
+            }
+            if (customMapper.selectCount(new QueryWrapper<Custom>()
+                    .eq("tel_phone", custom.getTelPhone())
+                    .ne("tel_phone", custom1.getTelPhone())
+            ) > 0) {
+                msg.setError("电话号码重复了");
+                return msg;
+            }
+            customMapper.updateById(custom);
+        } else {
+            if (customMapper.selectCount(new QueryWrapper<Custom>().eq("custom_name", custom.getCustomName())) > 0) {
+                msg.setError("客户名称重复了");
+                return msg;
+            }
+            if (customMapper.selectCount(new QueryWrapper<Custom>().eq("tel_phone", custom.getTelPhone())) > 0) {
+                msg.setError("电话号码重复了");
+                return msg;
+            }
+            custom.setCreateTime(new Date());
+            custom.setCreatorId(user.getId());
+            customMapper.insert(custom);
+        }
+        msg.setMsg("操作成功");
+        return msg;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void isDelete(List<Integer> ids) {
+        UpdateWrapper<Custom> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", ids);
+        Custom custom = new Custom();
+        custom.setIsDelete(1);
+        customMapper.update(custom, updateWrapper);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void isRollback(List<Integer> ids) {
+        UpdateWrapper<Custom> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", ids);
+        Custom custom = new Custom();
+        custom.setIsDelete(0);
+        customMapper.update(custom, updateWrapper);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void isReallyDelete(List<Integer> ids) {
+        customMapper.deleteBatchIds(ids);
+    }
+
+
+    private Custom setNull(Custom clue) {
+        if (clue.getPlate1() == "") {
+            clue.setPlate1(null);
+        }
+        if (clue.getPlate2() == "") {
+            clue.setPlate2(null);
+        }
+        if (clue.getPlate3() == "") {
+            clue.setPlate3(null);
+        }
+        if (clue.getPlate4() == "") {
+            clue.setPlate4(null);
+        }
+        if (clue.getPlate5() == "") {
+            clue.setPlate5(null);
+        }
+        return clue;
+    }
 
 }

+ 207 - 6
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -42,6 +42,7 @@ import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * <p>
@@ -85,9 +86,25 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     @Resource
     private TaskLogService taskLogService;
 
+    @Resource
+    private CustomMapper customMapper;
+
+    @Resource
+    private BusinessOpportunityMapper businessOpportunityMapper;
+
+    @Resource
+    private OrderMapper orderMapper;
+
+    @Resource
+    private ClueMapper clueMapper;
+
+    @Resource
+    private ContactsMapper contactsMapper;
+
+
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg addTask(TaskDto taskDto, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
 
@@ -134,7 +151,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 User selectedUser = userMapper.selectById(executorId);
                 taskExecutor.setExecutorId(executorId)
                         .setTaskId(task.getId())
-                        .setExecutorName(selectedUser.getName());
+                        .setExecutorName(selectedUser.getName())
+                        .setCompanyId(user.getCompanyId());
                 taskExecutorMapper.insert(taskExecutor);
             }
         }
@@ -146,6 +164,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         taskLog.setUserId(userId);
         taskLog.setUserName(user.getName());
         taskLog.setModTime(LocalDateTime.now());
+        taskLog.setCompanyId(user.getCompanyId());
         taskLogMapper.insert(taskLog);
 
 
@@ -158,7 +177,33 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         String token = String.valueOf(request.getHeader("Token"));
         User user = userMapper.selectById(token);
         taskDto.setCompanyId(user.getCompanyId());
+        List<TaskExecutor> taskExecutorList = taskExecutorMapper.selectList(new LambdaQueryWrapper<TaskExecutor>().eq(TaskExecutor::getCompanyId,user.getCompanyId()));
+        List<TaskLog> taskLogList = taskLogMapper.selectList(new LambdaQueryWrapper<TaskLog>().eq(TaskLog::getCompanyId,user.getCompanyId()));
         List<TasKVo> taskVoList =taskMapper.getPageListTask(taskDto);
+        for (TasKVo tasKVo : taskVoList) {
+            System.out.println(tasKVo.getStartDate());
+            System.out.println(tasKVo.getEndDate());
+            System.out.println(tasKVo.getCreateDate());
+            if (!taskExecutorList.isEmpty()){
+                List<TaskExecutor> collect = taskExecutorList.stream().
+                        filter(taskExecutor -> taskExecutor.getTaskId().equals(tasKVo.getId())).
+                        filter(taskExecutor -> taskExecutor.getCompanyId().equals(user.getCompanyId()))
+                        .collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    List<String> collect1 = collect.stream().map(TaskExecutor::getExecutorId).collect(Collectors.toList());
+                    ArrayList<String> taskExecutorIds = new ArrayList<>(collect1);
+                    tasKVo.setTaskExecutors(taskExecutorIds);
+                }
+            }
+            if (!taskLogList.isEmpty()){
+                List<TaskLog> collect = taskLogList.stream().filter(taskLog -> taskLog.getTaskId().equals(tasKVo.getId()))
+                        .filter(taskLog -> taskLog.getCompanyId().equals(user.getCompanyId())).collect(Collectors.toList());
+                if (!collect.isEmpty()){
+                    tasKVo.setTaskLogs(collect);
+                }
+            }
+
+        }
         if (!taskVoList.isEmpty()){
             taskVoList.forEach(tasKVo -> {
                 if (!tasKVo.getTaskExecutors().isEmpty()){
@@ -180,7 +225,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg updateTask(TaskDto taskDto, HttpServletRequest request) {
         HttpRespMsg msg=new HttpRespMsg();
         String token = String.valueOf(request.getHeader("Token"));
@@ -234,7 +279,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
     }
 
     @Override
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public HttpRespMsg deleteTasks(List<Integer> taskIds) {
         HttpRespMsg msg = new HttpRespMsg();
         List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().in("id", taskIds));
@@ -296,6 +341,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
             List<String> userNameList=new ArrayList<>();
             HttpRespMsg respMsg=new HttpRespMsg();
 
+            List<Contacts> contactsList = contactsMapper.selectList(new LambdaQueryWrapper<Contacts>().eq(Contacts::getIsDelete,0).eq(Contacts::getCompanyId, user.getCompanyId()));
+            List<Custom> customList=customMapper.selectList(new LambdaQueryWrapper<Custom>().eq(Custom::getCompanyId, user.getCompanyId()).eq(Custom::getIsDelete,0));
+            List<BusinessOpportunity> opportunityList = businessOpportunityMapper.selectList(new LambdaQueryWrapper<BusinessOpportunity>()
+                    .eq(BusinessOpportunity::getCompanyId, user.getCompanyId()).eq(BusinessOpportunity::getIsDelete, 0));
+            List<Order> orderList = orderMapper.getList(user);
+             List<Clue> clueList = clueMapper.selectList(new LambdaQueryWrapper<Clue>().eq(Clue::getCompanyId, user.getCompanyId()).eq(Clue::getIsDelete, 0).orderByDesc(Clue::getCreateTime));
             for (int rowIndex = 1; rowIndex <= rowNum; rowIndex++) {
                 HSSFRow row = sheet.getRow(rowIndex);
                 if (row == null) {
@@ -405,7 +456,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         }
                     }*/
                     if(modelName.equals("executorId")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
 
                             List<String> executorNames = new ArrayList<>();
                             String stringCellValue = cell.getStringCellValue();
@@ -451,7 +502,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         }
                     }
                     if(modelName.equals("priority")){
-                        if(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
                             switch (cell.getStringCellValue()){
                                 case "低":task.setPriority(0);
                                     break;
@@ -481,11 +532,141 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         }
                     }
 
+                    if(modelName.equals("contactsId")){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
+                            String contactsName = cell.getStringCellValue();
+                            List<Contacts> collect = contactsList.stream().filter(contacts -> contacts.getName().equals(contactsName)).collect(Collectors.toList());
+                            if (collect.size()>1){
+                                throw new Exception("["+contactsName+"]对应的联系人存在多个");
+                            }else if (collect.size()==1) {
+                                Contacts contacts = collect.get(0);
+                                task.setContactsId(contacts.getId());
+                            }else {
+                                throw new Exception("["+contactsName+"]对应的联系人不存在");
+                            }
+                        }
+                    }
+
+                    if(modelName.equals("customId")){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
+                            String customName = cell.getStringCellValue();
+                            List<Custom> customs = customList.stream().filter(custom -> customName.equals(custom.getCustomName())).collect(Collectors.toList());
+                            if (customs.size()>1){
+                                throw new Exception("["+customName+"]对应的客户存在多个");
+                            }else if (customs.size()==1){
+                                Custom custom = customs.get(0);
+                                if (task.getContactsId()!=null){
+                                    boolean isExist = contactsList.stream().anyMatch(contacts -> custom.getId().equals(contacts.getCustomId())&&contacts.getId().equals(task.getContactsId()));
+                                    if(!isExist){
+                                        throw new Exception("["+customName+"]对应的客户没有对应填写的联系人");
+                                    }
+                                    else {
+                                        task.setCustomId(custom.getId());
+                                    }
+                                }else {
+                                    task.setCustomId(custom.getId());
+                                }
+                            }else {
+                                throw new Exception("["+customName+"]对应的客户不存在");
+                            }
+                        }
+                    }
+                    if (modelName.equals("businessOpportunityId")){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
+                            String businessName = cell.getStringCellValue();
+                            List<BusinessOpportunity> collect = opportunityList.stream().filter(o -> businessName.equals(o.getName())).collect(Collectors.toList());
+                            if (collect.size()>1){
+                                throw new Exception("["+businessName+"]对应的商机存在多个");
+                            }else if (collect.size()==1) {
+                                BusinessOpportunity businessOpportunity = collect.get(0);
+                                if (task.getContactsId()!=null){
+                                    if (!businessOpportunity.getContactsId().equals(task.getContactsId())){
+                                        throw new Exception("["+businessName+"]对应的商机没有对应填写的联系人");
+                                    }else {
+                                        task.setBusinessOpportunityId(businessOpportunity.getId());
+                                    }
+                                }
+                            }else {
+                                throw new Exception("["+businessName+"]对应的商机不存在");
+                            }
+
+                        }
+                    }
+                    if (modelName.equals("orderId")){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
+                            String orderName = cell.getStringCellValue();
+                            List<Order> collect = orderList.stream().filter(order -> orderName.equals(order.getOrderName())).collect(Collectors.toList());
+                            if (collect.size()>1){
+                                throw new Exception("["+orderName+"]对应的销售订单存在多个");
+                            }else if (collect.size()==1) {
+                                Order order=collect.get(0);
+                                if (task.getContactsId()!=null){
+                                    if (!order.getContactsId().equals(task.getContactsId())){
+                                        throw new Exception("["+orderName+"]对应的销售订单没有对应填写的联系人");
+                                    }
+                                    else {
+                                        task.setOrderId(order.getId());
+                                    }
+                                }
+                            }else {
+                                throw new Exception("["+orderName+"]对应的销售订单不存在");
+                            }
+                        }
+                    }
+
+                    if (modelName.equals("clueId")) {
+                        if (cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())) {
+                            String clueName = cell.getStringCellValue();
+                            if (task.getContactsId()!=null){
+                                throw new Exception("["+clueName+"]对应的线索不存在联系人");
+                            }
+                            List<Clue> collect = clueList.stream().filter(clue -> clueName.equals(clue.getClueName())).collect(Collectors.toList());
+                            if (!collect.isEmpty()) {
+                                Clue clue = collect.get(0);
+                                task.setClueId(clue.getId());
+                            }else {
+                                throw new Exception("["+clueName+"]对应的线索不存在");
+                            }
+                        }
+                    }
+
+                    if (modelName.equals("phone")) {
+                        if (cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())) {
+                            String contactsPhone = cell.getStringCellValue();
+                            List<Contacts> collect = contactsList.stream().filter(contacts -> contactsPhone.equals(contacts.getPhone())).collect(Collectors.toList());
+                            if (collect.size()>1){
+                                throw new Exception("联系人号码"+"["+contactsPhone+"]对应的联系人存在多个");
+                            } else if (collect.size() == 1) {
+                                Contacts contacts = collect.get(0);
+                                if (task.getContactsId()!=null){
+                                    if (!contacts.getId().equals(task.getContactsId())){
+                                        throw new Exception("联系人号码"+"["+contactsPhone+"]与联系人不绑定");
+                                    }
+                                }else {
+                                    task.setContactsId(contacts.getId());
+                                }
+                            }
+
+                        }
+                    }
                 }
                 importTaskList.add(task);
             }
 
             if(importTaskList.size()>0){
+                for (Task task : importTaskList) {
+                    if (task.getClueId()!=null &&(task.getCustomId()!=null||task.getBusinessOpportunityId()!=null||task.getOrderId()!=null||task.getContactsId()!=null)){
+                        msg.setError("任务:"+task.getTaskName()+"中线索不应与客户/商机/销售订单/联系人一同存在");
+                        return msg;
+                    }
+                    if ((task.getCustomId()!=null&&task.getBusinessOpportunityId()!=null)
+                            ||(task.getCustomId()!=null&&task.getOrderId()!=null)
+                            ||(task.getOrderId()!=null&&task.getBusinessOpportunityId()!=null)
+                            ||(task.getCustomId()!=null&&task.getBusinessOpportunityId()!=null&&task.getOrderId()!=null)){
+                        msg.setError("任务:"+task.getTaskName()+"中客户/商机/销售订单不应一同存在");
+                        return msg;
+                    }
+                }
                 if(saveOrUpdateBatch(importTaskList)){
                     ArrayList<TaskExecutor> taskExecutors = new ArrayList<>();
                     ArrayList<TaskLog> taskLogs = new ArrayList<>();
@@ -499,6 +680,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                                 taskExecutor.setTaskId(task.getId());
                                 taskExecutor.setExecutorId(userList.stream().filter(u -> u.getId().equals(userId)).collect(Collectors.toList()).get(0).getId());
                                 taskExecutor.setExecutorName(userList.stream().filter(u -> u.getId().equals(userId)).collect(Collectors.toList()).get(0).getName());
+                                taskExecutor.setCompanyId(user.getCompanyId());
                                 taskExecutors.add(taskExecutor);
                             }
                         }
@@ -508,6 +690,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                         taskLog.setModTime(LocalDateTime.now());
                         taskLog.setUserName(user.getName());
                         taskLog.setUserId(user.getId());
+                        taskLog.setCompanyId(user.getCompanyId());
                         taskLogs.add(taskLog);
                     }
                     boolean b1 = taskExecutorService.saveOrUpdateBatch(taskExecutors);
@@ -620,6 +803,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         return excelExportService.exportGeneralExcelByTitleAndList(wxCorpInfo,fileName,dataList,path);
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public HttpRespMsg updateTaskStatus(TaskDto taskDto, HttpServletRequest request) {
+        User user = userMapper.selectById(request.getHeader("token"));
+        HttpRespMsg msg = new HttpRespMsg();
+        if (taskDto==null||taskDto.getId()==null){
+            msg.setError("缺少用户的关键信息");
+        }
+        LambdaUpdateWrapper<Task> luw = new LambdaUpdateWrapper<>();
+        luw.set(Task::getStatus,taskDto.getStatus()).eq(Task::getId,taskDto.getStatus());
+        taskMapper.update(null,luw);
+        TaskLog taskLog = new TaskLog();
+        taskLog.setUserId(user.getId()).setTaskId(taskDto.getId()).setUserName(user.getName())
+                .setContent("修改任务状态").setModTime(LocalDateTime.now());
+        taskLogMapper.insert(taskLog);
+        return msg;
+    }
+
     public void updateTaskRepeatConfigure(Task task){
         task.setRepeatType(null).setRepeatEndNever(null).setRepeatEndCount(null)
                 .setRepeatEndDate(null).setRepeatDesignDay(null).setRepeatDesignSameday(null);

+ 2 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -9,6 +9,7 @@
         <result column="name" property="name" />
         <result column="contacts_id" property="contactsId" />
         <result column="customer_id" property="customerId" />
+        <result column="product_id" property="productId" />
         <result column="amount_of_money" property="amountOfMoney" />
         <result column="expected_transaction_date" property="expectedTransactionDate" />
         <result column="stage" property="stage" />
@@ -27,7 +28,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, name, contacts_id, customer_id, amount_of_money, expected_transaction_date, stage, create_time, edit_time, creator_id, incharger_id, remark, is_delete, plate1, plate2, plate3, plate4, plate5
+        id, company_id, name, contacts_id, customer_id, product_id, amount_of_money, expected_transaction_date, stage, create_time, edit_time, creator_id, incharger_id, remark, is_delete, plate1, plate2, plate3, plate4, plate5
     </sql>
 
 </mapper>

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

@@ -33,7 +33,6 @@
     <select id="list" resultType="com.management.platform.entity.Clue">
         select c.id,
                c.company_id,
-               (select company_name from company where company_id = c.id) companyName,
                c.clue_name,
                c.clue_source_id,
                c.phone,
@@ -50,11 +49,17 @@
                c.plate4,
                c.plate5,
                c.create_time,
-               c.create_id
+               c.create_id,
+               (select company_name from company where c.company_id = id) companyName,
+               (select name from `user` where id = c.incharger_id) inchargerName,
+               (select name from `user` where id = c.create_id) createName,
+               (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
         where
             c.company_id = #{companyId} and is_delete = #{isDelete}
-        <if test="inchargerId != null  ">
+        <if test="inchargerId != null and inchargerId != ''  ">
            and c.incharger_id =#{inchargerId}
         </if>
         <if test="startTime != null and endTime != null ">
@@ -100,14 +105,19 @@
         c.plate4,
         c.plate5,
         c.create_time,
-        c.create_id
+        c.create_id,
+        (select name from `user` where id = c.incharger_id) inchargerName,
+        (select name from `user` where id = c.create_id) createName,
+        (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
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         and c.incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or c.incharger_id is null
-        <if test="inchargerId != null  ">
+        <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
           and  c.incharger_id =#{inchargerId}
         </if>
         <if test="clue.startTime != null and clue.endTime != null ">
@@ -119,14 +129,14 @@
         <if test="clue.clueSourceId != null">
             and  c.clue_source_id =  #{clue.clueSourceId}
         </if>
-        <if test="phone != null and phone != '' ">
-            and  c.phone =  #{phone}
+        <if test="clue.phone != null and clue.phone != '' ">
+            and  c.phone =  #{clue.phone}
         </if>
-        <if test="customerLevelId != null and customerLevelId != '' ">
-            and  c.customer_level_id =  #{customerLevelId}
+        <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
+            and  c.customer_level_id =  #{clue.customerLevelId}
         </if>
         <if test="email != null and email != '' ">
-            and  c.email =  #{email}
+            and  c.email =  #{clue.email}
         </if>
         <if test="clue.customerIndustryId != null">
             and  c.customer_industry_id =  #{clue.customerIndustryId}
@@ -153,13 +163,18 @@
         c.plate4,
         c.plate5,
         c.create_time,
-        c.create_id
+        c.create_id,
+        (select name from `user` where id = c.incharger_id) inchargerName,
+        (select name from `user` where id = c.create_id) createName,
+        (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
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
         and c.incharger_id = #{userId} or c.incharger_id is null
-        <if test="inchargerId != null  ">
-          and  c.incharger_id =#{inchargerId}
+        <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
+          and c.incharger_id =#{clue.inchargerId}
         </if>
         <if test="clue.startTime != null and clue.endTime != null ">
             and  c.create_time BETWEEN  #{clue.startTime} and #{clue.endTime}
@@ -167,14 +182,14 @@
         <if test="clue.clueName != null and clue.clueName != '' ">
             and  c.clue_name =  #{clue.clueName}
         </if>
-        <if test="phone != null and phone != '' ">
-            and  c.phone =  #{phone}
+        <if test="clue.phone != null and clue.phone != '' ">
+            and  c.phone =  #{clue.phone}
         </if>
-        <if test="customerLevelId != null and customerLevelId != '' ">
-            and  c.customer_level_id =  #{customerLevelId}
+        <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
+            and  c.customer_level_id =  #{clue.customerLevelId}
         </if>
-        <if test="email != null and email != '' ">
-            and  c.email =  #{email}
+        <if test="clue.email != null and clue.email != '' ">
+            and  c.email =  #{clue.email}
         </if>
         <if test="clue.clueSourceId != null">
             and  c.clue_source_id =  #{clue.clueSourceId}
@@ -204,7 +219,12 @@
                c.plate4,
                c.plate5,
                c.create_time,
-               c.create_id
+               c.create_id,
+        (select name from `user` where id = c.incharger_id) inchargerName,
+        (select name from `user` where id = c.create_id) createName,
+        (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
         where
             c.company_id = #{companyId} and is_delete = 1
@@ -214,7 +234,7 @@
         <if test="clueName != null and clueName != '' ">
         and  c.clue_name =  #{clueName}
         </if>
-        <if test="inchargerId != null  ">
+        <if test="inchargerId != null and inchargerId != ''  ">
            and c.incharger_id =#{inchargerId}
         </if>
         <if test="clueSourceId != null">
@@ -230,20 +250,20 @@
         from Clue c
         where
         c.company_id = #{companyId} and is_delete = #{isDelete}
-        <if test="startTime != null and endTime != null ">
+        <if test="clue.startTime != null and clue.endTime != null ">
             and  c.create_time BETWEEN  #{startTime} and #{endTime}
         </if>
-        <if test="inchargerId != null  ">
+        <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
            and c.incharger_id =#{inchargerId}
         </if>
-        <if test="clueName != null and clueName != '' ">
+        <if test="clue.clueName != null and clue.clueName != '' ">
             and  c.clue_name =  #{clueName}
         </if>
-        <if test="clueSourceId != null">
-            and  c.clue_source_id =  #{clueSourceId}
+        <if test="clue.clueSourceId != null">
+            and  c.clue_source_id =  #{clue.clueSourceId}
         </if>
-        <if test="customerIndustryId != null">
-            and  c.customer_industry_id =  #{customerIndustryId}
+        <if test="clue.customerIndustryId != null">
+            and  c.customer_industry_id =  #{clue.customerIndustryId}
         </if>
     </select>
     <select id="getDeleterTotal" resultType="java.lang.Integer">
@@ -251,7 +271,7 @@
         from Clue c
         where
         c.company_id = #{companyId} and is_delete = 1
-        <if test="inchargerId != null  ">
+        <if test="inchargerId != null and inchargerId != ''  ">
           and  c.incharger_id =#{inchargerId}
         </if>
         <if test="startTime != null and endTime != null ">
@@ -276,8 +296,8 @@
         and c.incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERe id = #{userId}))
         or c.incharger_id is null
-        <if test="inchargerId != null  ">
-           and c.incharger_id =#{inchargerId}
+        <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
+           and c.incharger_id =#{clue.inchargerId}
         </if>
         <if test="clue.startTime != null and clue.endTime != null ">
             and  c.create_time BETWEEN  #{clue.startTime} and #{clue.endTime}
@@ -285,14 +305,14 @@
         <if test="clue.clueName != null and clue.clueName != '' ">
             and  c.clue_name =  #{clue.clueName}
         </if>
-        <if test="phone != null and phone != '' ">
-            and  c.phone =  #{phone}
+        <if test="clue.phone != null and clue.phone != '' ">
+            and  c.phone =  #{clue.phone}
         </if>
-        <if test="customerLevelId != null and customerLevelId != '' ">
-            and  c.customer_level_id =  #{customerLevelId}
+        <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
+            and  c.customer_level_id =  #{clue.customerLevelId}
         </if>
-        <if test="email != null and email != '' ">
-            and  c.email =  #{email}
+        <if test="clue.email != null and clue.email != '' ">
+            and  c.email =  #{clue.email}
         </if>
         <if test="clue.clueSourceId != null">
             and  c.clue_source_id =  #{clue.clueSourceId}
@@ -307,8 +327,8 @@
         from Clue c
         where
         c.company_id = #{clue.companyId} and is_delete = #{clue.isDelete}
-        <if test="inchargerId != null  ">
-          and  c.incharger_id =#{inchargerId}
+        <if test="clue.inchargerId != null and clue.inchargerId != ''  ">
+          and  c.incharger_id =#{clue.inchargerId}
         </if>
         and c.incharger_id = #{userId} or c.incharger_id is null
         <if test="clue.startTime != null and clue.endTime != null ">
@@ -317,14 +337,14 @@
         <if test="clue.clueName != null and clue.clueName != '' ">
             and c.clue_name = #{clue.clueName}
         </if>
-        <if test="phone != null and phone != '' ">
-            and  c.phone =  #{phone}
+        <if test="clue.phone != null and clue.phone != '' ">
+            and  c.phone =  #{clue.phone}
         </if>
-        <if test="customerLevelId != null and customerLevelId != '' ">
-            and  c.customer_level_id =  #{customerLevelId}
+        <if test="clue.customerLevelId != null and clue.customerLevelId != '' ">
+            and  c.customer_level_id =  #{clue.customerLevelId}
         </if>
-        <if test="email != null and email != '' ">
-            and  c.email =  #{email}
+        <if test="clue.email != null and clue.email != '' ">
+            and  c.email =  #{clue.email}
         </if>
         <if test="clue.clueSourceId != null">
             and c.clue_source_id = #{clue.clueSourceId}

+ 19 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/ClueUploadfileMapper.xml

@@ -0,0 +1,19 @@
+<?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.ClueUploadfileMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.ClueUploadfile">
+        <id column="id" property="id" />
+        <result column="name" property="name" />
+        <result column="path" property="path" />
+        <result column="clue_id" property="clueId" />
+        <result column="create_time" property="createTime" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, name, path, clue_id, create_time
+    </sql>
+
+</mapper>

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

@@ -30,13 +30,13 @@
         <result column="plate4" property="plate4" />
         <result column="plate5" property="plate5" />
         <result column="creator_id" property="creatorId" />
-        <result column="desc" property="desc" />
+        <result column="custom_desc" property="customDesc" />
         <result column="is_delete" property="isDelete" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <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, desc, is_delete
+        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>
 
 </mapper>

+ 2 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/OrderMapper.xml

@@ -18,6 +18,7 @@
         <result column="incharger_id" property="inchargerId" />
         <result column="create_time" property="createTime" />
         <result column="creator_id" property="creatorId" />
+        <result column="is_delete" property="isDelete" />
         <result column="plate1" property="plate1" />
         <result column="plate2" property="plate2" />
         <result column="plate3" property="plate3" />
@@ -27,7 +28,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, company_id, order_name, order_code, custom_id, business_opportunity_id, price, contacts_id, type, received_payment, un_received_payment, incharger_id, create_time, creator_id, plate1, plate2, plate3, plate4, plate5
+        id, company_id, order_name, order_code, custom_id, business_opportunity_id, price, contacts_id, type, received_payment, un_received_payment, incharger_id, create_time, creator_id, is_delete, plate1, plate2, plate3, plate4, plate5
     </sql>
 
 </mapper>

+ 2 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskExecutorMapper.xml

@@ -5,6 +5,7 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.TaskExecutor">
         <id column="task_executor_id" property="taskExecutorId" />
+        <result column="company_id" property="companyId" />
         <result column="task_id" property="taskId" />
         <result column="executor_id" property="executorId" />
         <result column="executor_name" property="executorName" />
@@ -16,7 +17,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        task_executor_id, task_id, executor_id, executor_name, executor_color, plan_hours, project_id, service_id
+        task_executor_id, company_id, task_id, executor_id, executor_name, executor_color, plan_hours, project_id, service_id
     </sql>
 
 </mapper>

+ 2 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskLogMapper.xml

@@ -5,6 +5,7 @@
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.management.platform.entity.TaskLog">
         <id column="id" property="id" />
+        <result column="company_id" property="companyId" />
         <result column="task_id" property="taskId" />
         <result column="mod_time" property="modTime" />
         <result column="user_id" property="userId" />
@@ -14,7 +15,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, task_id, mod_time, user_id, user_name, content
+        id, company_id, task_id, mod_time, user_id, user_name, content
     </sql>
 
 </mapper>

+ 15 - 52
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

@@ -62,55 +62,29 @@
         <result column="repeat_type" property="repeatType" />
         <result column="repeat_end_never" property="repeatEndNever" />
         <result column="repeat_end_count" property="repeatEndCount" />
-        <result column="repeat_end_date" property="repeatEndDate" />
+        <result column="repeat_end_date" property="repeatEndDate" jdbcType="DATE" javaType="java.time.LocalDate" />
         <result column="repeat_design_day" property="repeatDesignDay" />
         <result column="repeat_design_sameday" property="repeatDesignSameday" />
         <result column="task_desc" property="taskDesc" />
         <result column="creater_id" property="createrId" />
         <result column="creater_name" property="createrName" />
-        <result column="create_date" property="createDate" />
-        <result column="end_date" property="endDate" />
-        <result column="start_date" property="startDate" />
-        <result column="finish_date" property="finishDate" />
+        <result column="create_date" property="createDate" jdbcType="DATE" javaType="java.time.LocalDate" />
+        <result column="end_date" property="endDate" jdbcType="DATE" javaType="java.time.LocalDate" />
+        <result column="start_date" property="startDate" jdbcType="DATE" javaType="java.time.LocalDate" />
+        <result column="finish_date" property="finishDate" jdbcType="DATE" javaType="java.time.LocalDate" />
         <result column="is_delete" property="isDelete" />
         <result column="plate1" property="plate1" />
         <result column="plate2" property="plate2" />
         <result column="plate3" property="plate3" />
         <result column="plate4" property="plate4" />
         <result column="plate5" property="plate5" />
-        <association property="custom" javaType="com.management.platform.entity.Custom">
-            <id column="custom_id" property="id"/>
-            <result column="custom_name" property="customName"/>
-        </association>
-        <association property="businessOpportunity" javaType="com.management.platform.entity.BusinessOpportunity">
-            <id column="business_opportunity_id" property="id"/>
-            <result column="businessName" property="name"/>
-        </association>
-        <association property="order" javaType="com.management.platform.entity.Order">
-            <id column="order_id" property="id"/>
-            <result column="order_name" property="orderName"/>
-        </association>
-        <association property="clue" javaType="com.management.platform.entity.Clue">
-            <id column="clue_id" property="id"/>
-            <result column="clue_name" property="clueName"/>
-        </association>
-        <association property="contacts" javaType="com.management.platform.entity.Contacts">
-            <id column="contacts_id" property="id"/>
-            <result column="contacts_name" property="name"/>
-            <result column="phone" property="phone"/>
-        </association>
-        <collection property="taskExecutors"  ofType="com.management.platform.entity.TaskExecutor">
-            <id column="task_executor_id" property="taskExecutorId"/>
-            <result column="taskExecutor_executor_id" property="executorId"/>
-            <result column="executor_name" property="executorName"/>
-        </collection>
-        <collection property="taskLogs"  ofType="com.management.platform.entity.TaskLog">
-            <id column="taskLogId" property="id"/>
-            <result column="taskLogModTime" property="modTime"/>
-            <result column="taskLogUserName" property="userName"/>
-            <result column="taskLogContent" property="content"/>
-        </collection>
 
+        <result column="custom_name" property="customName"/>
+        <result column="businessName" property="businessName"/>
+        <result column="order_name" property="orderName"/>
+        <result column="clue_name" property="clueName"/>
+        <result column="contacts_name" property="contactsName"/>
+        <result column="phone" property="contactsPhone"/>
     </resultMap>
 
     <select id="getPageListTask" resultMap="TaskVoMap">
@@ -119,17 +93,14 @@
                business_opportunity.name businessName,
               `order`.order_name ,
                clue.clue_name,
-               contacts.name contacts_name ,contacts.phone,
-               task_executor.task_executor_id, task_executor.executor_id taskExecutor_executor_id,task_executor.executor_name,
-               task_log.id taskLogId,task_log.mod_time taskLogModTime,task_log.user_name taskLogUserName,task_log.content taskLogContent
+               contacts.name contacts_name ,contacts.phone
         from task
             left join  custom on task.custom_id=custom.id
             left join  business_opportunity on task.business_opportunity_id=business_opportunity.id
             left join  `order` on task.order_id=`order`.id
             left join  clue on task.clue_id=clue.id
             left join  contacts on task.contacts_id=contacts.id
-            left join  task_executor on task.id=task_executor.task_id
-            left join  task_log on task.id=task_log.task_id
+
         <where>
             and 1=1 and task.is_delete=0
 
@@ -183,22 +154,14 @@
 
 
     <select id="getPageListTotalTask" resultMap="TaskVoMap">
-        select task.* ,
-        custom.custom_name,
-        business_opportunity.name businessName,
-        `order`.order_name ,
-        clue.clue_name,
-        contacts.name contacts_name ,contacts.phone,
-        task_executor.task_executor_id, task_executor.executor_id taskExecutor_executor_id,task_executor.executor_name,
-        task_log.id taskLogId,task_log.mod_time taskLogModTime,task_log.user_name taskLogUserName,task_log.content taskLogContent
+        select task.id
         from task
         left join  custom on task.custom_id=custom.id
         left join  business_opportunity on task.business_opportunity_id=business_opportunity.id
         left join  `order` on task.order_id=`order`.id
         left join  clue on task.clue_id=clue.id
         left join  contacts on task.contacts_id=contacts.id
-        left join  task_executor on task.id=task_executor.task_id
-        left join  task_log on task.id=task_log.task_id
+
         <where>
             and 1=1 and task.is_delete=0
 

+ 3 - 0
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -249,6 +249,7 @@
                     <el-form-item><el-checkbox v-model="dialogData.projectCustom">是否开启项目自定义表单</el-checkbox></el-form-item>
                     <el-form-item><el-checkbox v-model="dialogData.easyExpense">是否开启简易费用报销</el-checkbox></el-form-item>
                     <el-form-item><el-checkbox v-model="dialogData.enableNewWeeklyfill">是否启用新的按周填报模式</el-checkbox></el-form-item>
+                    <el-form-item><el-checkbox v-model="dialogData.hideSubproject">是否去除子项目</el-checkbox></el-form-item>
                 </el-form>
             </div>
             <!-- 是否开启审批流设置,是否启用主项目模式,是否秘薪模式,是否显示日报审批流程,是否CRO企业,是否仅使用导入日报审核(不要项目审核) reportAuditType-->
@@ -471,6 +472,7 @@ import App from '../../App.vue';
                             this.$set(this.dialogData,'projectCustom',res.data.projectCustom ? true : false)
                             this.$set(this.dialogData,'easyExpense',res.data.easyExpense ? true : false)
                             this.$set(this.dialogData,'enableNewWeeklyfill',res.data.enableNewWeeklyfill ? true : false)
+                            this.$set(this.dialogData,'hideSubproject',res.data.hideSubproject ? true : false)
                         }else{
                             this.$message({
                                 message: res.msg,
@@ -791,6 +793,7 @@ import App from '../../App.vue';
                     projectCustom: this.dialogData.projectCustom ? 1 : 0,
                     easyExpense: this.dialogData.easyExpense ? 1 : 0,
                     enableNewWeeklyfill: this.dialogData.enableNewWeeklyfill ? 1 : 0,
+                    hideSubproject:this.dialogData.hideSubproject ? 1: 0, 
                 },res => {
                     if(res.code == 'ok'){
                         this.editDialogG = false

+ 68 - 2
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2023-11-09
+ * @since 2024-03-25
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -116,6 +116,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("custom_degree_status")
     private Integer customDegreeStatus;
 
+    /**
+     * 工时填报自定义维度是否绑定项目 0-否 1-是
+     */
+    @TableField("custom_degree_with_pro")
+    private Integer customDegreeWithPro;
+
     /**
      * 提醒内容
      */
@@ -291,7 +297,7 @@ public class TimeType extends Model<TimeType> {
     private Integer mainProjectState;
 
     /**
-     * 日报的审核类型, 0-项目审核人审核,1-分组负责人审核,2-先分组负责人审核再项目负责人(PM)审核;3-员工自由选择审批人 4-项目所属BU审核 5-部门负责人审核
+     * 日报的审核类型, 0-项目审核人审核,1-分组负责人审核,2-先分组负责人审核再项目负责人(PM)审核;3-员工自由选择审批人 4-项目所属BU审核 5-直属审核人或部门负责人审核,6-直属或部门负责人审核->项目日报审核人审核
      */
     @TableField("report_audit_type")
     private Integer reportAuditType;
@@ -371,6 +377,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("max_report_time")
     private Float maxReportTime;
 
+    /**
+     * 填报工作时长下限
+     */
+    @TableField("min_report_time")
+    private Float minReportTime;
+
     /**
      * 是否同步泛微考勤打卡和出差
      */
@@ -497,6 +509,60 @@ public class TimeType extends Model<TimeType> {
     @TableField("fill_month_on_day")
     private Integer fillMonthOnDay;
 
+    /**
+     * 同步对接sap系统 0-否 1-是
+     */
+    @TableField("sync_sap")
+    private Integer syncSap;
+
+    /**
+     * 项目超期不可填报
+     */
+    @TableField("not_allowed_expired_project")
+    private Integer notAllowedExpiredProject;
+
+    /**
+     * 按时间段填报时,时间是否可重叠
+     */
+    @TableField("time_can_overlap")
+    private Integer timeCanOverlap;
+
+    /**
+     * 自定义维度是否填报是可多选
+     */
+    @TableField("custom_degree_multiple")
+    private Boolean customDegreeMultiple;
+
+    /**
+     * 任务是否必填 0-否 1-是
+     */
+    @TableField("task_required")
+    private Integer taskRequired;
+
+    /**
+     * 日报填报隐藏阶段项
+     */
+    @TableField("hide_stages")
+    private Integer hideStages;
+
+    /**
+     * 日报填报隐藏任务项
+     */
+    @TableField("hide_task")
+    private Integer hideTask;
+
+    /**
+     * 项目隐藏子项目功能按钮
+     */
+    @TableField("hide_subproject")
+    private Integer hideSubproject;
+
+    /**
+     * 开启日报审批流的本部门负责人由上级部门负责人审核
+     */
+    @TableField("report_audit_flow_enable_super_dept_aduit")
+    private Integer reportAuditFlowEnableSuperDeptAduit;
+
 
     @Override
     protected Serializable pkVal() {

+ 7 - 0
fhKeeper/formulahousekeeper/ops-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java

@@ -411,6 +411,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
                 str += "启动了日报审核通过推送消息功能,";
             }
         }
+        if (timeType.getHideSubproject() != null && old.getHideSubproject().intValue() != timeType.getHideSubproject().intValue()) {
+            if (timeType.getHideSubproject() == 0) {
+                str += "关闭了去除子项目功能,";
+            } else if (timeType.getHideSubproject() == 1) {
+                str += "启动了去除子项目功能,";
+            }
+        }
         saveLog(str);
         return new HttpRespMsg();
     }

Diff do ficheiro suprimidas por serem muito extensas
+ 12 - 1
fhKeeper/formulahousekeeper/ops-platform/src/main/resources/mapper/TimeTypeMapper.xml