修改河南项目的管理后台ui和删除之前不需要的游戏
This commit is contained in:
+4
-4
@@ -36,14 +36,14 @@ public class MahjongConstants {
|
||||
public static final String FLOOR_WIN = "0.01";
|
||||
|
||||
/**
|
||||
* 流水/背包 source 占位值 —— 定义在共享枚举里(下一步动作):
|
||||
* 流水/背包 source —— **已由共享枚举承接,这里只作数值留档**:
|
||||
* <ul>
|
||||
* <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>
|
||||
* </ul>
|
||||
* 本次任务明确不改共享文件,因此先以本地常量承接;共享枚举补上后,
|
||||
* 把 {@code MahjongGameService} 里的引用换成枚举常量即可(语义与数值都已对齐,不会有账面漂移)。
|
||||
* 2026-09-22 共享枚举已补齐,{@code MahjongGameService} 已全部改为引用枚举常量;
|
||||
* 新增代码请直接用枚举,不要再引用下面这几个本地常量。
|
||||
*/
|
||||
public static final int RECORD_SOURCE_SPIN = 68;
|
||||
public static final int RECORD_SOURCE_REWARD = 69;
|
||||
|
||||
+8
-13
@@ -8,7 +8,9 @@ import com.ruoyi.admin.service.TtUserService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
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.TtboxRecordSource;
|
||||
import com.ruoyi.domain.entity.TtBoxRecords;
|
||||
import com.ruoyi.domain.entity.sys.TtUser;
|
||||
import com.ruoyi.domain.other.TtOrnamentsLevel;
|
||||
@@ -92,12 +94,8 @@ public class MahjongGameService {
|
||||
/** 免费旋转总旋数上限(首赠 12 + 每多 1 胡 +2,重触发同式;发不满就不发) */
|
||||
private static final int MAX_FREE_SPINS = MahjongConstants.MAX_FREE_SPINS;
|
||||
|
||||
/**
|
||||
* 需改共享文件的接线点(本次任务明确不改共享文件):
|
||||
* {@code TtAccountRecordSource.MAHJONG_SPIN(68)}。共享枚举补齐后把本行换成 {@code MAHJONG_SPIN}。
|
||||
* TODO(共享文件): 见 MahjongConstants#RECORD_SOURCE_SPIN。
|
||||
*/
|
||||
private static final TtAccountRecordSource SPIN_SOURCE = TtAccountRecordSource.OLYMPUS_SPIN;
|
||||
/** 扣费流水来源:{@link TtAccountRecordSource#MAHJONG_SPIN}(68, OUTPUT, "麻将胡了消费")。 */
|
||||
private static final TtAccountRecordSource SPIN_SOURCE = TtAccountRecordSource.MAHJONG_SPIN;
|
||||
|
||||
// ============================================================
|
||||
// dospin 主入口
|
||||
@@ -292,12 +290,11 @@ public class MahjongGameService {
|
||||
MahjongRecord rec = recordMapper.selectById(cache.getRecordId());
|
||||
if (rec == null || rec.getPrizeName() == null) return;
|
||||
String priceStr = rec.getSettledWin() == null ? "0" : rec.getSettledWin().stripTrailingZeros().toPlainString();
|
||||
// TODO(共享文件): 共享枚举补上 MessageCategoryEnum.GAME_MAHJONG 后,改用它的 getTitle()/getCode()
|
||||
messageService.sendNotice(
|
||||
userId,
|
||||
MahjongConstants.MESSAGE_CATEGORY_TITLE,
|
||||
MessageCategoryEnum.GAME_MAHJONG.getTitle(),
|
||||
"麻将胡了挑战结算:您本局获得饰品 " + rec.getPrizeName() + "(价值 ¥" + priceStr + ")",
|
||||
MahjongConstants.MESSAGE_CATEGORY);
|
||||
MessageCategoryEnum.GAME_MAHJONG.getCode());
|
||||
} catch (Exception e) {
|
||||
log.error("mahjong 结算通知发送失败 userId={} recordId={}", userId, cache.getRecordId(), e);
|
||||
}
|
||||
@@ -338,9 +335,7 @@ public class MahjongGameService {
|
||||
.set(MahjongRecord::getPrizeLevelImg, prizeLevelImg));
|
||||
if (guard == 0) { cacheRepository.clearCache(userId); return; }
|
||||
|
||||
// 写入背包
|
||||
// TODO(共享文件): 共享枚举补上 TtboxRecordSource.MAHJONG_BOX(15) 后,
|
||||
// 把 MahjongConstants.BOX_RECORD_SOURCE 换成 MAHJONG_BOX.getCode()(数值已经是 15,不会漂)。
|
||||
// 写入背包(source = TtboxRecordSource.MAHJONG_BOX(15))
|
||||
if (boxRecordsMapper != null && prizeId != null) {
|
||||
if (prizeLevelImg == null && ornamentsLevelMapper != null) {
|
||||
TtOrnamentsLevel lv = ornamentsLevelMapper.selectById(prizeGrade);
|
||||
@@ -355,7 +350,7 @@ public class MahjongGameService {
|
||||
.marketHashName(prizeExteriorName != null ? prizeName + " (" + prizeExteriorName + ")" : prizeName)
|
||||
.ornamentsLevelId(prizeGrade != null ? prizeGrade : 1)
|
||||
.ornamentLevelImg(prizeLevelImg)
|
||||
.source(MahjongConstants.BOX_RECORD_SOURCE)
|
||||
.source(TtboxRecordSource.MAHJONG_BOX.getCode())
|
||||
.status(0).isShow(1).createTime(new Date())
|
||||
.build();
|
||||
boxRecordsMapper.insert(bi);
|
||||
|
||||
+7
-7
@@ -16,13 +16,13 @@ public class RedisConstants {
|
||||
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 BULLET_GAME_REWARD_POOL_CACHE = "ruoyi:bullet:reward:pool";
|
||||
// ========== Olympus 电子游戏 ==========
|
||||
// 单局进行中缓存:ruoyi:olympus:{userId},存整局步骤,TTL 30 分钟
|
||||
public static final String OLYMPUS_GAME_CACHE = "ruoyi:olympus:";
|
||||
// 按箱奖池(水位):ruoyi:olympus:reward:pool:box:{boxId}:bet/:win/:adjust,仅统计真实玩家(白号隔离)
|
||||
public static final String OLYMPUS_GAME_REWARD_POOL_CACHE = "ruoyi:olympus:reward:pool";
|
||||
// 一轮内RTP动态收敛账本:Hash ruoyi:olympus:cycle:{boxId}:{audience},字段 drawn/mulSum/conv:{ornamentId}
|
||||
public static final String OLYMPUS_GAME_CYCLE = "ruoyi:olympus:cycle:";
|
||||
// ========== 麻将胡了电子游戏 ==========
|
||||
// 单局进行中缓存:ruoyi:mahjong:{userId},存整局步骤,TTL 30 分钟
|
||||
public static final String MAHJONG_GAME_CACHE = "ruoyi:mahjong:";
|
||||
// 一轮内 RTP 收敛账本:Hash ruoyi:mahjong:cycle:{boxId}:{audience}
|
||||
public static final String MAHJONG_GAME_CYCLE = "ruoyi:mahjong:cycle:";
|
||||
// 按【箱 × 身份】奖池水位:ruoyi:mahjong:reward:pool:box:{boxId}:{audience}:*
|
||||
public static final String MAHJONG_GAME_REWARD_POOL_CACHE = "ruoyi:mahjong:reward:pool";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+19
-18
@@ -10,6 +10,7 @@ import com.ruoyi.admin.mapper.TtDeliveryRecordMapper;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.domain.entity.delivery.TtDeliveryRecord;
|
||||
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.TtRechargeConfig;
|
||||
import com.ruoyi.domain.entity.TtUserBlendErcash;
|
||||
@@ -150,8 +151,7 @@ public class TtRechargeRecordController extends BaseController {
|
||||
List<BigDecimal> luckyUpgradeList = new ArrayList<>();
|
||||
List<BigDecimal> westernDuelList = new ArrayList<>();
|
||||
List<BigDecimal> wheelList = new ArrayList<>();
|
||||
List<BigDecimal> roseladyList = new ArrayList<>();
|
||||
|
||||
List<BigDecimal> mahjongList = new ArrayList<>();
|
||||
List<Integer> sources = Arrays.asList(
|
||||
TtAccountRecordSource.RECHARGE.getCode(),
|
||||
TtAccountRecordSource.GAME_TYPE_01.getCode(),
|
||||
@@ -159,8 +159,8 @@ public class TtRechargeRecordController extends BaseController {
|
||||
TtAccountRecordSource.GOLD_DEVICE.getCode(),
|
||||
TtAccountRecordSource.BULLET_SPIN.getCode(),
|
||||
TtAccountRecordSource.LUCKLY_WHEEL_SPIN.getCode(),
|
||||
TtAccountRecordSource.WHEEL_BET_REFUND.getCode(), // 转盘兜底退款:折线按净口径冲减
|
||||
TtAccountRecordSource.OLYMPUS_SPIN.getCode());
|
||||
TtAccountRecordSource.MAHJONG_SPIN.getCode(),
|
||||
TtAccountRecordSource.WHEEL_BET_REFUND.getCode()); // 转盘兜底退款:折线按净口径冲减
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
// bucketKey -> (source -> 金额):原值与绝对值两份
|
||||
@@ -175,7 +175,7 @@ public class TtRechargeRecordController extends BaseController {
|
||||
for (int h = 0; h <= 23; h++) {
|
||||
dateList.add(String.format("%02d:00", h));
|
||||
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)) {
|
||||
// 按周:近4周,单次查询按日聚合,再在内存中合并为每周
|
||||
@@ -193,7 +193,7 @@ public class TtRechargeRecordController extends BaseController {
|
||||
keys.add(d.toString());
|
||||
}
|
||||
appendPoint(keys, rawByBucket, absByBucket,
|
||||
rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, roseladyList);
|
||||
rechargeList, boxOpenList, fightBoxOpenList, luckyUpgradeList, westernDuelList, wheelList, mahjongList);
|
||||
}
|
||||
} else {
|
||||
// 按天:近7天,单次查询按日聚合
|
||||
@@ -205,7 +205,7 @@ public class TtRechargeRecordController extends BaseController {
|
||||
LocalDate date = today.minusDays(i);
|
||||
dateList.add(date.getMonthValue() + "/" + date.getDayOfMonth());
|
||||
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("westernDuelList", westernDuelList);
|
||||
result.put("wheelList", wheelList);
|
||||
result.put("roseladyList", roseladyList);
|
||||
result.put("mahjongList", mahjongList);
|
||||
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> fightBoxOpenList, List<BigDecimal> luckyUpgradeList,
|
||||
List<BigDecimal> westernDuelList, List<BigDecimal> wheelList,
|
||||
List<BigDecimal> roseladyList) {
|
||||
List<BigDecimal> mahjongList) {
|
||||
BigDecimal recharge = BigDecimal.ZERO;
|
||||
BigDecimal box = BigDecimal.ZERO;
|
||||
BigDecimal fightBox = BigDecimal.ZERO;
|
||||
BigDecimal luckyUpgrade = BigDecimal.ZERO;
|
||||
BigDecimal westernDuel = BigDecimal.ZERO;
|
||||
BigDecimal wheel = BigDecimal.ZERO;
|
||||
BigDecimal mahjong = BigDecimal.ZERO;
|
||||
BigDecimal wheelRefund = BigDecimal.ZERO;
|
||||
BigDecimal roselady = BigDecimal.ZERO;
|
||||
for (String key : bucketKeys) {
|
||||
Map<Integer, BigDecimal> raw = rawByBucket.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));
|
||||
westernDuel = westernDuel.add(abs.getOrDefault(TtAccountRecordSource.BULLET_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));
|
||||
roselady = roselady.add(abs.getOrDefault(TtAccountRecordSource.OLYMPUS_SPIN.getCode(), BigDecimal.ZERO));
|
||||
}
|
||||
rechargeList.add(recharge);
|
||||
boxOpenList.add(box);
|
||||
@@ -278,7 +278,7 @@ public class TtRechargeRecordController extends BaseController {
|
||||
westernDuelList.add(westernDuel);
|
||||
// 转盘取净口径:消费 − 兜底退款(退款局的注单没进奖池,毛口径会与奖池统计对不上)
|
||||
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百分比。
|
||||
* 唯一化改造后所有产出先入背包,返奖统一按 tt_box_records 今日产出(按 source 分组、不看 status)统计,
|
||||
* 投注仍取 tt_user_blend_ercash 各游戏消费 source;覆盖全部 8 个产出游戏(含玫瑰女郎)。
|
||||
* 投注仍取 tt_user_blend_ercash 各游戏消费 source;覆盖全部 8 个产出游戏(含麻将胡了)。
|
||||
*/
|
||||
@GetMapping("/realTimeRtp")
|
||||
public AjaxResult realTimeRtp() {
|
||||
@@ -383,8 +383,9 @@ public class TtRechargeRecordController extends BaseController {
|
||||
Timestamp startOfDay = Timestamp.valueOf(today.atStartOfDay());
|
||||
Timestamp endOfDay = Timestamp.valueOf(today.plusDays(1).atStartOfDay());
|
||||
|
||||
// 投注 source:7 个游戏消费(含 Roll房=6、荒野争锋=34)+ 玫瑰女郎=60 + 转盘兜底退款=64(净口径冲减用)
|
||||
List<Integer> betSources = Arrays.asList(2, 4, 6, 34, 38, 40, 50, 60,
|
||||
// 投注 source:8 个游戏消费(含 Roll房=6、荒野争锋=34、麻将胡了=68)+ 转盘兜底退款=64(净口径冲减用)
|
||||
List<Integer> betSources = Arrays.asList(2, 4, 6, 34, 38, 40, 50,
|
||||
TtAccountRecordSource.MAHJONG_SPIN.getCode(),
|
||||
TtAccountRecordSource.WHEEL_BET_REFUND.getCode());
|
||||
|
||||
// 一次查询获取所有投注 source 的聚合数据,避免 N+1
|
||||
@@ -416,11 +417,11 @@ public class TtRechargeRecordController extends BaseController {
|
||||
{40, 4}, // 幸运升级
|
||||
{2, 1}, // 经典开箱
|
||||
{4, 2}, // 对战
|
||||
{6, 3}, // Roll 房(索引 5)
|
||||
{6, 3}, // Roll 房(索引 5,勿动:下方 i == 5 分支依赖此下标)
|
||||
{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<>();
|
||||
BigDecimal rollRoomBet = BigDecimal.ZERO;
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class TtUserAmountRecordsController extends BaseController {
|
||||
/** 聚合类排序字段集合(这些字段需要全局排序,不能用当页排序) */
|
||||
private static final java.util.Set<String> AGG_SORT_FIELDS = java.util.Set.of(
|
||||
"totalRecharge", "totalTurnover", "classicBox", "fightGame",
|
||||
"luckyUpgrade", "wheelGame", "olympusGame", "rollRoom");
|
||||
"luckyUpgrade", "wheelGame", "mahjongGame", "rollRoom");
|
||||
|
||||
/**
|
||||
* 用户流水统计列表
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ public class TtBoxServiceImpl extends ServiceImpl<TtBoxMapper, TtBox> implements
|
||||
String formattedDate = StringUtils.isNull(date) ? dateFormat.format(DateUtils.getNowDate()) : dateFormat.format(date);
|
||||
|
||||
// 对战宝箱(is_fight='0')与经典宝箱只统计各自的开箱渠道:对战=急速对战(source=2),经典=常规开箱(source=0/1),
|
||||
// 指数盲盒/roll房/幸运升级/福利开箱/荒野争锋/玫瑰女郎等其他电子游戏的开箱不计入本统计。
|
||||
// 指数盲盒/roll房/幸运升级/福利开箱/荒野争锋/麻将胡了等其他电子游戏的开箱不计入本统计。
|
||||
// 对战开箱记录先按常规开箱(source=1)落库,一轮对战结束后才改成急速对战(source=2),两个来源都算才不会漏掉中途中断的对局。
|
||||
boolean fightBox = "0".equals(ttBox.getIsFight());
|
||||
List<Integer> sources = fightBox
|
||||
|
||||
+1
-1
@@ -2293,7 +2293,7 @@ public class TtUserServiceImpl extends ServiceImpl<TtUserMapper, TtUser> impleme
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据游戏类型确定佣金比例和来源码
|
||||
// 根据游戏类型确定佣金比例和来源码(新游戏=麻将胡了,走 newGameCommissionRate)
|
||||
BigDecimal rate = BigDecimal.ZERO;
|
||||
TtAccountRecordSource commissionSource = TtAccountRecordSource.GAME_CONSUME_COMMISSION;
|
||||
if (TtAccountRecordSource.isNewGameConsumeForCommission(source.getCode())) {
|
||||
|
||||
+7
-7
@@ -71,12 +71,12 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
|
||||
parameterSetting.setWesternDuelMaintenance(getConfigValue(parameterSettingMap, "westernDuelMaintenance"));
|
||||
parameterSetting.setLuckyUpgradeMaintenance(getConfigValue(parameterSettingMap, "luckyUpgradeMaintenance"));
|
||||
parameterSetting.setWheelMaintenance(getConfigValue(parameterSettingMap, "wheelMaintenance"));
|
||||
// 玫瑰女郎维护配置(对应键 olympusMaintenance,可能不存在,安全读取,兜底 "0")
|
||||
List<ConfigData> olympusMaintenanceList = parameterSettingMap.get("olympusMaintenance");
|
||||
if (olympusMaintenanceList != null && !olympusMaintenanceList.isEmpty()) {
|
||||
parameterSetting.setOlympusMaintenance(olympusMaintenanceList.get(0).getConfigValue());
|
||||
// 麻将胡了维护配置(对应键 mahjongMaintenance,可能不存在,安全读取,兜底 "0")
|
||||
List<ConfigData> mahjongMaintenanceList = parameterSettingMap.get("mahjongMaintenance");
|
||||
if (mahjongMaintenanceList != null && !mahjongMaintenanceList.isEmpty()) {
|
||||
parameterSetting.setMahjongMaintenance(mahjongMaintenanceList.get(0).getConfigValue());
|
||||
} else {
|
||||
parameterSetting.setOlympusMaintenance("0");
|
||||
parameterSetting.setMahjongMaintenance("0");
|
||||
}
|
||||
// 充值渠道维护配置(可能不存在,安全读取,兜底 "0")
|
||||
List<ConfigData> rechargeMaintenanceList = parameterSettingMap.get("rechargeMaintenance");
|
||||
@@ -151,7 +151,7 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
|
||||
westernDuelMaintenance = parameterSettingBody.getWesternDuelMaintenance(),
|
||||
luckyUpgradeMaintenance = parameterSettingBody.getLuckyUpgradeMaintenance(),
|
||||
wheelMaintenance = parameterSettingBody.getWheelMaintenance(),
|
||||
olympusMaintenance = parameterSettingBody.getOlympusMaintenance();
|
||||
mahjongMaintenance = parameterSettingBody.getMahjongMaintenance();
|
||||
List<ConfigData> parameterSettingList = websiteSetupMapper.selectParameterSettingList();
|
||||
Map<String, List<ConfigData>> parameterSettingMap = parameterSettingList.stream().collect(Collectors.groupingBy(ConfigData::getConfigKey));
|
||||
List<ConfigData> updateList = new ArrayList<>();
|
||||
@@ -174,7 +174,7 @@ public class WebsiteSetupServiceImpl implements WebsiteSetupService {
|
||||
setConfigValue(parameterSettingMap, "westernDuelMaintenance", westernDuelMaintenance, updateList);
|
||||
setConfigValue(parameterSettingMap, "luckyUpgradeMaintenance", luckyUpgradeMaintenance, updateList);
|
||||
setConfigValue(parameterSettingMap, "wheelMaintenance", wheelMaintenance, updateList);
|
||||
setConfigValue(parameterSettingMap, "olympusMaintenance", olympusMaintenance, updateList);
|
||||
setConfigValue(parameterSettingMap, "mahjongMaintenance", mahjongMaintenance, updateList);
|
||||
// 充值渠道维护配置(安全读写,不存在时跳过,避免未执行 SQL 时报错)
|
||||
String rechargeMaintenance = parameterSettingBody.getRechargeMaintenance();
|
||||
List<ConfigData> rechargeMaintenanceUpdateList = parameterSettingMap.get("rechargeMaintenance");
|
||||
|
||||
+5
-5
@@ -516,7 +516,7 @@
|
||||
GROUP BY user_id
|
||||
</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 COALESCE(SUM(tbr.ornaments_price), 0)
|
||||
FROM tt_box_records tbr
|
||||
@@ -525,13 +525,13 @@
|
||||
AND ttu.user_type != '03'
|
||||
AND ttu.status != '1'
|
||||
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 < #{endOfDay}
|
||||
</select>
|
||||
|
||||
<!-- 历史游戏饰品返奖总额:与今日总返奖(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 COALESCE(SUM(tbr.ornaments_price), 0)
|
||||
FROM tt_box_records tbr
|
||||
@@ -540,7 +540,7 @@
|
||||
AND ttu.user_type != '03'
|
||||
AND ttu.status != '1'
|
||||
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 id="todayOrnamentRewardBySource" resultType="java.util.Map">
|
||||
@@ -551,7 +551,7 @@
|
||||
AND ttu.user_type != '03'
|
||||
AND ttu.status != '1'
|
||||
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 < #{endOfDay}
|
||||
GROUP BY tbr.source
|
||||
|
||||
+7
-7
@@ -500,7 +500,7 @@
|
||||
COALESCE(agg.fightGame, 0) AS `fightGame`,
|
||||
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
|
||||
COALESCE(agg.wheelGame, 0) AS `wheelGame`,
|
||||
COALESCE(agg.olympusGame, 0) AS `olympusGame`,
|
||||
COALESCE(agg.mahjongGame, 0) AS `mahjongGame`,
|
||||
COALESCE(agg.rollRoom, 0) AS `rollRoom`
|
||||
FROM (
|
||||
SELECT user_id, nick_name, user_name, phone_number, user_type
|
||||
@@ -519,14 +519,14 @@
|
||||
SELECT
|
||||
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 = 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 = 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 = 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 = 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 = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom
|
||||
FROM (
|
||||
@@ -573,7 +573,7 @@
|
||||
COALESCE(agg.fightGame, 0) AS `fightGame`,
|
||||
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
|
||||
COALESCE(agg.wheelGame, 0) AS `wheelGame`,
|
||||
COALESCE(agg.olympusGame, 0) AS `olympusGame`,
|
||||
COALESCE(agg.mahjongGame, 0) AS `mahjongGame`,
|
||||
COALESCE(agg.rollRoom, 0) AS `rollRoom`
|
||||
FROM (
|
||||
SELECT user_id, nick_name, user_name, phone_number, user_type
|
||||
@@ -590,14 +590,14 @@
|
||||
SELECT
|
||||
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 = 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 = 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 = 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 = 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 = 1 AND e.source = 56 AND e.amount > 0 THEN e.amount ELSE 0 END) AS rollRoom
|
||||
FROM (
|
||||
@@ -632,7 +632,7 @@
|
||||
<when test="sortField == 'fightGame'">ORDER BY fightGame</when>
|
||||
<when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</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>
|
||||
<otherwise>ORDER BY totalTurnover</otherwise>
|
||||
</choose>
|
||||
|
||||
+7
-7
@@ -27,7 +27,7 @@
|
||||
COALESCE(agg.fightGame, 0) AS `fightGame`,
|
||||
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
|
||||
COALESCE(agg.wheelGame, 0) AS `wheelGame`,
|
||||
COALESCE(agg.olympusGame, 0) AS `olympusGame`
|
||||
COALESCE(agg.mahjongGame, 0) AS `mahjongGame`
|
||||
FROM (
|
||||
SELECT user_id, nick_name, user_name, phone_number, user_type
|
||||
FROM tt_user
|
||||
@@ -45,12 +45,12 @@
|
||||
SELECT
|
||||
user_id,
|
||||
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 = 4 THEN diff ELSE 0 END) AS fightGame,
|
||||
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 = 60 THEN diff ELSE 0 END) AS olympusGame
|
||||
SUM(CASE WHEN source = 68 THEN diff ELSE 0 END) AS mahjongGame
|
||||
FROM (
|
||||
SELECT
|
||||
r.user_id,
|
||||
@@ -93,7 +93,7 @@
|
||||
COALESCE(agg.fightGame, 0) AS `fightGame`,
|
||||
COALESCE(agg.luckyUpgrade, 0) AS `luckyUpgrade`,
|
||||
COALESCE(agg.wheelGame, 0) AS `wheelGame`,
|
||||
COALESCE(agg.olympusGame, 0) AS `olympusGame`
|
||||
COALESCE(agg.mahjongGame, 0) AS `mahjongGame`
|
||||
FROM (
|
||||
SELECT user_id, nick_name, user_name, phone_number, user_type
|
||||
FROM tt_user
|
||||
@@ -109,12 +109,12 @@
|
||||
SELECT
|
||||
user_id,
|
||||
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 = 4 THEN diff ELSE 0 END) AS fightGame,
|
||||
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 = 60 THEN diff ELSE 0 END) AS olympusGame
|
||||
SUM(CASE WHEN source = 68 THEN diff ELSE 0 END) AS mahjongGame
|
||||
FROM (
|
||||
SELECT
|
||||
r.user_id,
|
||||
@@ -144,7 +144,7 @@
|
||||
<when test="sortField == 'fightGame'">ORDER BY fightGame</when>
|
||||
<when test="sortField == 'luckyUpgrade'">ORDER BY luckyUpgrade</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>
|
||||
</choose>
|
||||
<choose>
|
||||
|
||||
@@ -372,7 +372,7 @@ public class TaskUpdate {
|
||||
}).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")))
|
||||
.add(totalSpecialGameConsume.multiply(new BigDecimal("0.01")));
|
||||
|
||||
|
||||
+4
-4
@@ -62,15 +62,15 @@ public class ApiProfileRecordsServiceImpl implements ApiProfileRecordsService {
|
||||
3, 5, 7, 9, 11, 13, 14, 17, 18,
|
||||
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,
|
||||
// 61=玫瑰女郎奖励, 62=招商周结佣金, 63=流水抽奖奖励
|
||||
61, 62, 63
|
||||
// 62=招商周结佣金, 63=流水抽奖奖励, 69=麻将胡了奖励
|
||||
62, 63, 69
|
||||
);
|
||||
|
||||
/** 余额-消费 subFilter=1 覆盖的 source 集合(59=主播Roll房奖池扣款) */
|
||||
private static final Set<Integer> BALANCE_CONSUMPTION_SOURCES = Set.of(
|
||||
2, 4, 6, 8, 12, 14, 33, 34, 38, 40, 42, 45, 50, 59,
|
||||
// 53=主播创建CDKEY消费, 57=后台生成主播CDK红包扣款, 60=玫瑰女郎消费
|
||||
53, 57, 60
|
||||
// 53=主播创建CDKEY消费, 57=后台生成主播CDK红包扣款, 68=麻将胡了消费
|
||||
53, 57, 68
|
||||
);
|
||||
|
||||
/** 余额-结算 subFilter=4 覆盖的 source 集合 */
|
||||
|
||||
+2
-2
@@ -628,8 +628,8 @@ public class ApiUserPackSackServiceImpl implements ApiUserPackSackService {
|
||||
if (source.equals(TtboxRecordSource.BULLET_BOX.getCode())) {
|
||||
return TtAccountRecordSource.BULLET_REWARD;
|
||||
}
|
||||
if (source.equals(TtboxRecordSource.OLYMPUS_BOX.getCode())) {
|
||||
return TtAccountRecordSource.OLYMPUS_REWARD;
|
||||
if (source.equals(TtboxRecordSource.MAHJONG_BOX.getCode())) {
|
||||
return TtAccountRecordSource.MAHJONG_REWARD;
|
||||
}
|
||||
if (source.equals(TtboxRecordSource.ROLL.getCode())) {
|
||||
return TtAccountRecordSource.GAME_TYPE_03_AWARD;
|
||||
|
||||
Reference in New Issue
Block a user