diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java index ba1135ad1..0dc9d0f01 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java @@ -3,6 +3,7 @@ package com.iformall.controller.market; import com.alibaba.fastjson.JSONArray; import com.github.pagehelper.PageInfo; import com.iformall.annotation.SystemControllerLog; +import com.iformall.common.ErrorCode; import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.controller.base.BaseController; @@ -54,6 +55,14 @@ public class WxGameController extends BaseController { if (StringUtils.isBlank(wxGame.getCouponIds())) { wxGame.setCouponIds(JSONArray.toJSONString(new String[0])); } + if(wxGame.getPlayCreditLimit() != null && wxGame.getPlayCreditLimit() >= 0){ + if(wxGame.getPlayCredit() == null || wxGame.getPlayCredit() <= 0){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"游戏消耗积分不能为空或为0"); + } + if(wxGame.getPlayLimit() == null || wxGame.getPlayLimit() == 0){ + wxGame.setPlayLimit(-1); + } + } wxGame.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); wxGame.updateTenantInfo(getTenantInfo()); wxGameService.saveOrUpdate(wxGame); @@ -68,6 +77,14 @@ public class WxGameController extends BaseController { if (StringUtils.isBlank(wxGame.getCouponIds())) { wxGame.setCouponIds(JSONArray.toJSONString(new String[0])); } + if(wxGame.getPlayCreditLimit() != null && wxGame.getPlayCreditLimit() >= 0){ + if(wxGame.getPlayCredit() == null || wxGame.getPlayCredit() <= 0){ + return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"游戏消耗积分不能为空或为0"); + } + if(wxGame.getPlayLimit() == null || wxGame.getPlayLimit() == 0){ + wxGame.setPlayLimit(-1); + } + } wxGame.updateTenantInfo(getTenantInfo()); wxGameService.saveOrUpdate(wxGame); return new ResultData(); diff --git a/mallinkAdmin/src/main/resources/db/migration/V202012290001__wx_game.sql b/mallinkAdmin/src/main/resources/db/migration/V202012290001__wx_game.sql new file mode 100644 index 000000000..6b9a69505 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202012290001__wx_game.sql @@ -0,0 +1,3 @@ +ALTER TABLE `wx_game` +ADD COLUMN `play_credit_limit` int(11) NOT NULL DEFAULT -1 AFTER `award_limit`, +ADD COLUMN `play_credit` int(11) AFTER `play_credit_limit`; \ No newline at end of file diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index b485a006a..8bdd6397a 100755 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -961,6 +961,8 @@ public class WxUserGrantController extends BaseController { wxCreditHistory.setOperatorId(memberId); wxCreditHistoryService.saveOrUpdate(wxCreditHistory); wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record,tenantEntity); + + removeCacheCUser(); } return new ResultData(); } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxGame.java b/mallinkService/src/main/java/com/iformall/domain/po/WxGame.java index 6655dadde..a8a439d28 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxGame.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxGame.java @@ -34,9 +34,15 @@ public class WxGame extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发, 2:主页固定入口,3:购买触发,4:核销触发,5:公众号链接触发,6:二维码触发)", name = "triggleAction") private Integer triggleAction; - @io.swagger.annotations.ApiModelProperty(value = "限玩次数(0:不受限制,n:限玩次数)", name = "playLimit") + @io.swagger.annotations.ApiModelProperty(value = "限玩免费次数(-1:不能免费玩,0:不受限制,n:限玩次数)", name = "playLimit") private Integer playLimit; + @io.swagger.annotations.ApiModelProperty(value = "限玩积分次数(-1:不能积分玩法,0:不受限制,n:限玩次数)", name = "playCreditLimit") + private Integer playCreditLimit; + + @io.swagger.annotations.ApiModelProperty(value = "积分玩法消耗积分", name = "playCredit") + private Integer playCredit; + @io.swagger.annotations.ApiModelProperty(value = "限奖次数(0:不受限制,n:限奖次数)", name = "awardLimit") private Integer awardLimit; 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 8b9ae6cab..cf9a7c49b 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -280,7 +280,9 @@ public class WxGameServiceImpl implements WxGameService { Long couponId = obj.getLong("couponId"); int weight = obj.getIntValue("weight"); try { - saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); + if(couponId != null){ + saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); + } } catch (MallinkException e) { logger.error(e.getMessage()); }