ConstructionTeamController.java
2.59 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
package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import vion.dto.ConstructionTeamDTO;
import vion.dto.RContractTeamDTO;
import vion.service.IConstructionTeamService;
import vion.vo.ConstructionTeamVO;
import vion.vo.RContractTeamVO;
/**
* 施工队管理
*/
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class ConstructionTeamController {
private final IConstructionTeamService constructionTeamService;
@GetMapping("/constructionTeam")
@SaCheckPermission(value = "constructionTeam:list", orRole = "admin")
public Page<ConstructionTeamVO> list(ConstructionTeamDTO dto) {
return constructionTeamService.list(dto);
}
@GetMapping("/constructionTeam/{id}")
@SaCheckPermission(value = "constructionTeam:query", orRole = "admin")
public ConstructionTeamVO getVOById(@PathVariable Long id) {
return constructionTeamService.getVOById(id);
}
@PostMapping("/constructionTeam")
@SaCheckPermission(value = "constructionTeam:save", orRole = "admin")
public Object save(@RequestBody ConstructionTeamDTO dto) {
return constructionTeamService.save(dto);
}
@PostMapping("/constructionTeam/{id}")
@SaCheckPermission(value = "constructionTeam:edit", orRole = "admin")
public String update(@PathVariable Long id, @RequestBody ConstructionTeamDTO dto) {
dto.setId(id);
return constructionTeamService.updateById(dto);
}
@DeleteMapping("/constructionTeam/{id}")
@SaCheckPermission(value = "constructionTeam:remove", orRole = "admin")
public String delById(@PathVariable Long id) {
return constructionTeamService.removeById(id) ? "删除成功" : "删除失败";
}
@GetMapping("/contractTeam")
@SaCheckPermission(value = "contract:team:list", orRole = "admin")
public Page<RContractTeamVO> list(RContractTeamDTO dto) {
return constructionTeamService.list(dto);
}
@PostMapping("/contractTeam/{id}")
@SaCheckPermission(value = "contract:team:assign", orRole = "admin")
public String assignTeam(@PathVariable Long id, @RequestBody RContractTeamDTO dto) {
dto.setId(id);
return constructionTeamService.assignTeam(dto);
}
@DeleteMapping("/contractTeam/{id}")
@SaCheckPermission(value = "contract:team:remove", orRole = "admin")
public String delContractTeamById(@PathVariable Long id) {
return constructionTeamService.delContractTeamById(id);
}
}