|
@@ -1,16 +1,6 @@
|
|
|
package com.minpay.huicai.system.action;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.Comparator;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-
|
|
|
+import com.min.util.CommonUtil;
|
|
|
import com.minpay.common.bean.User;
|
|
|
import com.minpay.common.constant.Constant;
|
|
|
import com.minpay.common.constant.IConstant;
|
|
@@ -18,25 +8,8 @@ import com.minpay.common.exception.BusinessCodeException;
|
|
|
import com.minpay.common.format.IFormatService;
|
|
|
import com.minpay.common.service.ILogService;
|
|
|
import com.minpay.common.service.IPublicService;
|
|
|
-import com.minpay.db.table.mapper.ImBranchMapper;
|
|
|
-import com.minpay.db.table.mapper.ImItemMapper;
|
|
|
-import com.minpay.db.table.mapper.ImRoleAuthMapper;
|
|
|
-import com.minpay.db.table.mapper.ImRoleItemRelMapper;
|
|
|
-import com.minpay.db.table.mapper.ImRoleMapper;
|
|
|
-import com.minpay.db.table.mapper.ImUserRoleRelMapper;
|
|
|
-import com.minpay.db.table.model.ImBranch;
|
|
|
-import com.minpay.db.table.model.ImBranchExample;
|
|
|
-import com.minpay.db.table.model.ImItem;
|
|
|
-import com.minpay.db.table.model.ImItemExample;
|
|
|
-import com.minpay.db.table.model.ImRole;
|
|
|
-import com.minpay.db.table.model.ImRoleAuthExample;
|
|
|
-import com.minpay.db.table.model.ImRoleAuthKey;
|
|
|
-import com.minpay.db.table.model.ImRoleExample;
|
|
|
-import com.minpay.db.table.model.ImRoleItemRel;
|
|
|
-import com.minpay.db.table.model.ImRoleItemRelExample;
|
|
|
-import com.minpay.db.table.model.ImRoleItemRelKey;
|
|
|
-import com.minpay.db.table.model.ImUserRoleRelExample;
|
|
|
-import com.minpay.db.table.model.ImUserRoleRelKey;
|
|
|
+import com.minpay.db.table.mapper.*;
|
|
|
+import com.minpay.db.table.model.*;
|
|
|
import com.minpay.db.table.own.mapper.RoleMapper;
|
|
|
import com.startup.minpay.frame.business.IMINAction;
|
|
|
import com.startup.minpay.frame.business.res.MINActionResult;
|
|
@@ -54,6 +27,8 @@ import com.startup.minpay.frame.target.MINParam;
|
|
|
import com.startup.minpay.util.DateTime;
|
|
|
import com.startup.minpay.util.Str;
|
|
|
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
/**
|
|
|
* 角色管理
|
|
|
*
|
|
@@ -290,6 +265,7 @@ public class RoleManageAction implements IMINAction {
|
|
|
@MINParam(key = "name") String name, @MINParam(key = "desc") String desc,
|
|
|
@MINParam(key = "itemidStr") String itemidStr, @MINParam(key = "authInputs") String authInputs,
|
|
|
@MINParam(key = "moduleType") String[] moduleType, @MINParam(key = "roleMainPage") String roleMainPage,
|
|
|
+ @MINParam(key = "branchid") String branchid,
|
|
|
MINSession session) throws MINBusinessException {
|
|
|
if ("".equals(name.trim()) || name == null) {
|
|
|
throw new MINBusinessException("请输入角色名称!");
|
|
@@ -330,8 +306,8 @@ public class RoleManageAction implements IMINAction {
|
|
|
role.setId(roleId);
|
|
|
role.setName(name);
|
|
|
role.setDesc(desc);
|
|
|
- role.setBranchid(u.getBranchId());
|
|
|
- role.setAddbranch(u.getBranchId());
|
|
|
+ role.setBranchid(branchid);
|
|
|
+ role.setAddbranch(branchid);
|
|
|
role.setAddtime(new DateTime().toDateTimeString());
|
|
|
//role.setIndexpage(roleMainPage);
|
|
|
role.setIndexpage("main.html");
|
|
@@ -635,7 +611,11 @@ public class RoleManageAction implements IMINAction {
|
|
|
ImRoleExample example = new ImRoleExample();
|
|
|
ImRoleExample.Criteria criteria = example.createCriteria();
|
|
|
User user = session.getUser();
|
|
|
- criteria.andBranchidEqualTo(user.getBranchId());
|
|
|
+ if(CommonUtil.isEmpty(branchId)){
|
|
|
+ criteria.andBranchidEqualTo(user.getBranchId());
|
|
|
+ }else{
|
|
|
+ criteria.andBranchidEqualTo(branchId);
|
|
|
+ }
|
|
|
List<ImRole> ls = Service.lookup(IMINDataBaseService.class).selectByExample(ImRoleMapper.class, example);
|
|
|
res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
|
|
|
return res;
|
|
@@ -860,6 +840,14 @@ public class RoleManageAction implements IMINAction {
|
|
|
criteria.andIdEqualTo(user.getBranchId());
|
|
|
}
|
|
|
List<ImBranch> ls = Service.lookup(IMINDataBaseService.class).selectByExample(ImBranchMapper.class, example);
|
|
|
+ ImBranchExample exampleb = new ImBranchExample();
|
|
|
+ ImBranchExample.Criteria criteriab = exampleb.createCriteria();
|
|
|
+ criteria.andSttNotEqualTo(Constant.DEPT_STT_DEL);
|
|
|
+ if(!user.getBranchId().equals(Constant.DEFAULT_INSTITUTIONS)){
|
|
|
+ criteriab.andParentidEqualTo(user.getBranchId());
|
|
|
+ }
|
|
|
+ List<ImBranch> lsb = Service.lookup(IMINDataBaseService.class).selectByExample(ImBranchMapper.class, exampleb);
|
|
|
+ ls.addAll(lsb);
|
|
|
res.set(IMINBusinessConstant.F_QUERY_RESULT, ls);
|
|
|
return res;
|
|
|
}
|