|
@@ -1,24 +1,28 @@
|
|
|
package com.qmth.sop.server.api;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.sop.business.bean.dto.OrgDto;
|
|
|
+import com.qmth.sop.business.bean.dto.OrgDtoNotTree;
|
|
|
+import com.qmth.sop.business.bean.dto.RoleDto;
|
|
|
+import com.qmth.sop.business.bean.dto.UserDto;
|
|
|
import com.qmth.sop.business.bean.params.LoginParam;
|
|
|
import com.qmth.sop.business.bean.result.EditResult;
|
|
|
import com.qmth.sop.business.bean.result.LoginResult;
|
|
|
import com.qmth.sop.business.bean.result.MenuResult;
|
|
|
import com.qmth.sop.business.cache.CommonCacheService;
|
|
|
-import com.qmth.sop.business.entity.BasicAttachment;
|
|
|
-import com.qmth.sop.business.entity.SysConfig;
|
|
|
-import com.qmth.sop.business.entity.SysUser;
|
|
|
-import com.qmth.sop.business.entity.TBTask;
|
|
|
+import com.qmth.sop.business.entity.*;
|
|
|
import com.qmth.sop.business.service.*;
|
|
|
import com.qmth.sop.business.util.ImportExportUtil;
|
|
|
import com.qmth.sop.common.contant.SystemConstant;
|
|
|
import com.qmth.sop.common.enums.*;
|
|
|
+import com.qmth.sop.common.util.GsonUtil;
|
|
|
import com.qmth.sop.common.util.Result;
|
|
|
import com.qmth.sop.common.util.ResultUtil;
|
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
@@ -81,6 +85,9 @@ public class SysController {
|
|
|
@Resource
|
|
|
SysOrgService sysOrgService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ SysRoleService sysRoleService;
|
|
|
+
|
|
|
@ApiOperation(value = "登录")
|
|
|
@RequestMapping(value = "/login", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = LoginResult.class)})
|
|
@@ -257,4 +264,29 @@ public class SysController {
|
|
|
public Result getOrgUserList() {
|
|
|
return ResultUtil.ok(sysOrgService.listOrgTree(true));
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取所有角色")
|
|
|
+ @RequestMapping(value = "/get_role_list", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = RoleDto.class)})
|
|
|
+ public Result getRoleList() {
|
|
|
+ return ResultUtil.ok(sysRoleService.listRolesByUserId(null));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取所有用户")
|
|
|
+ @RequestMapping(value = "/get_user_list", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = UserDto.class)})
|
|
|
+ public Result getUserList() {
|
|
|
+ IPage<UserDto> userDtoIPage = sysUserService.query(new Page<>(SystemConstant.PAGE_NUMBER_MIN, SystemConstant.PAGE_SIZE_MAX_SELECT), null, null, null, null);
|
|
|
+ return ResultUtil.ok(userDtoIPage.getRecords());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取所有机构")
|
|
|
+ @RequestMapping(value = "/get_org_list", method = RequestMethod.POST)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = UserDto.class)})
|
|
|
+ public Result getOrgList() {
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.list();
|
|
|
+ List<OrgDtoNotTree> orgDtoNotTreeList = GsonUtil.fromJson(GsonUtil.toJson(sysOrgList), new TypeToken<List<OrgDtoNotTree>>() {
|
|
|
+ }.getType());
|
|
|
+ return ResultUtil.ok(orgDtoNotTreeList);
|
|
|
+ }
|
|
|
}
|