修改河南项目的管理后台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
@@ -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,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);