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 f657f1c26..18872baa2 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 @@ -5,6 +5,7 @@ import cn.lili.common.utils.CurrencyUtil; import cn.lili.common.utils.SnowFlake; import cn.lili.common.vo.PageVO; import cn.lili.modules.order.aftersale.entity.dos.AfterSale; +import cn.lili.modules.order.aftersale.service.AfterSaleService; import cn.lili.modules.order.order.entity.dos.Order; import cn.lili.modules.order.order.entity.dos.OrderItem; import cn.lili.modules.order.order.entity.dos.StoreFlow; @@ -61,6 +62,8 @@ public class StoreFlowServiceImpl extends ServiceImpl getStoreFlow(StoreFlowQueryDTO storeFlowQueryDTO) { diff --git a/framework/src/main/java/cn/lili/modules/store/mapper/BillMapper.java b/framework/src/main/java/cn/lili/modules/store/mapper/BillMapper.java index 867f591d0..fa611af29 100644 --- a/framework/src/main/java/cn/lili/modules/store/mapper/BillMapper.java +++ b/framework/src/main/java/cn/lili/modules/store/mapper/BillMapper.java @@ -57,6 +57,6 @@ public interface BillMapper extends BaseMapper { ",IFNULL(SUM( site_coupon_commission ),0) AS siteCouponRefundCommission" + ",IFNULL(SUM( kanjia_settlement_price ),0) AS kanjiaRefundSettlementPrice" + ",IFNULL(SUM( point_settlement_price ),0) AS pointRefundSettlementPrice" + - ",IFNULL(SUM( final_price ),0) AS billPrice FROM li_store_flow ${ew.customSqlSegment}") + ",IFNULL(SUM( bill_price ),0) 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 c05b108c2..5b1f53282 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 @@ -95,7 +95,6 @@ public class BillServiceImpl extends ServiceImpl implements Bi //退款结算信息 Bill refundBill = this.baseMapper.getRefundBill(new QueryWrapper().eq("store_id", storeId).eq("flow_type", FlowTypeEnum.REFUND.name()).between("create_time", startTime, endTime)); //店铺退款金额 - Double refundPrice = 0D; if (refundBill != null) { //退单金额 bill.setRefundPrice(refundBill.getRefundPrice() != null ? refundBill.getRefundPrice() : 0D); @@ -109,8 +108,7 @@ public class BillServiceImpl extends ServiceImpl implements Bi bill.setPointRefundSettlementPrice(refundBill.getPointRefundSettlementPrice() != null ? refundBill.getPointRefundSettlementPrice() : 0D); //退单 砍价补贴返还 bill.setKanjiaRefundSettlementPrice(refundBill.getKanjiaRefundSettlementPrice() != null ? refundBill.getKanjiaRefundSettlementPrice() : 0D); - //退款金额=店铺最终退款结算金额 - refundPrice = refundBill.getBillPrice() != null ? refundBill.getBillPrice() : 0D; + } @@ -119,7 +117,6 @@ public class BillServiceImpl extends ServiceImpl implements Bi */ Bill orderBill = this.baseMapper.getOrderBill(new QueryWrapper().eq("store_id", storeId).eq("flow_type", FlowTypeEnum.PAY.name()).between("create_time", startTime, endTime)); //店铺入款结算金额 - double orderPrice = 0D; if (orderBill != null) { //结算周期内订单付款总金额 @@ -135,11 +132,9 @@ public class BillServiceImpl extends ServiceImpl implements Bi //砍价商品结算价格 bill.setKanjiaSettlementPrice(orderBill.getKanjiaSettlementPrice() != null ? orderBill.getKanjiaSettlementPrice() : 0D); - //入款结算金额= 店铺支付结算金额 + 平台优惠券补贴 + 分销订单退还,返现佣金返还+退单产生退还佣金金额 - orderPrice = CurrencyUtil.add(orderBill.getBillPrice() == null ? 0 : orderBill.getBillPrice(), bill.getSiteCouponCommission() == null ? 0 : bill.getSiteCouponCommission(), bill.getDistributionRefundCommission() == null ? 0 : bill.getDistributionRefundCommission(), bill.getRefundCommissionPrice() == null ? 0 : bill.getRefundCommissionPrice()); } - //最终结算金额=入款结算金额-退款结算金额-退货平台优惠券补贴返还 - Double finalPrice = CurrencyUtil.sub(orderPrice, refundPrice, bill.getSiteCouponRefundCommission() == null ? 0 : bill.getSiteCouponRefundCommission()); + //最终结算金额=入款结算金额-退款结算金额 + Double finalPrice = CurrencyUtil.sub(orderBill.getBillPrice(), refundBill.getBillPrice()); //店铺最终结算金额=最终结算金额 bill.setBillPrice(finalPrice); @@ -148,6 +143,7 @@ public class BillServiceImpl extends ServiceImpl implements Bi } + /** * 立即结算 *