From 8cb7ec4a35a38ae91d0eed17cde711e81d2b2bbf Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期二, 14 五月 2019 11:37:49 +0800
Subject: [PATCH] 合并

---
 fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java |   49 +++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
index acfba6b..fe21a3b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -51,6 +51,7 @@
 import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
 import com.yeshi.fanli.entity.taobao.TaoBaoShop;
 import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
+import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetail;
 import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
 import com.yeshi.fanli.log.LogHelper;
 import com.yeshi.fanli.service.inter.goods.TaoBaoLinkService;
@@ -760,8 +761,10 @@
 		// 娴嬭瘯浣跨敤
 		tg.setMoneyType(Math.random() > 0.5 ? 1 : 2);
 		tg.setSalesType(Math.random() > 0.5 ? 1 : 2);
+		tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
 		List<ClientTextStyleVO> labels = new ArrayList<>();
 		labels.add(new ClientTextStyleVO("鏍囩娴嬭瘯鍐呭", "#FF0000"));
+		labels.add(new ClientTextStyleVO("鏍囩娴嬭瘯鍐呭", "#00FF00"));
 		tg.setLabels(labels);
 
 		return tg;
@@ -1010,8 +1013,10 @@
 		// 娴嬭瘯浣跨敤
 		tg.setMoneyType(Math.random() > 0.5 ? 1 : 2);
 		tg.setSalesType(Math.random() > 0.5 ? 1 : 2);
+		tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
 		List<ClientTextStyleVO> labels = new ArrayList<>();
 		labels.add(new ClientTextStyleVO("鏍囩娴嬭瘯鍐呭", "#FF0000"));
+		labels.add(new ClientTextStyleVO("鏍囩娴嬭瘯鍐呭", "#00FF00"));
 		tg.setLabels(labels);
 
 		return tg;
@@ -1325,10 +1330,11 @@
 	 * @return
 	 */
 	public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
-		if (goodsBrief != null && goodsBrief.getMaterialLibType() != null && goodsBrief.getMaterialLibType() == 0)
-			return "楼0.00";
-		else
-			return "楼" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
+		// if (goodsBrief != null && goodsBrief.getMaterialLibType() != null &&
+		// goodsBrief.getMaterialLibType() == 0)
+		// return "楼0.00";
+		// else
+		return "楼" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
 	}
 
 	/**
@@ -1684,6 +1690,29 @@
 		return taoBaoGoods;
 	}
 
+	public static TaoBaoGoodsBrief convert(DaTaoKeDetail detail) {
+		TaoBaoGoodsBrief taoBaoGoods = new TaoBaoGoodsBrief();
+		taoBaoGoods.setAuctionId(detail.getGoodsId());
+		taoBaoGoods.setBiz30day(detail.getSalesNum());
+		taoBaoGoods.setCouponAmount(detail.getQuanPrice());
+		taoBaoGoods.setCouponInfo(String.format("婊�%s鍏冨噺%s鍏�", detail.getQuanCondition(),
+				MoneyBigDecimalUtil.getWithNoZera(detail.getQuanPrice())));
+		taoBaoGoods.setCouponLeftCount(detail.getQuanSurplus());
+		taoBaoGoods.setCouponStartFee(new BigDecimal(detail.getQuanCondition()));
+		taoBaoGoods.setCouponTotalCount(detail.getQuanSurplus());
+		taoBaoGoods.setPictUrl(detail.getPic());
+		taoBaoGoods.setPictUrlWhite(detail.getPic());
+		taoBaoGoods.setSellerId(detail.getSellerId());
+		taoBaoGoods.setShopTitle("");
+		taoBaoGoods.setTitle(detail.getdTitle());
+		taoBaoGoods.setUserType(detail.getIsTmall());
+		taoBaoGoods.setZkPrice(detail.getOrgPrice());
+		taoBaoGoods.setTkRate(detail.getCommission());
+		taoBaoGoods.setTkCommFee(new BigDecimal("0"));
+		taoBaoGoods.setState(0);
+		return taoBaoGoods;
+	}
+
 	/**
 	 * 鑾峰彇娣樺疂鑱旂洘鐨勬巿鏉冮摼鎺�
 	 * 
@@ -1801,9 +1830,21 @@
 		else
 			shop.setUserType(0);
 
+		shop.setShopLink(TaoBaoUtil.getShopLink(shop.getId()));
+
 		return shop;
 	}
 
+	/**
+	 * 鏍规嵁鍗栧id鑾峰彇搴楅摵閾炬帴
+	 * 
+	 * @param sellerId
+	 * @return
+	 */
+	public static String getShopLink(Long sellerId) {
+		return "http://store.taobao.com/shop/view_shop.htm?user_number_id=" + sellerId;
+	}
+
 	public static void main(String[] args) {
 		String s = channelMap.get("3");
 		System.out.println(s);

--
Gitblit v1.8.0