Browse Source

开奖记录修改

kk 2 tháng trước cách đây
mục cha
commit
a39131a7b0

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

@@ -148,9 +148,9 @@ public class AppGameBettingController extends BaseController{
             return HttpRet.fail("投注次数已超过限额,无法下单。");
         }
 
-        Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate());
+        Integer bettingCount = appGameBettingService.getBettingCount(gameBetting.getUserId(), gameBetting.getGameId(), appGame.getGameDate(), gameBetting.getBettingItem());
         if(bettingCount != null && bettingCount > 0 ){
-            if(bettingCount.intValue() > appGame.getBettingCount().intValue()){
+            if(bettingCount.intValue() >= appGame.getBettingCount().intValue()){
                 return HttpRet.fail("投注次数已超过限额,无法下单。");
             }
         }

+ 1 - 1
game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java

@@ -21,6 +21,6 @@ public interface AppGameBettingMapper extends BaseMapper<AppGameBetting> {
     Map<String, BigDecimal> getBettingAmountSum(Long userId);
     Map<String, BigDecimal> getBettingAmountByDateSum(FinTranRecordDTO finTranRecordDTO);
 
-    Integer getBettingCount(@Param(value = "userId") Long userId, @Param(value = "gameId") Long gameId, @Param(value = "gameDate") String gameDate);
+    Integer getBettingCount(@Param(value = "userId") Long userId, @Param(value = "gameId") Long gameId, @Param(value = "gameDate") String gameDate, @Param(value = "bettingItem") String bettingItem);
     BigDecimal getBettingAmount(@Param(value = "userId") Long userId, @Param(value = "gameId") Long gameId, @Param(value = "gameDate") String gameDate, @Param(value = "bettingItem") String bettingItem);
 }

+ 1 - 1
game-business/src/main/java/com/game/business/service/IAppGameBettingService.java

@@ -40,7 +40,7 @@ public interface IAppGameBettingService extends IService<AppGameBetting> {
 
     Map<String, BigDecimal> getBettingAmountByDateSum(FinTranRecordDTO finTranRecordDTO);
 
-    Integer getBettingCount(Long userId, Long gameId, String gameDate);
+    Integer getBettingCount(Long userId, Long gameId, String gameDate, String bettingItem);
 
     BigDecimal getBettingAmount(Long userId, Long gameId, String gameDate, String bettingItem);
 }

+ 2 - 2
game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java

@@ -132,8 +132,8 @@ public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper,
     }
 
     @Override
-    public Integer getBettingCount(Long userId, Long gameId, String gameDate) {
-        return appGameBettingMapper.getBettingCount(userId, gameId, gameDate);
+    public Integer getBettingCount(Long userId, Long gameId, String gameDate, String bettingItem) {
+        return appGameBettingMapper.getBettingCount(userId, gameId, gameDate, bettingItem);
     }
 
     @Override

+ 1 - 1
game-business/src/main/resources/mapper/business/AppGameBettingMapper.xml

@@ -74,7 +74,7 @@
         select ifnull(count(1), 0) as bettingCount from (
             select
                 betting_item
-            from app_game_betting where user_id = #{userId} and game_id = #{gameId} and game_date = #{gameDate}
+            from app_game_betting where user_id = #{userId} and game_id = #{gameId} and game_date = #{gameDate} and betting_item != #{bettingItem}
             group by betting_item
         ) tmp
     </select>