From 0272ffc3e7037e10c2ddadeea6c597850903878f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 30 八月 2019 14:34:00 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java |   59 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 40 insertions(+), 19 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java
index 7d76c49..4ac83a7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java
@@ -13,6 +13,7 @@
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.yeshi.utils.DateUtil;
 import org.yeshi.utils.IPUtil;
 import org.yeshi.utils.JsonUtil;
@@ -108,9 +109,12 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getorder", method = RequestMethod.POST)
-	public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state, Integer type, Integer orderState,
-			String orderNo, String startTime, String endTime, Integer slotTime, boolean needCount, Integer dateType,
-			Integer goodsType, PrintWriter out) {
+	public void getOrder(AcceptData acceptData, Integer page, Long uid, Integer state,
+			@RequestParam("type") String type1, Integer orderState, String orderNo, String startTime, String endTime,
+			Integer slotTime, boolean needCount, Integer dateType, Integer goodsType, PrintWriter out) {
+		Integer type = null;
+		if (StringUtil.isNullOrEmpty(type1))
+			type = null;
 
 		if (uid == null) {
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
@@ -131,13 +135,19 @@
 			state = null; // 娓呯┖
 		}
 
+		// 杞崲鐘舵��
+		if (state != null && state == 5) {
+			orderState = 2; // 宸茬淮鏉�
+			state = null; // 娓呯┖
+		}
+
 		if (type != null && type == 0) {
 			type = null; // 鎵�鏈夌被鍨嬭鍗�
 		}
-		
+
 		if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
 			goodsType = Constant.SOURCE_TYPE_TAOBAO;
-		} else if (goodsType != null && goodsType == 0){
+		} else if (goodsType != null && goodsType == 0) {
 			goodsType = null; // 鎵�鏈夊钩鍙拌鍗�
 		}
 
@@ -164,8 +174,8 @@
 			BigDecimal todayMoney = null;
 
 			// 鏌ヨ鍒楄〃
-			List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState, orderNo,
-					startTime, endTime, dateType, goodsType);
+			List<CommonOrderVO> list = commonOrderService.getOrderByUid(acceptData, page, uid, state, type, orderState,
+					orderNo, startTime, endTime, dateType, goodsType);
 
 			if (list != null && list.size() > 0) {
 				// 缁熻鎬绘暟
@@ -176,9 +186,11 @@
 			// 闇�瑕佺粺璁$瓫閫変俊鎭� 锛氭湭澶辨晥鐨勬�婚噾棰� 浠ュ強璁㈠崟
 			if (needCount && page == 1) {
 
-				todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime, goodsType);
+				todayMoney = commonOrderService.countBonusOrderMoney(uid, type, dateType, startTime, endTime,
+						goodsType);
 
-				todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime, goodsType);
+				todayTotal = commonOrderService.countBonusOrderNumber(uid, type, dateType, startTime, endTime,
+						goodsType);
 
 				// 缁熻鏈夋晥鐨勮鍗曟暟閲� 銆� 澶辨晥璁㈠崟鏁伴噺 銆佺淮鏉冭鍗曟暟閲�
 				Map<String, BigDecimal> countOrder = commonOrderService.countByUidAndOrderState(uid, type, startTime,
@@ -284,8 +296,13 @@
 			JSONObject data = new JSONObject();
 			data.put("userInfo", userInfo);
 
+			Integer goodsType = null; // 鐗堟湰鍖哄垎
+			if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
+				goodsType = Constant.SOURCE_TYPE_TAOBAO;
+			}
+
 			/* 鎬昏鍗曠粺璁� */
-			Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, null);
+			Map<String, BigDecimal> countOrder = commonOrderService.countHistoryOrder(uid, null, goodsType);
 			int self = 0;
 			if (countOrder.get("totalSelf") != null) {
 				self = countOrder.get("totalSelf").intValue();
@@ -309,7 +326,7 @@
 			data.put("invite", invite);
 
 			/* 浠婃棩璁㈠崟缁熻 */
-			Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, null);
+			Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType);
 
 			int todaySelf = 0;
 			if (countToday.get("totalSelf") != null) {
@@ -337,7 +354,7 @@
 			data.put("today", todaydata);
 
 			/* 鏄ㄦ棩璁㈠崟缁熻 */
-			Map<String, BigDecimal> countYesterday = commonOrderService.countHistoryOrder(uid, 2, null);
+			Map<String, BigDecimal> countYesterday = commonOrderService.countHistoryOrder(uid, 2, goodsType);
 			int yesterdaySelf = 0;
 			if (countYesterday.get("totalSelf") != null) {
 				yesterdaySelf = countYesterday.get("totalSelf").intValue();
@@ -368,10 +385,10 @@
 			e.printStackTrace();
 		}
 	}
-	
-	
+
 	/**
 	 * 缁熻鍚勪釜骞冲彴鏁版嵁
+	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param goodsType
@@ -389,7 +406,7 @@
 			out.print(JsonUtil.loadFalseResult(1, "骞冲彴绫诲瀷缂哄け鎴栦笉姝g‘"));
 			return;
 		}
-		
+
 		/* 浠婃棩璁㈠崟缁熻 */
 		Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType);
 
@@ -445,8 +462,7 @@
 		data.put("yesterday", yesterdaydata);
 		out.print(JsonUtil.loadTrueResult(data));
 	}
-	
-	
+
 	/**
 	 * 缁熻濂栭噾
 	 * 
@@ -469,8 +485,13 @@
 			Object inviteCount = 0;
 			BigDecimal inviteMoney = new BigDecimal(0.00);
 
+			Integer goodsType = null; // 鐗堟湰鍖哄垎
+			if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
+				goodsType = Constant.SOURCE_TYPE_TAOBAO;
+			}
+
 			Map<String, Object> shareMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 2, dateType, null,
-					null);
+					null, goodsType);
 			if (shareMap != null) {
 				Object totalNum = shareMap.get("totalNum");
 				if (totalNum != null) {
@@ -485,7 +506,7 @@
 
 			// 閭�璇风粺璁�
 			Map<String, Object> inviteMap = commonOrderService.countBonusOrderMoneyAndNumber(uid, 3, dateType, null,
-					null);
+					null, goodsType);
 			if (inviteMap != null) {
 				Object totalNum = inviteMap.get("totalNum");
 				if (totalNum != null) {

--
Gitblit v1.8.0