From ca2c8d317c5eeffb0836ff64342fb4999afce54c Mon Sep 17 00:00:00 2001 From: hupeng Date: Wed, 13 Mar 2019 16:11:04 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=B8=B8=E6=88=8F][=E4=BF=AE=E6=94=B9]:?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E9=99=90=E5=88=B6=E5=89=A9=E4=BD=99=E6=AC=A1?= =?UTF-8?q?=E6=95=B0=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxGameServiceImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index 5ba5a7a61..1c894c9b5 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -101,13 +101,18 @@ public class WxGameServiceImpl implements WxGameService { wxGameActionLog.setUserId(userId); wxGameActionLog.setGameId(gameId); - if (wxGame.getPlayLimit() != 0 - && wxGameActionLogMapper.getPlayCount(wxGameActionLog) > wxGame.getPlayLimit()) - return new ResultData(ErrorCode.GAME_PLAY_HAS_BEEN_LIMITED); - - if (wxGame.getAwardLimit() != 0 - && wxGameActionLogMapper.getAwardCount(wxGameActionLog) > wxGame.getAwardLimit()) - return new ResultData(ErrorCode.GAME_AWARD_HAS_BEEN_LIMITED); + int playLimit = wxGame.getPlayLimit(); + int AwardLimit = wxGame.getPlayLimit(); + int playCount = wxGameActionLogMapper.getPlayCount(wxGameActionLog); + int AwardCount = wxGameActionLogMapper.getAwardCount(wxGameActionLog); + + if ( playLimit != 0 + && playCount > playLimit) + return new ResultData(ErrorCode.GAME_PLAY_HAS_BEEN_LIMITED,playCount - playLimit ); + + if (AwardLimit != 0 + && AwardCount > AwardLimit) + return new ResultData(ErrorCode.GAME_AWARD_HAS_BEEN_LIMITED,AwardCount - AwardLimit); return new ResultData(); }