DepartmentDictController.java
3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.dto.department.GetDepartmentMembersDTO;
import com.subsidy.model.DepartmentDictDO;
import com.subsidy.service.DepartmentDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 部门字典表 前端控制器
* </p>
*
* @author Tuyp
* @since 2024-01-11
*/
@RestController
@Api(tags = "部门字典表")
@RequestMapping("/departmentDict")
public class DepartmentDictController {
@Autowired
private DepartmentDictService departmentDictService;
@PostMapping("getDepartments")
@ApiOperation("获取所有部门 companyId 企业id")
@LoginRequired
public ResponseVO getDepartments(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartments(departmentDictDO));
}
@PostMapping("addDepartment")
@ApiOperation("添加部门 companyId departmentName leaderName parentId 父节点")
@LoginRequired
public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO));
}
@PostMapping("deleteDepartment")
@ApiOperation("删除部门 id")
@LoginRequired
public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO));
}
@PostMapping("updateDepartment")
@ApiOperation("编辑部门 id companyId fullName departmentName leaderName parentId")
@LoginRequired
public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){
return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO));
}
@PostMapping("getDepartmentMembers")
@ApiOperation("获取部门成员 companyId 公司id departmentId 部门id userName startDate endDate")
@LoginRequired
public ResponseVO getDepartmentMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartmentMembers(getDepartmentMembersDTO));
}
@PostMapping("getMembers")
@ApiOperation("获取成员(树) companyId 公司id startDate endDate ")
// @LoginRequired
public ResponseVO getMembers(@RequestBody GetDepartmentMembersDTO getDepartmentMembersDTO){
return ResponseData.generateCreatedResponse(0,departmentDictService.getMembers(getDepartmentMembersDTO));
}
}