...
|
...
|
@@ -364,8 +364,6 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
|
|
|
logger.info("generate new orderCode:{}",orderCode);
|
|
|
|
|
|
//优惠券支付结果
|
|
|
List<CouponPayResult> couponPayResults = chargeResult.getCouponPayResultList().getCouponPayResults();
|
|
|
// 减库存,skup更新成不可售,入库
|
|
|
//BigDecimal shipFee = new BigDecimal(delivery_way_sf_cost);
|
|
|
OrderBuilder orderBuilder = OrderBuilder.builder()
|
...
|
...
|
@@ -378,20 +376,13 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
.channelNo(shoppingRequest.getChannelNo())
|
|
|
.amount(BigDecimal.valueOf(chargeResult.getFinalAmount()))
|
|
|
.shipFee(BigDecimal.valueOf(chargeResult.getFinalShippingAmount()))
|
|
|
.couponBos(couponPayResults.stream().map(couponPayResult -> CouponBo.builder().couponCode(couponPayResult.getCouponCode()).couponAmount(BigDecimal.valueOf(couponPayResult.getCouponAmount())).build())
|
|
|
.collect(Collectors.toList())
|
|
|
)
|
|
|
.couponBos(buildOrderCouponBos(chargeResult))
|
|
|
.hiddenAddressInfo(userAddressPair.getRight())
|
|
|
.addressInfo(userAddressPair.getLeft())
|
|
|
.clientType(shoppingRequest.getClientType())
|
|
|
.attributes(buildOrderAttribute(psog).getCode())
|
|
|
.sellerOrderGoods(psog)
|
|
|
.activityBo(ActivityBo.builder().activityType(chargeResult.getActivityCutResult().getActivityType())
|
|
|
.userActivityId(chargeResult.getActivityCutResult().getUserActivityId())
|
|
|
//以计算结果为准
|
|
|
.activityCutAmount(BigDecimal.valueOf(chargeResult.getActivityCutResult().getActivityCutAmount()))
|
|
|
.build()
|
|
|
)
|
|
|
.activityBo(buildOrderActivityBo(chargeResult))
|
|
|
.amountDetailBo(buildOrderAmountDetailBo(chargeResult))
|
|
|
.build();
|
|
|
|
...
|
...
|
@@ -478,6 +469,37 @@ public class ShoppingServiceImpl implements IShoppingService { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 优惠券支付结果
|
|
|
*
|
|
|
* @param chargeResult
|
|
|
* @return
|
|
|
*/
|
|
|
protected List<CouponBo> buildOrderCouponBos(ChargeResult chargeResult) {
|
|
|
return chargeResult.getCouponPayResultList().getCouponPayResults().stream()
|
|
|
.map(couponPayResult -> CouponBo.builder()
|
|
|
.couponCode(couponPayResult.getCouponCode())
|
|
|
.couponType(couponPayResult.getCouponType())
|
|
|
.couponAmount(BigDecimal.valueOf(couponPayResult.getCouponAmount()))
|
|
|
.build()
|
|
|
)
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 活动优惠
|
|
|
*
|
|
|
* @param chargeResult
|
|
|
* @return
|
|
|
*/
|
|
|
protected ActivityBo buildOrderActivityBo(ChargeResult chargeResult) {
|
|
|
return ActivityBo.builder().activityType(chargeResult.getActivityCutResult().getActivityType())
|
|
|
.userActivityId(chargeResult.getActivityCutResult().getUserActivityId())
|
|
|
//以计算结果为准
|
|
|
.activityCutAmount(BigDecimal.valueOf(chargeResult.getActivityCutResult().getActivityCutAmount()))
|
|
|
.build();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单金额明细
|
|
|
* @param chargeResult
|
|
|
* @return
|
...
|
...
|
|