|
@@ -42,8 +42,10 @@ import cn.com.qmth.examcloud.commons.web.security.enums.UacPolicy;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.controller.bean.FullUserInfo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.OrgRepo;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.RoleRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.UserRepo;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.Org;
|
|
|
+import cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.UserEntity;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.entity.UserRole;
|
|
|
import cn.com.qmth.examcloud.core.basic.dao.enums.UserType;
|
|
@@ -67,18 +69,28 @@ public class UserController extends ControllerSupport {
|
|
|
@Autowired
|
|
|
OrgRepo orgRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ RoleRepo roleRepo;
|
|
|
+
|
|
|
@ApiOperation(value = "查询所有用户", notes = "")
|
|
|
@GetMapping("/all/{curPage}/{pageSize}")
|
|
|
public PageInfo<FullUserInfo> getAllUser(@PathVariable Integer curPage,
|
|
|
@PathVariable Integer pageSize, @RequestParam Long orgId,
|
|
|
@RequestParam String loginName, @RequestParam String name, @RequestParam String enable,
|
|
|
- @RequestParam String roleCode, @RequestParam String type) {
|
|
|
+ @RequestParam Long roleId, @RequestParam String type) {
|
|
|
|
|
|
cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
|
if ((!isSuperAdmin()) && (!orgId.equals(accessUser.getRootOrgId()))) {
|
|
|
throw new StatusException("B-150001", "非法请求");
|
|
|
}
|
|
|
|
|
|
+ RoleEntity roleEntity = roleRepo.findOne(roleId);
|
|
|
+ if (null == roleEntity) {
|
|
|
+ throw new StatusException("B-150002", "角色不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ String roleCode = roleEntity.getCode();
|
|
|
+
|
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
"update_time");
|
|
|
|