| @@ -3,6 +3,7 @@ package com.iformall.controller.market; | |||||
| import com.alibaba.fastjson.JSONArray; | import com.alibaba.fastjson.JSONArray; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| @@ -54,6 +55,14 @@ public class WxGameController extends BaseController { | |||||
| if (StringUtils.isBlank(wxGame.getCouponIds())) { | if (StringUtils.isBlank(wxGame.getCouponIds())) { | ||||
| wxGame.setCouponIds(JSONArray.toJSONString(new String[0])); | 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.setStatus(EnumGameStatus.STATUS_THROW_IN.getCode()); | ||||
| wxGame.updateTenantInfo(getTenantInfo()); | wxGame.updateTenantInfo(getTenantInfo()); | ||||
| wxGameService.saveOrUpdate(wxGame); | wxGameService.saveOrUpdate(wxGame); | ||||
| @@ -68,6 +77,14 @@ public class WxGameController extends BaseController { | |||||
| if (StringUtils.isBlank(wxGame.getCouponIds())) { | if (StringUtils.isBlank(wxGame.getCouponIds())) { | ||||
| wxGame.setCouponIds(JSONArray.toJSONString(new String[0])); | 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()); | wxGame.updateTenantInfo(getTenantInfo()); | ||||
| wxGameService.saveOrUpdate(wxGame); | wxGameService.saveOrUpdate(wxGame); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -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`; | |||||
| @@ -961,6 +961,8 @@ public class WxUserGrantController extends BaseController { | |||||
| wxCreditHistory.setOperatorId(memberId); | wxCreditHistory.setOperatorId(memberId); | ||||
| wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | wxCreditHistoryService.saveOrUpdate(wxCreditHistory); | ||||
| wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record,tenantEntity); | wxCUserTagsService.triggerAssignTags(EnumAssignTagsTrigger.ASSIGN_TAGS_TRIGGER_IMPORT, record,tenantEntity); | ||||
| removeCacheCUser(); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -34,9 +34,15 @@ public class WxGame extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发, 2:主页固定入口,3:购买触发,4:核销触发,5:公众号链接触发,6:二维码触发)", name = "triggleAction") | @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发, 2:主页固定入口,3:购买触发,4:核销触发,5:公众号链接触发,6:二维码触发)", name = "triggleAction") | ||||
| private Integer 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; | 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") | @io.swagger.annotations.ApiModelProperty(value = "限奖次数(0:不受限制,n:限奖次数)", name = "awardLimit") | ||||
| private Integer awardLimit; | private Integer awardLimit; | ||||
| @@ -280,7 +280,9 @@ public class WxGameServiceImpl implements WxGameService { | |||||
| Long couponId = obj.getLong("couponId"); | Long couponId = obj.getLong("couponId"); | ||||
| int weight = obj.getIntValue("weight"); | int weight = obj.getIntValue("weight"); | ||||
| try { | try { | ||||
| saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); | |||||
| if(couponId != null){ | |||||
| saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); | |||||
| } | |||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| } | } | ||||