|
|
|
@ -10,13 +10,13 @@ import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.FileContentTypeTool;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysRefRoleMenu;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysRefUserRole;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysRole;
|
|
|
|
|
import cn.estsh.i3plus.pojo.model.platform.SysRoleModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.*;
|
|
|
|
|
import cn.estsh.impp.framework.base.controller.CrudBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.base.service.ICrudService;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
@ -30,14 +30,11 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.BeanWrapper;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
import org.springframework.util.ObjectUtils;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.persistence.EntityManager;
|
|
|
|
@ -47,9 +44,7 @@ import java.io.DataInputStream;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.OutputStream;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -246,6 +241,43 @@ public class SysRoleController extends CrudBaseController<SysRole> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/queryRoleRefUser",consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
|
|
@ApiOperation(value = "查询角色及关联的人员信息", notes = "查询角色及关联的人员信息")
|
|
|
|
|
public BaseResultBean queryRoleRefUser(@RequestBody SysRoleModel sysRoleModel) {
|
|
|
|
|
try {
|
|
|
|
|
ListPager result = null;
|
|
|
|
|
SysRole sysRole = sysRoleModel.getSysRole();
|
|
|
|
|
Pager pager = sysRoleModel.getPager();
|
|
|
|
|
if (ObjectUtils.isEmpty(sysRole)){
|
|
|
|
|
sysRole = new SysRole();
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtils.isEmpty(pager)){
|
|
|
|
|
pager = new Pager();
|
|
|
|
|
}
|
|
|
|
|
List<SysRefUserRole> refList = personnelService.findSysRefUserRole(getSessionUser().getUser().getId());
|
|
|
|
|
if (refList != null && refList.size() > 0) {
|
|
|
|
|
List<Long> idList = new ArrayList<>(refList.size());
|
|
|
|
|
Map<Long, SysRefUserRole> refMap = new HashMap<>();
|
|
|
|
|
refList.forEach(ref -> {
|
|
|
|
|
idList.add(ref.getRoleId());
|
|
|
|
|
refMap.put(ref.getRoleId(), ref);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
result = sysRoleService.querySysRole(sysRole, idList, pager);
|
|
|
|
|
List<SysRole> roleList = result.getObjectList();
|
|
|
|
|
//过滤SysRefUserRole
|
|
|
|
|
|
|
|
|
|
List<Long> roleIdList = roleList.stream().map(el -> el.getId()).collect(Collectors.toList());
|
|
|
|
|
result = personnelService.findSysRefUserRoleByRoleIds(roleIdList,pager);
|
|
|
|
|
}
|
|
|
|
|
return ResultBean.success("操作成功").setListPager(result).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
|
return ResultBean.fail(busExcep);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改角色状态
|
|
|
|
|
*
|
|
|
|
|