cuixq 4 سال پیش
والد
کامیت
a64ec973a2
1فایلهای تغییر یافته به همراه11 افزوده شده و 1 حذف شده
  1. 11 1
      src/main/java/com/minpay/shouhuo/GameSetupManageAction.java

+ 11 - 1
src/main/java/com/minpay/shouhuo/GameSetupManageAction.java

@@ -62,11 +62,13 @@ public class GameSetupManageAction implements IMINAction {
 			@MINParam(key = "name") String name,
 			MINHttpServletRequestContext fapRequest
 			) throws MINBusinessException {
-
+		User user = session.getUser();
+		String branch =user.getBranchId();
 		MINActionResult res = new MINActionResult();
 		VmGameRuleExample vmGameRuleExample = new VmGameRuleExample();
 		VmGameRuleExample.Criteria createCriteria = vmGameRuleExample.createCriteria();
 		createCriteria.andStateNotEqualTo("2");
+		createCriteria.andMechanismEqualTo(branch);
 		if(!StringUtils.isNullOrEmpty(name)){
 			createCriteria.andNameEqualTo(name);
 		}
@@ -104,6 +106,13 @@ public class GameSetupManageAction implements IMINAction {
 			MINSession session) throws MINBusinessException {
 		MINActionResult res = new MINActionResult();
 		User user = session.getUser();
+		String branch =user.getBranchId();
+		VmGameRuleExample vmGameRuleExample = new VmGameRuleExample();
+		vmGameRuleExample.createCriteria().andTypeEqualTo(type).andStateEqualTo("0").andMechanismEqualTo(branch);
+		List<VmGameRule> ls = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmGameRuleMapper.class).selectByExample(vmGameRuleExample);
+		if (ls.size()>0){
+			throw new MINBusinessException("当前类型已存在");
+		}
 		if(!Constant.ADMINISTRATION_SYSTEM_NUMBER.equals(user.getBranchId())){
 			throw new MINBusinessException("此用户没有权限,此操作");
 		}
@@ -139,6 +148,7 @@ public class GameSetupManageAction implements IMINAction {
 		vmGameRule.setAlipayid(alipayid);
 		vmGameRule.setCreateUser(user.getId());
 		vmGameRule.setType(type);
+		vmGameRule.setMechanism(branch);
 		Service.lookup(IMINDataBaseService.class).insertSelective(VmGameRuleMapper.class, vmGameRule);
 		String logInfo = user.getName()+"-添加游戏规则:" + id;
 		Service.lookup(ILogService.class).logging(session, logInfo);