refactor(ff-game): 优化游戏结果状态处理逻辑
- 新增游戏状态判断逻辑,根据结算金额确定游戏结果 - 修改 gameStatus 字段赋值方式,提高代码可读性和维护性main-p
parent
9d9a4c31bd
commit
ee49e83c79
|
@ -667,6 +667,12 @@ public class GamesPGServiceImpl implements IGamesService {
|
||||||
GameDTO gameDTO = new GameDTO();
|
GameDTO gameDTO = new GameDTO();
|
||||||
gameDTO.setPlatformCodes(NGPlatforms.getAllPlatforms());
|
gameDTO.setPlatformCodes(NGPlatforms.getAllPlatforms());
|
||||||
|
|
||||||
|
int gameStatus = GameStatus.FLAT.getCode();
|
||||||
|
if (BigDecimal.ZERO.compareTo(resultBean.getSettledAmount())>0) {
|
||||||
|
gameStatus = GameStatus.FAIL.getCode();
|
||||||
|
}else if (BigDecimal.ZERO.compareTo(resultBean.getSettledAmount())<0) {
|
||||||
|
gameStatus = GameStatus.WIN.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
//数据构造
|
//数据构造
|
||||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||||
|
@ -679,7 +685,7 @@ public class GamesPGServiceImpl implements IGamesService {
|
||||||
.platformCode(NGPlatforms.getByCode(resultBean.getPlatType()).getPlatform())
|
.platformCode(NGPlatforms.getByCode(resultBean.getPlatType()).getPlatform())
|
||||||
.gameId(gamesDataDTO.getId())
|
.gameId(gamesDataDTO.getId())
|
||||||
.gameName(gamesDataDTO.getGameName())
|
.gameName(gamesDataDTO.getGameName())
|
||||||
.gameStatus(resultBean.getStatus())
|
.gameStatus(gameStatus)
|
||||||
.gameStatusType(1)
|
.gameStatusType(1)
|
||||||
.gameCurrencyCode(resultBean.getCurrency())
|
.gameCurrencyCode(resultBean.getCurrency())
|
||||||
.account(resultBean.getPlayerId())
|
.account(resultBean.getPlayerId())
|
||||||
|
|
Loading…
Reference in New Issue