Commit 4146270e by 徐康

Merge remote-tracking branch 'origin/develop' into develop

parents c9318eab 6dff21a9
......@@ -1435,23 +1435,25 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
if (response.getData() == null || response.getData().getData() == null || response.getData().getData().getCardSimpleInfos().size() > 1) {
throw new ServiceException(ResponseResult.USER_SVC_CARD_ERROR);
}
//获取实际配送费
//获取实际配送费,配送费不
Integer deliveryAmount = 0;
if (StringUtils.isNotBlank(receiveId) && shoppingCartGoodsResponseVo.getDiscountDeliveryAmount() != null) {
// Integer deliveryAmount = getDeliveryAmount(receiveId, partnerId, storeId);
Integer deliveryAmount = shoppingCartGoodsResponseVo.getDiscountDeliveryAmount().intValue();
deliveryAmount = shoppingCartGoodsResponseVo.getDiscountDeliveryAmount().intValue();
orderAmount += deliveryAmount;
}
//混合支付无需校验svc卡余额
// Integer amount1 = response.getData().getData().getCardSimpleInfos().get(0).getAmount();
// Integer vamount = response.getData().getData().getCardSimpleInfos().get(0).getVamount();
//
// if (orderAmount > amount1 + vamount) {
// throw new ServiceException(ResponseResult.USER_SVC_CARD_AMOUNT_DEFICIENCY);
// }
BigDecimal bigDecimal = new BigDecimal(orderAmount);
String amountStr = bigDecimal.divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).toString();
shoppingCartGoodsResponseVo.setTotalAmount(0L);
shoppingCartGoodsResponseVo.setSvcDiscountDesc("储值卡支付¥" + amountStr);
//混合支付无需校验svc卡余额,但是配送和包装费不计算在svc卡支付
Integer amount1 = response.getData().getData().getCardSimpleInfos().get(0).getAmount();
Integer vamount = response.getData().getData().getCardSimpleInfos().get(0).getVamount();
BigDecimal svcPayAmount = BigDecimal.ZERO;
if (orderAmount > amount1 + vamount) {
svcPayAmount = new BigDecimal(amount1 + vamount).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
shoppingCartGoodsResponseVo.setTotalAmount(orderAmount - svcPayAmount.multiply(new BigDecimal(100)).longValue());
}else{
svcPayAmount = new BigDecimal(orderAmount - deliveryAmount).divide(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
shoppingCartGoodsResponseVo.setTotalAmount(deliveryAmount.longValue());
}
shoppingCartGoodsResponseVo.setSvcDiscountDesc("储值卡支付¥" + svcPayAmount);
}
/**
......
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