From dd5b15229cb15459fa7c31ccea77dac28cbfafbd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 13 四月 2020 10:04:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java
index bd21e29..e123c72 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeBaseUtil.java
@@ -10,6 +10,7 @@
 import com.yeshi.fanli.exception.taobao.TaoKeApiException;
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.log.TaoKeLogHelper;
+import com.yeshi.fanli.util.EmergencyUtil;
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TaoBaoHttpUtil;
 import com.yeshi.fanli.util.TimeUtil;
@@ -49,10 +50,16 @@
 		String result = TaoBaoHttpUtil.taoKeGet(params);
 		JSONObject data = JSONObject.fromObject(result);
 		if (data != null) {
-			if (data.optJSONObject("error_response") != null
-					&& data.optJSONObject("error_response").optInt("code") == 7) {
+			if (data.optJSONObject("error_response") != null && data.optJSONObject("error_response").optInt("code") == 7
+					&& "accesscontrol.limited-by-app-access-count"
+							.equalsIgnoreCase(data.optJSONObject("error_response").optString("sub_code"))) {
 				reportAppInvalid(app.getAppKey());
 				TaoKeLogHelper.error(params, result);
+				try {
+					EmergencyUtil.baoJin("monitor-error-tb-app-limit-" + params.get("app_key"),
+							"娣樺疂APPKey璇锋眰闄愬埗銆�" + params.get("app_key") + "銆�", new String[] { "18581318252" });
+				} catch (Exception e1) {
+				}
 				throw new TaoKeApiException(TaoKeApiException.CODE_APPKEY_LIMIT, "娣樺疂璇锋眰闄愬埗:" + result, params);
 			} else if (data.optJSONObject("error_response") != null) {
 				throw new TaoKeApiException(TaoKeApiException.CODE_API_ERROR, result, params);
@@ -83,13 +90,15 @@
 		params.put("v", "2.0");
 		params.put("timestamp", TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
 		params.put("format", "json");
-		params.put("adzone_id", app.getAdzoneId());
+		if (!StringUtil.isNullOrEmpty(app.getAdzoneId()))
+			params.put("adzone_id", app.getAdzoneId());
 		params.put("sign", getSign(params, "md5", app).toUpperCase());
 		String result = TaoBaoHttpUtil.taoKeGet(params);
 		JSONObject data = JSONObject.fromObject(result);
 		if (data != null) {
-			if (data.optJSONObject("error_response") != null
-					&& data.optJSONObject("error_response").optInt("code") == 7) {
+			if (data.optJSONObject("error_response") != null && data.optJSONObject("error_response").optInt("code") == 7
+					&& "accesscontrol.limited-by-app-access-count"
+							.equalsIgnoreCase(data.optJSONObject("error_response").optString("sub_code"))) {
 				reportAppInvalid(app.getAppKey());
 				throw new TaoKeApiException(TaoKeApiException.CODE_APPKEY_LIMIT, "娣樺疂璇锋眰闄愬埗:" + result, params);
 			} else if (data.optJSONObject("error_response") != null) {

--
Gitblit v1.8.0