From 7e7db2fa55a9a3af46d4fd8ede0dee147f101d64 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 09 五月 2020 21:41:27 +0800
Subject: [PATCH] 2.1需求

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java
index 1af87c0..8ad030b 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserGoodsStorageServiceImpl.java
@@ -20,8 +20,10 @@
 import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
 import com.yeshi.fanli.dto.share.ShareGoodsRecordDTO;
 import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
+import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
 import com.yeshi.fanli.entity.goods.CommonGoods;
 import com.yeshi.fanli.entity.jd.JDGoods;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
 import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
 import com.yeshi.fanli.exception.goods.CommonGoodsException;
 import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
@@ -217,7 +219,7 @@
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	public void addCommonGoods(Long uid, Set<Long> ids) throws UserGoodsStorageException {
 
 		if (uid == null) {
@@ -289,7 +291,7 @@
 			}
 		}
 
-		BigDecimal rate = manageService.getFanLiRate();
+		BigDecimal rate = manageService.getFanLiRate(UserLevelEnum.daRen);
 		Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
 				.excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
 
@@ -372,7 +374,7 @@
 		BigDecimal totalMoney = new BigDecimal(0.00);
 		List<TaoBaoGoodsBrief> listGoodsBrief = new ArrayList<TaoBaoGoodsBrief>();
 
-		BigDecimal rate = hongBaoManageService.getShareRate();
+		BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
 		for (UserGoodsStorage userGoodsStorage : listResult) {
 			CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
 			TaoBaoGoodsBrief goodsBrief = TaoBaoUtil.convert(commonGoods);
@@ -391,7 +393,7 @@
 		data.put("revenue", listGoodsBrief.size() + "涓晢鍝侀浼板垎浜閲戯細楼" + totalMoney);
 		data.put("shareId", shareRecord.getRedisKey());
 		data.put("shareImg", uploadResult);
-		data.put("notifyDesc", configService.get("goods_share_multiple_notify"));
+		data.put("notifyDesc", configService.get(ConfigKeyEnum.goodsShareMultipleNotify.getKey()));
 		return data;
 	}
 
@@ -419,7 +421,7 @@
 		List<CommonGoods> listCommonGoods = new ArrayList<CommonGoods>();
 
 		Integer goodsType = null;
-		BigDecimal rate = hongBaoManageService.getShareRate();
+		BigDecimal rate = hongBaoManageService.getShareRate(UserLevelEnum.daRen);
 		for (UserGoodsStorage userGoodsStorage : listResult) {
 			CommonGoods commonGoods = userGoodsStorage.getCommonGoods();
 			BigDecimal money = CommonGoodsUtil.getCommission(commonGoods, rate);
@@ -444,12 +446,12 @@
 		// 鎻愮ず璇笉鍚�
 		if (goodsType == Constant.SOURCE_TYPE_JD) {
 			// 浜笢
-			data.put("notifyDesc", configService.get("goods_share_notify_jd"));
+			data.put("notifyDesc", configService.get(ConfigKeyEnum.goodsShareNotifyJD.getKey()));
 		} else if (goodsType == Constant.SOURCE_TYPE_PDD) {
 			// 鎷煎澶�
-			data.put("notifyDesc", configService.get("goods_share_notify_pdd"));
+			data.put("notifyDesc", configService.get(ConfigKeyEnum.goodsShareNotifyPDD.getKey()));
 		} else {
-			data.put("notifyDesc", configService.get("goods_share_multiple_notify"));
+			data.put("notifyDesc", configService.get(ConfigKeyEnum.goodsShareMultipleNotify.getKey()));
 		}
 		return data;
 	}

--
Gitblit v1.8.0