修改河南项目的管理后台ui和删除之前不需要的游戏

This commit is contained in:
2026-09-22 17:14:18 +08:00
parent 1e256b94e8
commit 687a1f0f98
36 changed files with 327 additions and 309 deletions
+47 -105
View File
@@ -1,130 +1,72 @@
# 数据库变更台账 # 数据库变更台账
> **数据库改动只写这里**:中文标题 + 完整可执行 SQL。不再单独建 `docs/*.sql`(全量基线除外)。 > **数据库改动只写这里**:中文标题 + 完整可执行 SQL。不再单独建 `docs/*.sql`(全量基线除外)。
> 每条都要能回得去 —— **回滚方案与验证步骤必写**。 > 只记**变更 SQL**;**不写回滚 SQL** —— 已执行的条目即为既成事实,要撤销请从本文件的 git 历史取旧版本。
> 若某条变更依赖**尚未执行**的前置对象(建表、种子数据等),必须在条目标注清楚,别让后来者踩空。
--- ---
## 删除「奥林匹斯 / 荒野争锋 / 极速糖果」三个玩法的后台菜单 ## 新增「麻将胡了」(mahjong 玩法)的后台菜单、角色授权与维护开关
**背景**:这三个玩法不再需要,要求从后台左侧菜单移除。 **背景**:麻将胡了以「**新游戏**」类型接入,复用原玫瑰女郎(olympus 玩法)的整套统计口径
—— 消费流水 `source=68`、奖励流水 `source=69`、开箱产出 `source=15`、新游戏返佣费率字段
`tt_user.newGameCommissionRate`。代码层改动(后端统计链路 + 两个前端)见 `docs/修改记录.md`;
本条目**只记数据库变更**。
**为什么先动数据库**:RuoYi 的左侧菜单是**数据库驱动**的(`sys_menu` → `/getRouters` 接口 → 前端 `sidebarRouters`), **本次数据库变更 3 张表、共 17 行**(2026-09-22 已在库 `henan` 执行):
代码里没有菜单清单。所以顺序是:**先删数据,再删前端页面文件**。
**影响面**(实查本机库 `henan`,非估算): | 表 | 变更 | 说明 |
| 表 | 行数 | 说明 |
|---|---|---| |---|---|---|
| `sys_menu` | **22** | 3 个顶级菜单(`menu_type='M'`)+ 19 个子页面(`'C'`);**无** `'F'` 按钮权限行 | | `sys_config` | 新增 **1 行** | `config_id=154`、`config_key='mahjongMaintenance'`,即「麻将胡了维护」开关 |
| `sys_role_menu` | **22** | 全部属于 `role_id = 103` 这一个角色 | | `sys_menu` | 新增 **8 行** | 顶级目录 `mahjong`(`menu_id=3200`)+ 7 个子页面(`3201`~`3207`) |
| `sys_role_menu` | 新增 **8 行** | 全部授权给 `role_id=103` |
| 顶级 menu_id | 菜单 | path | 子菜单 | 子菜单 menu_id | 前端 component | > **为什么 `menu_id` 用 `3200~3207`**:`3130~3137` 是已下架的奥林匹斯旧号段,不复用,
|---|---|---|---|---|---| > 免得数据里「哪段 ID 属于哪个玩法」的对应关系失真。
| 3130 | 奥林匹斯 | `olympus` | 7 个 | 3131~3137 | `game/olympus/*` |
| 2105 | 荒野争锋 | `bullet` | 6 个 | 2106~2110、2112 | `game/bullet/*` |
| 2125 | 极速糖果 | `sweet` | 6 个 | 2126~2131 | `game/sweet/*` |
⚠️ **`2111`(宝箱管理→临时倍率)不在删除范围内** —— 它虽然编号紧邻 `2110`,但父级是 `2018`(宝箱管理), **变更 SQL**:
且其 component 是 `game/box/mock/index`(被 `3141` 经典开箱的「临时爆率」也在用),**不要动**。
**变更 SQL**(2026-09-22 已在库 `henan` 执行):
```sql ```sql
-- 1) 先清角色-菜单授权,避免留下孤儿行 INSERT INTO `sys_menu`
DELETE FROM sys_role_menu (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
WHERE menu_id IN (3130,3131,3132,3133,3134,3135,3136,3137,2105,2106,2107,2108,2109,2110,2112,2125,2126,2127,2128,2129,2130,2131); VALUES
(3200, '麻将胡了', 0, 6, 'mahjong', '', NULL, 1, 0, 'M', '0', '0', '', 'star', 'admin', NOW(), '', NULL, '麻将胡了游戏后台管理目录'),
(3201, '箱子配置', 3200, 1, 'box', 'game/mahjong/box/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:box', 'shopping', 'admin', NOW(), '', NULL, '麻将胡了·箱子配置(11 档投注,price ≡ bet)'),
(3202, '饰品列表', 3200, 2, 'bucket', 'game/mahjong/bucket/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:bucket', 'star', 'admin', NOW(), '', NULL, '麻将胡了·16 档饰品桶定义(0x~500x,只读)'),
(3203, '回合管理', 3200, 3, 'round', 'game/mahjong/round/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:round', 'documentation', 'admin', NOW(), '', NULL, '麻将胡了·预生成回合池(只读)'),
(3204, '奖池水位', 3200, 4, 'rewardPool', 'game/mahjong/rewardPool/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:pool', 'money', 'admin', NOW(), '', NULL, '麻将胡了·奖池水位(3 身份:普通/主播/白号)'),
(3205, '玩家记录', 3200, 5, 'record', 'game/mahjong/record/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:record', 'list', 'admin', NOW(), '', NULL, '麻将胡了·玩家游玩记录'),
(3206, '每日统计', 3200, 6, 'dailywin', 'game/mahjong/dailywin/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:win', 'chart', 'admin', NOW(), '', NULL, '麻将胡了·每日投注/赢奖/RTP 统计'),
(3207, '奖品管理', 3200, 7, 'prize', 'game/mahjong/prize/index', NULL, 1, 0, 'C', '0', '0', 'game:mahjong:prize', 'guide', 'admin', NOW(), '', NULL, '麻将胡了·返奖饰品与返奖区间');
-- 2) 再删菜单本身 INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES
DELETE FROM sys_menu (103, 3200), (103, 3201), (103, 3202), (103, 3203),
WHERE menu_id IN (3130,3131,3132,3133,3134,3135,3136,3137,2105,2106,2107,2108,2109,2110,2112,2125,2126,2127,2128,2129,2130,2131); (103, 3204), (103, 3205), (103, 3206), (103, 3207);
INSERT INTO `sys_config`
(`config_id`, `config_name`, `config_key`, `config_value`, `config_type`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
VALUES
(154, '麻将胡了维护', 'mahjongMaintenance', '0', 'Y', 'admin', NOW(), '', NULL, '麻将胡了维护开关 0正常 1维护');
``` ```
**验证**(执行后实测): **验证**(2026-09-22 实测结果):
```sql ```sql
-- 两个都必须是 0 SELECT COUNT(*) FROM sys_menu WHERE menu_id BETWEEN 3200 AND 3207; -- 期望 8,实测 8
SELECT COUNT(*) FROM sys_menu SELECT COUNT(*) FROM sys_role_menu WHERE menu_id BETWEEN 3200 AND 3207; -- 期望 8,实测 8
WHERE menu_id IN (3130,3131,3132,3133,3134,3135,3136,3137,2105,2106,2107,2108,2109,2110,2112,2125,2126,2127,2128,2129,2130,2131) SELECT COUNT(*) FROM sys_config WHERE config_key = 'mahjongMaintenance'; -- 期望 1,实测 1
OR parent_id IN (3130, 2105, 2125); -- 实测 0
SELECT COUNT(*) FROM sys_role_menu
WHERE menu_id IN (3130,3131,3132,3133,3134,3135,3136,3137,2105,2106,2107,2108,2109,2110,2112,2125,2126,2127,2128,2129,2130,2131); -- 实测 0
``` ```
一级菜单复查(`SELECT menu_id, menu_name, path FROM sys_menu WHERE parent_id = 0 ORDER BY order_num, menu_id`) 后台左侧出现「麻将胡了」目录(`order_num=6`),下辖 7 个子页面;
实测剩余 20 项,已无「奥林匹斯 / 荒野争锋 / 极速糖果」。 「网站设置」页出现「麻将胡了维护」下拉框(0 正常 / 1 维护)。
**回滚 SQL**(22 条 `sys_menu` + 22 条 `sys_role_menu`,由 `mysqldump --no-create-info --complete-insert` 导出): **⚠️ 尚未落库的前置依赖:麻将胡了的 11 张游戏表**(`game_mahjong_box` / `_bucket` / `_box_bucket` /
`_round` / `_step` / `_record` / `_user` / `_box_template` / `_reward_log` / `_prize_ornament` / `_prize_range`)。
```sql DDL + 种子数据已写在 `mahjong-py/schema.sql`(`CREATE TABLE IF NOT EXISTS` + 11 档箱子 / 饰品桶 / 返奖饰品种子),
-- 事务包裹更安全;menu_id 是显式指定,不需要自增 **本次未执行** —— 上方 7 个后台页面依赖这些表,未建表前打开会报「表不存在」。
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2105,'荒野争锋',0,7,'bullet',NULL,NULL,1,0,'M','0','0','','excel','admin','2026-05-14 14:36:15','admin','2026-08-01 13:37:13',''); 执行方式(需单独确认后进行):
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2106,'饰品列表',2105,1,'ornament','game/bullet/ornament/index',NULL,1,0,'C','0','0','game:bullet:ornament:list','button','admin','2026-05-14 14:49:48','admin','2026-05-14 14:55:16','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2107,'箱子管理',2105,2,'box','game/bullet/box/index',NULL,1,0,'C','0','0','game:bullet:box:list','bug','admin','2026-05-14 14:56:11','',NULL,'');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2108,'回合管理',2105,3,'round','game/bullet/round/index',NULL,1,0,'C','0','0','game:bullet:round:list','build','admin','2026-05-14 14:56:49','',NULL,'');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2109,'玩家记录',2105,4,'record','game/bullet/record/index',NULL,1,0,'C','0','0','game:bullet:record:list','button','admin','2026-05-14 14:57:29','',NULL,'');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2110,'每日统计',2105,5,'dailywin','game/bullet/dailywin/index',NULL,1,0,'C','0','0','game:bullet:dailywin:list','chart','admin','2026-05-14 14:58:07','',NULL,'');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2112,'奖品管理',2105,6,'prize','game/bullet/prize/index',NULL,1,0,'C','0','0','game:bullet:prize:list','component','admin','2026-05-26 04:47:02','admin','2026-05-26 05:34:40','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2125,'极速糖果',0,7,'sweet',NULL,NULL,1,0,'M','0','0','','star','admin','2026-06-18 10:15:36','admin','2026-08-01 13:29:08','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2126,'箱子管理',2125,2,' box','game/sweet/box/index',NULL,1,0,'C','0','0','game:sweet:box:list','404','admin','2026-06-18 10:17:18','admin','2026-06-18 14:34:47','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2127,'饰品列表',2125,1,'ornament','game/sweet/ornament/index',NULL,1,0,'C','0','0','game:sweet:ornament:list','bug','admin','2026-06-18 10:18:01','admin','2026-06-18 14:34:29','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2128,'奖品管理',2125,6,'prize','game/sweet/prize/index',NULL,1,0,'C','0','0','game:sweet:prize:list','build','admin','2026-06-18 10:18:41','admin','2026-06-18 14:35:55','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2129,'每日统计',2125,5,'dailywin','game/sweet/dailywin/index',NULL,1,0,'C','0','0','game:sweet:dailywin:list','button','admin','2026-06-18 10:19:39','admin','2026-06-18 14:35:39','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2130,'回合管理',2125,3,'round','game/sweet/round/index',NULL,1,0,'C','0','0','game:sweet:round:list','cascader','admin','2026-06-18 10:20:13','admin','2026-06-18 14:35:03','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (2131,'玩家记录',2125,4,'record','game/sweet/record/index',NULL,1,0,'C','0','0','game:sweet:record:list','cascader','admin','2026-06-18 10:21:20','admin','2026-06-18 14:35:17','');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3130,'奥林匹斯',0,5,'olympus','',NULL,1,0,'M','0','0','','star','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯电子游戏管理');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3131,'箱子配置',3130,1,'box','game/olympus/box/index',NULL,1,0,'C','0','0','game:olympus:box','shopping','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯箱子配置与身份桶分布');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3132,'饰品列表',3130,2,'ornament','game/olympus/ornament/index',NULL,1,0,'C','0','0','game:olympus:ornament','star','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯 17 档饰品桶定义');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3133,'回合管理',3130,3,'round','game/olympus/round/index',NULL,1,0,'C','0','0','game:olympus:round','documentation','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯预生成回合查询');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3134,'奖池水位',3130,4,'rewardPool','game/olympus/rewardPool/index',NULL,1,0,'C','0','0','game:olympus:pool','money','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯按箱奖池水位(注水/抽水/批量/重置)');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3135,'玩家记录',3130,5,'record','game/olympus/record/index',NULL,1,0,'C','0','0','game:olympus:record','list','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯游戏记录');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3136,'每日统计',3130,6,'dailywin','game/olympus/dailywin/index',NULL,1,0,'C','0','0','game:olympus:win','chart','admin','2026-08-01 13:41:53','',NULL,'奥林匹斯每日盈亏统计');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (3137,'奖品管理',3130,7,'prize','game/olympus/prize/index',NULL,1,0,'C','0','0','game:olympus:prize','guide','admin','2026-08-01 13:41:53','admin','2026-08-04 13:46:18','奥林匹斯返奖饰品与区间配置');
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2105); ```bash
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2106); docker exec -i henan_mysql_db mysql -uroot -p123456 --default-character-set=utf8mb4 -D henan < mahjong-py/schema.sql
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2107);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2108);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2109);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2110);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2112);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2125);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2126);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2127);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2128);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2129);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2130);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,2131);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3130);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3131);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3132);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3133);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3134);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3135);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3136);
INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (103,3137);
``` ```
**配套的前端文件删除**(38 个文件,全部在 git 里,`git checkout` 可恢复):
| 目录 | 文件数 |
|---|---|
| `ruoyi-ui/src/views/game/olympus/` | 7 |
| `ruoyi-ui/src/views/game/bullet/` | 6 |
| `ruoyi-ui/src/views/game/sweet/` | 6 |
| `ruoyi-ui/src/api/game/olympus/` | 7 |
| `ruoyi-ui/src/api/game/bullet/` | 6 |
| `ruoyi-ui/src/api/game/sweet/` | 6 |
**刻意没动**:
- **后端 Java 代码**。`olympus / bullet / sweet / sugar` 在后端出现在**跨模块共享**的位置 ——
`TtAccountRecordSource`(流水来源码:60=奥林匹斯…)、`TtboxRecordSource`、`RedisConstants`、
`MessageCategoryEnum`、`PromoTurnover*`、`ApiUserPackSackServiceImpl`、`WebsiteSetupServiceImpl` 等。
删这些会波及**其他玩法与推广/发货链路**,不在「删页面」范围内。
- **数据库业务表**(`game_olympus_*`、`game_sweet_*` 等)原样保留,未 TRUNCATE、未 DROP。
- `ruoyi-ui/src/views/game/sugar/`(5 个 api + 5 个页面)—— **没有任何菜单引用它**:
菜单里的「极速糖果」指向的是 `game/sweet/*`,而 `game_sugar_*` 表在 `docs/cleanup_records.sql` 里被标注为「极速糖果」。
即 `sugar` 与 `sweet` 是两套并存的东西,`sugar` 未被任何菜单挂载(后端却存在 `GameSugarWin/User/StepInfo/Spin` 实体)。
**疑似遗留或未接入的开发分支,未确认前不删。**
+98 -4
View File
@@ -2,7 +2,7 @@
> **只记大改动**:一个需求 / 一个模块算一条;同一件事的多轮微调合并成一条,不逐轮记。 > **只记大改动**:一个需求 / 一个模块算一条;同一件事的多轮微调合并成一条,不逐轮记。
> **排序:最新在最上面。** > **排序:最新在最上面。**
> 展开细节看 `docs/updata_sql.md`(数据库改动,含完整可执行 SQL 与回滚)与 `.workbuddy/memory/YYYY-MM-DD.md`(过程与踩坑)。 > 展开细节看 `docs/updata_sql.md`(数据库改动,含完整可执行 SQL)与 `.workbuddy/memory/YYYY-MM-DD.md`(过程与踩坑)。
> **维护**:完成一个大改动后,在顶部按日期加一条;同一天追加在该日期块末尾。 > **维护**:完成一个大改动后,在顶部按日期加一条;同一天追加在该日期块末尾。
--- ---
@@ -37,14 +37,14 @@
**关键前提**:RuoYi 的左侧菜单是**数据库驱动**的(`sys_menu` → `/getRouters` → 前端 `sidebarRouters`),**代码里没有菜单清单**,所以必须"先删数据、再删页面文件",只删前端文件的话菜单依然在。 **关键前提**:RuoYi 的左侧菜单是**数据库驱动**的(`sys_menu` → `/getRouters` → 前端 `sidebarRouters`),**代码里没有菜单清单**,所以必须"先删数据、再删页面文件",只删前端文件的话菜单依然在。
**改动清单**(完整 SQL 与回滚语句见 `docs/updata_sql.md`): **改动清单**(完整 SQL 见 `docs/updata_sql.md`):
1. **数据库**(库 `henan`,已执行):`sys_menu` 删 **22 行**(3 个顶级 M + 19 个子页面 C);`sys_role_menu` 删 **22 行**授权(全属 `role_id=103`)。**无 `'F'` 按钮权限行**。 1. **数据库**(库 `henan`,已执行):`sys_menu` 删 **22 行**(3 个顶级 M + 19 个子页面 C);`sys_role_menu` 删 **22 行**授权(全属 `role_id=103`)。**无 `'F'` 按钮权限行**。
- 3130 奥林匹斯 `olympus` → 子菜单 3131~3137 - 3130 奥林匹斯 `olympus` → 子菜单 3131~3137
- 2105 荒野争锋 `bullet` → 子菜单 2106~2110、2112 - 2105 荒野争锋 `bullet` → 子菜单 2106~2110、2112
- 2125 极速糖果 `sweet` → 子菜单 2126~2131 - 2125 极速糖果 `sweet` → 子菜单 2126~2131
2. **前端文件**(38 个,删前已确认全部被 git 跟踪):`ruoyi-ui/src/views/game/{olympus,bullet,sweet}/`(7+6+6)与 `ruoyi-ui/src/api/game/{olympus,bullet,sweet}/`(7+6+6)。 2. **前端文件**(38 个,删前已确认全部被 git 跟踪):`ruoyi-ui/src/views/game/{olympus,bullet,sweet}/`(7+6+6)与 `ruoyi-ui/src/api/game/{olympus,bullet,sweet}/`(7+6+6)。
3. **文档**:本条 + `docs/updata_sql.md` 新条目(含 44 条回滚 INSERT)。 3. **文档**:本条 + `docs/updata_sql.md` 新条目。
**验证**: **验证**:
@@ -58,4 +58,98 @@
2. **数据库业务表**:`game_olympus_*` / `game_sweet_*` 等原样保留,未 TRUNCATE、未 DROP。数据还在,随时可回。 2. **数据库业务表**:`game_olympus_*` / `game_sweet_*` 等原样保留,未 TRUNCATE、未 DROP。数据还在,随时可回。
3. **`ruoyi-ui/src/views/game/sugar/`**(5 api + 5 页面)—— **没有任何菜单引用**。菜单「极速糖果」指向的是 `game/sweet/*`,而 `docs/cleanup_records.sql` 又把 `game_sugar_*` 标注为「极速糖果」,两套并存;后端还存在 `GameSugarWin/User/StepInfo/Spin` 实体。**疑似遗留或未接入的开发分支,未确认前不删。** 3. **`ruoyi-ui/src/views/game/sugar/`**(5 api + 5 页面)—— **没有任何菜单引用**。菜单「极速糖果」指向的是 `game/sweet/*`,而 `docs/cleanup_records.sql` 又把 `game_sugar_*` 标注为「极速糖果」,两套并存;后端还存在 `GameSugarWin/User/StepInfo/Spin` 实体。**疑似遗留或未接入的开发分支,未确认前不删。**
**遗留待定**:① 仪表盘「实时 RTP」卡片与「流水统计」折线里仍有 **玫瑰女郎(=olympus)** 一条 —— 那是后端 `/getRtpData` 返回的玩法列表,**与菜单无关**,删菜单不会让它消失;若要一并去掉得动后端。② `game/sugar/*` 是否清理待定。③ 是否需要把 `game_olympus_*` / `game_sweet_*` 业务表也清掉(现在只是入口没了,数据仍在库里占空间)。 **遗留待定**:① 仪表盘「实时 RTP」卡片与「流水统计」折线里仍有 **玫瑰女郎(=olympus)** 一条 —— **已于下一轮处理**;② `game/sugar/*` 是否清理待定。③ 是否需要把 `game_olympus_*` / `game_sweet_*` 业务表也清掉(现在只是入口没了,数据仍在库里占空间)——实查确认**不存在 `%olympus%` 业务表**,无需处理。
- **彻底清理「玫瑰女郎」(olympus)的后端:枚举、返利统计链路与前端列**
**起因**:上一轮只下架了菜单与页面,后端仍保留整套 olympus 常量、统计列与返利计算。本轮要求「和后端相关的都删掉,包括返利的统计」。
**顺手修掉一个构建阻塞**:`skins-service/pom.xml` 仍声明 `<module>game-olympus-service</module>`、`ruoyi-admin/pom.xml` 仍依赖该 artifact,而**该模块目录早已不存在** ⇒ 这是**当时 Maven 构建必挂**的隐藏故障(本次删掉引用后构建才通过)。全仓已无任何文件名含 olympus。
**改动面:2 个 pom + 21 个后端文件 + 13 个前端文件**
| 层 | 文件 | 改动 |
|---|---|---|
| pom | `skins-service/pom.xml`、`ruoyi-admin/pom.xml` | 删 `game-olympus-service` 的 module / dependency |
| 常量 | `TtAccountRecordSource.java` | 删 `OLYMPUS_SPIN(60)` / `OLYMPUS_REWARD(61)` 枚举项,并从 **6 处**集合与判断中移除(推广福利流水、返利游戏类型、今日投注、今日赢奖、流水抽奖条件);删 `isSpecialGameConsume` / `isNewGameConsumeForCommission`,`isGameConsumeForCommission` 简化为只判经典 |
| 常量 | `TtboxRecordSource.java` | 删 `OLYMPUS_BOX(13)` |
| 常量 | `MessageCategoryEnum.java` | 删 `GAME_OLYMPUS` |
| 常量 | `RedisConstants.java` | 删 3 个 `OLYMPUS_*` 缓存键 |
| 配置 | `ParameterSettingBody.java`、`WebsiteSetupServiceImpl.java` | 删 `olympusMaintenance` 字段与读写(数据库侧见 `updata_sql.md`) |
| 仪表盘 | `TtRechargeRecordController.java` | 折线 `chartData` 整条 `roseladyList` 链删除;实时 RTP 的 `gameConfig` / `gameNames` 去掉第 8 项(**保留索引 5 = Roll 房**,`if (i == 5)` 依赖它) |
| 用户报表 | `TtUserBlendErcashMapper.xml`、`TtUserSourceReportMapper.xml`、`TtUserAmountRecordsController.java` | 删 `olympusGame` 列 ×2 + 排序分支;总流水 source 列表去 60 |
| 开箱统计 | `TtBoxRecordsMapper.xml` | 返奖总额 `source IN (...)` 去 13 |
| 返利 | `PromoTurnoverMapper.xml` | 删 `todayOlympus` / `yesterdayOlympus` / `weekOlympus` / `totalOlympus` 四列、`todayNewGame` / `yesterdayNewGame`、`newGameConsume` ×2,source 列表去 60 |
| 返利 | `PromoTurnoverMapper.java` | 删 `getSubNewGameConsumeByDate` / `getSpecialGameConsumeByUserId` 两个专属查询 |
| 返利 | `PromoTurnoverServiceImpl.java` | 看板 `buildPeriod` 去掉 olympus 周期项与 4 个调用点参数;下级佣金去掉新游戏分项 |
| 返利 | `PromoTurnoverController.java` | 三处 `olympusConsume` 统计链删除;`businessGameRate` 统一取经典费率 |
| 返利 | `PromoAdminManageController.java` | 删 `specialGameTurnover` 输出与 `sumNewGameConsume` |
| 返利 | `CommissionSettlementTask.java` | **周结佣金**去掉新游戏分项 |
| 其他 | `TtUserServiceImpl.java` | 实时返佣分支去掉「新游戏」,只判经典 |
| 其他 | `ApiUserPackSackServiceImpl.java`、`ApiProfileRecordsServiceImpl.java`、`TaskUpdate.java`、`TtBoxServiceImpl.java` | 映射 / 筛选集合 / 发奖公式 / 注释 |
| 前端 ruoyi-ui | `utils/accountSource.js`、`ttSetting/index.vue`、`ttuser/{userTurnover,userPack,creditsRecords,amountRecords,blendErcashArchive}.vue` | 删流水来源码 60/61 与 13 的字典与筛选项、删「玫瑰女郎维护」开关、删用户流水表的 `olympusGame` 列与排序标签 |
| 前端 promo-ui2 | `Home`、`FlowRecord`、`BusinessManage`、`AnchorManage`、`subFlow/transaction`、`CommissionReport` | 删费率卡 / 周期列 / 玫瑰女郎列 ×3 / 特殊游戏流水列 ×2 / 日特殊游戏消费列 / 来源码字典 |
**验证**(产物级断言,不是看代码):
- 后端 `mvn -B clean install -DskipTests` → **`BUILD SUCCESS`**,`Total time: 04:13 min`,无 `BUILD FAILURE` / `COMPILATION ERROR`;`ruoyi-admin.jar` 正常产出(6 个模块全链打通)。
- `target/classes` 里 5 个关键 class(`TtAccountRecordSource` / `TtboxRecordSource` / `MessageCategoryEnum` / `RedisConstants` / `PromoTurnoverServiceImpl`)搜 `OLYMPUS` **命中 = 0**。
- `target` 中 3 个 mapper XML 搜 `olympus` / `newGame` / `source 60` **命中全 0**。
- 数据库:`sys_config` 里 `%olympus%` 残留 **= 0**;一级菜单 20 个(与上轮一致)。
- `ruoyi-ui` 生产构建通过;`promo-ui2` 因 `node_modules` 缺 `esbuild` 无法构建(环境问题,非本次改动),改做静态校验。
**刻意保留**:
1. **历史数据**(`tt_user_blend_ercash` 47 行、`tt_box_records` 293 行、`tt_user_source_report` 14 行)—— 属账目,未删。副作用:流水来源码字典删了,这些历史流水在后台显示不出中文名。
2. `ruoyi-ui/src/views/index.vue` 的 `hidden` 数组仍留「玫瑰女郎」、`.rtp-theme-4` 样式保留 —— 后端已不再返回,留作**二层防护**。
3. **`newGameCommissionRate`(新游戏返佣比例)字段保留** —— 它挂在 `tt_user` 表上,属**用户配置字段**而非统计,删除涉及 DDL 与用户管理页,且语义上不点名玫瑰女郎。现状:无任何消费来源指向它,相关分项恒为 0。
- **新增「麻将胡了」玩法:以「新游戏」类型接入,复用原玫瑰女郎的整套统计口径**
**起因**:玫瑰女郎下架后,用户引入新游戏「麻将胡了」(后端 `mahjong` 玩法),要求「以新游戏的类型把相应的统计都加上」。
本轮是**上一轮删除动作的完整镜像** —— 把上一轮删掉的 olympus 分支,按 mahjong 重新接回全部统计链路。
**口径映射**(沿用原语义,未改结构):
| 概念 | olympus 旧值 | mahjong 新值 |
|---|---|---|
| 消费来源码 | `OLYMPUS_SPIN = 60` | `MAHJONG_SPIN = 68` |
| 奖励来源码 | `OLYMPUS_REWARD = 61` | `MAHJONG_REWARD = 69` |
| 开箱产出码 | `TtboxRecordSource` 13 | `MAHJONG_BOX = 15` |
| 新游戏返佣费率 | `tt_user.newGameCommissionRate` | **同名沿用**(未动 DDL) |
| 返佣流水来源 | `GAME_CONSUME_COMMISSION(47)`「特殊游戏返利」 | 同 |
**改动清单**(后端 21 个文件 + 前端 7 个 + DB 3 张表):
| 层 | 文件 | 改了什么 |
|---|---|---|
| 枚举 | `TtAccountRecordSource` / `TtboxRecordSource` / `MessageCategoryEnum` / `RedisConstants` | 新增 68 / 69 / 15 及消息分类、缓存键 |
| 仪表盘 | `TtRechargeRecordController` | `chartData` 加 `mahjongList`;`realTimeRtp` 加第 8 项「麻将胡了」(**追加在末尾,不动 `i == 5` 的 Roll 房下标**) |
| 开箱统计 | `TtBoxRecordsMapper.xml` | 3 处返奖口径 `source IN` 加 `15` |
| 用户报表 | `TtUserBlendErcashMapper.xml` / `TtUserSourceReportMapper.xml` / `TtUserAmountRecordsController` | 加 `mahjongGame` 列 ×2 + 排序分支 + `AGG_SORT_FIELDS` |
| 返利 | `PromoTurnoverMapper.xml` | `getBatchedCommissionData` / `getGameCommissionData` / `getWeeklyCommissionDataWithSnapshot` / `getWeeklyDailyCommissionData` / `businessGameConsumeRows` 全部加 68 与 newGame/mahjong 列 |
| 返利 | `PromoTurnoverServiceImpl` / `PromoTurnoverController` / `PromoAdminManageController` / `CommissionSettlementTask` | 看板费率卡与周期项、三处 `*Consume` 统计链、`businessGameRate` 新游戏分支、`specialGameTurnover`、`sumNewGameConsume`、周结分项 |
| 其他 | `TtUserServiceImpl`(实时返佣新游戏分支)、`ApiProfileRecordsServiceImpl`(69 / 68)、`ApiUserPackSackServiceImpl`(15 → 69 映射)、`TaskUpdate`(特殊游戏消费 + 0.01 系数)、`TtBoxServiceImpl`(注释) | |
| 配置 | `ParameterSettingBody` + `WebsiteSetupServiceImpl` | `mahjongMaintenance` 读写(键 `mahjongMaintenance`,兜底 `"0"`) |
| 前端 ruoyi-ui | `views/index.vue`(折线加「麻将胡了流水」)、`utils/accountSource.js`(68 / 69)、`skins/ttSetting/index.vue`(麻将胡了维护)、`skins/ttuser/{amountRecords,creditsRecords,blendErcashArchive,userPack,userTurnover}` | 来源码字典与筛选 68 / 69、开箱码 15、`mahjongGame` 列与排序标签 |
| 前端 promo-ui2 | `Home`(费率卡 + 周期列)、`FlowRecord`(麻将胡了列 ×2)、`BusinessManage` / `AnchorManage`(特殊游戏流水列)、`subFlow/transaction`(日特殊游戏消费)、`CommissionReport`(68 → 麻将胡了) | |
**数据库**:`sys_menu` +8(麻将胡了目录 `3200` + 7 子页)、`sys_role_menu` +8(role 103)、
`sys_config` +1(`mahjongMaintenance`)。完整 SQL 见 `docs/updata_sql.md`。
**验证**(产物级断言):
- 后端 `mvn -B clean install -DskipTests` → **`BUILD SUCCESS`**,19 个模块全过,`Total time: 03:55 min`。
- `ruoyi-ui` 生产构建 → `DONE Build complete`。
- `promo-ui2` 生产构建 → **本轮把环境修好了**,构建通过(修法见「踩坑」)。
- 数据库实测:`sys_menu` 3200~3207 = 8 行、`sys_role_menu` = 8 行、`sys_config.mahjongMaintenance` = 1 行。
**踩坑(记一次,下次别重踩)**:`promo-ui2/node_modules` 是**残缺的扁平布局** —— 绝大多数包只在
`node_modules/.pnpm/node_modules/` 里有,顶层没有软链 ⇒ vite 一启动就 `ERR_MODULE_NOT_FOUND`
(先 `esbuild`、再 `@rollup/rollup-win32-x64-msvc`、再 `@babel/core`…… 逐个补是打地鼠)。
**一次性修法**:把 `.pnpm/node_modules` 下**所有**包(含 `@scope` 子目录)在顶层批量建 junction
(本次补了 800+ 个链接)后构建即通过。根因是当初 `pnpm install` 没跑完/被裁过,属**环境问题、非代码问题**。
**刻意未做**:麻将胡了的 **11 张 `game_mahjong_*` 游戏表尚未落库**(DDL + 种子在 `mahjong-py/schema.sql`)。
这 7 个新菜单页面依赖它们,未建表前打开会报「表不存在」。属「游戏本体」前置依赖、且 generator 还没写完
(见 `mahjong-py/README.md`),**待用户确认后再执行**。
@@ -104,7 +104,7 @@ const gameTypeLabel = (code: number, originalSource?: number) => {
4: '对战', 4: '对战',
38: '疯狂转盘', 38: '疯狂转盘',
40: '幸运升级', 40: '幸运升级',
60: '玫瑰女郎' 68: '麻将胡了'
} }
const key = originalSource || code const key = originalSource || code
if (key != null && originalMap[key]) return originalMap[key] if (key != null && originalMap[key]) return originalMap[key]
+4 -4
View File
@@ -81,9 +81,9 @@
<span style="color: #f56c6c">{{ formatNum(row.crazyWheelConsume) }}</span> <span style="color: #f56c6c">{{ formatNum(row.crazyWheelConsume) }}</span>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn label="玫瑰女郎" width="110"> <ElTableColumn label="麻将胡了" width="110">
<template #default="{ row }"> <template #default="{ row }">
<span style="color: #e6a23c">{{ formatNum(row.olympusConsume) }}</span> <span style="color: #e6a23c">{{ formatNum(row.mahjongConsume) }}</span>
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
@@ -130,9 +130,9 @@
<span style="color: #f56c6c">{{ formatNum(child.crazyWheelConsume) }}</span> <span style="color: #f56c6c">{{ formatNum(child.crazyWheelConsume) }}</span>
</template> </template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn label="玫瑰女郎" width="110"> <ElTableColumn label="麻将胡了" width="110">
<template #default="{ row: child }"> <template #default="{ row: child }">
<span style="color: #e6a23c">{{ formatNum(child.olympusConsume) }}</span> <span style="color: #e6a23c">{{ formatNum(child.mahjongConsume) }}</span>
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
+3 -3
View File
@@ -89,7 +89,7 @@
<div class="rate-card-value">{{ formatRate(gameRates.classicGameRate) }}</div> <div class="rate-card-value">{{ formatRate(gameRates.classicGameRate) }}</div>
</div> </div>
<div class="rate-card"> <div class="rate-card">
<div class="rate-card-title">玫瑰女郎</div> <div class="rate-card-title">麻将胡了</div>
<div class="rate-card-value">{{ formatRate(gameRates.newGameRate) }}</div> <div class="rate-card-value">{{ formatRate(gameRates.newGameRate) }}</div>
</div> </div>
</div> </div>
@@ -112,8 +112,8 @@
<ElTableColumn prop="crazyWheel" label="疯狂转盘" align="center" min-width="110"> <ElTableColumn prop="crazyWheel" label="疯狂转盘" align="center" min-width="110">
<template #default="{ row }">{{ formatNum(row.crazyWheel) }}</template> <template #default="{ row }">{{ formatNum(row.crazyWheel) }}</template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="olympus" label="玫瑰女郎" align="center" min-width="110"> <ElTableColumn prop="mahjong" label="麻将胡了" align="center" min-width="110">
<template #default="{ row }">{{ formatNum(row.olympus) }}</template> <template #default="{ row }">{{ formatNum(row.mahjong) }}</template>
</ElTableColumn> </ElTableColumn>
<ElTableColumn prop="totalConsume" label="总消费" align="center" min-width="110"> <ElTableColumn prop="totalConsume" label="总消费" align="center" min-width="110">
<template #default="{ row }">{{ formatNum(row.totalConsume) }}</template> <template #default="{ row }">{{ formatNum(row.totalConsume) }}</template>
+3 -3
View File
@@ -53,12 +53,12 @@ export const ACCOUNT_SOURCE_MAP = {
52: '极速糖果奖励', 52: '极速糖果奖励',
56: 'Roll房未发放退回主播', 56: 'Roll房未发放退回主播',
59: '主播Roll房奖池扣款', 59: '主播Roll房奖池扣款',
60: '玫瑰女郎消费',
61: '玫瑰女郎奖励',
62: '招商周结佣金', 62: '招商周结佣金',
63: '流水抽奖奖励', 63: '流水抽奖奖励',
65: '管理员调整余额', 65: '管理员调整余额',
66: '管理员调整积分' 66: '管理员调整积分',
68: '麻将胡了消费',
69: '麻将胡了奖励'
}; };
/** /**
+11 -6
View File
@@ -145,9 +145,11 @@ export default {
}; };
}, },
computed: { computed: {
// 隐藏极速糖果、Roll 房、荒野争锋卡片 // 隐藏已下架玩法的 RTP 卡片。按后端返回的 name 精确匹配。
// 2026-09-22:「玫瑰女郎」(= 后端 olympus 玩法)已下架并隐藏;
// 新游戏「麻将胡了」不在隐藏列表里,正常展示。
visibleRtpList() { visibleRtpList() {
const hidden = ["极速糖果", "Roll 房", "Roll房", "荒野争锋"]; const hidden = ["极速糖果", "Roll 房", "Roll房", "荒野争锋", "玫瑰女郎"];
return this.rtpList.filter(item => !hidden.includes(item.name)); return this.rtpList.filter(item => !hidden.includes(item.name));
}, },
chartTypeLabel() { chartTypeLabel() {
@@ -311,7 +313,7 @@ export default {
getChartDataList() { getChartDataList() {
return getChartData(this.chartType).then(res => { return getChartData(this.chartType).then(res => {
const data = res.data; const data = res.data;
this.drawLineChart(data.dateList, data.rechargeList, data.boxOpenList, data.fightBoxOpenList, data.luckyUpgradeList, data.westernDuelList, data.wheelList, data.roseladyList); this.drawLineChart(data.dateList, data.rechargeList, data.boxOpenList, data.fightBoxOpenList, data.luckyUpgradeList, data.westernDuelList, data.wheelList, data.roseladyList, data.mahjongList);
}); });
}, },
switchChartType(type) { switchChartType(type) {
@@ -337,7 +339,7 @@ export default {
this.rollRoomReward = 0; this.rollRoomReward = 0;
}); });
}, },
drawLineChart(dateList, rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList) { drawLineChart(dateList, rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList, mahjongList) {
var chartDom = document.getElementById("lineChart"); var chartDom = document.getElementById("lineChart");
if (this.lineChartInstance) { if (this.lineChartInstance) {
this.lineChartInstance.dispose(); this.lineChartInstance.dispose();
@@ -354,7 +356,10 @@ export default {
{ name: "对战开箱流水", data: fightBoxOpenList, color: "#4a9163" }, { name: "对战开箱流水", data: fightBoxOpenList, color: "#4a9163" },
{ name: "幸运升级流水", data: luckyUpgradeList, color: "#4a7f8c" }, { name: "幸运升级流水", data: luckyUpgradeList, color: "#4a7f8c" },
{ name: "疯狂转盘流水", data: wheelList, color: "#7a6a9c" }, { name: "疯狂转盘流水", data: wheelList, color: "#7a6a9c" },
{ name: "玫瑰女郎流水", data: roseladyList, color: "#a35790" } // 麻将胡了流水:沿用原玫瑰女郎的品红 #a35790(色相与前 5 条继续错开,不撞色)
{ name: "麻将胡了流水", data: mahjongList, color: "#a35790" }
// 玫瑰女郎流水(= 后端 olympus 玩法)已随玩法下架移除,2026-09-22;
// roseladyList 参数仍由 getChartData 传入但不再使用(与 westernDuelList 写法一致,方便将来一行恢复)。
]; ];
var option = { var option = {
tooltip: { tooltip: {
@@ -788,7 +793,7 @@ export default {
.rtp-dot { background: #4a9163; } .rtp-dot { background: #4a9163; }
.rtp-progress-inner { background: linear-gradient(90deg, #8fb8a0, #4a9163); } .rtp-progress-inner { background: linear-gradient(90deg, #8fb8a0, #4a9163); }
} }
.rtp-theme-4 { /* 玫瑰女郎 */ .rtp-theme-4 { /* 麻将胡了(idx%5=4) */
.rtp-dot { background: #a35790; } .rtp-dot { background: #a35790; }
.rtp-progress-inner { background: linear-gradient(90deg, #c69bb8, #a35790); } .rtp-progress-inner { background: linear-gradient(90deg, #c69bb8, #a35790); }
} }
+2 -2
View File
@@ -56,8 +56,8 @@
<el-option label="维护" value="1"></el-option> <el-option label="维护" value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="玫瑰女郎维护"> <el-form-item label="麻将胡了维护">
<el-select v-model="form.olympusMaintenance" placeholder="请选择活动区域"> <el-select v-model="form.mahjongMaintenance" placeholder="请选择活动区域">
<el-option label="正常" value="0"></el-option> <el-option label="正常" value="0"></el-option>
<el-option label="维护" value="1"></el-option> <el-option label="维护" value="1"></el-option>
</el-select> </el-select>
@@ -88,8 +88,8 @@ export default {
{ value: 38, label: '疯狂转盘消费' }, { value: 38, label: '疯狂转盘消费' },
{ value: 39, label: '疯狂转盘奖励' }, { value: 39, label: '疯狂转盘奖励' },
{ value: 64, label: '疯狂转盘注单退款' }, { value: 64, label: '疯狂转盘注单退款' },
{ value: 60, label: '玫瑰女郎消费' }, { value: 68, label: '麻将胡了消费' },
{ value: 61, label: '玫瑰女郎奖励' }, { value: 69, label: '麻将胡了奖励' },
{ value: 10, label: '背包分解饰品收入' }, { value: 10, label: '背包分解饰品收入' },
{ value: 12, label: '商城兑换消费' }, { value: 12, label: '商城兑换消费' },
{ value: 17, label: '兑换CDKEY收入' }, { value: 17, label: '兑换CDKEY收入' },
@@ -87,8 +87,8 @@ const AMOUNT_SOURCE_OPTIONS = [
{ value: 38, label: '疯狂转盘消费' }, { value: 38, label: '疯狂转盘消费' },
{ value: 39, label: '疯狂转盘奖励' }, { value: 39, label: '疯狂转盘奖励' },
{ value: 64, label: '疯狂转盘注单退款' }, { value: 64, label: '疯狂转盘注单退款' },
{ value: 60, label: '玫瑰女郎消费' }, { value: 68, label: '麻将胡了消费' },
{ value: 61, label: '玫瑰女郎奖励' }, { value: 69, label: '麻将胡了奖励' },
{ value: 10, label: '背包分解饰品收入' }, { value: 10, label: '背包分解饰品收入' },
{ value: 12, label: '商城兑换消费' }, { value: 12, label: '商城兑换消费' },
{ value: 17, label: '兑换CDKEY收入' }, { value: 17, label: '兑换CDKEY收入' },
@@ -118,8 +118,8 @@ const CREDITS_SOURCE_OPTIONS = [
{ value: 38, label: '疯狂转盘消费' }, { value: 38, label: '疯狂转盘消费' },
{ value: 39, label: '疯狂转盘奖励' }, { value: 39, label: '疯狂转盘奖励' },
{ value: 64, label: '疯狂转盘注单退款' }, { value: 64, label: '疯狂转盘注单退款' },
{ value: 60, label: '玫瑰女郎消费' }, { value: 68, label: '麻将胡了消费' },
{ value: 61, label: '玫瑰女郎奖励' }, { value: 69, label: '麻将胡了奖励' },
{ value: 10, label: '背包分解饰品收入' }, { value: 10, label: '背包分解饰品收入' },
{ value: 12, label: '商城兑换消费' }, { value: 12, label: '商城兑换消费' },
{ value: 17, label: '兑换CDKEY收入' }, { value: 17, label: '兑换CDKEY收入' },
@@ -87,8 +87,8 @@ export default {
{ value: 38, label: '疯狂转盘消费' }, { value: 38, label: '疯狂转盘消费' },
{ value: 39, label: '疯狂转盘奖励' }, { value: 39, label: '疯狂转盘奖励' },
{ value: 64, label: '疯狂转盘注单退款' }, { value: 64, label: '疯狂转盘注单退款' },
{ value: 60, label: '玫瑰女郎消费' }, { value: 68, label: '麻将胡了消费' },
{ value: 61, label: '玫瑰女郎奖励' }, { value: 69, label: '麻将胡了奖励' },
{ value: 10, label: '背包分解饰品收入' }, { value: 10, label: '背包分解饰品收入' },
{ value: 12, label: '商城兑换消费' }, { value: 12, label: '商城兑换消费' },
{ value: 17, label: '兑换CDKEY收入' }, { value: 17, label: '兑换CDKEY收入' },
+2 -2
View File
@@ -47,7 +47,7 @@
<el-option label="roll房" value="3" /> <el-option label="roll房" value="3" />
<el-option label="幸运升级" value="4" /> <el-option label="幸运升级" value="4" />
<el-option label="疯狂转盘" value="99" /> <el-option label="疯狂转盘" value="99" />
<el-option label="玫瑰女郎" value="13" /> <el-option label="麻将胡了" value="15" />
<el-option label="转赠" value="9" /> <el-option label="转赠" value="9" />
<el-option label="系统发放" value="5" /> <el-option label="系统发放" value="5" />
<el-option label="商城兑换" value="6" /> <el-option label="商城兑换" value="6" />
@@ -141,10 +141,10 @@ export default {
3: 'roll房', 3: 'roll房',
4: '幸运升级', 4: '幸运升级',
99: '疯狂转盘', 99: '疯狂转盘',
15: '麻将胡了',
5: '系统发放', 5: '系统发放',
6: '商城兑换', 6: '商城兑换',
9: '转赠', 9: '转赠',
13: '玫瑰女郎',
14: '流水抽奖' 14: '流水抽奖'
}, },
statusMap: { statusMap: {
@@ -64,12 +64,12 @@
<el-table-column prop="wheelGame" label="疯狂转盘" min-width="100" align="right" sortable="custom"> <el-table-column prop="wheelGame" label="疯狂转盘" min-width="100" align="right" sortable="custom">
<template slot-scope="scope">{{ formatMoney(scope.row.wheelGame) }}</template> <template slot-scope="scope">{{ formatMoney(scope.row.wheelGame) }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="olympusGame" label="玫瑰女郎" min-width="100" align="right" sortable="custom">
<template slot-scope="scope">{{ formatMoney(scope.row.olympusGame) }}</template>
</el-table-column>
<el-table-column prop="rollRoom" label="roll房" min-width="90" align="right" sortable="custom"> <el-table-column prop="rollRoom" label="roll房" min-width="90" align="right" sortable="custom">
<template slot-scope="scope">{{ formatMoney(scope.row.rollRoom) }}</template> <template slot-scope="scope">{{ formatMoney(scope.row.rollRoom) }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="mahjongGame" label="麻将胡了" min-width="100" align="right" sortable="custom">
<template slot-scope="scope">{{ formatMoney(scope.row.mahjongGame) }}</template>
</el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
@@ -95,7 +95,7 @@ import { getUserTurnover } from '@/api/skins/userTurnover'
const sortLabels = { const sortLabels = {
totalRecharge: '充值', totalTurnover: '总流水', totalRecharge: '充值', totalTurnover: '总流水',
classicBox: '经典开箱', fightGame: '对战', luckyUpgrade: '幸运升级', classicBox: '经典开箱', fightGame: '对战', luckyUpgrade: '幸运升级',
wheelGame: '疯狂转盘', olympusGame: '玫瑰女郎', rollRoom: 'roll房', wheelGame: '疯狂转盘', rollRoom: 'roll房', mahjongGame: '麻将胡了',
userId: '用户ID' userId: '用户ID'
} }
@@ -15,7 +15,7 @@ public enum MessageCategoryEnum {
GAME_BOX("GAME_BOX", "常规补给"), GAME_BOX("GAME_BOX", "常规补给"),
GAME_LUCKY_UPGRADE("GAME_LUCKY_UPGRADE", "进阶风暴"), GAME_LUCKY_UPGRADE("GAME_LUCKY_UPGRADE", "进阶风暴"),
GAME_WHEEL("GAME_WHEEL", "狂欢转盘"), GAME_WHEEL("GAME_WHEEL", "狂欢转盘"),
GAME_OLYMPUS("GAME_OLYMPUS", "玫瑰女郎"), GAME_MAHJONG("GAME_MAHJONG", "麻将胡了"),
// ==================== 系统类消息 ==================== // ==================== 系统类消息 ====================
SYS_ROLL_OFFICIAL("SYS_ROLL_OFFICIAL", "Roll房"), SYS_ROLL_OFFICIAL("SYS_ROLL_OFFICIAL", "Roll房"),
@@ -145,12 +145,6 @@ public enum TtAccountRecordSource {
// 导致主播建房+删房循环刷 VIP 流水返利/消费排行榜奖励并污染投注统计。 // 导致主播建房+删房循环刷 VIP 流水返利/消费排行榜奖励并污染投注统计。
PROMO_ROLL_DEDUCT(59, TtAccountRecordType.OUTPUT, "主播Roll房奖池扣款"), PROMO_ROLL_DEDUCT(59, TtAccountRecordType.OUTPUT, "主播Roll房奖池扣款"),
// 玫瑰女郎电子游戏消费
OLYMPUS_SPIN(60, TtAccountRecordType.OUTPUT, "玫瑰女郎消费"),
// 玫瑰女郎电子游戏奖励
OLYMPUS_REWARD(61, TtAccountRecordType.INPUT, "玫瑰女郎奖励"),
// 招商周结佣金(每周一结算上一周,与主播实时返佣 27/47/49 区分) // 招商周结佣金(每周一结算上一周,与主播实时返佣 27/47/49 区分)
BUSINESS_WEEKLY_COMMISSION(62, TtAccountRecordType.INPUT, "招商周结佣金"), BUSINESS_WEEKLY_COMMISSION(62, TtAccountRecordType.INPUT, "招商周结佣金"),
@@ -167,7 +161,13 @@ public enum TtAccountRecordSource {
ADMIN_ADJUST_CREDITS(66, TtAccountRecordType.INPUT, "管理员调整积分"), ADMIN_ADJUST_CREDITS(66, TtAccountRecordType.INPUT, "管理员调整积分"),
// 管理员手动调整卡商余额(写入卡商余额变动流水,操作人/IP 见 remark;与 45/46/55 一样复用 credits 列记账) // 管理员手动调整卡商余额(写入卡商余额变动流水,操作人/IP 见 remark;与 45/46/55 一样复用 credits 列记账)
ADMIN_ADJUST_MERCHANT_BALANCE(67, TtAccountRecordType.INPUT, "管理员调整卡商余额") ADMIN_ADJUST_MERCHANT_BALANCE(67, TtAccountRecordType.INPUT, "管理员调整卡商余额"),
// 麻将胡了电子游戏消费
MAHJONG_SPIN(68, TtAccountRecordType.OUTPUT, "麻将胡了消费"),
// 麻将胡了电子游戏奖励
MAHJONG_REWARD(69, TtAccountRecordType.INPUT, "麻将胡了奖励")
; ;
private final Integer code; private final Integer code;
@@ -196,7 +196,7 @@ public enum TtAccountRecordSource {
GAME_TYPE_02.getCode(), GAME_TYPE_02.getCode(),
GOLD_DEVICE.getCode(), GOLD_DEVICE.getCode(),
LUCKLY_WHEEL_SPIN.getCode(), LUCKLY_WHEEL_SPIN.getCode(),
OLYMPUS_SPIN.getCode()); MAHJONG_SPIN.getCode());
} }
// 计算流水返利的游戏类型 // 计算流水返利的游戏类型
@@ -205,7 +205,7 @@ public enum TtAccountRecordSource {
GAME_TYPE_02.getCode(), GAME_TYPE_02.getCode(),
GOLD_DEVICE.getCode(), GOLD_DEVICE.getCode(),
LUCKLY_WHEEL_SPIN.getCode(), LUCKLY_WHEEL_SPIN.getCode(),
OLYMPUS_SPIN.getCode()); MAHJONG_SPIN.getCode());
} }
// 今日总投注:所有游戏消费 source // 今日总投注:所有游戏消费 source
@@ -216,7 +216,7 @@ public enum TtAccountRecordSource {
GAME_TYPE_03.getCode(), // roll 房消费 GAME_TYPE_03.getCode(), // roll 房消费
LUCKLY_WHEEL_SPIN.getCode(), // 疯狂转盘消费 LUCKLY_WHEEL_SPIN.getCode(), // 疯狂转盘消费
GOLD_DEVICE.getCode(), // 幸运升级消费 GOLD_DEVICE.getCode(), // 幸运升级消费
OLYMPUS_SPIN.getCode() // 玫瑰女郎消费 MAHJONG_SPIN.getCode() // 麻将胡了消费
); );
} }
@@ -228,7 +228,7 @@ public enum TtAccountRecordSource {
GAME_TYPE_03_AWARD.getCode(), // roll房奖励 GAME_TYPE_03_AWARD.getCode(), // roll房奖励
GOLD_DEVICE_REWARD.getCode(), // 幸运升级奖励 GOLD_DEVICE_REWARD.getCode(), // 幸运升级奖励
LUCKLY_WHEEL_REWARD.getCode(), // 疯狂转盘奖励 LUCKLY_WHEEL_REWARD.getCode(), // 疯狂转盘奖励
OLYMPUS_REWARD.getCode() // 玫瑰女郎奖励 MAHJONG_REWARD.getCode() // 麻将胡了奖励
); );
} }
@@ -241,14 +241,14 @@ public enum TtAccountRecordSource {
|| code == LUCKLY_WHEEL_SPIN.getCode(); || code == LUCKLY_WHEEL_SPIN.getCode();
} }
/** 新游戏消费:玫瑰女郎 */ /** 特殊游戏消费:麻将胡了(发奖/福利口径里的「特殊游戏」) */
public static boolean isSpecialGameConsume(int code) { public static boolean isSpecialGameConsume(int code) {
return code == OLYMPUS_SPIN.getCode(); return code == MAHJONG_SPIN.getCode();
} }
/** 新游戏消费(对应 newGameCommissionRate):玫瑰女郎 */ /** 新游戏消费(对应 newGameCommissionRate):麻将胡了 */
public static boolean isNewGameConsumeForCommission(int code) { public static boolean isNewGameConsumeForCommission(int code) {
return code == OLYMPUS_SPIN.getCode(); return code == MAHJONG_SPIN.getCode();
} }
/** 经典游戏消费(对应 classicGameCommissionRate):经典开箱、对战、幸运升级、疯狂转盘 */ /** 经典游戏消费(对应 classicGameCommissionRate):经典开箱、对战、幸运升级、疯狂转盘 */
@@ -274,7 +274,7 @@ public enum TtAccountRecordSource {
GAME_TYPE_02.getCode(), // 对战消费 GAME_TYPE_02.getCode(), // 对战消费
GOLD_DEVICE.getCode(), // 幸运升级消费 GOLD_DEVICE.getCode(), // 幸运升级消费
LUCKLY_WHEEL_SPIN.getCode(), // 疯狂转盘消费 LUCKLY_WHEEL_SPIN.getCode(), // 疯狂转盘消费
OLYMPUS_SPIN.getCode() // 玫瑰女郎消费 MAHJONG_SPIN.getCode() // 麻将胡了消费
); );
} }
@@ -25,9 +25,9 @@ public enum TtboxRecordSource {
TRANSFER(9,"转赠"), TRANSFER(9,"转赠"),
WELFARE_BOX(10,"福利开箱"), WELFARE_BOX(10,"福利开箱"),
BULLET_BOX(12,"荒野争锋"), BULLET_BOX(12,"荒野争锋"),
OLYMPUS_BOX(13,"玫瑰女郎"),
WHEEL_BOX(99,"疯狂转盘"), WHEEL_BOX(99,"疯狂转盘"),
TURNOVER_LOTTERY(14,"流水抽奖"), TURNOVER_LOTTERY(14,"流水抽奖"),
MAHJONG_BOX(15,"麻将胡了"),
; ;
private Integer code; private Integer code;
@@ -33,8 +33,8 @@ public class ParameterSettingBody {
private String luckyUpgradeMaintenance; private String luckyUpgradeMaintenance;
private String wheelMaintenance; private String wheelMaintenance;
/** 玫瑰女郎维护开关:0正常 1维护(对应 sys_config 键 olympusMaintenance,产品已更名,key 保持不变) */ /** 麻将胡了维护开关:0正常 1维护(对应 sys_config 键 mahjongMaintenance,客户端 MahjongClientController 读取) */
private String olympusMaintenance; private String mahjongMaintenance;
/** 充值渠道维护开关:0正常 1维护(仅控制第三方支付渠道 unifiedPay) */ /** 充值渠道维护开关:0正常 1维护(仅控制第三方支付渠道 unifiedPay) */
private String rechargeMaintenance; private String rechargeMaintenance;
@@ -113,7 +113,7 @@ public class PromoAdminManageController extends BaseController {
BigDecimal anchorRecharge = BigDecimal.ZERO; BigDecimal anchorRecharge = BigDecimal.ZERO;
BigDecimal anchorTurnover = BigDecimal.ZERO; BigDecimal anchorTurnover = BigDecimal.ZERO;
BigDecimal anchorSpecialTurnover = BigDecimal.ZERO; // 特殊游戏(玫瑰女郎)流水 BigDecimal anchorSpecialTurnover = BigDecimal.ZERO; // 特殊游戏(麻将胡了)流水
BigDecimal anchorClassicTurnover = BigDecimal.ZERO; // 经典游戏流水 BigDecimal anchorClassicTurnover = BigDecimal.ZERO; // 经典游戏流水
BigDecimal anchorEarnings = BigDecimal.ZERO; BigDecimal anchorEarnings = BigDecimal.ZERO;
BigDecimal businessEarningsForAnchor = BigDecimal.ZERO; // 招商从该主播获得的收益 BigDecimal businessEarningsForAnchor = BigDecimal.ZERO; // 招商从该主播获得的收益
@@ -130,7 +130,7 @@ public class PromoAdminManageController extends BaseController {
TtAccountRecordType.INPUT.getCode()); TtAccountRecordType.INPUT.getCode());
// 总流水(游戏消费) // 总流水(游戏消费)
anchorTurnover = sumGameConsume(subUserIds); anchorTurnover = sumGameConsume(subUserIds);
// 特殊游戏(玫瑰女郎)消费 // 特殊游戏(麻将胡了)消费
anchorSpecialTurnover = sumNewGameConsume(subUserIds); anchorSpecialTurnover = sumNewGameConsume(subUserIds);
// 经典游戏消费 // 经典游戏消费
anchorClassicTurnover = sumClassicGameConsume(subUserIds); anchorClassicTurnover = sumClassicGameConsume(subUserIds);
@@ -256,7 +256,7 @@ public class PromoAdminManageController extends BaseController {
TtAccountRecordType.INPUT.getCode()); TtAccountRecordType.INPUT.getCode());
// 总流水(游戏消费) // 总流水(游戏消费)
totalTurnover = sumGameConsume(subUserIds); totalTurnover = sumGameConsume(subUserIds);
// 新游戏消费 // 新游戏(麻将胡了)消费
newGameConsume = sumNewGameConsume(subUserIds); newGameConsume = sumNewGameConsume(subUserIds);
// 经典游戏消费 // 经典游戏消费
classicGameConsume = sumClassicGameConsume(subUserIds); classicGameConsume = sumClassicGameConsume(subUserIds);
@@ -382,7 +382,7 @@ public class PromoAdminManageController extends BaseController {
} }
/** /**
* 汇总新游戏消费(奥林匹斯) * 汇总新游戏消费(麻将胡了)
*/ */
private BigDecimal sumNewGameConsume(List<Integer> userIds) { private BigDecimal sumNewGameConsume(List<Integer> userIds) {
return sumConsumeByFilter(userIds, TtAccountRecordSource::isNewGameConsumeForCommission); return sumConsumeByFilter(userIds, TtAccountRecordSource::isNewGameConsumeForCommission);
@@ -404,16 +404,16 @@ public class PromoTurnoverController extends BaseController {
BigDecimal battleConsume = BigDecimal.ZERO; BigDecimal battleConsume = BigDecimal.ZERO;
BigDecimal luckUpgradeConsume = BigDecimal.ZERO; BigDecimal luckUpgradeConsume = BigDecimal.ZERO;
BigDecimal crazyWheelConsume = BigDecimal.ZERO; BigDecimal crazyWheelConsume = BigDecimal.ZERO;
BigDecimal olympusConsume = BigDecimal.ZERO; BigDecimal mahjongConsume = BigDecimal.ZERO;
if (!gameUserIds.isEmpty()) { if (!gameUserIds.isEmpty()) {
classicBoxConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(2), startTime, endTime)); classicBoxConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(2), startTime, endTime));
battleConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(4), startTime, endTime)); battleConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(4), startTime, endTime));
luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(40), startTime, endTime)); luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(40), startTime, endTime));
crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(38), startTime, endTime)); crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(38), startTime, endTime));
olympusConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(60), startTime, endTime)); mahjongConsume = coalesce(promoTurnoverMapper.getGameConsumeByUserIds(gameUserIds, Collections.singletonList(68), startTime, endTime));
} }
BigDecimal classicGameConsume = classicBoxConsume.add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume); BigDecimal classicGameConsume = classicBoxConsume.add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume);
BigDecimal specialGameConsume = olympusConsume; BigDecimal specialGameConsume = mahjongConsume;
// 主播行流水列:均为该主播名下所有普通用户的流水汇总 // 主播行流水列:均为该主播名下所有普通用户的流水汇总
BigDecimal anchorTotalFlow = classicGameConsume.add(specialGameConsume); BigDecimal anchorTotalFlow = classicGameConsume.add(specialGameConsume);
BigDecimal anchorClassicFlow = classicGameConsume; BigDecimal anchorClassicFlow = classicGameConsume;
@@ -432,7 +432,7 @@ public class PromoTurnoverController extends BaseController {
item.put("battleConsume", battleConsume); item.put("battleConsume", battleConsume);
item.put("luckUpgradeConsume", luckUpgradeConsume); item.put("luckUpgradeConsume", luckUpgradeConsume);
item.put("crazyWheelConsume", crazyWheelConsume); item.put("crazyWheelConsume", crazyWheelConsume);
item.put("olympusConsume", olympusConsume); item.put("mahjongConsume", mahjongConsume);
item.put("totalCommission", totalCommission); item.put("totalCommission", totalCommission);
// 主播下属普通用户明细(供前端展开展示,不计算佣金) // 主播下属普通用户明细(供前端展开展示,不计算佣金)
@@ -456,13 +456,13 @@ public class PromoTurnoverController extends BaseController {
BigDecimal uBattle = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime)); BigDecimal uBattle = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime));
BigDecimal uLuck = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime)); BigDecimal uLuck = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime));
BigDecimal uWheel = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime)); BigDecimal uWheel = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime));
BigDecimal uOlympus = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(60), startTime, endTime)); BigDecimal uMahjong = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(68), startTime, endTime));
child.put("totalRecharge", uRecharge); child.put("totalRecharge", uRecharge);
child.put("classicBoxConsume", uCB); child.put("classicBoxConsume", uCB);
child.put("battleConsume", uBattle); child.put("battleConsume", uBattle);
child.put("luckUpgradeConsume", uLuck); child.put("luckUpgradeConsume", uLuck);
child.put("crazyWheelConsume", uWheel); child.put("crazyWheelConsume", uWheel);
child.put("olympusConsume", uOlympus); child.put("mahjongConsume", uMahjong);
child.put("totalCommission", BigDecimal.ZERO); // 普通用户行不独立计算 child.put("totalCommission", BigDecimal.ZERO); // 普通用户行不独立计算
children.add(child); children.add(child);
} }
@@ -493,10 +493,10 @@ public class PromoTurnoverController extends BaseController {
BigDecimal battleConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime)); BigDecimal battleConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime));
BigDecimal luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime)); BigDecimal luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime));
BigDecimal crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime)); BigDecimal crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime));
BigDecimal olympusConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(60), startTime, endTime)); BigDecimal mahjongConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(68), startTime, endTime));
BigDecimal classicGameConsume = classicBoxConsume.add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume); BigDecimal classicGameConsume = classicBoxConsume.add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume);
BigDecimal specialGameConsume = olympusConsume; BigDecimal specialGameConsume = mahjongConsume;
// 主播佣金:分项各自 calcRate 后相加,舍入口径与 admin 端 calcRate 完全一致 // 主播佣金:分项各自 calcRate 后相加,舍入口径与 admin 端 calcRate 完全一致
BigDecimal totalCommission = calcRate(totalRecharge, commissionRate) BigDecimal totalCommission = calcRate(totalRecharge, commissionRate)
@@ -508,7 +508,7 @@ public class PromoTurnoverController extends BaseController {
item.put("battleConsume", battleConsume); item.put("battleConsume", battleConsume);
item.put("luckUpgradeConsume", luckUpgradeConsume); item.put("luckUpgradeConsume", luckUpgradeConsume);
item.put("crazyWheelConsume", crazyWheelConsume); item.put("crazyWheelConsume", crazyWheelConsume);
item.put("olympusConsume", olympusConsume); item.put("mahjongConsume", mahjongConsume);
item.put("totalCommission", totalCommission); item.put("totalCommission", totalCommission);
result.add(item); result.add(item);
} }
@@ -715,6 +715,7 @@ public class PromoTurnoverController extends BaseController {
/** /**
* 招商游戏消费返点比例:按游戏来源取新游戏/经典玩法费率(口径与周结 CommissionSettlementTask 一致)。 * 招商游戏消费返点比例:按游戏来源取新游戏/经典玩法费率(口径与周结 CommissionSettlementTask 一致)。
* 新游戏 = 麻将胡了(source 68),走 newGameCommissionRate。
*/ */
private BigDecimal businessGameRate(TtUser businessUser, int src) { private BigDecimal businessGameRate(TtUser businessUser, int src) {
return TtAccountRecordSource.isNewGameConsumeForCommission(src) return TtAccountRecordSource.isNewGameConsumeForCommission(src)
@@ -777,10 +778,10 @@ public class PromoTurnoverController extends BaseController {
BigDecimal battleConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime)); BigDecimal battleConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(4), startTime, endTime));
BigDecimal luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime)); BigDecimal luckUpgradeConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(40), startTime, endTime));
BigDecimal crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime)); BigDecimal crazyWheelConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(38), startTime, endTime));
BigDecimal olympusConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(60), startTime, endTime)); BigDecimal mahjongConsume = coalesce(promoTurnoverMapper.getGameConsumeBySources(u.getUserId(), Collections.singletonList(68), startTime, endTime));
classicGameConsume = classicGameConsume.add(classicBoxConsume).add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume); classicGameConsume = classicGameConsume.add(classicBoxConsume).add(battleConsume).add(luckUpgradeConsume).add(crazyWheelConsume);
specialGameConsume = specialGameConsume.add(olympusConsume); specialGameConsume = specialGameConsume.add(mahjongConsume);
} }
return calcRate(totalRecharge, anchor.getCommissionRate()) return calcRate(totalRecharge, anchor.getCommissionRate())
@@ -173,7 +173,7 @@ public interface PromoTurnoverMapper {
/** /**
* 按 business_id 快照统计指定招商上周流水(不受后续改绑/解绑影响)。 * 按 business_id 快照统计指定招商上周流水(不受后续改绑/解绑影响)。
* 返回 Map:recharge, newGameConsume, classicGameConsume。 * 返回 Map:recharge, classicGameConsume。
* 游戏消费按 anchor_id IS NOT NULL 排除主播自玩,与旧口径「仅普通用户」一致。 * 游戏消费按 anchor_id IS NOT NULL 排除主播自玩,与旧口径「仅普通用户」一致。
*/ */
Map<String, Object> getWeeklyCommissionDataWithSnapshot(@Param("businessUserId") Integer businessUserId, Map<String, Object> getWeeklyCommissionDataWithSnapshot(@Param("businessUserId") Integer businessUserId,
@@ -183,8 +183,8 @@ public interface PromoTurnoverMapper {
/** /**
* 按天统计本周佣金计算所需数据(按当前关系树 user_id IN 统计,增加 GROUP BY DATE(create_time))。 * 按天统计本周佣金计算所需数据(按当前关系树 user_id IN 统计,增加 GROUP BY DATE(create_time))。
* - rechargeUserIds:全部下级(含主播自身),统计充值 * - rechargeUserIds:全部下级(含主播自身),统计充值
* - gameUserIds:仅普通用户(排除主播自玩),统计新/经典游戏消费 * - gameUserIds:仅普通用户(排除主播自玩),统计游戏消费
* 返回每天一行 Map:date, recharge, newGameConsume, classicGameConsume * 返回每天一行 Map:date, recharge, classicGameConsume
* 注意:本方法是“本周待结算”展示口径,与周结落账用的 business_id 快照口径不同。 * 注意:本方法是“本周待结算”展示口径,与周结落账用的 business_id 快照口径不同。
*/ */
List<Map<String, Object>> getWeeklyDailyCommissionData(@Param("rechargeUserIds") List<Integer> rechargeUserIds, List<Map<String, Object>> getWeeklyDailyCommissionData(@Param("rechargeUserIds") List<Integer> rechargeUserIds,
@@ -280,19 +280,6 @@ public interface PromoTurnoverMapper {
@Param("startTime") Date startTime, @Param("startTime") Date startTime,
@Param("endTime") Date endTime); @Param("endTime") Date endTime);
/**
* 统计指定用户群在指定日期内的特殊游戏(玫瑰女郎)消费总额
*/
@Select({"<script>",
"SELECT COALESCE(SUM(ABS(total)), 0) FROM tt_user_blend_ercash",
"WHERE type = 0 AND source IN (60)",
"AND user_id IN <foreach item='id' collection='userIds' open='(' separator=',' close=')'>#{id}</foreach>",
"AND create_time >= #{startTime} AND create_time &lt; #{endTime}",
"</script>"})
BigDecimal getSubNewGameConsumeByDate(@Param("userIds") List<Integer> userIds,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime);
/** /**
* 统计指定用户群在指定日期内的经典玩法游戏消费总额(经典开箱、对战、幸运升级、疯狂转盘) * 统计指定用户群在指定日期内的经典玩法游戏消费总额(经典开箱、对战、幸运升级、疯狂转盘)
*/ */
@@ -358,12 +345,6 @@ public interface PromoTurnoverMapper {
@Select("SELECT COALESCE(SUM(ABS(amount)), 0) FROM tt_user_blend_ercash WHERE user_id = #{userId} AND type = 0 AND source IN (2, 4, 40, 38)") @Select("SELECT COALESCE(SUM(ABS(amount)), 0) FROM tt_user_blend_ercash WHERE user_id = #{userId} AND type = 0 AND source IN (2, 4, 40, 38)")
BigDecimal getNormalGameConsumeByUserId(@Param("userId") Integer userId); BigDecimal getNormalGameConsumeByUserId(@Param("userId") Integer userId);
/**
* 用户终身特殊游戏消费(玫瑰女郎)
*/
@Select("SELECT COALESCE(SUM(ABS(amount)), 0) FROM tt_user_blend_ercash WHERE user_id = #{userId} AND type = 0 AND source IN (60)")
BigDecimal getSpecialGameConsumeByUserId(@Param("userId") Integer userId);
/** /**
* 按 source 列表统计用户游戏消费(startTime/endTime 为空时为终身累计) * 按 source 列表统计用户游戏消费(startTime/endTime 为空时为终身累计)
*/ */
@@ -113,7 +113,7 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
BigDecimal yesterdayCommission = BigDecimal.ZERO; BigDecimal yesterdayCommission = BigDecimal.ZERO;
if (CollectionUtils.isNotEmpty(allSubUserIds)) { if (CollectionUtils.isNotEmpty(allSubUserIds)) {
// === 佣金数据:一次查询替代原来6次(充值×2 + 新游戏×2 + 经典×2)=== // === 佣金数据:一次查询替代原来多次查询(充值×2 + 新游戏×2 + 经典×2)===
Map<String, Object> commData = promoTurnoverMapper.getBatchedCommissionData( Map<String, Object> commData = promoTurnoverMapper.getBatchedCommissionData(
allSubUserIds, gameUserIds, todayStart, todayEnd, yesterdayStart, yesterdayEnd); allSubUserIds, gameUserIds, todayStart, todayEnd, yesterdayStart, yesterdayEnd);
BigDecimal todaySubRecharge = toBd(commData, "todayRecharge"); BigDecimal todaySubRecharge = toBd(commData, "todayRecharge");
@@ -273,19 +273,19 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
List<Map<String, Object>> periods = new ArrayList<>(); List<Map<String, Object>> periods = new ArrayList<>();
periods.add(buildPeriod("今日", data, periods.add(buildPeriod("今日", data,
rechargeRate, newGameRate, classicGameRate, rechargeRate, newGameRate, classicGameRate,
"todayClassicBox", "todayLuckyUpgrade", "todayBattle", "todayCrazyWheel", "todayOlympus", "todayClassicBox", "todayLuckyUpgrade", "todayBattle", "todayCrazyWheel", "todayMahjong",
"todayRecharge", todayNewSub)); "todayRecharge", todayNewSub));
periods.add(buildPeriod("昨日", data, periods.add(buildPeriod("昨日", data,
rechargeRate, newGameRate, classicGameRate, rechargeRate, newGameRate, classicGameRate,
"yesterdayClassicBox", "yesterdayLuckyUpgrade", "yesterdayBattle", "yesterdayCrazyWheel", "yesterdayOlympus", "yesterdayClassicBox", "yesterdayLuckyUpgrade", "yesterdayBattle", "yesterdayCrazyWheel", "yesterdayMahjong",
"yesterdayRecharge", yesterdayNewSub)); "yesterdayRecharge", yesterdayNewSub));
periods.add(buildPeriod("本周", data, periods.add(buildPeriod("本周", data,
rechargeRate, newGameRate, classicGameRate, rechargeRate, newGameRate, classicGameRate,
"weekClassicBox", "weekLuckyUpgrade", "weekBattle", "weekCrazyWheel", "weekOlympus", "weekClassicBox", "weekLuckyUpgrade", "weekBattle", "weekCrazyWheel", "weekMahjong",
"weekRecharge", weekNewSub)); "weekRecharge", weekNewSub));
periods.add(buildPeriod("总", data, periods.add(buildPeriod("总", data,
rechargeRate, newGameRate, classicGameRate, rechargeRate, newGameRate, classicGameRate,
"totalClassicBox", "totalLuckyUpgrade", "totalBattle", "totalCrazyWheel", "totalOlympus", "totalClassicBox", "totalLuckyUpgrade", "totalBattle", "totalCrazyWheel", "totalMahjong",
"totalRecharge", totalNewSub)); "totalRecharge", totalNewSub));
result.put("periods", periods); result.put("periods", periods);
@@ -460,7 +460,6 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
return TtAccountRecordSource.isSpecialGameConsume(v.getSource()); return TtAccountRecordSource.isSpecialGameConsume(v.getSource());
}).map(v -> v.getAmount().abs()).reduce(BigDecimal.ZERO, BigDecimal::add); }).map(v -> v.getAmount().abs()).reduce(BigDecimal.ZERO, BigDecimal::add);
userInfo.setTotalNormGameCost(totalNormalGameConsume); userInfo.setTotalNormGameCost(totalNormalGameConsume);
userInfo.setTotalSpecialGameCost(totalSpecialGameConsume); userInfo.setTotalSpecialGameCost(totalSpecialGameConsume);
userInfo.setTotalRecharge(totalRecharge); userInfo.setTotalRecharge(totalRecharge);
@@ -817,10 +816,10 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
private Map<String, Object> createZeroGameCommissionData() { private Map<String, Object> createZeroGameCommissionData() {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
String[] keys = { String[] keys = {
"todayClassicBox", "todayLuckyUpgrade", "todayBattle", "todayCrazyWheel", "todayOlympus", "todayClassicBox", "todayLuckyUpgrade", "todayBattle", "todayCrazyWheel", "todayMahjong",
"yesterdayClassicBox", "yesterdayLuckyUpgrade", "yesterdayBattle", "yesterdayCrazyWheel", "yesterdayOlympus", "yesterdayClassicBox", "yesterdayLuckyUpgrade", "yesterdayBattle", "yesterdayCrazyWheel", "yesterdayMahjong",
"weekClassicBox", "weekLuckyUpgrade", "weekBattle", "weekCrazyWheel", "weekOlympus", "weekClassicBox", "weekLuckyUpgrade", "weekBattle", "weekCrazyWheel", "weekMahjong",
"totalClassicBox", "totalLuckyUpgrade", "totalBattle", "totalCrazyWheel", "totalOlympus", "totalClassicBox", "totalLuckyUpgrade", "totalBattle", "totalCrazyWheel", "totalMahjong",
"todayRecharge", "yesterdayRecharge", "weekRecharge", "totalRecharge" "todayRecharge", "yesterdayRecharge", "weekRecharge", "totalRecharge"
}; };
for (String key : keys) { for (String key : keys) {
@@ -835,17 +834,17 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
private Map<String, Object> buildPeriod(String periodName, Map<String, Object> data, private Map<String, Object> buildPeriod(String periodName, Map<String, Object> data,
BigDecimal rechargeRate, BigDecimal newGameRate, BigDecimal classicGameRate, BigDecimal rechargeRate, BigDecimal newGameRate, BigDecimal classicGameRate,
String classicBoxKey, String luckyUpgradeKey, String battleKey, String classicBoxKey, String luckyUpgradeKey, String battleKey,
String crazyWheelKey, String olympusKey, String rechargeKey, int newSub) { String crazyWheelKey, String mahjongKey, String rechargeKey, int newSub) {
BigDecimal classicBox = toBd(data, classicBoxKey); BigDecimal classicBox = toBd(data, classicBoxKey);
BigDecimal luckyUpgrade = toBd(data, luckyUpgradeKey); BigDecimal luckyUpgrade = toBd(data, luckyUpgradeKey);
BigDecimal battle = toBd(data, battleKey); BigDecimal battle = toBd(data, battleKey);
BigDecimal crazyWheel = toBd(data, crazyWheelKey); BigDecimal crazyWheel = toBd(data, crazyWheelKey);
BigDecimal olympus = toBd(data, olympusKey); BigDecimal mahjong = toBd(data, mahjongKey);
BigDecimal recharge = toBd(data, rechargeKey); BigDecimal recharge = toBd(data, rechargeKey);
BigDecimal totalConsume = classicBox.add(luckyUpgrade).add(battle).add(crazyWheel).add(olympus); BigDecimal totalConsume = classicBox.add(luckyUpgrade).add(battle).add(crazyWheel).add(mahjong);
BigDecimal classicConsume = classicBox.add(luckyUpgrade).add(battle).add(crazyWheel); BigDecimal classicConsume = classicBox.add(luckyUpgrade).add(battle).add(crazyWheel);
BigDecimal totalRebate = calcCommission(recharge, rechargeRate) BigDecimal totalRebate = calcCommission(recharge, rechargeRate)
.add(calcCommission(olympus, newGameRate)) .add(calcCommission(mahjong, newGameRate))
.add(calcCommission(classicConsume, classicGameRate)); .add(calcCommission(classicConsume, classicGameRate));
Map<String, Object> period = new LinkedHashMap<>(); Map<String, Object> period = new LinkedHashMap<>();
@@ -854,7 +853,7 @@ public class PromoTurnoverServiceImpl implements PromoTurnoverService {
period.put("luckyUpgrade", luckyUpgrade); period.put("luckyUpgrade", luckyUpgrade);
period.put("battle", battle); period.put("battle", battle);
period.put("crazyWheel", crazyWheel); period.put("crazyWheel", crazyWheel);
period.put("olympus", olympus); period.put("mahjong", mahjong);
period.put("totalConsume", totalConsume); period.put("totalConsume", totalConsume);
period.put("recharge", recharge); period.put("recharge", recharge);
period.put("newSub", newSub); period.put("newSub", newSub);
@@ -102,14 +102,14 @@
</foreach> </foreach>
AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd}
THEN amount ELSE 0 END), 0) AS yesterdayRecharge, THEN amount ELSE 0 END), 0) AS yesterdayRecharge,
COALESCE(SUM(CASE WHEN source IN (60) AND type = 0 COALESCE(SUM(CASE WHEN source IN (68) AND type = 0
AND user_id IN AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")"> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd}
THEN ABS(total) ELSE 0 END), 0) AS todayNewGame, THEN ABS(total) ELSE 0 END), 0) AS todayNewGame,
COALESCE(SUM(CASE WHEN source IN (60) AND type = 0 COALESCE(SUM(CASE WHEN source IN (68) AND type = 0
AND user_id IN AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")"> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">
#{id} #{id}
@@ -137,7 +137,7 @@
#{id} #{id}
</foreach>) </foreach>)
OR OR
(source IN (60, 2, 4, 40, 38) AND type = 0 AND user_id IN (source IN (68, 2, 4, 40, 38) AND type = 0 AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")"> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">
#{id} #{id}
</foreach>) </foreach>)
@@ -164,22 +164,22 @@
COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayLuckyUpgrade, COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayLuckyUpgrade,
COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayBattle, COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayBattle,
COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayCrazyWheel, COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayCrazyWheel,
COALESCE(SUM(CASE WHEN source = 60 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayOlympus, COALESCE(SUM(CASE WHEN source = 68 AND type = 0 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN ABS(total) ELSE 0 END), 0) AS todayMahjong,
COALESCE(SUM(CASE WHEN source = 2 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayClassicBox, COALESCE(SUM(CASE WHEN source = 2 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayClassicBox,
COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayLuckyUpgrade, COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayLuckyUpgrade,
COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayBattle, COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayBattle,
COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayCrazyWheel, COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayCrazyWheel,
COALESCE(SUM(CASE WHEN source = 60 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayOlympus, COALESCE(SUM(CASE WHEN source = 68 AND type = 0 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN ABS(total) ELSE 0 END), 0) AS yesterdayMahjong,
COALESCE(SUM(CASE WHEN source = 2 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekClassicBox, COALESCE(SUM(CASE WHEN source = 2 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekClassicBox,
COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekLuckyUpgrade, COALESCE(SUM(CASE WHEN source = 40 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekLuckyUpgrade,
COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekBattle, COALESCE(SUM(CASE WHEN source = 4 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekBattle,
COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekCrazyWheel, COALESCE(SUM(CASE WHEN source = 38 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekCrazyWheel,
COALESCE(SUM(CASE WHEN source = 60 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekOlympus, COALESCE(SUM(CASE WHEN source = 68 AND type = 0 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN ABS(total) ELSE 0 END), 0) AS weekMahjong,
COALESCE(SUM(CASE WHEN source = 2 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalClassicBox, COALESCE(SUM(CASE WHEN source = 2 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalClassicBox,
COALESCE(SUM(CASE WHEN source = 40 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalLuckyUpgrade, COALESCE(SUM(CASE WHEN source = 40 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalLuckyUpgrade,
COALESCE(SUM(CASE WHEN source = 4 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalBattle, COALESCE(SUM(CASE WHEN source = 4 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalBattle,
COALESCE(SUM(CASE WHEN source = 38 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalCrazyWheel, COALESCE(SUM(CASE WHEN source = 38 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalCrazyWheel,
COALESCE(SUM(CASE WHEN source = 60 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalOlympus, COALESCE(SUM(CASE WHEN source = 68 AND type = 0 THEN ABS(total) ELSE 0 END), 0) AS totalMahjong,
COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN amount ELSE 0 END), 0) AS todayRecharge, COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{todayStart} AND create_time &lt; #{todayEnd} THEN amount ELSE 0 END), 0) AS todayRecharge,
COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN amount ELSE 0 END), 0) AS yesterdayRecharge, COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{yesterdayStart} AND create_time &lt; #{yesterdayEnd} THEN amount ELSE 0 END), 0) AS yesterdayRecharge,
COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN amount ELSE 0 END), 0) AS weekRecharge, COALESCE(SUM(CASE WHEN source = 1 AND type = 1 AND create_time >= #{weekStart} AND create_time &lt; #{weekEnd} THEN amount ELSE 0 END), 0) AS weekRecharge,
@@ -188,7 +188,7 @@
SELECT user_id, source, type, amount, total, create_time SELECT user_id, source, type, amount, total, create_time
FROM tt_user_blend_ercash FROM tt_user_blend_ercash
WHERE ( WHERE (
(source IN (2, 4, 38, 40, 60) AND type = 0 AND user_id IN (source IN (68, 2, 4, 38, 40) AND type = 0 AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>) <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>)
OR OR
(source = 1 AND type = 1 AND user_id IN (source = 1 AND type = 1 AND user_id IN
@@ -198,7 +198,7 @@
SELECT user_id, source, type, amount, total, create_time SELECT user_id, source, type, amount, total, create_time
FROM tt_user_blend_ercash_archive FROM tt_user_blend_ercash_archive
WHERE ( WHERE (
(source IN (2, 4, 38, 40, 60) AND type = 0 AND user_id IN (source IN (68, 2, 4, 38, 40) AND type = 0 AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>) <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>)
OR OR
(source = 1 AND type = 1 AND user_id IN (source = 1 AND type = 1 AND user_id IN
@@ -436,7 +436,7 @@
COALESCE(SUM(CASE WHEN source = 1 AND type = 1 COALESCE(SUM(CASE WHEN source = 1 AND type = 1
AND business_id = #{businessUserId} AND business_id = #{businessUserId}
THEN amount ELSE 0 END), 0) AS recharge, THEN amount ELSE 0 END), 0) AS recharge,
COALESCE(SUM(CASE WHEN source IN (60) AND type = 0 COALESCE(SUM(CASE WHEN source IN (68) AND type = 0
AND business_id = #{businessUserId} AND anchor_id IS NOT NULL AND business_id = #{businessUserId} AND anchor_id IS NOT NULL
THEN ABS(total) ELSE 0 END), 0) AS newGameConsume, THEN ABS(total) ELSE 0 END), 0) AS newGameConsume,
COALESCE(SUM(CASE WHEN source IN (2, 4, 40, 38) AND type = 0 COALESCE(SUM(CASE WHEN source IN (2, 4, 40, 38) AND type = 0
@@ -452,7 +452,7 @@
(source = 1 AND type = 1 AND business_id = #{businessUserId}) (source = 1 AND type = 1 AND business_id = #{businessUserId})
OR OR
-- 只统计属于该招商的下级产生的游戏消费记录 -- 只统计属于该招商的下级产生的游戏消费记录
(source IN (60, 2, 4, 40, 38) AND type = 0 AND business_id = #{businessUserId}) (source IN (68, 2, 4, 40, 38) AND type = 0 AND business_id = #{businessUserId})
) )
UNION ALL UNION ALL
SELECT create_time, user_id, source, type, amount, total, business_id, anchor_id SELECT create_time, user_id, source, type, amount, total, business_id, anchor_id
@@ -464,7 +464,7 @@
(source = 1 AND type = 1 AND business_id = #{businessUserId}) (source = 1 AND type = 1 AND business_id = #{businessUserId})
OR OR
-- 只统计属于该招商的下级产生的游戏消费记录 -- 只统计属于该招商的下级产生的游戏消费记录
(source IN (60, 2, 4, 40, 38) AND type = 0 AND business_id = #{businessUserId}) (source IN (68, 2, 4, 40, 38) AND type = 0 AND business_id = #{businessUserId})
) )
) t ) t
</select> </select>
@@ -478,7 +478,7 @@
DATE(t.create_time) AS date, DATE(t.create_time) AS date,
COALESCE(SUM(CASE WHEN t.source = 1 AND t.type = 1 COALESCE(SUM(CASE WHEN t.source = 1 AND t.type = 1
THEN t.amount ELSE 0 END), 0) AS recharge, THEN t.amount ELSE 0 END), 0) AS recharge,
COALESCE(SUM(CASE WHEN t.source IN (60) AND t.type = 0 COALESCE(SUM(CASE WHEN t.source IN (68) AND t.type = 0
THEN ABS(t.total) ELSE 0 END), 0) AS newGameConsume, THEN ABS(t.total) ELSE 0 END), 0) AS newGameConsume,
COALESCE(SUM(CASE WHEN t.source IN (2, 4, 40, 38) AND t.type = 0 COALESCE(SUM(CASE WHEN t.source IN (2, 4, 40, 38) AND t.type = 0
THEN ABS(t.total) ELSE 0 END), 0) AS classicGameConsume THEN ABS(t.total) ELSE 0 END), 0) AS classicGameConsume
@@ -493,7 +493,7 @@
#{id} #{id}
</foreach>) </foreach>)
OR OR
(source IN (60, 2, 4, 40, 38) AND type = 0 AND user_id IN (source IN (68, 2, 4, 40, 38) AND type = 0 AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")"> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">
#{id} #{id}
</foreach>) </foreach>)
@@ -509,7 +509,7 @@
#{id} #{id}
</foreach>) </foreach>)
OR OR
(source IN (60, 2, 4, 40, 38) AND type = 0 AND user_id IN (source IN (68, 2, 4, 40, 38) AND type = 0 AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")"> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">
#{id} #{id}
</foreach>) </foreach>)
@@ -639,13 +639,13 @@
<sql id="businessGameConsumeRows"> <sql id="businessGameConsumeRows">
SELECT create_time, user_id, source, total SELECT create_time, user_id, source, total
FROM tt_user_blend_ercash FROM tt_user_blend_ercash
WHERE type = 0 AND source IN (2, 4, 38, 40, 60) WHERE type = 0 AND source IN (68, 2, 4, 38, 40)
AND user_id IN AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>
UNION ALL UNION ALL
SELECT create_time, user_id, source, total SELECT create_time, user_id, source, total
FROM tt_user_blend_ercash_archive FROM tt_user_blend_ercash_archive
WHERE type = 0 AND source IN (2, 4, 38, 40, 60) WHERE type = 0 AND source IN (68, 2, 4, 38, 40)
AND user_id IN AND user_id IN
<foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach> <foreach item="id" collection="gameUserIds" open="(" separator="," close=")">#{id}</foreach>
</sql> </sql>
@@ -36,14 +36,14 @@ public class MahjongConstants {
public static final String FLOOR_WIN = "0.01"; public static final String FLOOR_WIN = "0.01";
/** /**
* 流水/背包 source 占位值 —— 定义在共享枚举里(下一步动作): * 流水/背包 source —— **已由共享枚举承接,这里只作数值留档**:
* <ul> * <ul>
* <li>{@code TtAccountRecordSource.MAHJONG_SPIN(68, OUTPUT, "麻将胡了消费")} / {@code MAHJONG_REWARD(69, INPUT, "麻将胡了奖励")}</li> * <li>{@code TtAccountRecordSource.MAHJONG_SPIN(68, OUTPUT, "麻将胡了消费")} / {@code MAHJONG_REWARD(69, INPUT, "麻将胡了奖励")}</li>
* <li>{@code TtboxRecordSource.MAHJONG_BOX(15, "麻将")}</li> * <li>{@code TtboxRecordSource.MAHJONG_BOX(15, "麻将胡了")}</li>
* <li>{@code MessageCategoryEnum.GAME_MAHJONG("GAME_MAHJONG", "麻将胡了")}</li> * <li>{@code MessageCategoryEnum.GAME_MAHJONG("GAME_MAHJONG", "麻将胡了")}</li>
* </ul> * </ul>
* 本次任务明确不改共享文件,因此先以本地常量承接;共享枚举补上后, * 2026-09-22 共享枚举已补齐,{@code MahjongGameService} 已全部改为引用枚举常量;
* 把 {@code MahjongGameService} 里的引用换成枚举常量即可(语义与数值都已对齐,不会有账面漂移)。 * 新增代码请直接用枚举,不要再引用下面这几个本地常量。
*/ */
public static final int RECORD_SOURCE_SPIN = 68; public static final int RECORD_SOURCE_SPIN = 68;
public static final int RECORD_SOURCE_REWARD = 69; public static final int RECORD_SOURCE_REWARD = 69;
@@ -8,7 +8,9 @@ import com.ruoyi.admin.service.TtUserService;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.redis.config.RedisLock; import com.ruoyi.common.redis.config.RedisLock;
import com.ruoyi.domain.common.constant.MessageCategoryEnum;
import com.ruoyi.domain.common.constant.TtAccountRecordSource; import com.ruoyi.domain.common.constant.TtAccountRecordSource;
import com.ruoyi.domain.common.constant.TtboxRecordSource;
import com.ruoyi.domain.entity.TtBoxRecords; import com.ruoyi.domain.entity.TtBoxRecords;
import com.ruoyi.domain.entity.sys.TtUser; import com.ruoyi.domain.entity.sys.TtUser;
import com.ruoyi.domain.other.TtOrnamentsLevel; import com.ruoyi.domain.other.TtOrnamentsLevel;
@@ -92,12 +94,8 @@ public class MahjongGameService {
/** 免费旋转总旋数上限(首赠 12 + 每多 1 胡 +2,重触发同式;发不满就不发) */ /** 免费旋转总旋数上限(首赠 12 + 每多 1 胡 +2,重触发同式;发不满就不发) */
private static final int MAX_FREE_SPINS = MahjongConstants.MAX_FREE_SPINS; private static final int MAX_FREE_SPINS = MahjongConstants.MAX_FREE_SPINS;
/** /** 扣费流水来源:{@link TtAccountRecordSource#MAHJONG_SPIN}(68, OUTPUT, "麻将胡了消费")。 */
* 需改共享文件的接线点(本次任务明确不改共享文件): private static final TtAccountRecordSource SPIN_SOURCE = TtAccountRecordSource.MAHJONG_SPIN;
* {@code TtAccountRecordSource.MAHJONG_SPIN(68)}。共享枚举补齐后把本行换成 {@code MAHJONG_SPIN}。
* TODO(共享文件): 见 MahjongConstants#RECORD_SOURCE_SPIN。
*/
private static final TtAccountRecordSource SPIN_SOURCE = TtAccountRecordSource.OLYMPUS_SPIN;
// ============================================================ // ============================================================
// dospin 主入口 // dospin 主入口
@@ -292,12 +290,11 @@ public class MahjongGameService {
MahjongRecord rec = recordMapper.selectById(cache.getRecordId()); MahjongRecord rec = recordMapper.selectById(cache.getRecordId());
if (rec == null || rec.getPrizeName() == null) return; if (rec == null || rec.getPrizeName() == null) return;
String priceStr = rec.getSettledWin() == null ? "0" : rec.getSettledWin().stripTrailingZeros().toPlainString(); String priceStr = rec.getSettledWin() == null ? "0" : rec.getSettledWin().stripTrailingZeros().toPlainString();
// TODO(共享文件): 共享枚举补上 MessageCategoryEnum.GAME_MAHJONG 后,改用它的 getTitle()/getCode()
messageService.sendNotice( messageService.sendNotice(
userId, userId,
MahjongConstants.MESSAGE_CATEGORY_TITLE, MessageCategoryEnum.GAME_MAHJONG.getTitle(),
"麻将胡了挑战结算:您本局获得饰品 " + rec.getPrizeName() + "(价值 ¥" + priceStr + ")", "麻将胡了挑战结算:您本局获得饰品 " + rec.getPrizeName() + "(价值 ¥" + priceStr + ")",
MahjongConstants.MESSAGE_CATEGORY); MessageCategoryEnum.GAME_MAHJONG.getCode());
} catch (Exception e) { } catch (Exception e) {
log.error("mahjong 结算通知发送失败 userId={} recordId={}", userId, cache.getRecordId(), e); log.error("mahjong 结算通知发送失败 userId={} recordId={}", userId, cache.getRecordId(), e);
} }
@@ -338,9 +335,7 @@ public class MahjongGameService {
.set(MahjongRecord::getPrizeLevelImg, prizeLevelImg)); .set(MahjongRecord::getPrizeLevelImg, prizeLevelImg));
if (guard == 0) { cacheRepository.clearCache(userId); return; } if (guard == 0) { cacheRepository.clearCache(userId); return; }
// 写入背包 // 写入背包(source = TtboxRecordSource.MAHJONG_BOX(15))
// TODO(共享文件): 共享枚举补上 TtboxRecordSource.MAHJONG_BOX(15) 后,
// 把 MahjongConstants.BOX_RECORD_SOURCE 换成 MAHJONG_BOX.getCode()(数值已经是 15,不会漂)。
if (boxRecordsMapper != null && prizeId != null) { if (boxRecordsMapper != null && prizeId != null) {
if (prizeLevelImg == null && ornamentsLevelMapper != null) { if (prizeLevelImg == null && ornamentsLevelMapper != null) {
TtOrnamentsLevel lv = ornamentsLevelMapper.selectById(prizeGrade); TtOrnamentsLevel lv = ornamentsLevelMapper.selectById(prizeGrade);
@@ -355,7 +350,7 @@ public class MahjongGameService {
.marketHashName(prizeExteriorName != null ? prizeName + " (" + prizeExteriorName + ")" : prizeName) .marketHashName(prizeExteriorName != null ? prizeName + " (" + prizeExteriorName + ")" : prizeName)
.ornamentsLevelId(prizeGrade != null ? prizeGrade : 1) .ornamentsLevelId(prizeGrade != null ? prizeGrade : 1)
.ornamentLevelImg(prizeLevelImg) .ornamentLevelImg(prizeLevelImg)
.source(MahjongConstants.BOX_RECORD_SOURCE) .source(TtboxRecordSource.MAHJONG_BOX.getCode())
.status(0).isShow(1).createTime(new Date()) .status(0).isShow(1).createTime(new Date())
.build(); .build();
boxRecordsMapper.insert(bi); boxRecordsMapper.insert(bi);
@@ -16,13 +16,13 @@ public class RedisConstants {
public static final String SUGAR_GAME_REWARD_POOL_CACHE = "ruoyi:sugar:reward:pool"; public static final String SUGAR_GAME_REWARD_POOL_CACHE = "ruoyi:sugar:reward:pool";
public static final String WHEEL_GAME_REWARD_POOL_CACHE = "ruoyi:wheel:reward:pool"; public static final String WHEEL_GAME_REWARD_POOL_CACHE = "ruoyi:wheel:reward:pool";
public static final String BULLET_GAME_REWARD_POOL_CACHE = "ruoyi:bullet:reward:pool"; public static final String BULLET_GAME_REWARD_POOL_CACHE = "ruoyi:bullet:reward:pool";
// ========== Olympus 电子游戏 ========== // ========== 麻将胡了电子游戏 ==========
// 单局进行中缓存:ruoyi:olympus:{userId},存整局步骤,TTL 30 分钟 // 单局进行中缓存:ruoyi:mahjong:{userId},存整局步骤,TTL 30 分钟
public static final String OLYMPUS_GAME_CACHE = "ruoyi:olympus:"; public static final String MAHJONG_GAME_CACHE = "ruoyi:mahjong:";
// 按箱奖池(水位):ruoyi:olympus:reward:pool:box:{boxId}:bet/:win/:adjust,仅统计真实玩家(白号隔离) // 一轮内 RTP 收敛账本:Hash ruoyi:mahjong:cycle:{boxId}:{audience}
public static final String OLYMPUS_GAME_REWARD_POOL_CACHE = "ruoyi:olympus:reward:pool"; public static final String MAHJONG_GAME_CYCLE = "ruoyi:mahjong:cycle:";
// 一轮内RTP动态收敛账本:Hash ruoyi:olympus:cycle:{boxId}:{audience},字段 drawn/mulSum/conv:{ornamentId} // 按【箱 × 身份】奖池水位:ruoyi:mahjong:reward:pool:box:{boxId}:{audience}:*
public static final String OLYMPUS_GAME_CYCLE = "ruoyi:olympus:cycle:"; public static final String MAHJONG_GAME_REWARD_POOL_CACHE = "ruoyi:mahjong:reward:pool";
/** /**
@@ -10,6 +10,7 @@ import com.ruoyi.admin.mapper.TtDeliveryRecordMapper;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.entity.delivery.TtDeliveryRecord; import com.ruoyi.domain.entity.delivery.TtDeliveryRecord;
import com.ruoyi.domain.common.constant.TtAccountRecordSource; import com.ruoyi.domain.common.constant.TtAccountRecordSource;
import com.ruoyi.domain.common.constant.TtboxRecordSource;
import com.ruoyi.domain.entity.TtOrder; import com.ruoyi.domain.entity.TtOrder;
import com.ruoyi.domain.entity.TtRechargeConfig; import com.ruoyi.domain.entity.TtRechargeConfig;
import com.ruoyi.domain.entity.TtUserBlendErcash; import com.ruoyi.domain.entity.TtUserBlendErcash;
@@ -150,8 +151,7 @@ public class TtRechargeRecordController extends BaseController {
List<BigDecimal> luckyUpgradeList = new ArrayList<>(); List<BigDecimal> luckyUpgradeList = new ArrayList<>();
List<BigDecimal> westernDuelList = new ArrayList<>(); List<BigDecimal> westernDuelList = new ArrayList<>();
List<BigDecimal> wheelList = new ArrayList<>(); List<BigDecimal> wheelList = new ArrayList<>();
List<BigDecimal> roseladyList = new ArrayList<>(); List<BigDecimal> mahjongList = new ArrayList<>();
List<Integer> sources = Arrays.asList( List<Integer> sources = Arrays.asList(
TtAccountRecordSource.RECHARGE.getCode(), TtAccountRecordSource.RECHARGE.getCode(),
TtAccountRecordSource.GAME_TYPE_01.getCode(), TtAccountRecordSource.GAME_TYPE_01.getCode(),
@@ -159,8 +159,8 @@ public class TtRechargeRecordController extends BaseController {
TtAccountRecordSource.GOLD_DEVICE.getCode(), TtAccountRecordSource.GOLD_DEVICE.getCode(),
TtAccountRecordSource.BULLET_SPIN.getCode(), TtAccountRecordSource.BULLET_SPIN.getCode(),
TtAccountRecordSource.LUCKLY_WHEEL_SPIN.getCode(), TtAccountRecordSource.LUCKLY_WHEEL_SPIN.getCode(),
TtAccountRecordSource.WHEEL_BET_REFUND.getCode(), // 转盘兜底退款:折线按净口径冲减 TtAccountRecordSource.MAHJONG_SPIN.getCode(),
TtAccountRecordSource.OLYMPUS_SPIN.getCode()); TtAccountRecordSource.WHEEL_BET_REFUND.getCode()); // 转盘兜底退款:折线按净口径冲减
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
// bucketKey -> (source -> 金额):原值与绝对值两份 // bucketKey -> (source -> 金额):原值与绝对值两份
@@ -175,7 +175,7 @@ public class TtRechargeRecordController extends BaseController {
for (int h = 0; h <= 23; h++) { for (int h = 0; h <= 23; h++) {
dateList.add(String.format("%02d:00", h)); dateList.add(String.format("%02d:00", h));
appendPoint(Collections.singletonList(String.valueOf(h)), rawByBucket, absByBucket, appendPoint(Collections.singletonList(String.valueOf(h)), rawByBucket, absByBucket,
rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList); rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, mahjongList);
} }
} else if ("week".equals(type)) { } else if ("week".equals(type)) {
// 按周:近4周,单次查询按日聚合,再在内存中合并为每周 // 按周:近4周,单次查询按日聚合,再在内存中合并为每周
@@ -193,7 +193,7 @@ public class TtRechargeRecordController extends BaseController {
keys.add(d.toString()); keys.add(d.toString());
} }
appendPoint(keys, rawByBucket, absByBucket, appendPoint(keys, rawByBucket, absByBucket,
rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList); rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, mahjongList);
} }
} else { } else {
// 按天:近7天,单次查询按日聚合 // 按天:近7天,单次查询按日聚合
@@ -205,7 +205,7 @@ public class TtRechargeRecordController extends BaseController {
LocalDate date = today.minusDays(i); LocalDate date = today.minusDays(i);
dateList.add(date.getMonthValue() + "/" + date.getDayOfMonth()); dateList.add(date.getMonthValue() + "/" + date.getDayOfMonth());
appendPoint(Collections.singletonList(date.toString()), rawByBucket, absByBucket, appendPoint(Collections.singletonList(date.toString()), rawByBucket, absByBucket,
rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList); rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, mahjongList);
} }
} }
@@ -217,7 +217,7 @@ public class TtRechargeRecordController extends BaseController {
result.put("luckyUpgradeList", luckyUpgradeList); result.put("luckyUpgradeList", luckyUpgradeList);
result.put("westernDuelList", westernDuelList); result.put("westernDuelList", westernDuelList);
result.put("wheelList", wheelList); result.put("wheelList", wheelList);
result.put("roseladyList", roseladyList); result.put("mahjongList", mahjongList);
return com.ruoyi.common.core.domain.R.ok(result); return com.ruoyi.common.core.domain.R.ok(result);
} }
@@ -250,15 +250,15 @@ public class TtRechargeRecordController extends BaseController {
List<BigDecimal> rechargeList, List<BigDecimal> boxOpenList, List<BigDecimal> rechargeList, List<BigDecimal> boxOpenList,
List<BigDecimal> fightBoxOpenList, List<BigDecimal> luckyUpgradeList, List<BigDecimal> fightBoxOpenList, List<BigDecimal> luckyUpgradeList,
List<BigDecimal> westernDuelList, List<BigDecimal> wheelList, List<BigDecimal> westernDuelList, List<BigDecimal> wheelList,
List<BigDecimal> roseladyList) { List<BigDecimal> mahjongList) {
BigDecimal recharge = BigDecimal.ZERO; BigDecimal recharge = BigDecimal.ZERO;
BigDecimal box = BigDecimal.ZERO; BigDecimal box = BigDecimal.ZERO;
BigDecimal fightBox = BigDecimal.ZERO; BigDecimal fightBox = BigDecimal.ZERO;
BigDecimal luckyUpgrade = BigDecimal.ZERO; BigDecimal luckyUpgrade = BigDecimal.ZERO;
BigDecimal westernDuel = BigDecimal.ZERO; BigDecimal westernDuel = BigDecimal.ZERO;
BigDecimal wheel = BigDecimal.ZERO; BigDecimal wheel = BigDecimal.ZERO;
BigDecimal mahjong = BigDecimal.ZERO;
BigDecimal wheelRefund = BigDecimal.ZERO; BigDecimal wheelRefund = BigDecimal.ZERO;
BigDecimal roselady = BigDecimal.ZERO;
for (String key : bucketKeys) { for (String key : bucketKeys) {
Map<Integer, BigDecimal> raw = rawByBucket.getOrDefault(key, Collections.emptyMap()); Map<Integer, BigDecimal> raw = rawByBucket.getOrDefault(key, Collections.emptyMap());
Map<Integer, BigDecimal> abs = absByBucket.getOrDefault(key, Collections.emptyMap()); Map<Integer, BigDecimal> abs = absByBucket.getOrDefault(key, Collections.emptyMap());
@@ -268,8 +268,8 @@ public class TtRechargeRecordController extends BaseController {
luckyUpgrade = luckyUpgrade.add(abs.getOrDefault(TtAccountRecordSource.GOLD_DEVICE.getCode(), BigDecimal.ZERO)); luckyUpgrade = luckyUpgrade.add(abs.getOrDefault(TtAccountRecordSource.GOLD_DEVICE.getCode(), BigDecimal.ZERO));
westernDuel = westernDuel.add(abs.getOrDefault(TtAccountRecordSource.BULLET_SPIN.getCode(), BigDecimal.ZERO)); westernDuel = westernDuel.add(abs.getOrDefault(TtAccountRecordSource.BULLET_SPIN.getCode(), BigDecimal.ZERO));
wheel = wheel.add(abs.getOrDefault(TtAccountRecordSource.LUCKLY_WHEEL_SPIN.getCode(), BigDecimal.ZERO)); wheel = wheel.add(abs.getOrDefault(TtAccountRecordSource.LUCKLY_WHEEL_SPIN.getCode(), BigDecimal.ZERO));
mahjong = mahjong.add(abs.getOrDefault(TtAccountRecordSource.MAHJONG_SPIN.getCode(), BigDecimal.ZERO));
wheelRefund = wheelRefund.add(abs.getOrDefault(TtAccountRecordSource.WHEEL_BET_REFUND.getCode(), BigDecimal.ZERO)); wheelRefund = wheelRefund.add(abs.getOrDefault(TtAccountRecordSource.WHEEL_BET_REFUND.getCode(), BigDecimal.ZERO));
roselady = roselady.add(abs.getOrDefault(TtAccountRecordSource.OLYMPUS_SPIN.getCode(), BigDecimal.ZERO));
} }
rechargeList.add(recharge); rechargeList.add(recharge);
boxOpenList.add(box); boxOpenList.add(box);
@@ -278,7 +278,7 @@ public class TtRechargeRecordController extends BaseController {
westernDuelList.add(westernDuel); westernDuelList.add(westernDuel);
// 转盘取净口径:消费 − 兜底退款(退款局的注单没进奖池,毛口径会与奖池统计对不上) // 转盘取净口径:消费 − 兜底退款(退款局的注单没进奖池,毛口径会与奖池统计对不上)
wheelList.add(wheel.subtract(wheelRefund).max(BigDecimal.ZERO)); wheelList.add(wheel.subtract(wheelRefund).max(BigDecimal.ZERO));
roseladyList.add(roselady); mahjongList.add(mahjong);
} }
/** /**
@@ -375,7 +375,7 @@ public class TtRechargeRecordController extends BaseController {
/** /**
* 实时RTP(Return To Player)统计:当日各游戏的投注/奖励/RTP百分比。 * 实时RTP(Return To Player)统计:当日各游戏的投注/奖励/RTP百分比。
* 唯一化改造后所有产出先入背包,返奖统一按 tt_box_records 今日产出(按 source 分组、不看 status)统计, * 唯一化改造后所有产出先入背包,返奖统一按 tt_box_records 今日产出(按 source 分组、不看 status)统计,
* 投注仍取 tt_user_blend_ercash 各游戏消费 source;覆盖全部 8 个产出游戏(含玫瑰女郎)。 * 投注仍取 tt_user_blend_ercash 各游戏消费 source;覆盖全部 8 个产出游戏(含麻将胡了)。
*/ */
@GetMapping("/realTimeRtp") @GetMapping("/realTimeRtp")
public AjaxResult realTimeRtp() { public AjaxResult realTimeRtp() {
@@ -383,8 +383,9 @@ public class TtRechargeRecordController extends BaseController {
Timestamp startOfDay = Timestamp.valueOf(today.atStartOfDay()); Timestamp startOfDay = Timestamp.valueOf(today.atStartOfDay());
Timestamp endOfDay = Timestamp.valueOf(today.plusDays(1).atStartOfDay()); Timestamp endOfDay = Timestamp.valueOf(today.plusDays(1).atStartOfDay());
// 投注 source:7 个游戏消费(含 Roll房=6、荒野争锋=34)+ 玫瑰女郎=60 + 转盘兜底退款=64(净口径冲减用) // 投注 source:8 个游戏消费(含 Roll房=6、荒野争锋=34、麻将胡了=68)+ 转盘兜底退款=64(净口径冲减用)
List<Integer> betSources = Arrays.asList(2, 4, 6, 34, 38, 40, 50, 60, List<Integer> betSources = Arrays.asList(2, 4, 6, 34, 38, 40, 50,
TtAccountRecordSource.MAHJONG_SPIN.getCode(),
TtAccountRecordSource.WHEEL_BET_REFUND.getCode()); TtAccountRecordSource.WHEEL_BET_REFUND.getCode());
// 一次查询获取所有投注 source 的聚合数据,避免 N+1 // 一次查询获取所有投注 source 的聚合数据,避免 N+1
@@ -416,11 +417,11 @@ public class TtRechargeRecordController extends BaseController {
{40, 4}, // 幸运升级 {40, 4}, // 幸运升级
{2, 1}, // 经典开箱 {2, 1}, // 经典开箱
{4, 2}, // 对战 {4, 2}, // 对战
{6, 3}, // Roll 房(索引 5) {6, 3}, // Roll 房(索引 5,勿动:下方 i == 5 分支依赖此下标)
{34, 12}, // 荒野争锋 {34, 12}, // 荒野争锋
{60, 13} // 玫瑰女郎(索引 7,投注=60,背包=13) {TtAccountRecordSource.MAHJONG_SPIN.getCode(), TtboxRecordSource.MAHJONG_BOX.getCode()} // 麻将胡了(新游戏)
}; };
String[] gameNames = {"极速糖果", "疯狂转盘", "幸运升级", "经典开箱", "对战", "Roll 房", "荒野争锋", "玫瑰女郎"}; String[] gameNames = {"极速糖果", "疯狂转盘", "幸运升级", "经典开箱", "对战", "Roll 房", "荒野争锋", "麻将胡了"};
List<Map<String, Object>> data = new ArrayList<>(); List<Map<String, Object>> data = new ArrayList<>();
BigDecimal rollRoomBet = BigDecimal.ZERO; BigDecimal rollRoomBet = BigDecimal.ZERO;
@@ -47,7 +47,7 @@ public class TtUserAmountRecordsController extends BaseController {
/** 聚合类排序字段集合(这些字段需要全局排序,不能用当页排序) */ /** 聚合类排序字段集合(这些字段需要全局排序,不能用当页排序) */
private static final java.util.Set<String> AGG_SORT_FIELDS = java.util.Set.of( private static final java.util.Set<String> AGG_SORT_FIELDS = java.util.Set.of(
"totalRecharge", "totalTurnover", "classicBox", "fightGame", "totalRecharge", "totalTurnover", "classicBox", "fightGame",
"luckyUpgrade", "wheelGame", "olympusGame", "rollRoom"); "luckyUpgrade", "wheelGame", "mahjongGame", "rollRoom");
/** /**
* 用户流水统计列表 * 用户流水统计列表
@@ -158,7 +158,7 @@ public class TtBoxServiceImpl extends ServiceImpl<TtBoxMapper, TtBox> implements
String formattedDate = StringUtils.isNull(date) ? dateFormat.format(DateUtils.getNowDate()) : dateFormat.format(date); String formattedDate = StringUtils.isNull(date) ? dateFormat.format(DateUtils.getNowDate()) : dateFormat.format(date);
// 对战宝箱(is_fight='0')与经典宝箱只统计各自的开箱渠道:对战=急速对战(source=2),经典=常规开箱(source=0/1), // 对战宝箱(is_fight='0')与经典宝箱只统计各自的开箱渠道:对战=急速对战(source=2),经典=常规开箱(source=0/1),
// 指数盲盒/roll房/幸运升级/福利开箱/荒野争锋/玫瑰女郎等其他电子游戏的开箱不计入本统计。 // 指数盲盒/roll房/幸运升级/福利开箱/荒野争锋/麻将胡了等其他电子游戏的开箱不计入本统计。
// 对战开箱记录先按常规开箱(source=1)落库,一轮对战结束后才改成急速对战(source=2),两个来源都算才不会漏掉中途中断的对局。 // 对战开箱记录先按常规开箱(source=1)落库,一轮对战结束后才改成急速对战(source=2),两个来源都算才不会漏掉中途中断的对局。
boolean fightBox = "0".equals(ttBox.getIsFight()); boolean fightBox = "0".equals(ttBox.getIsFight());
List<Integer> sources = fightBox List<Integer> sources = fightBox
@@ -2293,7 +2293,7 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
return; return;
} }
// 根据游戏类型确定佣金比例和来源码 // 根据游戏类型确定佣金比例和来源码(新游戏=麻将胡了,走 newGameCommissionRate)
BigDecimal rate = BigDecimal.ZERO; BigDecimal rate = BigDecimal.ZERO;
TtAccountRecordSource commissionSource = TtAccountRecordSource.GAME_CONSUME_COMMISSION; TtAccountRecordSource commissionSource = TtAccountRecordSource.GAME_CONSUME_COMMISSION;
if (TtAccountRecordSource.isNewGameConsumeForCommission(source.getCode())) { if (TtAccountRecordSource.isNewGameConsumeForCommission(source.getCode())) {
@@ -71,12 +71,12 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
parameterSetting.setWesternDuelMaintenance(getConfigValue(parameterSettingMap, "westernDuelMaintenance")); parameterSetting.setWesternDuelMaintenance(getConfigValue(parameterSettingMap, "westernDuelMaintenance"));
parameterSetting.setLuckyUpgradeMaintenance(getConfigValue(parameterSettingMap, "luckyUpgradeMaintenance")); parameterSetting.setLuckyUpgradeMaintenance(getConfigValue(parameterSettingMap, "luckyUpgradeMaintenance"));
parameterSetting.setWheelMaintenance(getConfigValue(parameterSettingMap, "wheelMaintenance")); parameterSetting.setWheelMaintenance(getConfigValue(parameterSettingMap, "wheelMaintenance"));
// 玫瑰女郎维护配置(对应键 olympusMaintenance,可能不存在,安全读取,兜底 "0") // 麻将胡了维护配置(对应键 mahjongMaintenance,可能不存在,安全读取,兜底 "0")
List<ConfigData> olympusMaintenanceList = parameterSettingMap.get("olympusMaintenance"); List<ConfigData> mahjongMaintenanceList = parameterSettingMap.get("mahjongMaintenance");
if (olympusMaintenanceList != null && !olympusMaintenanceList.isEmpty()) { if (mahjongMaintenanceList != null && !mahjongMaintenanceList.isEmpty()) {
parameterSetting.setOlympusMaintenance(olympusMaintenanceList.get(0).getConfigValue()); parameterSetting.setMahjongMaintenance(mahjongMaintenanceList.get(0).getConfigValue());
} else { } else {
parameterSetting.setOlympusMaintenance("0"); parameterSetting.setMahjongMaintenance("0");
} }
// 充值渠道维护配置(可能不存在,安全读取,兜底 "0") // 充值渠道维护配置(可能不存在,安全读取,兜底 "0")
List<ConfigData> rechargeMaintenanceList = parameterSettingMap.get("rechargeMaintenance"); List<ConfigData> rechargeMaintenanceList = parameterSettingMap.get("rechargeMaintenance");
@@ -151,7 +151,7 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
westernDuelMaintenance = parameterSettingBody.getWesternDuelMaintenance(), westernDuelMaintenance = parameterSettingBody.getWesternDuelMaintenance(),
luckyUpgradeMaintenance = parameterSettingBody.getLuckyUpgradeMaintenance(), luckyUpgradeMaintenance = parameterSettingBody.getLuckyUpgradeMaintenance(),
wheelMaintenance = parameterSettingBody.getWheelMaintenance(), wheelMaintenance = parameterSettingBody.getWheelMaintenance(),
olympusMaintenance = parameterSettingBody.getOlympusMaintenance(); mahjongMaintenance = parameterSettingBody.getMahjongMaintenance();
List<ConfigData> parameterSettingList = websiteSetupMapper.selectParameterSettingList(); List<ConfigData> parameterSettingList = websiteSetupMapper.selectParameterSettingList();
Map<String, List<ConfigData>> parameterSettingMap = parameterSettingList.stream().collect(Collectors.groupingBy(ConfigData::getConfigKey)); Map<String, List<ConfigData>> parameterSettingMap = parameterSettingList.stream().collect(Collectors.groupingBy(ConfigData::getConfigKey));
List<ConfigData> updateList = new ArrayList<>(); List<ConfigData> updateList = new ArrayList<>();
@@ -174,7 +174,7 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
setConfigValue(parameterSettingMap, "westernDuelMaintenance", westernDuelMaintenance, updateList); setConfigValue(parameterSettingMap, "westernDuelMaintenance", westernDuelMaintenance, updateList);
setConfigValue(parameterSettingMap, "luckyUpgradeMaintenance", luckyUpgradeMaintenance, updateList); setConfigValue(parameterSettingMap, "luckyUpgradeMaintenance", luckyUpgradeMaintenance, updateList);
setConfigValue(parameterSettingMap, "wheelMaintenance", wheelMaintenance, updateList); setConfigValue(parameterSettingMap, "wheelMaintenance", wheelMaintenance, updateList);
setConfigValue(parameterSettingMap, "olympusMaintenance", olympusMaintenance, updateList); setConfigValue(parameterSettingMap, "mahjongMaintenance", mahjongMaintenance, updateList);
// 充值渠道维护配置(安全读写,不存在时跳过,避免未执行 SQL 时报错) // 充值渠道维护配置(安全读写,不存在时跳过,避免未执行 SQL 时报错)
String rechargeMaintenance = parameterSettingBody.getRechargeMaintenance(); String rechargeMaintenance = parameterSettingBody.getRechargeMaintenance();
List<ConfigData> rechargeMaintenanceUpdateList = parameterSettingMap.get("rechargeMaintenance"); List<ConfigData> rechargeMaintenanceUpdateList = parameterSettingMap.get("rechargeMaintenance");
@@ -516,7 +516,7 @@
GROUP BY user_id GROUP BY user_id
</select> </select>
<!-- 今日游戏饰品返奖总额:唯一化改造后所有产出先入背包,按产出统计全部8个游戏(1,2,3,4,11,12,13,99,含玫瑰女郎),不看status(含当日已分解) --> <!-- 今日游戏饰品返奖总额:唯一化改造后所有产出先入背包,按产出统计全部8个游戏(1,2,3,4,11,12,15,99,含麻将胡了),不看status(含当日已分解) -->
<select id="todayOrnamentRewardTotal" resultType="java.math.BigDecimal"> <select id="todayOrnamentRewardTotal" resultType="java.math.BigDecimal">
SELECT COALESCE(SUM(tbr.ornaments_price), 0) SELECT COALESCE(SUM(tbr.ornaments_price), 0)
FROM tt_box_records tbr FROM tt_box_records tbr
@@ -525,13 +525,13 @@
AND ttu.user_type != '03' AND ttu.user_type != '03'
AND ttu.status != '1' AND ttu.status != '1'
AND ttu.del_flag = '0' AND ttu.del_flag = '0'
WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 13, 99) WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 15, 99)
AND tbr.create_time >= #{startOfDay} AND tbr.create_time >= #{startOfDay}
AND tbr.create_time &lt; #{endOfDay} AND tbr.create_time &lt; #{endOfDay}
</select> </select>
<!-- 历史游戏饰品返奖总额:与今日总返奖(todayOrnamentRewardTotal)同口径,仅不限时间范围; <!-- 历史游戏饰品返奖总额:与今日总返奖(todayOrnamentRewardTotal)同口径,仅不限时间范围;
覆盖全部8个游戏(1,2,3,4,11,12,13,99,含玫瑰女郎),不看status(含已分解),排除无效用户 --> 覆盖全部8个游戏(1,2,3,4,11,12,15,99,含麻将胡了),不看status(含已分解),排除无效用户 -->
<select id="historyOrnamentRewardTotal" resultType="java.math.BigDecimal"> <select id="historyOrnamentRewardTotal" resultType="java.math.BigDecimal">
SELECT COALESCE(SUM(tbr.ornaments_price), 0) SELECT COALESCE(SUM(tbr.ornaments_price), 0)
FROM tt_box_records tbr FROM tt_box_records tbr
@@ -540,7 +540,7 @@
AND ttu.user_type != '03' AND ttu.user_type != '03'
AND ttu.status != '1' AND ttu.status != '1'
AND ttu.del_flag = '0' AND ttu.del_flag = '0'
WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 13, 99) WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 15, 99)
</select> </select>
<select id="todayOrnamentRewardBySource" resultType="java.util.Map"> <select id="todayOrnamentRewardBySource" resultType="java.util.Map">
@@ -551,7 +551,7 @@
AND ttu.user_type != '03' AND ttu.user_type != '03'
AND ttu.status != '1' AND ttu.status != '1'
AND ttu.del_flag = '0' AND ttu.del_flag = '0'
WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 13, 99) WHERE tbr.source IN (1, 2, 3, 4, 11, 12, 15, 99)
AND tbr.create_time >= #{startOfDay} AND tbr.create_time >= #{startOfDay}
AND tbr.create_time &lt; #{endOfDay} AND tbr.create_time &lt; #{endOfDay}
GROUP BY tbr.source GROUP BY tbr.source
@@ -500,7 +500,7 @@
COALESCE(agg.fightGame, 0) AS `fightGame`, COALESCE(agg.fightGame, 0) AS `fightGame`,
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`, COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
COALESCE(agg.wheelGame, 0) AS `wheelGame`, COALESCE(agg.wheelGame, 0) AS `wheelGame`,
COALESCE(agg.olympusGame, 0) AS `olympusGame`, COALESCE(agg.mahjongGame, 0) AS `mahjongGame`,
COALESCE(agg.rollRoom, 0) AS `rollRoom` COALESCE(agg.rollRoom, 0) AS `rollRoom`
FROM ( FROM (
SELECT user_id, nick_name, user_name, phone_number, user_type SELECT user_id, nick_name, user_name, phone_number, user_type
@@ -519,14 +519,14 @@
SELECT SELECT
e.user_id, e.user_id,
SUM(CASE WHEN e.type = 1 AND e.source = 1 THEN e.amount ELSE 0 END) AS totalRecharge, SUM(CASE WHEN e.type = 1 AND e.source = 1 THEN e.amount ELSE 0 END) AS totalRecharge,
SUM(CASE WHEN e.type = 0 AND e.source IN (2, 4, 40, 38, 60) THEN ABS(e.total) ELSE 0 END) SUM(CASE WHEN e.type = 0 AND e.source IN (2, 4, 40, 38, 68) THEN ABS(e.total) ELSE 0 END)
+ SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END) + SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END)
- SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS totalTurnover, - SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS totalTurnover,
SUM(CASE WHEN e.type = 0 AND e.source = 2 THEN ABS(e.total) ELSE 0 END) AS classicBox, SUM(CASE WHEN e.type = 0 AND e.source = 2 THEN ABS(e.total) ELSE 0 END) AS classicBox,
SUM(CASE WHEN e.type = 0 AND e.source = 4 THEN ABS(e.total) ELSE 0 END) AS fightGame, SUM(CASE WHEN e.type = 0 AND e.source = 4 THEN ABS(e.total) ELSE 0 END) AS fightGame,
SUM(CASE WHEN e.type = 0 AND e.source = 40 THEN ABS(e.total) ELSE 0 END) AS luckyUpgrade, SUM(CASE WHEN e.type = 0 AND e.source = 40 THEN ABS(e.total) ELSE 0 END) AS luckyUpgrade,
SUM(CASE WHEN e.type = 0 AND e.source = 38 THEN ABS(e.total) ELSE 0 END) AS wheelGame, SUM(CASE WHEN e.type = 0 AND e.source = 38 THEN ABS(e.total) ELSE 0 END) AS wheelGame,
SUM(CASE WHEN e.type = 0 AND e.source = 60 THEN ABS(e.total) ELSE 0 END) AS olympusGame, SUM(CASE WHEN e.type = 0 AND e.source = 68 THEN ABS(e.total) ELSE 0 END) AS mahjongGame,
SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END) SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END)
- SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom - SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom
FROM ( FROM (
@@ -573,7 +573,7 @@
COALESCE(agg.fightGame, 0) AS `fightGame`, COALESCE(agg.fightGame, 0) AS `fightGame`,
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`, COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
COALESCE(agg.wheelGame, 0) AS `wheelGame`, COALESCE(agg.wheelGame, 0) AS `wheelGame`,
COALESCE(agg.olympusGame, 0) AS `olympusGame`, COALESCE(agg.mahjongGame, 0) AS `mahjongGame`,
COALESCE(agg.rollRoom, 0) AS `rollRoom` COALESCE(agg.rollRoom, 0) AS `rollRoom`
FROM ( FROM (
SELECT user_id, nick_name, user_name, phone_number, user_type SELECT user_id, nick_name, user_name, phone_number, user_type
@@ -590,14 +590,14 @@
SELECT SELECT
e.user_id, e.user_id,
SUM(CASE WHEN e.type = 1 AND e.source = 1 THEN e.amount ELSE 0 END) AS totalRecharge, SUM(CASE WHEN e.type = 1 AND e.source = 1 THEN e.amount ELSE 0 END) AS totalRecharge,
SUM(CASE WHEN e.type = 0 AND e.source IN (2, 4, 40, 38, 60) THEN ABS(e.total) ELSE 0 END) SUM(CASE WHEN e.type = 0 AND e.source IN (2, 4, 40, 38, 68) THEN ABS(e.total) ELSE 0 END)
+ SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END) + SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END)
- SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS totalTurnover, - SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS totalTurnover,
SUM(CASE WHEN e.type = 0 AND e.source = 2 THEN ABS(e.total) ELSE 0 END) AS classicBox, SUM(CASE WHEN e.type = 0 AND e.source = 2 THEN ABS(e.total) ELSE 0 END) AS classicBox,
SUM(CASE WHEN e.type = 0 AND e.source = 4 THEN ABS(e.total) ELSE 0 END) AS fightGame, SUM(CASE WHEN e.type = 0 AND e.source = 4 THEN ABS(e.total) ELSE 0 END) AS fightGame,
SUM(CASE WHEN e.type = 0 AND e.source = 40 THEN ABS(e.total) ELSE 0 END) AS luckyUpgrade, SUM(CASE WHEN e.type = 0 AND e.source = 40 THEN ABS(e.total) ELSE 0 END) AS luckyUpgrade,
SUM(CASE WHEN e.type = 0 AND e.source = 38 THEN ABS(e.total) ELSE 0 END) AS wheelGame, SUM(CASE WHEN e.type = 0 AND e.source = 38 THEN ABS(e.total) ELSE 0 END) AS wheelGame,
SUM(CASE WHEN e.type = 0 AND e.source = 60 THEN ABS(e.total) ELSE 0 END) AS olympusGame, SUM(CASE WHEN e.type = 0 AND e.source = 68 THEN ABS(e.total) ELSE 0 END) AS mahjongGame,
SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END) SUM(CASE WHEN e.type = 0 AND e.source = 59 THEN ABS(e.amount) ELSE 0 END)
- SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom - SUM(CASE WHEN e.type = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom
FROM ( FROM (
@@ -632,7 +632,7 @@
<when test="sortField == 'fightGame'">ORDER BY fightGame</when> <when test="sortField == 'fightGame'">ORDER BY fightGame</when>
<when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</when> <when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</when>
<when test="sortField == 'wheelGame'">ORDER BY wheelGame</when> <when test="sortField == 'wheelGame'">ORDER BY wheelGame</when>
<when test="sortField == 'olympusGame'">ORDER BY olympusGame</when> <when test="sortField == 'mahjongGame'">ORDER BY mahjongGame</when>
<when test="sortField == 'rollRoom'">ORDER BY rollRoom</when> <when test="sortField == 'rollRoom'">ORDER BY rollRoom</when>
<otherwise>ORDER BY totalTurnover</otherwise> <otherwise>ORDER BY totalTurnover</otherwise>
</choose> </choose>
@@ -27,7 +27,7 @@
COALESCE(agg.fightGame, 0) AS `fightGame`, COALESCE(agg.fightGame, 0) AS `fightGame`,
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`, COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
COALESCE(agg.wheelGame, 0) AS `wheelGame`, COALESCE(agg.wheelGame, 0) AS `wheelGame`,
COALESCE(agg.olympusGame, 0) AS `olympusGame` COALESCE(agg.mahjongGame, 0) AS `mahjongGame`
FROM ( FROM (
SELECT user_id, nick_name, user_name, phone_number, user_type SELECT user_id, nick_name, user_name, phone_number, user_type
FROM tt_user FROM tt_user
@@ -45,12 +45,12 @@
SELECT SELECT
user_id, user_id,
SUM(CASE WHEN source = 1 THEN diff ELSE 0 END) AS totalRecharge, SUM(CASE WHEN source = 1 THEN diff ELSE 0 END) AS totalRecharge,
SUM(CASE WHEN source IN (2, 4, 40, 38, 60) THEN diff ELSE 0 END) AS totalTurnover, SUM(CASE WHEN source IN (2, 4, 40, 38, 68) THEN diff ELSE 0 END) AS totalTurnover,
SUM(CASE WHEN source = 2 THEN diff ELSE 0 END) AS classicBox, SUM(CASE WHEN source = 2 THEN diff ELSE 0 END) AS classicBox,
SUM(CASE WHEN source = 4 THEN diff ELSE 0 END) AS fightGame, SUM(CASE WHEN source = 4 THEN diff ELSE 0 END) AS fightGame,
SUM(CASE WHEN source = 40 THEN diff ELSE 0 END) AS luckyUpgrade, SUM(CASE WHEN source = 40 THEN diff ELSE 0 END) AS luckyUpgrade,
SUM(CASE WHEN source = 38 THEN diff ELSE 0 END) AS wheelGame, SUM(CASE WHEN source = 38 THEN diff ELSE 0 END) AS wheelGame,
SUM(CASE WHEN source = 60 THEN diff ELSE 0 END) AS olympusGame SUM(CASE WHEN source = 68 THEN diff ELSE 0 END) AS mahjongGame
FROM ( FROM (
SELECT SELECT
r.user_id, r.user_id,
@@ -93,7 +93,7 @@
COALESCE(agg.fightGame, 0) AS `fightGame`, COALESCE(agg.fightGame, 0) AS `fightGame`,
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`, COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
COALESCE(agg.wheelGame, 0) AS `wheelGame`, COALESCE(agg.wheelGame, 0) AS `wheelGame`,
COALESCE(agg.olympusGame, 0) AS `olympusGame` COALESCE(agg.mahjongGame, 0) AS `mahjongGame`
FROM ( FROM (
SELECT user_id, nick_name, user_name, phone_number, user_type SELECT user_id, nick_name, user_name, phone_number, user_type
FROM tt_user FROM tt_user
@@ -109,12 +109,12 @@
SELECT SELECT
user_id, user_id,
SUM(CASE WHEN source = 1 THEN diff ELSE 0 END) AS totalRecharge, SUM(CASE WHEN source = 1 THEN diff ELSE 0 END) AS totalRecharge,
SUM(CASE WHEN source IN (2, 4, 40, 38, 60) THEN diff ELSE 0 END) AS totalTurnover, SUM(CASE WHEN source IN (2, 4, 40, 38, 68) THEN diff ELSE 0 END) AS totalTurnover,
SUM(CASE WHEN source = 2 THEN diff ELSE 0 END) AS classicBox, SUM(CASE WHEN source = 2 THEN diff ELSE 0 END) AS classicBox,
SUM(CASE WHEN source = 4 THEN diff ELSE 0 END) AS fightGame, SUM(CASE WHEN source = 4 THEN diff ELSE 0 END) AS fightGame,
SUM(CASE WHEN source = 40 THEN diff ELSE 0 END) AS luckyUpgrade, SUM(CASE WHEN source = 40 THEN diff ELSE 0 END) AS luckyUpgrade,
SUM(CASE WHEN source = 38 THEN diff ELSE 0 END) AS wheelGame, SUM(CASE WHEN source = 38 THEN diff ELSE 0 END) AS wheelGame,
SUM(CASE WHEN source = 60 THEN diff ELSE 0 END) AS olympusGame SUM(CASE WHEN source = 68 THEN diff ELSE 0 END) AS mahjongGame
FROM ( FROM (
SELECT SELECT
r.user_id, r.user_id,
@@ -144,7 +144,7 @@
<when test="sortField == 'fightGame'">ORDER BY fightGame</when> <when test="sortField == 'fightGame'">ORDER BY fightGame</when>
<when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</when> <when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</when>
<when test="sortField == 'wheelGame'">ORDER BY wheelGame</when> <when test="sortField == 'wheelGame'">ORDER BY wheelGame</when>
<when test="sortField == 'olympusGame'">ORDER BY olympusGame</when> <when test="sortField == 'mahjongGame'">ORDER BY mahjongGame</when>
<otherwise>ORDER BY totalTurnover</otherwise> <otherwise>ORDER BY totalTurnover</otherwise>
</choose> </choose>
<choose> <choose>
@@ -372,7 +372,7 @@ public class TaskUpdate {
}).map(v -> v.getAmount().abs()).reduce(BigDecimal.ZERO, BigDecimal::add); }).map(v -> v.getAmount().abs()).reduce(BigDecimal.ZERO, BigDecimal::add);
// 发奖 // 发奖
// 0.02*总充值 + 0.03*普通游戏消费 + 0.01*特殊游戏消费 // 0.02*总充值 + 0.03*普通游戏消费 + 0.01*特殊游戏消费(特殊游戏=麻将胡了)
BigDecimal prize = totalRecharge.multiply(new BigDecimal("0.02")).add(totalNormalGameConsume.multiply(new BigDecimal("0.03"))) BigDecimal prize = totalRecharge.multiply(new BigDecimal("0.02")).add(totalNormalGameConsume.multiply(new BigDecimal("0.03")))
.add(totalSpecialGameConsume.multiply(new BigDecimal("0.01"))); .add(totalSpecialGameConsume.multiply(new BigDecimal("0.01")));
@@ -62,15 +62,15 @@ public class ApiProfileRecordsServiceImpl implements ApiProfileRecordsService {
3, 5, 7, 9, 11, 13, 14, 17, 18, 3, 5, 7, 9, 11, 13, 14, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
37, 39, 41, 43, 44, 46, 47, 48, 49, 52, 56, 37, 39, 41, 43, 44, 46, 47, 48, 49, 52, 56,
// 61=玫瑰女郎奖励, 62=招商周结佣金, 63=流水抽奖奖励 // 62=招商周结佣金, 63=流水抽奖奖励, 69=麻将胡了奖励
61, 62, 63 62, 63, 69
); );
/** 余额-消费 subFilter=1 覆盖的 source 集合(59=主播Roll房奖池扣款) */ /** 余额-消费 subFilter=1 覆盖的 source 集合(59=主播Roll房奖池扣款) */
private static final Set<Integer> BALANCE_CONSUMPTION_SOURCES = Set.of( private static final Set<Integer> BALANCE_CONSUMPTION_SOURCES = Set.of(
2, 4, 6, 8, 12, 14, 33, 34, 38, 40, 42, 45, 50, 59, 2, 4, 6, 8, 12, 14, 33, 34, 38, 40, 42, 45, 50, 59,
// 53=主播创建CDKEY消费, 57=后台生成主播CDK红包扣款, 60=玫瑰女郎消费 // 53=主播创建CDKEY消费, 57=后台生成主播CDK红包扣款, 68=麻将胡了消费
53, 57, 60 53, 57, 68
); );
/** 余额-结算 subFilter=4 覆盖的 source 集合 */ /** 余额-结算 subFilter=4 覆盖的 source 集合 */
@@ -628,8 +628,8 @@ public class ApiUserPackSackServiceImpl implements ApiUserPackSackService {
if (source.equals(TtboxRecordSource.BULLET_BOX.getCode())) { if (source.equals(TtboxRecordSource.BULLET_BOX.getCode())) {
return TtAccountRecordSource.BULLET_REWARD; return TtAccountRecordSource.BULLET_REWARD;
} }
if (source.equals(TtboxRecordSource.OLYMPUS_BOX.getCode())) { if (source.equals(TtboxRecordSource.MAHJONG_BOX.getCode())) {
return TtAccountRecordSource.OLYMPUS_REWARD; return TtAccountRecordSource.MAHJONG_REWARD;
} }
if (source.equals(TtboxRecordSource.ROLL.getCode())) { if (source.equals(TtboxRecordSource.ROLL.getCode())) {
return TtAccountRecordSource.GAME_TYPE_03_AWARD; return TtAccountRecordSource.GAME_TYPE_03_AWARD;