From f6af1863a4f68c1be2ec07cc6b5992f9e7464e52 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期三, 29 十一月 2023 14:28:27 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/controller/DashboardController.java |   52 +++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 43 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/DashboardController.java b/src/main/java/com/zy/crm/manager/controller/DashboardController.java
index f34603e..910bff4 100644
--- a/src/main/java/com/zy/crm/manager/controller/DashboardController.java
+++ b/src/main/java/com/zy/crm/manager/controller/DashboardController.java
@@ -24,6 +24,8 @@
 @RestController
 public class DashboardController extends BaseController {
 
+    Integer PBN = 6;
+
     @Autowired
     private CompanyTargetService companyTargetService;
     @Autowired
@@ -42,6 +44,10 @@
     private ReimburseOnlineService reimburseOnlineService;
     @Autowired
     private CompanyMoneyService companyMoneyService;
+    @Autowired
+    private ProcessPermissionsService processPermissionsService;
+    @Autowired
+    private PlanTypeService planTypeService;
 
     //鑾峰彇鍥㈤槦鏁版嵁
     @RequestMapping(value = "/dashboard/companyData/auth")
@@ -126,13 +132,6 @@
         map.put("progressCount", progressCount);
         map.put("successCount", successCount);
 
-//        planPendingTaskCount
-//        priOnlinePendingTaskCount
-//        priQuotePendingTaskCount
-//        businessTripPendingTaskCount
-//        reimburseOnlinePendingTaskCount
-//        planPriOnlinePendingTaskCount
-
         //鑾峰彇寰呭鐞嗕换鍔℃暟閲�
         int planPendingTaskCount = planService.selectCount(new EntityWrapper<Plan>().eq("director", getUserId()).lt("settle",4));
         map.put("planPendingTaskCount", planPendingTaskCount);
@@ -146,7 +145,28 @@
         map.put("businessTripPendingTaskCount", businessTripPendingTaskCount);
         int reimburseOnlinePendingTaskCount = reimburseOnlineService.selectCount(new EntityWrapper<ReimburseOnline>().eq("member_id", getUserId()).lt("settle",6));
         map.put("reimburseOnlinePendingTaskCount", reimburseOnlinePendingTaskCount);
-        int planPriOnlinePendingTaskCount = planService.selectCount(new EntityWrapper<Plan>().eq("status", 1).eq("settle",4));
+        int planPriOnlinePendingTaskCount = 0;
+        List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2锛氭牳浠锋祦绋�
+        int type =0;
+        for (ProcessPermissions processPermissions:processPermissionsList){
+            if (getUserId().equals(processPermissions.getUserId())){
+                type=PBN-processPermissions.getProcessMemo();
+                break;
+            }
+        }
+        if (type!=0){
+            EntityWrapper<Plan> wrapper = new EntityWrapper<>();
+            wrapper.eq("status",1);
+            wrapper.eq("assistant_host_sign",0);
+            List<Long> typeList = new ArrayList<>();
+            List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", type));
+            for (PlanType planType : planTypes){
+                typeList.add(planType.getId());
+            }
+            wrapper.in("plan_type",typeList);
+            List<Plan> plans = planService.selectList(wrapper);
+            planPriOnlinePendingTaskCount=plans.size();
+        }
         map.put("planPriOnlinePendingTaskCount", planPriOnlinePendingTaskCount);
 
         Double successMoney1 = companyMoneyService.selectMoneyReceivablesAll(getUserId(), year);
@@ -219,9 +239,23 @@
             }else if (user.getRoleId()<3){
                 item="true2";
             }
-        }catch (Exception e){
+        }catch (Exception ignored){ }
+        return R.ok(item);
+    }
 
+    @RequestMapping("/dashboard/user/id/popup/auth")
+    public R popupUserId(String token) {
+        Long item = 0L;
+        if (Cools.isEmpty(token)){
+            return R.ok(item);
         }
+        try{
+            User user = getUser(token);
+            if (Cools.isEmpty(user) || Cools.isEmpty(user.getId())){
+                return R.ok(item);
+            }
+            item = user.getId();
+        }catch (Exception ignored){ }
         return R.ok(item);
     }
 

--
Gitblit v1.9.1