diff --git a/sql/mysql/statistics.sql b/sql/mysql/statistics.sql index 0decf1ef1..0ec0469e2 100644 --- a/sql/mysql/statistics.sql +++ b/sql/mysql/statistics.sql @@ -7,10 +7,10 @@ CREATE TABLE trade_statistics order_create_count int DEFAULT 0 NOT NULL COMMENT '创建订单数', order_pay_count int DEFAULT 0 NOT NULL COMMENT '支付订单商品数', order_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额,单位:分', - order_wallet_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额(余额),单位:分', after_sale_count int DEFAULT 0 NOT NULL COMMENT '退款订单数', after_sale_refund_price int DEFAULT 0 NOT NULL COMMENT '总退款金额,单位:分', brokerage_settlement_price int DEFAULT 0 NOT NULL COMMENT '佣金金额(已结算),单位:分', + wallet_pay_price int DEFAULT 0 NOT NULL COMMENT '总支付金额(余额),单位:分', recharge_pay_count int DEFAULT 0 NOT NULL COMMENT '充值订单数', recharge_pay_price int DEFAULT 0 NOT NULL COMMENT '充值金额,单位:分', recharge_refund_count int DEFAULT 0 NOT NULL COMMENT '充值退款订单数', diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryExcelVO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryExcelVO.java index 928818dd0..5b14fa1d4 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryExcelVO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryExcelVO.java @@ -34,7 +34,7 @@ public class TradeTrendSummaryExcelVO { private Integer expensePrice; @ExcelProperty(value = "余额支付金额", converter = MoneyConvert.class) - private Integer orderWalletPayPrice; + private Integer walletPayPrice; @ExcelProperty(value = "支付佣金金额", converter = MoneyConvert.class) private Integer brokerageSettlementPrice; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryRespVO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryRespVO.java index 9c323327f..f76d02e91 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryRespVO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/controller/admin/trade/vo/TradeTrendSummaryRespVO.java @@ -23,7 +23,7 @@ public class TradeTrendSummaryRespVO { private Integer orderPayPrice; @Schema(description = "余额支付金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") - private Integer orderWalletPayPrice; + private Integer walletPayPrice; @Schema(description = "订单退款金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") private Integer afterSaleRefundPrice; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java index 6a6c06817..7c140628f 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/convert/trade/TradeStatisticsConvert.java @@ -66,7 +66,7 @@ public interface TradeStatisticsConvert { // 营业额 = 商品支付金额 + 充值金额 .setTurnoverPrice(tradeStatistics.getOrderPayPrice() + tradeStatistics.getRechargePayPrice()) // 支出金额 = 余额支付金额 + 支付佣金金额 + 商品退款金额 - .setExpensePrice(tradeStatistics.getOrderWalletPayPrice() + tradeStatistics.getBrokerageSettlementPrice() + tradeStatistics.getAfterSaleRefundPrice()); + .setExpensePrice(tradeStatistics.getWalletPayPrice() + tradeStatistics.getBrokerageSettlementPrice() + tradeStatistics.getAfterSaleRefundPrice()); } TradeOrderCountRespVO convert(Long undelivered, Long pickUp, Long afterSaleApply, Long auditingWithdraw); diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java index b8e26ff35..8efa7f400 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/dal/dataobject/trade/TradeStatisticsDO.java @@ -63,11 +63,10 @@ public class TradeStatisticsDO extends TenantBaseDO { */ private Integer brokerageSettlementPrice; - // TODO @疯狂:walletPayPrice,钱包支付金额 /** * 总支付金额(余额),单位:分 */ - private Integer orderWalletPayPrice; + private Integer walletPayPrice; /** * 充值订单数 *

diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java index 10f8bdc97..5630b40e9 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/pay/PayWalletStatisticsServiceImpl.java @@ -33,7 +33,7 @@ public class PayWalletStatisticsServiceImpl implements PayWalletStatisticsServic Integer walletPayPrice = payWalletStatisticsMapper.selectPriceSummaryByBizTypeAndCreateTimeBetween( beginTime, endTime, PayWalletBizTypeEnum.PAYMENT.getType()); // 拼接 - paySummary.setOrderWalletPayPrice(walletPayPrice) + paySummary.setWalletPayPrice(walletPayPrice) .setRechargeRefundCount(refundSummary.getRechargeRefundCount()) .setRechargeRefundPrice(refundSummary.getRechargeRefundPrice()); return paySummary; diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java index ada494e30..89371f6c1 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/java/cn/iocoder/yudao/module/statistics/service/trade/bo/WalletSummaryRespBO.java @@ -13,7 +13,7 @@ public class WalletSummaryRespBO { /** * 总支付金额(余额),单位:分 */ - private Integer orderWalletPayPrice; + private Integer walletPayPrice; /** * 充值订单数 diff --git a/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml b/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml index 380044e40..2415f6d55 100644 --- a/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml +++ b/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/trade/TradeStatisticsMapper.xml @@ -15,14 +15,14 @@ resultType="cn.iocoder.yudao.module.statistics.controller.admin.trade.vo.TradeTrendSummaryRespVO"> SELECT -- 营业额 = 商品支付金额 + 充值金额 - SUM(order_pay_price + recharge_pay_price) AS turnoverPrice, - SUM(order_pay_price) AS orderPayPrice, - SUM(recharge_pay_price) AS rechargePrice, + SUM(order_pay_price + recharge_pay_price) AS turnoverPrice, + SUM(order_pay_price) AS orderPayPrice, + SUM(recharge_pay_price) AS rechargePrice, -- 支出金额 = 余额支付金额 + 支付佣金金额 + 商品退款金额 - SUM(order_wallet_pay_price + brokerage_settlement_price + after_sale_refund_price) AS expensePrice, - SUM(order_wallet_pay_price) AS orderWalletPayPrice, - SUM(brokerage_settlement_price) AS brokerageSettlementPrice, - SUM(after_sale_refund_price) AS afterSaleRefundPrice + SUM(wallet_pay_price + brokerage_settlement_price + after_sale_refund_price) AS expensePrice, + SUM(wallet_pay_price) AS walletPayPrice, + SUM(brokerage_settlement_price) AS brokerageSettlementPrice, + SUM(after_sale_refund_price) AS afterSaleRefundPrice FROM trade_statistics WHERE time BETWEEN #{beginTime} AND #{endTime} AND deleted = FALSE @@ -30,7 +30,7 @@