From d3a9feeeee6f70462d12e48db5fd1cab9b183bc8 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 17 九月 2019 17:14:54 +0800
Subject: [PATCH] 更改goodsType

---
 fanli/src/main/java/com/yeshi/fanli/controller/client/v1/UserOrderController.java |   89 ++++++++++++++++++++++++--------------------
 1 files changed, 48 insertions(+), 41 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 f31c8bc..e4bdf05 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
@@ -35,10 +35,10 @@
 import com.yeshi.fanli.service.inter.order.CommonOrderService;
 import com.yeshi.fanli.service.inter.order.LostOrderService;
 import com.yeshi.fanli.service.inter.order.OrderService;
-import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
-import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
+import com.yeshi.fanli.service.inter.order.tb.TaoBaoOrderService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
+import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
 import com.yeshi.fanli.util.CMQManager;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.StringUtil;
@@ -110,17 +110,23 @@
 	 */
 	@RequestMapping(value = "getorder", method = RequestMethod.POST)
 	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) {
+			@RequestParam(name = "type",required = false) 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))
+		if (StringUtil.isNullOrEmpty(type1)) {
 			type = null;
-
+		} else {
+			type = Integer.parseInt(type1);
+		}
+		
 		if (uid == null) {
 			out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
 			return;
 		}
+		
+		if (needCount == null)
+			needCount = false;
 
 		if (page == null || page < 1) {
 			page = 1;
@@ -141,14 +147,20 @@
 			orderState = 2; // 宸茬淮鏉�
 			state = null; // 娓呯┖
 		}
-
+				
 		if (type != null && type == 0) {
 			type = null; // 鎵�鏈夌被鍨嬭鍗�
 		}
-
+		
+		Integer tempState = state;
+		// 杞崲鐘舵��
+		if (state != null && orderState != null && (orderState == 2|| orderState == 3)) {
+			state = 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; // 鎵�鏈夊钩鍙拌鍗�
 		}
 
@@ -168,15 +180,15 @@
 
 		try {
 			long count = 0;
-			int totalValid = 0;
-			int totalProces = 0;
-			int totalInvite = 0;
+			long totalValid = 0;
+			long totalProces = 0;
+			long totalInvite = 0;
 			long todayTotal = 0;
 			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) {
 				// 缁熻鎬绘暟
@@ -187,27 +199,21 @@
 			// 闇�瑕佺粺璁$瓫閫変俊鎭� 锛氭湭澶辨晥鐨勬�婚噾棰� 浠ュ強璁㈠崟
 			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,
-						endTime, dateType, goodsType);
-
-				if (countOrder.get("totalValid") != null) {
-					totalValid = countOrder.get("totalValid").intValue();
-				}
-
-				if (countOrder.get("totalProces") != null) {
-					totalProces = countOrder.get("totalProces").intValue();
-				}
-
-				if (countOrder.get("totalInvite") != null) {
-					totalInvite = countOrder.get("totalInvite").intValue();
-				}
+				// 鏈夋晥璁㈠崟
+				totalValid = commonOrderService.countUserOrderToApp(uid, type, startTime,
+						endTime, dateType, goodsType, tempState, 1);
+				
+				// 缁存潈璁㈠崟
+				totalProces = commonOrderService.countUserOrderToApp(uid, type, startTime,
+						endTime, dateType, goodsType, null, 2);
+				
+				// 澶辨晥璁㈠崟
+				totalInvite = commonOrderService.countUserOrderToApp(uid, type, startTime,
+						endTime, dateType, goodsType, null, 3);
 			}
 
 			if (todayMoney == null) {
@@ -300,8 +306,8 @@
 			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, goodsType);
 			int self = 0;
@@ -386,10 +392,10 @@
 			e.printStackTrace();
 		}
 	}
-
+	
+	
 	/**
 	 * 缁熻鍚勪釜骞冲彴鏁版嵁
-	 * 
 	 * @param acceptData
 	 * @param uid
 	 * @param goodsType
@@ -407,7 +413,7 @@
 			out.print(JsonUtil.loadFalseResult(1, "骞冲彴绫诲瀷缂哄け鎴栦笉姝g‘"));
 			return;
 		}
-
+		
 		/* 浠婃棩璁㈠崟缁熻 */
 		Map<String, BigDecimal> countToday = commonOrderService.countHistoryOrder(uid, 1, goodsType);
 
@@ -463,7 +469,8 @@
 		data.put("yesterday", yesterdaydata);
 		out.print(JsonUtil.loadTrueResult(data));
 	}
-
+	
+	
 	/**
 	 * 缁熻濂栭噾
 	 * 
@@ -485,11 +492,11 @@
 			BigDecimal sharemoney = new BigDecimal(0.00);
 			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, goodsType);

--
Gitblit v1.8.0