yusm 1 年之前
父节点
当前提交
a1edc5b168
共有 16 个文件被更改,包括 244 次插入91 次删除
  1. 6 6
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/controller/TaskController.java
  2. 14 4
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/BusinessOpportunity.java
  3. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Clue.java
  4. 3 3
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Custom.java
  5. 7 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/Order.java
  6. 4 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskExecutor.java
  7. 4 1
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/TaskLog.java
  8. 17 6
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/entity/vo/TasKVo.java
  9. 6 0
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/OrderMapper.java
  10. 152 11
      fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  11. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml
  12. 2 2
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml
  13. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/OrderMapper.xml
  14. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskExecutorMapper.xml
  15. 2 1
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskLogMapper.xml
  16. 15 52
      fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/TaskMapper.xml

+ 6 - 6
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,12 +78,12 @@ 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(@RequestBody TaskDto taskDto) throws Exception {
+    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;
 
     /**

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

@@ -45,6 +45,7 @@ public class Clue extends Model<Clue> {
     @TableField("clue_name")
     private String clueName;
 
+    @TableField(exist = false)
     private String companyName;
 
     /**
@@ -139,12 +140,17 @@ public class Clue extends Model<Clue> {
      */
     @TableField("create_time")
     private Date createTime;
+    @TableField(exist = false)
     private Date startTime;
+    @TableField(exist = false)
     private Date endTime;
 
+    @TableField(exist = false)
     private Integer pageIndex;
+    @TableField(exist = false)
     private Integer pageFrom;
 
+    @TableField(exist = false)
     private List<ClueLog> clueLogList;
 
 

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

@@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author Seyason
- * @since 2024-02-28
+ * @since 2024-03-22
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -178,8 +178,8 @@ public class Custom extends Model<Custom> {
     /**
      * 描述
      */
-    @TableField("desc")
-    private String desc;
+    @TableField("custom_desc")
+    private String customDesc;
 
     /**
      * 回收站(是否删除) 0-否 1-是

+ 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;
+
+
 }

+ 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);
 }

+ 152 - 11
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>
@@ -150,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);
             }
         }
@@ -162,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);
 
 
@@ -174,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()){
@@ -312,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) {
@@ -421,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();
@@ -467,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;
@@ -497,34 +532,138 @@ 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(!StringUtils.isEmpty(cell.getStringCellValue())){
+                        if(cell!=null&&!StringUtils.isEmpty(cell.getStringCellValue())){
                             String customName = cell.getStringCellValue();
-                            List<Custom> customList = customMapper.selectList(new LambdaQueryWrapper<Custom>().eq(Custom::getCustomName, customName).eq(Custom::getCompanyId, user.getCompanyId()));
-                            if (customList.size()>1){
+                            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+"]对应的商机不存在");
                             }
-                            Custom custom = customList.get(0);
-                            task.setCustomId(custom.getId());
 
                         }
                     }
+                    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)){
-                        msg.setError("任务:"+task.getTaskName()+"中线索不应与客户/商机/销售订单一同存在");
+                    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()+"中不应客户/商机/销售订单一同存在");
+                        msg.setError("任务:"+task.getTaskName()+"中客户/商机/销售订单不应一同存在");
                         return msg;
                     }
                 }
@@ -541,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);
                             }
                         }
@@ -550,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);

+ 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>

+ 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