From 9eeda0d3049b71877c373c04d65533939b5582ef Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期一, 02 九月 2019 09:55:55 +0800
Subject: [PATCH] getBoss方法只查询有效上级信息

---
 fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateTBRelationAndSpecialOrderJob.java |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateTBRelationAndSpecialOrderJob.java b/fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateTBRelationAndSpecialOrderJob.java
index dee78a6..dc8dc42 100644
--- a/fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateTBRelationAndSpecialOrderJob.java
+++ b/fanli/src/main/java/com/yeshi/fanli/job/order/taobao/UpdateTBRelationAndSpecialOrderJob.java
@@ -44,10 +44,30 @@
 	 *            缁撴潫椤电爜锛堟瘡椤�100鏉℃暟鎹級
 	 */
 	public void updateRelationAndSpecialOrder(long startTime, long endTime) {
-		List<TaoBaoOrder> list = TaoKeOrderApiUtil.getSpecialOrder(startTime, endTime);
-		List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getThirdSpecialOrder(startTime, endTime);
-		List<TaoBaoOrder> list2 = TaoKeOrderApiUtil.getRelationOrder(startTime, endTime);
-		List<TaoBaoOrder> list3 = TaoKeOrderApiUtil.getThirdRelationOrder(startTime, endTime);
+		List<TaoBaoOrder> list = TaoKeOrderApiUtil.getSpecialOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_ALL);
+		List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getThirdSpecialOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_ALL);
+		List<TaoBaoOrder> list2 = TaoKeOrderApiUtil.getRelationOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_ALL);
+		List<TaoBaoOrder> list3 = TaoKeOrderApiUtil.getThirdRelationOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_ALL);
+		if (list1 != null && list1.size() > 0)
+			list.addAll(list1);
+		if (list2 != null && list2.size() > 0)
+			list.addAll(list2);
+		if (list3 != null && list3.size() > 0)
+			list.addAll(list3);
+		// 鐖彇鍒扮殑璁㈠崟鍙�
+		if (list != null)
+			for (TaoBaoOrder order : list) {
+				LogHelper.orderInfo("鐖彇鍒扮殑璁㈠崟鍙�:" + order.getOrderId());
+			}
+
+		addRelationAndSpecialOrder(list);
+	}
+	
+	public void updateRelationAndSpecialSettleOrder(long startTime, long endTime) {
+		List<TaoBaoOrder> list = TaoKeOrderApiUtil.getSpecialOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_SETTLEMENT);
+		List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getThirdSpecialOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_SETTLEMENT);
+		List<TaoBaoOrder> list2 = TaoKeOrderApiUtil.getRelationOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_SETTLEMENT);
+		List<TaoBaoOrder> list3 = TaoKeOrderApiUtil.getThirdRelationOrder(startTime, endTime,TaoKeOrderApiUtil.TK_STATUS_SETTLEMENT);
 		if (list1 != null && list1.size() > 0)
 			list.addAll(list1);
 		if (list2 != null && list2.size() > 0)
@@ -77,7 +97,7 @@
 				while (its.hasNext()) {
 					String key = its.next();
 					List<TaoBaoOrder> orders = map.get(key);
-					String redisKey = "addorderqueue-" + key;
+					String redisKey = "addorderqueue-" + TaoBaoOrderUtil.getOrderDataHashCode(orders);;
 					// redis鍋氶鐜囬檺鍒�
 					try {
 						if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(redisKey))) {
@@ -118,6 +138,7 @@
 		LogHelper.orderInfo("鐖崟:30s鐖彇涓�娆″崟");
 		long endTime = System.currentTimeMillis();
 		updateRelationAndSpecialOrder(endTime - 1000 * 60 * 20L, endTime);
+		updateRelationAndSpecialSettleOrder(endTime - 1000 * 60 * 20L, endTime);
 	}
 
 	// 姣�5鍒嗛挓鏇存柊锛堣繎1澶╂暟鎹級
@@ -127,6 +148,7 @@
 			return;
 		long endTime = System.currentTimeMillis();
 		updateRelationAndSpecialOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
+		updateRelationAndSpecialSettleOrder(endTime - 1000 * 60 * 60 * 24L, endTime);
 	}
 
 	// 姣忎釜灏忔椂鏇存柊

--
Gitblit v1.8.0