店铺结算单结算问题

This commit is contained in:
fengtianyangyang 2022-04-18 19:09:05 +08:00
parent df505e0e17
commit 9dc01f6057
3 changed files with 13 additions and 7 deletions

View File

@ -180,6 +180,12 @@ public class StoreFlowServiceImpl extends ServiceImpl<StoreFlowMapper, StoreFlow
storeFlow.setFinalPrice(afterSale.getActualRefundPrice());
//最终结算金额 =店铺流水金额+店铺单品返现支出金额+平台收取佣金金额
storeFlow.setBillPrice(CurrencyUtil.add(storeFlow.getFinalPrice(), storeFlow.getDistributionRebate(), storeFlow.getCommissionPrice()));
//站点优惠券佣金
storeFlow.setSiteCouponCommission(payStoreFlow.getSiteCouponCommission());
//平台优惠券 使用金额
storeFlow.setSiteCouponPrice(payStoreFlow.getSiteCouponPrice());
//站点优惠券佣金比例
storeFlow.setSiteCouponPoint(payStoreFlow.getSiteCouponPoint());
//退款日志
RefundLog refundLog = refundLogService.queryByAfterSaleSn(afterSale.getSn());
//第三方流水单号

View File

@ -51,6 +51,6 @@ public interface BillMapper extends BaseMapper<Bill> {
*/
@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<Bill> queryWrapper);
}

View File

@ -103,7 +103,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> 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<BillMapper, Bill> 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);