Browse Source

宠物马拉松,判断投注倍数

kk 2 months ago
parent
commit
4833de543f

+ 10 - 1
game-business/src/main/java/com/game/business/controller/AppGameBettingController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.game.business.domain.*;
 import com.game.business.task.AppAgentGameBettingTask;
+import com.game.business.util.Common;
 import com.game.business.vo.*;
 import com.game.business.service.*;
 import com.game.common.annotation.Anonymous;
@@ -117,7 +118,15 @@ public class AppGameBettingController extends BaseController{
                 return HttpRet.fail("游戏选项不存在,无法下单。");
             }
 
-            gameBetting.setBettingMultiple(Double.parseDouble(appGameItem.getItemMultiple() + ""));
+            if(appGame.getCode().equals(Common.GAME_ONE_CODE)){
+                if(gameBetting.getBettingMultiple() != null && gameBetting.getBettingMultiple() > 0){
+                    if(gameBetting.getBettingMultiple().doubleValue() != appGameItem.getItemMultiple().doubleValue()){
+                        return HttpRet.fail("游戏选项倍数不统一,无法下单。");
+                    }
+                }
+            }
+
+            gameBetting.setBettingMultiple(appGameItem.getItemMultiple());
         // 多选
         }else if(gameBetting.getBettingGameType() == 1 || gameBetting.getBettingGameType() == 2){
             List<AppGameItemBettingVO> itemList = JSON.parseArray(gameBetting.getBettingItem(), AppGameItemBettingVO.class);