From a520bc5faff1d6ee9a1d2da62da461700997f418 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 21 五月 2019 18:00:47 +0800
Subject: [PATCH] 选品库商品分享状态 更新sql调整

---
 fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 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 fe21a3b..c59fe2c 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
@@ -704,7 +704,10 @@
 		tg.setUserType(tb.getUserType());
 		tg.setShopTitle(tb.getShopTitle());
 		tg.setState(tb.getState()); // 鐘舵�侊細2018-12-03
-		if (tb.getCouponAmount().compareTo(BigDecimal.valueOf(0)) == 1) {
+		if (tb.getCouponAmount().compareTo(BigDecimal.valueOf(0)) > 0) {
+
+			tg.setCoupon(true);// 鏈夊埜
+
 			TaoBaoQuanInfo quanInfo = new TaoBaoQuanInfo();
 			quanInfo.setCouponAmount(tb.getCouponAmount());
 			String couponEffectiveEndTime = tb.getCouponEffectiveEndTime();
@@ -715,7 +718,7 @@
 			quanInfo.setCouponLeftCount(tb.getCouponLeftCount());
 			quanInfo.setCouponLink(
 					TaoBaoCouponUtil.getCoupleUrl(tb.getCouponActivityId(), pid, tb.getAuctionId() + ""));
-			quanInfo.setCouponPrice(tb.getZkPrice().subtract(tb.getTkCommFee()));
+			quanInfo.setCouponPrice(MoneyBigDecimalUtil.sub(tg.getZkPrice(), tb.getCouponAmount()));
 			quanInfo.setCouponStartFee(tb.getCouponStartFee());
 			quanInfo.setCouponTotalCount(tb.getCouponTotalCount());
 			tg.setTaoBaoQuanInfo(quanInfo);
@@ -758,15 +761,14 @@
 
 		tg.setTaoBaoHongBaoInfo(hongBaoInfo);
 
+		tg.setMoneyType(1);
+		tg.setSalesType(1);
 		// 娴嬭瘯浣跨敤
-		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);
-
+		// tg.setSalesType(Math.random() > 0.5 ? tg.getSalesType() : 3);
+		// List<ClientTextStyleVO> labels = new ArrayList<>();
+		// labels.add(new ClientTextStyleVO("鏍囩鍐呭", "#F14242"));
+		// labels.add(new ClientTextStyleVO("鏍囩鍐呭", "#00FF00"));
+		// tg.setLabels(labels);
 		return tg;
 	}
 
@@ -1010,14 +1012,16 @@
 		}
 		tg.setTaoBaoHongBaoInfo(hongBaoInfo);
 
+		tg.setMoneyType(1);
+		tg.setSalesType(1);
 		// 娴嬭瘯浣跨敤
-		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);
+		// 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("鏍囩鍐呭", "#F14242"));
+		// labels.add(new ClientTextStyleVO("鏍囩鍐呭", "#000000"));
+		// tg.setLabels(labels);
 
 		return tg;
 	}

--
Gitblit v1.8.0