...
|
...
|
@@ -61,7 +61,6 @@ import java.math.BigDecimal; |
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import org.springframework.context.annotation.Primary;
|
...
|
...
|
@@ -504,7 +503,7 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
*/
|
|
|
protected AmountDetailBo buildOrderAmountDetailBo(ChargeResult chargeResult) {
|
|
|
//订单金额明细
|
|
|
AmountDetailBo amountDetailBo = new AmountDetailBo();
|
|
|
final AmountDetailBo amountDetailBo = new AmountDetailBo();
|
|
|
//商品金额
|
|
|
amountDetailBo.setGoodsAmount(chargeResult.getGoodsAmount());
|
|
|
//运费原价
|
...
|
...
|
@@ -512,16 +511,13 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
//活动金额
|
|
|
amountDetailBo.setActivityCutAmount(chargeResult.getActivityCutResult().getActivityCutAmount());
|
|
|
|
|
|
Optional<CouponPayResult> tempPayResult;
|
|
|
if ((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode())).isPresent()) {
|
|
|
//活动券减免金额
|
|
|
amountDetailBo.setCouponCutAmount(tempPayResult.get().getCouponAmount());
|
|
|
}
|
|
|
//活动券减免金额
|
|
|
chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode()).
|
|
|
ifPresent(tempPayResult -> amountDetailBo.setCouponCutAmount(tempPayResult.getCouponAmount()));
|
|
|
|
|
|
if ((tempPayResult = chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.SHIPPING_COUPON.getCode())).isPresent()) {
|
|
|
//运费券减免金额
|
|
|
amountDetailBo.setShippingCouponCutAmount(tempPayResult.get().getCouponAmount());
|
|
|
}
|
|
|
//运费券减免金额
|
|
|
chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.SHIPPING_COUPON.getCode()).
|
|
|
ifPresent(tempPayResult -> amountDetailBo.setShippingCouponCutAmount(tempPayResult.getCouponAmount()));
|
|
|
|
|
|
return amountDetailBo;
|
|
|
}
|
...
|
...
|
|