From 13ec337a0d24485d9f006cfd44ea5d69c00540f3 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 11 一月 2019 16:21:22 +0800
Subject: [PATCH] 资金统计修改

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java |   56 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
index a86ec70..d1ec5f0 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -94,8 +94,11 @@
 		
 		try {
 			long count = 0;
+			int totalValid = 0;
+			int totalProces = 0;
+			int totalInvite = 0;
 			long todayTotal = 0;
-			BigDecimal todayMoney = new BigDecimal(0.00);
+			BigDecimal todayMoney = null;
 			
 			// 鏌ヨ鍒楄〃
 			List<CommonOrderVO> list = commonOrderService.getOrderByUid(page, uid, state, type, orderState,
@@ -105,29 +108,16 @@
 				// 缁熻鎬绘暟
 				count = commonOrderService.countGroupOrderNoByUid(uid,  state, type, orderState, orderNo, 
 						startTime, endTime, dateType);
-				
-				// 闇�瑕佺粺璁′俊鎭�
-				if (needCount && page == 1) {
-					Map<String, Object> countMap = commonOrderService.countMoneyGroupOrderNoByUid(uid, type,
-							orderNo, startTime, endTime, dateType);
-					if (countMap != null) {
-						BigDecimal totalMoney = (BigDecimal) countMap.get("totalMoney");
-						if (totalMoney != null) {
-							todayMoney = totalMoney;// 褰撳墠鏌ヨ鎵�鏈夎鍗曞凡鍒拌处鎬婚噾棰�
-						}
-						
-						//褰撳墠鏌ヨ鎵�鏈夊凡鍒拌处璁㈠崟鏁伴噺
-						todayTotal  = (long) countMap.get("totalRow");
-					}
-				}
 			}
 			
-			int totalValid = 0;
-			int totalProces = 0;
-			int totalInvite = 0;
-			
-			// 闇�瑕佺粺璁′俊鎭�
+			// 闇�瑕佺粺璁$瓫閫変俊鎭� 锛氭湭澶辨晥鐨勬�婚噾棰� 浠ュ強璁㈠崟
 			if (needCount && page == 1) {
+				
+				todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime);
+				
+				todayTotal =  commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime);
+				
+				// 缁熻鏈夋晥鐨勮鍗曟暟閲� 銆� 澶辨晥璁㈠崟鏁伴噺 銆佺淮鏉冭鍗曟暟閲�
 				Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, 
 						startTime, endTime, dateType);
 				
@@ -143,7 +133,12 @@
 					totalInvite = countOrder.get("totalInvite").intValue();
 				}	
 			}
-		
+			
+			if (todayMoney == null) {
+				todayMoney = new BigDecimal(0.00);
+			}
+			
+			
 			String helpUrl = configService.get("order_list_help");
 			
 			JSONObject data = new JSONObject();
@@ -203,7 +198,7 @@
 			data.put("userInfo", userInfo);
 			
 			/* 鎬昏鍗曠粺璁�   */
-			Map<String, BigDecimal> countOrder= commonOrderService.countOrderByHongBaoType(uid, null);
+			Map<String, BigDecimal> countOrder= commonOrderService.countHistoryOrder(uid, null);
 			int self = 0;
 			if (countOrder.get("totalSelf") != null) {
 				self = countOrder.get("totalSelf").intValue();
@@ -227,7 +222,7 @@
 			data.put("invite", invite);
 			
 			/*  浠婃棩璁㈠崟缁熻  */
-			Map<String, BigDecimal> countToday= commonOrderService.countOrderByHongBaoType(uid, 1);
+			Map<String, BigDecimal> countToday= commonOrderService.countHistoryOrder(uid, 1);
 			
 			int todaySelf = 0;
 			if (countToday.get("totalSelf") != null) {
@@ -255,7 +250,7 @@
 			data.put("today", todaydata);
 			
 			/*  鏄ㄦ棩璁㈠崟缁熻   */
-			Map<String, BigDecimal> countYesterday= commonOrderService.countOrderByHongBaoType(uid, 2);
+			Map<String, BigDecimal> countYesterday= commonOrderService.countHistoryOrder(uid, 2);
 			int yesterdaySelf = 0;
 			if (countYesterday.get("totalSelf") != null) {
 				yesterdaySelf = countYesterday.get("totalSelf").intValue();
@@ -305,12 +300,15 @@
 			
 			JSONObject data = new JSONObject();
 			// 鍒嗕韩缁熻
-			BigDecimal sharemoney = commonOrderService.countOrderMoney(uid,2, dateType);
-			data.put("shareCount", commonOrderService.countOrder(uid, 2, dateType));
+			BigDecimal sharemoney = commonOrderService.countBonusOrderMoney(uid,2, dateType, null, null);
+			
+			data.put("shareCount", commonOrderService.countBonusOrderNumber(uid, 2, dateType, null, null));
 			data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
+			
 			// 閭�璇风粺璁�
-			BigDecimal inviteMoney = commonOrderService.countOrderMoney(uid,3, dateType);
-			data.put("inviteCount", commonOrderService.countOrder(uid, 3, dateType));
+			BigDecimal inviteMoney = commonOrderService.countBonusOrderMoney(uid,3, dateType, null, null);
+			
+			data.put("inviteCount", commonOrderService.countBonusOrderNumber(uid, 3, dateType, null, null));
 			data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
 			
 			data.put("showTiCheng", hongBaoService.getTotalTiChengCount(uid) > 0);

--
Gitblit v1.8.0