From 8ba02b125d2df1a3393efdb276daae2244452d45 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 28 十月 2019 18:06:58 +0800
Subject: [PATCH] 返利奖励券新规则调整,订单统计,返利到账优化
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
index f560e7d..8175fa3 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
@@ -16,6 +16,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.taobao.TbImgUtil;
+import com.yeshi.fanli.dto.jd.JDCategoryInfo;
import com.yeshi.fanli.dto.jd.JDCouponInfo;
import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
@@ -27,6 +28,7 @@
import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
import com.yeshi.fanli.entity.jd.JDGoods;
+import com.yeshi.fanli.entity.jd.JDGoodsClass;
import com.yeshi.fanli.entity.system.BusinessSystem;
import com.yeshi.fanli.entity.system.SystemClientParams;
import com.yeshi.fanli.entity.taobao.ClientTBPid;
@@ -46,6 +48,7 @@
import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
+import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
@@ -180,6 +183,9 @@
@Resource
private JumpDetailV2Service jumpDetailV2Service;
+ @Resource
+ private JDGoodsClassService jdGoodsClassService;
+
/**
* 娣樺疂鍟嗗搧璇︽儏
*
@@ -259,7 +265,6 @@
taoBaoGoodsUpdateService.offlineTaoBaoGoods(id);
}
});
-
}
} else {
@@ -344,6 +349,15 @@
BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
BigDecimal shareRate = hongBaoManageService.getShareRate();
GoodsDetailVO goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, null, fanLiRate, shareRate);
+
+ if (TaoBaoUtil.isYUShou(goods)) {
+ if (!StringUtil.isNullOrEmpty(goods.getPresaleDiscountFeeText())) {
+ if (goodsDetail.getLabels() == null)
+ goodsDetail.setLabels(new ArrayList<>());
+ goodsDetail.getLabels().add(new ClientTextStyleVO(goods.getPresaleDiscountFeeText(), "#FF2B4E"));
+ }
+ }
+ // 鍦ㄦ爣棰樻坊鍔犱紭鎯犱俊鎭�
// 搴楅摵淇℃伅
TaoBaoShop shop = taoBaoShopService.getTaoBaoShop(id, goods.getSellerId());
@@ -539,11 +553,11 @@
OtherInfo otherInfo = new OtherInfo();
RewardCouponVO rewardCoupon = new RewardCouponVO();
rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
- JSONObject params1=new JSONObject();
+ JSONObject params1 = new JSONObject();
params1.put("url", configService.get("special_guide_reward_coupon_link"));
rewardCoupon.setParams(params1.toString());
- rewardCoupon.setMaxMoney("楼" +TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate).add( MoneyBigDecimalUtil.mul(TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate),
- Constant.MAX_REWARD_RATE)));
+ rewardCoupon.setMaxMoney("楼" + TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate).add(MoneyBigDecimalUtil
+ .mul(TaoBaoUtil.getGoodsHongBaoMoney(goods, fanLiRate), Constant.MAX_REWARD_RATE)));
rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
otherInfo.setRewardCoupon(rewardCoupon);
goodsDetail.setOtherInfo(otherInfo);
@@ -629,13 +643,39 @@
// 闄勫姞淇℃伅
OtherInfo otherInfo = new OtherInfo();
+
+ // 浜笢plus杩斿埄
+ String maxMoneyPlus = null;
+ JDCategoryInfo categoryInfo = jdGoods.getCategoryInfo();
+ if (categoryInfo != null && categoryInfo.getCid3() != null && jdGoods.getCommissionInfo() != null) {
+ Long cid3 = categoryInfo.getCid3();
+ JDGoodsClass threeClass = jdGoodsClassService.getThreeClassByCid(Integer.parseInt(cid3.toString()));
+ if (threeClass != null && threeClass.getSelfComm() != null
+ && threeClass.getSelfComm().compareTo(new BigDecimal(0)) > 0) {
+ BigDecimal commissionShare = jdGoods.getCommissionInfo().getCommissionShare();
+ // plus姣斾緥 灏忎簬姝e父姣斾緥
+ if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
+ jdGoods.setCommissionPlus(threeClass.getSelfComm());
+ // plus杩斿埄
+ BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
+ otherInfo.setFanliMoneyPlus("浜笢plus浼氬憳杩斅�" + fanliMoneyPlus);
+ // 浣跨敤濂栧姳鍒告渶楂樿繑
+ maxMoneyPlus = "锛堜含涓減lus浼氬憳鏈�楂樿繑楼"
+ + fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))
+ + "锛�";
+ }
+ }
+ }
+
+ // 濂栧姳鍒歌繑鍒�
RewardCouponVO rewardCoupon = new RewardCouponVO();
+ rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
- JSONObject params1=new JSONObject();
+ JSONObject params1 = new JSONObject();
params1.put("url", configService.get("special_guide_reward_coupon_link"));
rewardCoupon.setParams(params1.toString());
- rewardCoupon.setMaxMoney(
- "楼" +JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate).add( MoneyBigDecimalUtil.mul(JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
+ rewardCoupon.setMaxMoney("楼" + JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate)
+ .add(MoneyBigDecimalUtil.mul(JDUtil.getGoodsFanLiMoney(jdGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
otherInfo.setRewardCoupon(rewardCoupon);
goodsDetail.setOtherInfo(otherInfo);
@@ -779,11 +819,11 @@
OtherInfo otherInfo = new OtherInfo();
RewardCouponVO rewardCoupon = new RewardCouponVO();
rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
- JSONObject params1=new JSONObject();
+ JSONObject params1 = new JSONObject();
params1.put("url", configService.get("special_guide_reward_coupon_link"));
rewardCoupon.setParams(params1.toString());
- rewardCoupon.setMaxMoney("楼" +PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate).add(MoneyBigDecimalUtil.mul(PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate),
- Constant.MAX_REWARD_RATE)));
+ rewardCoupon.setMaxMoney("楼" + PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate).add(MoneyBigDecimalUtil
+ .mul(PinDuoDuoUtil.getGoodsFanLiMoney(pddGoods, fanLiRate), Constant.MAX_REWARD_RATE)));
rewardCoupon.setDesc("鐢ㄨ繑鍒╁鍔卞埜鏈�楂樿繑");
otherInfo.setRewardCoupon(rewardCoupon);
goodsDetail.setOtherInfo(otherInfo);
--
Gitblit v1.8.0