From 3fc935a8b53708a4402e24bf4086741f684bbd35 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 14 九月 2023 16:17:34 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/crm/manager/controller/DashboardController.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 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 1202412..8d418b6 100644
--- a/src/main/java/com/zy/crm/manager/controller/DashboardController.java
+++ b/src/main/java/com/zy/crm/manager/controller/DashboardController.java
@@ -42,12 +42,15 @@
         if (companyTarget == null) {
             return R.error();
         }
-        map.put("yearTarget", formatter.format(Double.parseDouble(companyTarget.getTarget())));//鍏ㄥ勾浜ゆ槗鐩爣
+        double whole = Double.parseDouble(companyTarget.getTarget());
+        map.put("yearTarget", formatter.format(whole));//鍏ㄥ勾浜ゆ槗鐩爣
 
         //鑾峰彇鍏ㄥ勾浜ゆ槗鎴愬姛閲戦
         Double successMoney = orderService.selectMoneyByYearAndStatus(year, 1);
         //鑾峰彇鍏ㄥ勾鏈氦鏄撴垚鍔熼噾棰�
-        Double progressMoney = orderService.selectMoneyByYearAndStatus(year, 0);
+//        double v = whole - orderService.selectMoneyByYearAndStatus(year, 0);
+        double v = whole - orderService.selectMoneyByYearAndStatus(year, 1);
+        Double progressMoney =  v > 0? v : 0D;
         //鑾峰彇鍏ㄥ勾浜ゆ槗澶辫触閲戦
         Double failedMoney = orderService.selectMoneyByYearAndStatus(year, 2);
         //鍏ㄥ勾瀹屾垚鐜�
@@ -81,7 +84,9 @@
         //鑾峰彇鍏ㄥ勾浜ゆ槗鎴愬姛閲戦
         Double successMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 1);
         //鑾峰彇鍏ㄥ勾鏈氦鏄撴垚鍔熼噾棰�
-        Double progressMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 0);
+        double v = yearTarget - orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 1);
+        Double progressMoney = v > 0? v : 0D;
+        Double progressMoney2 = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 0);
         //鑾峰彇鍏ㄥ勾浜ゆ槗澶辫触閲戦
         Double failedMoney = orderService.selectMoneyByUserAndYearAndStatus(getUserId(), year, 2);
         //鍏ㄥ勾瀹屾垚鐜�
@@ -90,6 +95,7 @@
 
         map.put("successMoney", formatter.format(successMoney));//鍏ㄥ勾浜ゆ槗鎴愬姛閲戦
         map.put("progressMoney", formatter.format(progressMoney));//鍏ㄥ勾鏈氦鏄撴垚鍔熼噾棰�
+        map.put("progressMoney2", formatter.format(progressMoney2));//璺熻釜椤圭洰閲戦
         map.put("yearTransactionRate", String.format("%.2f", yearTransactionRate));//鍏ㄥ勾浜ゆ槗鐜�
 
         //鑾峰彇鍏ㄥ勾璺熻釜鏁伴噺

--
Gitblit v1.9.1