From a6f34b99ee20e528b766c8ed5a61bd9c5aa0e7ae Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期六, 16 十一月 2019 18:10:33 +0800
Subject: [PATCH] 淘宝相似商品推荐接口优化,根据商品ID搜索商品基本信息优化

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
index 0e3f9b7..50950ef 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/HongBaoV2ServiceImpl.java
@@ -145,6 +145,7 @@
 		return hongBaoV2Mapper.selectByPrimaryKey(id);
 	}
 
+
 	@Transactional
 	@Override
 	public int addHongBao(List<CommonOrder> commonOrderList, int type) throws HongBaoException {
@@ -313,7 +314,7 @@
 						MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
 				if (mianDan)
 					hongBao.setMoney(commonOrder.getPayment());
-			} else if (commonOrder.getState() == CommonOrder.STATE_JS) {
+			} else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
 				hongBao.setState(HongBaoV2.STATE_KELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -449,6 +450,9 @@
 						} else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
 							firstHongbao.setMoney(
 									MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
+						}else if(hongBao.getState() == HongBaoV2.STATE_SHIXIAO)
+						{
+							firstHongbao.setMoney(new BigDecimal(0));
 						}
 						hongBaoV2Mapper.insertSelective(firstHongbao);
 						// 鐢ㄦ埛閫氱煡
@@ -543,7 +547,7 @@
 				hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
-			} else if (commonOrder.getState() == CommonOrder.STATE_JS) {
+			} else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
 				hongBao.setState(HongBaoV2.STATE_KELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -591,7 +595,7 @@
 					}
 
 					// 浠ュ疄闄呮敹鍏ヤ负鍑嗚绠楅浼版敹鐩�
-					if (CommonOrder.STATE_JS == commonOrder.getState()) {
+					if (CommonOrder.STATE_JS == commonOrder.getState()||CommonOrder.STATE_WQ == commonOrder.getState()) {
 						childUpdate.setMoney(
 								MoneyBigDecimalUtil.mul(hongBao.getMoney(), rate.divide(new BigDecimal(100))));
 						if (commonOrder.getThirdCreateTime().getTime() > TimeUtil.convertToTimeTemp("2019-04-16",
@@ -691,7 +695,7 @@
 				hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), fanliRate.divide(new BigDecimal(100))));
-			} else if (commonOrder.getState() == CommonOrder.STATE_JS) {
+			} else if (commonOrder.getState() == CommonOrder.STATE_JS||CommonOrder.STATE_WQ == commonOrder.getState()) {
 				hongBao.setState(HongBaoV2.STATE_KELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), fanliRate.divide(new BigDecimal(100))));
@@ -898,7 +902,7 @@
 				hongBao.setState(HongBaoV2.STATE_BUKELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.getEstimate(), shareRate.divide(new BigDecimal(100))));
-			} else if (commonOrder.getState() == CommonOrder.STATE_JS) {
+			} else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
 				hongBao.setState(HongBaoV2.STATE_KELINGQU);
 				hongBao.setMoney(
 						MoneyBigDecimalUtil.mul(commonOrder.geteIncome(), shareRate.divide(new BigDecimal(100))));
@@ -950,7 +954,7 @@
 						child.setState(HongBaoV2.STATE_BUKELINGQU);
 						child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.getEstimate(),
 								firstLevelRate.divide(new BigDecimal(100))));
-					} else if (commonOrder.getState() == CommonOrder.STATE_JS) {
+					} else if (commonOrder.getState() == CommonOrder.STATE_JS||commonOrder.getState() == CommonOrder.STATE_WQ) {
 						child.setState(HongBaoV2.STATE_KELINGQU);
 						child.setMoney(MoneyBigDecimalUtil.mul(commonOrder.geteIncome(),
 								firstLevelRate.divide(new BigDecimal(100))));

--
Gitblit v1.8.0