From bf6b2a0e57730d4b241a5b94cf2e8d3954a48c88 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 28 十一月 2023 16:20:50 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/controller/PriOnlineController.java |   35 ++++++++++++++++++-----------------
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java b/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java
index a4e190b..6e0f136 100644
--- a/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java
+++ b/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java
@@ -5,20 +5,14 @@
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.core.common.DateUtils;
-import com.zy.crm.manager.entity.Item;
-import com.zy.crm.manager.entity.Order;
-import com.zy.crm.manager.entity.Pri;
-import com.zy.crm.manager.entity.PriOnline;
-import com.zy.crm.manager.service.ItemService;
-import com.zy.crm.manager.service.OrderService;
-import com.zy.crm.manager.service.PriOnlineService;
+import com.zy.crm.manager.entity.*;
+import com.zy.crm.manager.service.*;
 import com.core.annotations.ManagerAuth;
 import com.core.common.BaseRes;
 import com.core.common.Cools;
 import com.core.common.R;
 import com.core.domain.KeyValueVo;
 import com.zy.crm.common.web.BaseController;
-import com.zy.crm.manager.service.PriService;
 import com.zy.crm.system.entity.Role;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
@@ -41,7 +35,7 @@
     private PriService priService;
 
     @Autowired
-    private OrderService orderService;
+    private PlanService planService;
 
     @RequestMapping(value = "/priOnline/{id}/auth")
     @ManagerAuth
@@ -78,12 +72,15 @@
     }
 
     private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
-        Long deptId = getDeptId();
         boolean signUserId = false;
         boolean signDeptId = false;
+        boolean signHostId = false;
         for (Map.Entry<String, Object> entry : map.entrySet()){
             if (entry.getKey().equals("dept_id")){
                 signDeptId = true;
+                if (String.valueOf(entry.getValue()).equals("19")){
+                    signHostId = true;
+                }
             }
         }
         for (Map.Entry<String, Object> entry : map.entrySet()){
@@ -105,6 +102,9 @@
         }
         if (!signUserId && !signDeptId){
             wrapper.eq("user_id", getUserId());
+        }
+        if (signHostId){
+            wrapper.or().eq("host_id",1);
         }
     }
 
@@ -137,13 +137,13 @@
         priOnline.setStatus(0);
         //涓氬姟鍛�
 //        Item item = itemService.selectById(priOnline.getItemId());
-        Order order = orderService.selectById(priOnline.getItemId());
-        priOnline.setMemberId(order.getUserId());
+        Plan plan = planService.selectById(priOnline.getItemId());
+        priOnline.setMemberId(plan.getUserId());
 
 
         //璁剧疆椤圭洰娴佺▼
-        order.setStep(2);
-        orderService.updateById(order);
+        plan.setStep(2);
+        planService.updateById(plan);
 
         priOnlineService.insert(priOnline);
         return R.ok();
@@ -171,10 +171,11 @@
         priOnline.setUpdateUserId(getUserId());
         //鐘舵�侊紝鏈畬鎴�
         priOnline.setStatus(0);
+        priOnline.setDeptId(getDeptId());
         //涓氬姟鍛�
 //        Item item = itemService.selectById(priOnline.getItemId());
-        Order order = orderService.selectById(priOnline.getItemId());
-        priOnline.setMemberId(order.getUserId());
+        Plan plan = planService.selectById(priOnline.getItemId());
+        priOnline.setMemberId(plan.getUserId());
 
         priOnlineService.insert(priOnline);
         return R.ok();
@@ -311,7 +312,7 @@
         for (PriOnline priOnline : page.getRecords()){
             Map<String, Object> map = new HashMap<>();
             map.put("id", priOnline.getId());
-            map.put("value", priOnline.getOrderNum() + "/" + priOnline.getOrderId$() + "/" + priOnline.getMemberId$());
+            map.put("value", priOnline.getOrderNum() + "/" + priOnline.getPlanId$() + "/" + priOnline.getMemberId$());
             result.add(map);
         }
         return R.ok(result);

--
Gitblit v1.9.1