|
@@ -66,6 +66,7 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
VmGameRuleExample vmGameRuleExample = new VmGameRuleExample();
|
|
|
VmGameRuleExample.Criteria createCriteria = vmGameRuleExample.createCriteria();
|
|
|
+ createCriteria.andStateNotEqualTo("2");
|
|
|
if(!StringUtils.isNullOrEmpty(name)){
|
|
|
createCriteria.andNameEqualTo(name);
|
|
|
}
|
|
@@ -93,7 +94,7 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
public MINActionResult addGameSetup(
|
|
|
@MINParam(key = "name") String name,
|
|
|
@MINParam(key = "desc") String desc,
|
|
|
- @MINParam(key = "alipayId") String alipayId,
|
|
|
+ @MINParam(key = "alipayid") String alipayid,
|
|
|
@MINParam(key = "type") String type,
|
|
|
@MINParam(key = "rewardGrade") String rewardGrade,
|
|
|
@MINParam(key = "rewardAmtRatio") String rewardAmtRatio,
|
|
@@ -135,7 +136,7 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
vmGameRule.setName(name);
|
|
|
vmGameRule.setDesc(desc);
|
|
|
vmGameRule.setCreateTime(time);
|
|
|
- vmGameRule.setAlipayid(alipayId);
|
|
|
+ vmGameRule.setAlipayid(alipayid);
|
|
|
vmGameRule.setCreateUser(user.getId());
|
|
|
vmGameRule.setType(type);
|
|
|
Service.lookup(IMINDataBaseService.class).insertSelective(VmGameRuleMapper.class, vmGameRule);
|
|
@@ -157,7 +158,6 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
* @param id
|
|
|
* @param name
|
|
|
* @param desc
|
|
|
- * @param alipayId
|
|
|
* @param session
|
|
|
* @return
|
|
|
* @throws MINBusinessException
|
|
@@ -167,16 +167,37 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
@MINParam(key = "id") String id,
|
|
|
@MINParam(key = "name") String name,
|
|
|
@MINParam(key = "desc") String desc,
|
|
|
- @MINParam(key = "alipayId") String alipayId,
|
|
|
+ @MINParam(key = "alipayid") String alipayid,
|
|
|
+ @MINParam(key = "rewardGrade") String rewardGrade,
|
|
|
+ @MINParam(key = "rewardAmtRatio") String rewardAmtRatio,
|
|
|
+ @MINParam(key = "rewardType") String rewardType,
|
|
|
+ @MINParam(key = "jackpotAmt") String jackpotAmt,
|
|
|
+ @MINParam(key = "extractRatio") String extractRatio,
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
User user = session.getUser();
|
|
|
+ if(!Constant.ADMINISTRATION_SYSTEM_NUMBER.equals(user.getBranchId())){
|
|
|
+ throw new MINBusinessException("此用户没有权限,此操作");
|
|
|
+ }
|
|
|
VmGameRule vmGameRule = new VmGameRule();
|
|
|
- vmGameRule.setId(id);
|
|
|
+ vmGameRule.setRewardGrade(rewardGrade);
|
|
|
+ vmGameRule.setRewardAmtRatio(rewardAmtRatio);
|
|
|
vmGameRule.setName(name);
|
|
|
vmGameRule.setDesc(desc);
|
|
|
- vmGameRule.setAlipayid(alipayId);
|
|
|
+ vmGameRule.setAlipayid(alipayid);
|
|
|
+ if("0".equals(rewardType)){
|
|
|
+ if(StringUtils.isNullOrEmpty(jackpotAmt)){
|
|
|
+ throw new MINBusinessException("奖池金额不能为空");
|
|
|
+ }
|
|
|
+ vmGameRule.setJackpotAmt(jackpotAmt);
|
|
|
+
|
|
|
+ }else if("1".equals(rewardType)){
|
|
|
+ if(StringUtils.isNullOrEmpty(extractRatio)){
|
|
|
+ throw new MINBusinessException("抽取比例不能为空");
|
|
|
+ }
|
|
|
+ vmGameRule.setExtractRatio(extractRatio);
|
|
|
+ }
|
|
|
Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(VmGameRuleMapper.class, vmGameRule);
|
|
|
String logInfo = user.getName()+"-编辑游戏规则:" + id;
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);
|
|
@@ -202,21 +223,23 @@ public class GameSetupManageAction implements IMINAction {
|
|
|
@MINAction(value = DELETE_GAME_SETUP, transaction = IMINTransactionEnum.CMT)
|
|
|
public MINActionResult deleteGameSetup(
|
|
|
@MINParam(key = "id") String id,
|
|
|
+ @MINParam(key = "state") String state,
|
|
|
MINSession session
|
|
|
) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
User user = session.getUser();
|
|
|
VmGameRule vmGameRule = new VmGameRule();
|
|
|
vmGameRule.setId(id);
|
|
|
- vmGameRule.setState("1");
|
|
|
+ vmGameRule.setState(state);
|
|
|
Service.lookup(IMINDataBaseService.class).updateByPrimaryKeySelective(VmGameRuleMapper.class, vmGameRule);
|
|
|
- String logInfo = user.getName()+"-删除游戏规则:" + id;
|
|
|
+ String logInfo = user.getName()+"-编辑游戏规则状态:" + id+"状态:"+state;
|
|
|
Service.lookup(ILogService.class).logging(session, logInfo);
|
|
|
return res;
|
|
|
}
|
|
|
@MINValidator(value = DELETE_GAME_SETUP)
|
|
|
public MINActionResult deleteGameSetupValidator(
|
|
|
@MINParam(key = "id",regex = RegexUtil.NOT_NULL, error = "数据异常") String id,
|
|
|
+ @MINParam(key = "state",regex = RegexUtil.NOT_NULL, error = "数据异常") String state,
|
|
|
MINSession session) throws MINBusinessException {
|
|
|
MINActionResult res = new MINActionResult();
|
|
|
return res;
|