From 087b91bff39bb54d872a181c113cdb41c27cacbe Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 17 四月 2020 13:57:38 +0800
Subject: [PATCH] 商家跑路后奖励券赠送修改,饿了么兼容封面图片

---
 fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java |  123 ++++-------------------------------------
 1 files changed, 12 insertions(+), 111 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java
index 48df09b..3a1a2e5 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeOrderApiUtil.java
@@ -102,117 +102,6 @@
 		return resultList;
 	}
 
-	private static List<TaoBaoOrder> parseTaoBaoOrder(String response) {
-
-		List<TaoBaoOrder> orderList = new ArrayList<>();
-
-		JSONObject data = JSONObject.fromObject(response);
-		if (data.optJSONObject("tbk_order_get_response") == null)
-			return orderList;
-		if (data.optJSONObject("tbk_order_get_response").optJSONObject("results") == null)
-			return orderList;
-		if (data.optJSONObject("tbk_order_get_response").optJSONObject("results").optJSONArray("n_tbk_order") == null)
-			return orderList;
-
-		JSONArray array = data.optJSONObject("tbk_order_get_response").optJSONObject("results")
-				.optJSONArray("n_tbk_order");
-		for (int i = 0; i < array.size(); i++) {
-
-			JSONObject item = array.optJSONObject(i);
-			try {
-				TaoBaoOrder taoBaoOrder = new TaoBaoOrder();
-				taoBaoOrder.setAdPositionId(item.optString("adzone_id"));
-				taoBaoOrder.setAdPositionName(item.optString("adzone_name"));
-				taoBaoOrder.setAuctionId(item.optLong("num_iid"));
-				taoBaoOrder.setClassName(item.optString("auction_category"));
-				taoBaoOrder.setClickTime(item.optString("click_time"));
-				taoBaoOrder.setCount(item.optInt("item_num"));
-				taoBaoOrder.setCreateTime(item.optString("create_time"));
-				if (!StringUtil.isNullOrEmpty(item.optString("total_commission_fee")))
-					taoBaoOrder.seteIncome(new BigDecimal(item.optString("total_commission_fee")));
-				else
-					taoBaoOrder.seteIncome(new BigDecimal(0));
-
-				if (!StringUtil.isNullOrEmpty(item.optString("pub_share_pre_fee")))
-					taoBaoOrder.setEstimate(new BigDecimal(item.optString("pub_share_pre_fee")));
-				else
-					taoBaoOrder.setEstimate(new BigDecimal(0));
-				taoBaoOrder.setiRatio(new BigDecimal(item.optString("income_rate")).multiply(new BigDecimal(100)));
-				taoBaoOrder.setLatestUpdateTime(null);
-				taoBaoOrder.setManagerWangWang(null);
-				taoBaoOrder.setOrderBy(null);
-				taoBaoOrder.setOrderId(item.optString("trade_parent_id"));
-				if (item.optInt("tk_status") == 12)
-					taoBaoOrder.setOrderState("璁㈠崟浠樻");
-				else if (item.optInt("tk_status") == 3)
-					taoBaoOrder.setOrderState("璁㈠崟缁撶畻");
-				else if (item.optInt("tk_status") == 13)
-					taoBaoOrder.setOrderState("璁㈠崟澶辨晥");
-				else if (item.optInt("tk_status") == 14)
-					taoBaoOrder.setOrderState("璁㈠崟鎴愬姛");
-
-				taoBaoOrder.setOrderType(item.optString("order_type"));
-				if (!StringUtil.isNullOrEmpty(item.optString("alipay_total_price")))
-					taoBaoOrder.setPayment(new BigDecimal(item.optString("alipay_total_price")));
-				else
-					taoBaoOrder.setPayment(new BigDecimal(0));
-				taoBaoOrder.setPrice(new BigDecimal(item.optString("price")));
-				if (!StringUtil.isNullOrEmpty(item.optString("pay_price")))
-					taoBaoOrder.setSettlement(new BigDecimal(item.optString("pay_price")));
-				else
-					taoBaoOrder.setSettlement(new BigDecimal(0));
-				taoBaoOrder.setSettlementTime(item.optString("earning_time"));
-				taoBaoOrder.setShop(item.optString("seller_shop_title"));
-				taoBaoOrder.setSourceMediaId(item.optString("site_id"));
-				taoBaoOrder.setSourceMediaName(item.optString("site_name"));
-				taoBaoOrder.setsRatio(null);
-				if (!StringUtil.isNullOrEmpty(item.optString("subsidy_fee")))// 琛ヨ创閲戦
-					taoBaoOrder.setSubsidy(new BigDecimal(item.optString("subsidy_fee")));
-				if (!StringUtil.isNullOrEmpty(item.optString("subsidy_rate")))
-					taoBaoOrder.setSubsidyRatio(
-							new BigDecimal(item.optString("subsidy_rate")).multiply(new BigDecimal(100)));
-				taoBaoOrder.setSubsidyType(item.optString("subsidy_type"));
-				taoBaoOrder.setTechnologySupportPercent(null);
-				taoBaoOrder.setThirdService(null);
-				taoBaoOrder.setTitle(item.optString("item_title"));
-				if (!StringUtil.isNullOrEmpty(item.optString("total_commission_fee")))
-					taoBaoOrder.setTkMoney(new BigDecimal(item.optString("total_commission_fee")));
-				else
-					taoBaoOrder.setTkMoney(new BigDecimal(0));
-				if (!StringUtil.isNullOrEmpty(item.optString("commission_rate")))
-					taoBaoOrder
-							.setTkRate(new BigDecimal(item.optString("commission_rate")).multiply(new BigDecimal(100)));
-				else if (!StringUtil.isNullOrEmpty(item.optString("total_commission_rate")))
-					taoBaoOrder.setTkRate(
-							new BigDecimal(item.optString("total_commission_rate")).multiply(new BigDecimal(100)));
-				taoBaoOrder.setTransactionPlatform(item.optString("terminal_type"));
-				taoBaoOrder.setRelationId(item.optString("relation_id"));
-				taoBaoOrder.setSpecialId(item.optString("special_id"));
-				taoBaoOrder.setTradeId(item.optString("trade_id"));
-				// 瑙f瀽鍟嗗搧淇℃伅
-				TaoBaoOrderGoods goods = new TaoBaoOrderGoods();
-				goods.setCategoryName(item.optString("item_category_name"));
-				goods.setCreateTime(new Date());
-				goods.setGoodsId(item.optLong("item_id"));
-				goods.setImg(item.optString("item_img"));
-				goods.setLink(item.optString("item_link"));
-				goods.setPrice(item.optString("item_price"));
-				goods.setTitle(item.optString("item_title"));
-				goods.setTradeId(item.optString("trade_id"));
-				
-				taoBaoOrder.setGoods(goods);
-				orderList.add(taoBaoOrder);
-			} catch (Exception e) {
-				try {
-					LogHelper.errorDetailInfo(e, "璁㈠崟鍙蜂俊鎭�:" + item.toString(), "璁㈠崟瑙f瀽鍑洪敊");
-				} catch (Exception e1) {
-				}
-			}
-		}
-
-		return orderList;
-	}
-
 	private static TaoBaoOrderResultDTO parseTaoBaoOrderNew(String response) {
 
 		TaoBaoOrderResultDTO dto = new TaoBaoOrderResultDTO(false, false, null, new ArrayList<>());
@@ -305,6 +194,18 @@
 					taoBaoOrder.setRelationId(item.optString("relation_id"));
 					taoBaoOrder.setSpecialId(item.optString("special_id"));
 					taoBaoOrder.setTradeId(item.optString("trade_id"));
+					// 瑙f瀽鍟嗗搧淇℃伅
+					TaoBaoOrderGoods goods = new TaoBaoOrderGoods();
+					goods.setCategoryName(item.optString("item_category_name"));
+					goods.setCreateTime(new Date());
+					goods.setGoodsId(item.optLong("item_id"));
+					goods.setImg(item.optString("item_img"));
+					goods.setLink(item.optString("item_link"));
+					goods.setPrice(item.optString("item_price"));
+					goods.setTitle(item.optString("item_title"));
+					goods.setTradeId(item.optString("trade_id"));
+					
+					taoBaoOrder.setGoods(goods);
 					orderList.add(taoBaoOrder);
 				} catch (Exception e) {
 					try {

--
Gitblit v1.8.0