Commit 99933a70 by chongfu.liang

fix

parent 61e555bf
......@@ -56,6 +56,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
@Autowired
private ProductManager productManager;
@Autowired
private CouponManager couponManager;
......@@ -453,7 +454,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
List<CartGoods> giftGoods = null;
AdditionBO additionBO = null;
ScoreReduceBO scoreReduceBO = null;
if (distributeBO.getCalculationDiscountBO() == null || CollectionUtils.isEmpty(distributeBO.getCartGoods())){
if (distributeBO.getCalculationDiscountBO() != null || CollectionUtils.isEmpty(distributeBO.getCartGoods())){
/**
* 用促销价格初始化购物车行记录成交价
*/
......@@ -466,11 +467,13 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
*/
additionBO = this.additionResponse(distributeBO.getCalculationDiscountBO().getResult(), baseRequestDTO);
}
/**
* 积分抵扣
*/
scoreReduceBO = this.scoreReduce(distributeBO.getCalculationDiscountBO().getResult(), baseRequestDTO, shoppingGoodsAmountBO, additionBO);
}
scoreReduceBO = this.scoreReduce(distributeBO.getCalculationDiscountBO(), baseRequestDTO, shoppingGoodsAmountBO, additionBO);
/**
* 配送费
......@@ -661,7 +664,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
public ScoreReduceBO scoreReduce(CalculationDiscountBO.CalculationDiscountResult discountResult
public ScoreReduceBO scoreReduce(CalculationDiscountBO calculationDiscountBO
, ListCartGoodsBO baseRequestDTO, ShoppingGoodsAmountBO shoppingGoodsAmountBO, AdditionBO additionBO) {
ScoreReduceBO scoreReduce = new ScoreReduceBO();
if (baseRequestDTO == null || baseRequestDTO.getUseCustomerScore() == null
......@@ -698,8 +701,13 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
if (getValue(userScoreUseDetail.getOverlayOffers()) == 0) {
scoreReduce.setScoreReduceState(getValue(userScoreUseDetail.getScoreState()));
} else {
if (StringUtils.isNotBlank(baseRequestDTO.getCouponCode()) || (discountResult != null && discountResult.getTotalDiscountAmount().intValue() > 0)
|| (discountResult != null && !CollectionUtils.isEmpty(discountResult.getDiscounts()))) {
CalculationDiscountBO.CalculationDiscountResult discountResult = null;
if (calculationDiscountBO != null){
discountResult = calculationDiscountBO.getResult();
}
if (discountResult != null){
if (StringUtils.isNotBlank(baseRequestDTO.getCouponCode()) || (discountResult.getTotalDiscountAmount().intValue() > 0)
|| (!CollectionUtils.isEmpty(discountResult.getDiscounts()))) {
//是否有换购
int type81 = 0;
for (CalculationDiscountBO.CalculationDiscountResult.Discount discount : discountResult.getDiscounts()) {
......@@ -723,6 +731,7 @@ public class AbstractListCartGoodsService implements ListCartGoodsService {
}
}
}
}
scoreReduce.setUseScore(getValue(userScoreUseDetail.getUseScore()));
scoreReduce.setScoreState(userScoreUseDetail.getScoreState());
scoreReduce.setScoreReduceRate(userScoreUseDetail.getScoreReduceRate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment