Ver código fonte

Merge remote-tracking branch 'origin/master'

kk 2 meses atrás
pai
commit
20a4c6d420

+ 11 - 4
game-business/src/main/java/com/game/business/controller/AppGameBettingController.java

@@ -126,6 +126,10 @@ public class AppGameBettingController extends BaseController{
             return HttpRet.fail("游戏期号不存在,无法下单。");
         }
 
+        if(!appGame.getGameDate().equals(gameBetting.getGameDate())){
+            return HttpRet.fail("游戏期号不匹配,无法下单。");
+        }
+
         if(StringUtils.isBlank(appGame.getGameTime())){
             return HttpRet.fail("游戏已封盘,无法下单。");
         }
@@ -140,10 +144,13 @@ public class AppGameBettingController extends BaseController{
             return HttpRet.fail("游戏已封盘,无法下单。");
         }
 
+        if(appGame.getBettingCount() == null || appGame.getBettingCount() == 0){
+            return HttpRet.fail("投注次数已超过限额,无法下单。");
+        }
 
-        Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), gameBetting.getGameDate());
-        if(bettingCount != null && bettingCount > 0){
-            if(bettingCount.intValue() > appGame.getBettingCount().intValue()){
+        Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
+        if(bettingCount != null && bettingCount > 0 ){
+            if(bettingCount.intValue() >= appGame.getBettingCount().intValue()){
                 return HttpRet.fail("投注次数已超过限额,无法下单。");
             }
         }
@@ -165,7 +172,7 @@ public class AppGameBettingController extends BaseController{
             }
 
             BigDecimal bettingAmountCheck = new BigDecimal(appGameItem.getBettingMoney() + "");
-            BigDecimal bettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), gameBetting.getGameDate(), gameBetting.getBettingItem());
+            BigDecimal bettingAmountSum = appGameBettingService.getBettingAmount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
             BigDecimal bettingAmountAdd = bettingAmountSum.add(new BigDecimal(gameBetting.getBettingAmount() + ""));
             if(bettingAmountAdd.compareTo(bettingAmountCheck) == 1){
                 return HttpRet.fail("投注金额已超过限额,无法下单。");

+ 2 - 2
game-business/src/main/java/com/game/business/controller/AppUserController.java

@@ -272,8 +272,8 @@ public class AppUserController extends BaseController
             //流水 余额
             FinTranAddedInfo addedInfo = FinTranAddedInfo.createTranInfo(appUser.getUserid(), 0, 0, AppSceneType.Scene_None, "");
             FinTranRecord tran = null;
-            tran = FinTranRecord.initFinTranRecordSomeParams(addedInfo, FinTranType3.CHARGE_IN_Back, FinTranType1.U_Income_Coin_Balance, appUser);
-            tran.setDiamondCoinChange(withdrawDto.getAmount());
+            tran = FinTranRecord.initFinTranRecordSomeParams(addedInfo, FinTranType3.CONSUM_GAME_ANCHOR_WITHDRAW, withdrawDto.getAmount()<0?FinTranType1.U_Income_Coin_Balance:FinTranType1.U_Outcome_Balance, appUser);
+            tran.setDiamondCoinChange(withdrawDto.getAmount()*-1);
             tran.setAfterDiamondCoin(appUser.getDiamondCoin());
             tran.setCurrencyType(TranCurrencyType.Balance.getType());
             tran.setTranGroupId(IdUtil.getSnowflakeNextId());

+ 1 - 3
game-business/src/main/java/com/game/business/task/AppUserCountTask.java

@@ -616,8 +616,6 @@ public class AppUserCountTask {
         if(null != curTranList && curTranList.size() > 0){
             //筛选投注流水
             double bettingAmount = curTranList.stream().filter(e->
-                    e.getTranType3().equals(FinTranType3.CONSUM_GAME_ANCHOR_ZHUANPAN.getType())
-                            &&
                             e.getCurrencyType().intValue() == 4
             ).mapToDouble(FinTranRecord::getDiamondCoinChange).sum() * -1;
             if(bettingAmount >= money * 2){
@@ -642,7 +640,7 @@ public class AppUserCountTask {
         if(null != userId && userId.longValue() == -1){
             userId = null;
         }
-        //查询所有满足提现的充值、转账
+        //查询所有满足提现的充值、转账
         String chargeType3 = FinTranType3.ON_LINE_CHARGE.getType() + "," + FinTranType3.CHARGE_IN.getType()+ "," + FinTranType3.CHARGE_IN_Back.getType()
                 + "," + FinTranType3.TRANSFER_TO_TEAM_DiamondCoin.getType();
         List<FinTranRecord> chargeList = finTranRecordService.selectUserTran(FinTranType1.U_Income_Coin_Balance.getType(),chargeType3,userId,null,null,1);

+ 2 - 2
game-business/src/main/java/com/game/business/util/Common.java

@@ -30,8 +30,8 @@ public class Common {
 //    public static final String WS_GAME_FIVE_REMARK_URL = "ws://47.115.133.74:8000/ws";
 
 
-    public static final String WS_GAME_ONE_URL = "ws://114.132.100.104:8000/ws";
-    public static final String WS_GAME_ONE_REMARK_URL = "ws://129.204.16.2:8000/ws";
+    public static final String WS_GAME_ONE_URL = "ws://119.29.174.68:8000/ws";
+    public static final String WS_GAME_ONE_REMARK_URL = "ws://81.71.95.104:8000/ws";
 
     public static final String WS_GAME_TWO_URL = "ws://159.75.147.253:8000/ws";
     public static final String WS_GAME_TWO_REMARK_URL = "ws://175.178.88.93:8000/ws";