From 26ebf71529e5ee4f70c4ad3ed52ea5e59c1b46e5 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期一, 09 十月 2023 14:02:30 +0800
Subject: [PATCH] #核价相关

---
 src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java |   41 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
index 7674537..bffd268 100644
--- a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
+++ b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java
@@ -45,6 +45,9 @@
     private PriSalesService priSalesService;
 
     @Autowired
+    private PriQuoteService priQuoteService;
+
+    @Autowired
     private CstmrService cstmrService;
 
     @Autowired
@@ -91,12 +94,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()){
@@ -118,6 +124,9 @@
         }
         if (!signUserId && !signDeptId){
             wrapper.eq("user_id", getUserId());
+        }
+        if (signHostId){
+            wrapper.or().eq("host_id",1);
         }
     }
 
@@ -318,10 +327,14 @@
                 return R.error();
             }
             for (Long id : ids){
-                int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id));
-                if (priSales!=0){
-                    return R.error("瀛樺湪鍏宠仈鐨勪骇鍝佽垂鐢ㄦ槑缁嗭紝绂佹鍒犻櫎锛侊紒锛�");
+                int  priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("pri_online_id", id));
+                if (priQuote!=0){
+                    return R.error("瀛樺湪鍏宠仈鐨勬姤浠峰崟锛岀姝㈠垹闄わ紒锛侊紒");
                 }
+//                int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id));
+//                if (priSales!=0){
+//                    return R.error("瀛樺湪鍏宠仈鐨勪骇鍝佽垂鐢ㄦ槑缁嗭紝绂佹鍒犻櫎锛侊紒锛�");
+//                }
             }
             for (Long id : ids) {
                 PriOnline2 priOnline2 = priOnline2Service.selectById(id);
@@ -366,6 +379,26 @@
         return R.ok(result);
     }
 
+    @RequestMapping(value = "/priOnline2Query2/auth")
+    @ManagerAuth
+    public R query2(String condition) {
+        EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>();
+        wrapper.like("order_num", condition);
+        wrapper.in("user_id", getUserRoleBelongsToUserId("allopen"));
+        Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper);
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (PriOnline2 priOnline2 : page.getRecords()){
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", priOnline2.getId());
+//            map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$());
+//            map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName());
+            map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$() + "/" + priOnline2.getTemplateName());
+
+            result.add(map);
+        }
+        return R.ok(result);
+    }
+
     @RequestMapping(value = "/priOnline2/check/column/auth")
     @ManagerAuth
     public R query(@RequestBody JSONObject param) {

--
Gitblit v1.9.1