diff --git a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java index 8dda9a15..e4707a3f 100644 --- a/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/order/order/serviceimpl/StoreFlowServiceImpl.java @@ -180,6 +180,12 @@ public class StoreFlowServiceImpl extends ServiceImpl { */ @Select("SELECT SUM( final_price ) AS refundPrice,SUM( commission_price ) AS refundCommissionPrice" + ",SUM( distribution_rebate ) AS distributionRefundCommission,SUM( site_coupon_commission ) AS siteCouponRefundCommission" + - ",SUM( bill_price ) AS billPrice FROM li_store_flow ${ew.customSqlSegment}") + ",SUM( final_price ) AS billPrice FROM li_store_flow ${ew.customSqlSegment}") Bill getRefundBill(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); } \ No newline at end of file diff --git a/framework/src/main/java/cn/lili/modules/store/serviceimpl/BillServiceImpl.java b/framework/src/main/java/cn/lili/modules/store/serviceimpl/BillServiceImpl.java index 5cf4338b..d74c4339 100644 --- a/framework/src/main/java/cn/lili/modules/store/serviceimpl/BillServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/store/serviceimpl/BillServiceImpl.java @@ -103,7 +103,7 @@ public class BillServiceImpl extends ServiceImpl implements Bi //分销订单退还,返现佣金返还 bill.setDistributionRefundCommission(refundBill.getDistributionRefundCommission()); //退货平台优惠券补贴返还 - bill.setSiteCouponRefundCommission(refundBill.getSiteCouponRefundCommission()); + bill.setSiteCouponRefundCommission(refundBill.getSiteCouponRefundCommission()!=null?refundBill.getSiteCouponRefundCommission():0D); //退款金额=店铺最终退款结算金额 refundPrice = refundBill.getBillPrice(); } @@ -132,16 +132,16 @@ public class BillServiceImpl extends ServiceImpl implements Bi bill.setPointSettlementPrice(orderBill.getPointSettlementPrice()); //砍价商品结算价格 bill.setKanjiaSettlementPrice(orderBill.getKanjiaSettlementPrice()); - //入款结算金额= 店铺支付结算金额 + 平台优惠券补贴 + 退单产生退还佣金金额 + 分销订单退还,返现佣金返还+退货平台优惠券补贴返还 + + //入款结算金额= 店铺支付结算金额 + 平台优惠券补贴 + 分销订单退还,返现佣金返还+退单产生退还佣金金额 orderPrice = CurrencyUtil.add(orderBill.getBillPrice(), bill.getSiteCouponCommission(), - bill.getRefundCommissionPrice(), bill.getDistributionRefundCommission(), - bill.getSiteCouponRefundCommission()); + bill.getRefundCommissionPrice()); } - //最终结算金额=入款结算金额-退款结算金额- - Double finalPrice = CurrencyUtil.sub(orderPrice, refundPrice); + //最终结算金额=入款结算金额-退款结算金额-退货平台优惠券补贴返还 + Double finalPrice = CurrencyUtil.sub(orderPrice, refundPrice,bill.getSiteCouponRefundCommission()); //店铺最终结算金额=最终结算金额 bill.setBillPrice(finalPrice);