feat:android机器硬件管理接口
This commit is contained in:
1 parent
f922ddf09b
commit
d1db95452e
46 files changed
+1440
-316
No files matched your search
+33
-21
@@ -37,27 +37,39 @@ import java.util.Map;
|
||||
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
|
||||
public interface RemoteDeptService {
|
||||
|
||||
/**
|
||||
* 获取所有部门接口
|
||||
* @param parentDeptId 父部门ID
|
||||
* @return R 返回结果对象,包含所有部门信息列表
|
||||
*/
|
||||
@GetMapping("/dept/list")
|
||||
R<List<SysDept>> getAllDept(@RequestParam("parentDeptId") Long parentDeptId);
|
||||
/**
|
||||
* 获取所有部门接口
|
||||
*
|
||||
* @param parentDeptId 父部门ID
|
||||
* @return R 返回结果对象,包含所有部门信息列表
|
||||
*/
|
||||
@GetMapping("/dept/list")
|
||||
R<List<SysDept>> getAllDept(@RequestParam("parentDeptId") Long parentDeptId);
|
||||
|
||||
/**
|
||||
* 通过部门ID获取负责人列表
|
||||
* @param deptId 部门ID
|
||||
* @return 负责人ID列表
|
||||
*/
|
||||
@GetMapping("/dept/leader/{deptId}")
|
||||
R<List<Long>> getAllDeptLeader(@PathVariable("deptId") Long deptId);
|
||||
/**
|
||||
* 通过部门ID获取负责人列表
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @return 负责人ID列表
|
||||
*/
|
||||
@GetMapping("/dept/leader/{deptId}")
|
||||
R<List<Long>> getAllDeptLeader(@PathVariable("deptId") Long deptId);
|
||||
|
||||
/**
|
||||
* 根据部门id集合查询
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/dept/getDeptListByDeptIds")
|
||||
R<Map<Long, SysDept>> getDeptByDeptIds(@RequestParam("deptIds")List<Long> deptIds);
|
||||
/**
|
||||
* 根据部门id集合查询
|
||||
*
|
||||
* @param deptIds
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/dept/getDeptListByDeptIds")
|
||||
R<Map<Long, SysDept>> getDeptByDeptIds(@RequestParam("deptIds") List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 根据部门id查询
|
||||
*
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/dept/getDeptListByDeptId")
|
||||
R<SysDept> getDeptByDeptId(@RequestParam("deptId") Long deptId);
|
||||
}
|
||||
+127
-113
@@ -54,132 +54,146 @@ import java.util.Map;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysDeptController {
|
||||
|
||||
private final SysDeptService sysDeptService;
|
||||
private final SysDeptService sysDeptService;
|
||||
|
||||
/**
|
||||
* 通过ID查询
|
||||
* @param id ID
|
||||
* @return SysDept
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.getById(id));
|
||||
}
|
||||
/**
|
||||
* 通过ID查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return SysDept
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部部门
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(sysDeptService.list());
|
||||
}
|
||||
/**
|
||||
* 查询全部部门
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(sysDeptService.list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回树形菜单集合
|
||||
* @param deptName 部门名称
|
||||
* @return 树形菜单
|
||||
*/
|
||||
@GetMapping(value = "/tree")
|
||||
public R getTree(String deptName, Long parentId) {
|
||||
return R.ok(sysDeptService.selectTree(deptName, parentId));
|
||||
}
|
||||
/**
|
||||
* 返回树形菜单集合
|
||||
*
|
||||
* @param deptName 部门名称
|
||||
* @return 树形菜单
|
||||
*/
|
||||
@GetMapping(value = "/tree")
|
||||
public R getTree(String deptName, Long parentId) {
|
||||
return R.ok(sysDeptService.selectTree(deptName, parentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("添加部门")
|
||||
@PostMapping
|
||||
@HasPermission("sys_dept_add")
|
||||
public R save(@Valid @RequestBody SysDept sysDept) {
|
||||
return R.ok(sysDeptService.save(sysDept));
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("添加部门")
|
||||
@PostMapping
|
||||
@HasPermission("sys_dept_add")
|
||||
public R save(@Valid @RequestBody SysDept sysDept) {
|
||||
return R.ok(sysDeptService.save(sysDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param id ID
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除部门")
|
||||
@DeleteMapping("/{id}")
|
||||
@HasPermission("sys_dept_del")
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.removeDeptById(id));
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id ID
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("删除部门")
|
||||
@DeleteMapping("/{id}")
|
||||
@HasPermission("sys_dept_del")
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return R.ok(sysDeptService.removeDeptById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("编辑部门")
|
||||
@PutMapping
|
||||
@HasPermission("sys_dept_edit")
|
||||
public R update(@Valid @RequestBody SysDept sysDept) {
|
||||
sysDept.setUpdateTime(LocalDateTime.now());
|
||||
return R.ok(sysDeptService.updateById(sysDept));
|
||||
}
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sysDept 实体
|
||||
* @return success/false
|
||||
*/
|
||||
@SysLog("编辑部门")
|
||||
@PutMapping
|
||||
@HasPermission("sys_dept_edit")
|
||||
public R update(@Valid @RequestBody SysDept sysDept) {
|
||||
sysDept.setUpdateTime(LocalDateTime.now());
|
||||
return R.ok(sysDeptService.updateById(sysDept));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查收子级列表
|
||||
* @return 返回子级
|
||||
*/
|
||||
@GetMapping(value = "/getDescendantList/{deptId}")
|
||||
public R getDescendantList(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDescendant(deptId));
|
||||
}
|
||||
/**
|
||||
* 查收子级列表
|
||||
*
|
||||
* @return 返回子级
|
||||
*/
|
||||
@GetMapping(value = "/getDescendantList/{deptId}")
|
||||
public R getDescendantList(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDescendant(deptId));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/leader/{deptId}")
|
||||
public R getAllDeptLeader(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDeptLeader(deptId));
|
||||
}
|
||||
@GetMapping(value = "/leader/{deptId}")
|
||||
public R getAllDeptLeader(@PathVariable Long deptId) {
|
||||
return R.ok(sysDeptService.listDeptLeader(deptId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出部门
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<DeptExcelVO> export() {
|
||||
return sysDeptService.listExcelVo();
|
||||
}
|
||||
/**
|
||||
* 导出部门
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
public List<DeptExcelVO> export() {
|
||||
return sysDeptService.listExcelVo();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入部门
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("import")
|
||||
public R importDept(@RequestExcel List<DeptExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return sysDeptService.importDept(excelVOList, bindingResult);
|
||||
}
|
||||
/**
|
||||
* 导入部门
|
||||
*
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("import")
|
||||
public R importDept(@RequestExcel List<DeptExcelVO> excelVOList, BindingResult bindingResult) {
|
||||
return sysDeptService.importDept(excelVOList, bindingResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部部门包含用户
|
||||
* @param parentDeptId 父部门ID
|
||||
* @param type 查询类型
|
||||
*/
|
||||
@GetMapping("/org")
|
||||
public R listOrgTree(Long parentDeptId, String type) {
|
||||
return R.ok(sysDeptService.listOrgTree(parentDeptId, type));
|
||||
}
|
||||
/**
|
||||
* 查询全部部门包含用户
|
||||
*
|
||||
* @param parentDeptId 父部门ID
|
||||
* @param type 查询类型
|
||||
*/
|
||||
@GetMapping("/org")
|
||||
public R listOrgTree(Long parentDeptId, String type) {
|
||||
return R.ok(sysDeptService.listOrgTree(parentDeptId, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 模糊搜索用户
|
||||
* @param username 用户名/拼音/首字母
|
||||
* @return 匹配到的用户
|
||||
*/
|
||||
@GetMapping("/org/user/search")
|
||||
public R getOrgTreeUser(@RequestParam String username) {
|
||||
return R.ok(sysDeptService.getOrgTreeUser(username));
|
||||
}
|
||||
/**
|
||||
* 模糊搜索用户
|
||||
*
|
||||
* @param username 用户名/拼音/首字母
|
||||
* @return 匹配到的用户
|
||||
*/
|
||||
@GetMapping("/org/user/search")
|
||||
public R getOrgTreeUser(@RequestParam String username) {
|
||||
return R.ok(sysDeptService.getOrgTreeUser(username));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDeptListByDeptIds")
|
||||
public R<Map<Long,SysDept>> getDeptListByDeptIds(@RequestParam("deptIds") List<Long> deptIds) {
|
||||
@GetMapping("/getDeptListByDeptIds")
|
||||
public R<Map<Long, SysDept>> getDeptListByDeptIds(@RequestParam("deptIds") List<Long> deptIds) {
|
||||
return R.ok(sysDeptService.getDeptListByDeptIds(deptIds));
|
||||
}
|
||||
|
||||
return R.ok(sysDeptService.getDeptListByDeptIds(deptIds));
|
||||
}
|
||||
@GetMapping("/getDeptListByDeptId")
|
||||
public R<SysDept> getDeptByDeptId(@RequestParam("deptId") Long deptId) {
|
||||
return R.ok(sysDeptService.getById(deptId));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user