From 7e70b3809c845cf8b4c8f549cdcf280204d2bcd7 Mon Sep 17 00:00:00 2001 From: hy001 Date: Mon, 25 May 2026 13:23:34 +0800 Subject: [PATCH] Expose salary transfer in country dashboard --- .../datav/CountryDashboardServiceImpl.java | 1 + .../datav/CountryDashboardDailyMetricDTO.java | 2 + .../dto/datav/CountryDashboardMetricDTO.java | 2 + .../CountryDashboardPeriodMetricDTO.java | 2 + .../dao/datav/CountryDashboardDAO.xml | 41 +++++++++++++++++++ 5 files changed, 48 insertions(+) diff --git a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/datav/CountryDashboardServiceImpl.java b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/datav/CountryDashboardServiceImpl.java index adba3488..e991daf6 100644 --- a/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/datav/CountryDashboardServiceImpl.java +++ b/rc-service/rc-service-console/console-application/src/main/java/com/red/circle/console/app/service/app/datav/CountryDashboardServiceImpl.java @@ -375,6 +375,7 @@ public class CountryDashboardServiceImpl implements CountryDashboardService { row.setGoogleRecharge(add(row.getGoogleRecharge(), metric.getGoogleRecharge())); row.setDealerRecharge(add(row.getDealerRecharge(), metric.getDealerRecharge())); row.setSalaryExchange(add(row.getSalaryExchange(), metric.getSalaryExchange())); + row.setSalaryTransfer(add(row.getSalaryTransfer(), metric.getSalaryTransfer())); row.setGiftConsume(add(row.getGiftConsume(), metric.getGiftConsume())); row.setLuckyGiftTotalFlow(add(row.getLuckyGiftTotalFlow(), metric.getLuckyGiftTotalFlow())); row.setLuckyGiftUser(row.getLuckyGiftUser() + safeLong(metric.getLuckyGiftUser())); diff --git a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardDailyMetricDTO.java b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardDailyMetricDTO.java index b789bcc5..753f5e61 100644 --- a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardDailyMetricDTO.java +++ b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardDailyMetricDTO.java @@ -36,6 +36,8 @@ public class CountryDashboardDailyMetricDTO { private BigDecimal salaryExchange; + private BigDecimal salaryTransfer; + private BigDecimal giftConsume; private BigDecimal luckyGiftTotalFlow; diff --git a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardMetricDTO.java b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardMetricDTO.java index 8a56e47e..67eb90b9 100644 --- a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardMetricDTO.java +++ b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardMetricDTO.java @@ -35,6 +35,8 @@ public class CountryDashboardMetricDTO { private BigDecimal salaryExchange; + private BigDecimal salaryTransfer; + private BigDecimal giftConsume; private BigDecimal luckyGiftTotalFlow; diff --git a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardPeriodMetricDTO.java b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardPeriodMetricDTO.java index cd6d88ed..03787f8f 100644 --- a/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardPeriodMetricDTO.java +++ b/rc-service/rc-service-console/console-infrastructure/src/main/java/com/red/circle/console/infra/database/rds/dto/datav/CountryDashboardPeriodMetricDTO.java @@ -46,6 +46,8 @@ public class CountryDashboardPeriodMetricDTO { private BigDecimal salaryExchange; + private BigDecimal salaryTransfer; + private BigDecimal giftConsume; private BigDecimal luckyGiftTotalFlow; diff --git a/rc-service/rc-service-console/console-infrastructure/src/main/resources/dao/datav/CountryDashboardDAO.xml b/rc-service/rc-service-console/console-infrastructure/src/main/resources/dao/datav/CountryDashboardDAO.xml index 12b29bc6..603cde1a 100644 --- a/rc-service/rc-service-console/console-infrastructure/src/main/resources/dao/datav/CountryDashboardDAO.xml +++ b/rc-service/rc-service-console/console-infrastructure/src/main/resources/dao/datav/CountryDashboardDAO.xml @@ -26,6 +26,7 @@ `google_recharge` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT 'Google充值', `dealer_recharge` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '代理充值', `salary_exchange` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '工资兑换', + `salary_transfer` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '工资转移', `gift_consume` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '礼物消耗', `lucky_gift_total_flow` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '幸运礼物流水', `lucky_gift_user` bigint NOT NULL DEFAULT 0 COMMENT '幸运礼物用户数', @@ -64,6 +65,7 @@ `google_recharge` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT 'Google充值', `dealer_recharge` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '代理充值', `salary_exchange` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '工资兑换', + `salary_transfer` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '工资转移', `gift_consume` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '礼物消耗', `lucky_gift_total_flow` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT '幸运礼物流水', `lucky_gift_user` bigint NOT NULL DEFAULT 0 COMMENT '幸运礼物用户数', @@ -581,6 +583,21 @@ SET @country_dashboard_value_columns_schema_lock = GET_LOCK('country_dashboard_value_columns_schema', 60); SET @current_schema = DATABASE(); + SET @ddl = IF( + @country_dashboard_value_columns_schema_lock = 1 + AND NOT EXISTS ( + SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = @current_schema + AND TABLE_NAME = 'country_dashboard_daily_metric' + AND COLUMN_NAME = 'salary_transfer' + ), + 'ALTER TABLE `country_dashboard_daily_metric` ADD COLUMN `salary_transfer` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT ''工资转移'' AFTER `salary_exchange`', + 'SELECT 1' + ); + PREPARE stmt FROM @ddl; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + SET @ddl = IF( @country_dashboard_value_columns_schema_lock = 1 AND NOT EXISTS ( @@ -596,6 +613,21 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; + SET @ddl = IF( + @country_dashboard_value_columns_schema_lock = 1 + AND NOT EXISTS ( + SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = @current_schema + AND TABLE_NAME = 'country_dashboard_period_metric' + AND COLUMN_NAME = 'salary_transfer' + ), + 'ALTER TABLE `country_dashboard_period_metric` ADD COLUMN `salary_transfer` decimal(20,2) NOT NULL DEFAULT 0.00 COMMENT ''工资转移'' AFTER `salary_exchange`', + 'SELECT 1' + ); + PREPARE stmt FROM @ddl; + EXECUTE stmt; + DEALLOCATE PREPARE stmt; + SET @ddl = IF( @country_dashboard_value_columns_schema_lock = 1 AND NOT EXISTS ( @@ -1058,6 +1090,7 @@ IFNULL(SUM(t.google_recharge), 0) AS googleRecharge, IFNULL(SUM(t.dealer_recharge), 0) AS dealerRecharge, IFNULL(SUM(t.salary_exchange), 0) AS salaryExchange, + IFNULL(SUM(t.salary_transfer), 0) AS salaryTransfer, IFNULL(SUM(t.gift_consume), 0) AS giftConsume, IFNULL(SUM(t.lucky_gift_total_flow), 0) AS luckyGiftTotalFlow, IFNULL(SUM(t.lucky_gift_user), 0) AS luckyGiftUser, @@ -1116,6 +1149,7 @@ IFNULL(SUM(t.google_recharge), 0) AS googleRecharge, IFNULL(SUM(t.dealer_recharge), 0) AS dealerRecharge, IFNULL(SUM(t.salary_exchange), 0) AS salaryExchange, + IFNULL(SUM(t.salary_transfer), 0) AS salaryTransfer, IFNULL(SUM(t.gift_consume), 0) AS giftConsume, IFNULL(SUM(t.lucky_gift_total_flow), 0) AS luckyGiftTotalFlow, IFNULL(SUM(t.lucky_gift_user), 0) AS luckyGiftUser, @@ -1200,6 +1234,7 @@ google_recharge, dealer_recharge, salary_exchange, + salary_transfer, gift_consume, lucky_gift_total_flow, lucky_gift_user, @@ -1225,6 +1260,7 @@ IFNULL(#{item.googleRecharge}, 0), IFNULL(#{item.dealerRecharge}, 0), IFNULL(#{item.salaryExchange}, 0), + IFNULL(#{item.salaryTransfer}, 0), IFNULL(#{item.giftConsume}, 0), IFNULL(#{item.luckyGiftTotalFlow}, 0), IFNULL(#{item.luckyGiftUser}, 0), @@ -1245,6 +1281,7 @@ google_recharge = VALUES(google_recharge), dealer_recharge = VALUES(dealer_recharge), salary_exchange = VALUES(salary_exchange), + salary_transfer = VALUES(salary_transfer), gift_consume = VALUES(gift_consume), lucky_gift_total_flow = VALUES(lucky_gift_total_flow), lucky_gift_user = VALUES(lucky_gift_user), @@ -1285,6 +1322,7 @@ google_recharge, dealer_recharge, salary_exchange, + salary_transfer, gift_consume, lucky_gift_total_flow, lucky_gift_user, @@ -1321,6 +1359,7 @@ IFNULL(#{item.googleRecharge}, 0), IFNULL(#{item.dealerRecharge}, 0), IFNULL(#{item.salaryExchange}, 0), + IFNULL(#{item.salaryTransfer}, 0), IFNULL(#{item.giftConsume}, 0), IFNULL(#{item.luckyGiftTotalFlow}, 0), IFNULL(#{item.luckyGiftUser}, 0), @@ -1351,6 +1390,7 @@ google_recharge = VALUES(google_recharge), dealer_recharge = VALUES(dealer_recharge), salary_exchange = VALUES(salary_exchange), + salary_transfer = VALUES(salary_transfer), gift_consume = VALUES(gift_consume), lucky_gift_total_flow = VALUES(lucky_gift_total_flow), lucky_gift_user = VALUES(lucky_gift_user), @@ -1623,6 +1663,7 @@ IFNULL(SUM(t.google_recharge), 0) AS googleRecharge, IFNULL(SUM(t.dealer_recharge), 0) AS dealerRecharge, IFNULL(SUM(t.salary_exchange), 0) AS salaryExchange, + IFNULL(SUM(t.salary_transfer), 0) AS salaryTransfer, IFNULL(SUM(t.gift_consume), 0) AS giftConsume, IFNULL(SUM(t.lucky_gift_total_flow), 0) AS luckyGiftTotalFlow, IFNULL(SUM(t.lucky_gift_payout), 0) AS luckyGiftPayout,