ke
2024-07-19 08a962d2925baa255207fdf979e6fee794f1773b
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
package cn.gistack.sm.sg.controller;
 
import cn.gistack.sm.sg.DO.SgGxRoleDO;
import cn.gistack.sm.sg.DO.SgGxStepDO;
import cn.gistack.sm.sg.DTO.ProjectSearchDTO;
import cn.gistack.sm.sg.VO.SgGxRoleVO;
import cn.gistack.sm.sg.VO.SgGxVO;
import cn.gistack.sm.sg.service.SgGxStepService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Arrays;
import java.util.List;
 
/**
 * <p>
 * 施工工序步骤表 前端控制器
 * </p>
 *
 * @author shenyijian
 * @since 2024-06-13 15:46:18
 */
@RestController
@RequestMapping("/sg_gx_step")
public class SgGxStepController extends BladeController {
    @Autowired
    private SgGxStepService sgGxStepService;
 
    /**
     * 新增工序步骤
     */
    @PostMapping(value = "/add")
    public R add(@RequestBody SgGxStepDO sgGxStepDO) {
        sgGxStepService.add(sgGxStepDO);
        return R.success("添加成功");
    }
 
    /**
     * 修改工序步骤
     */
    @PostMapping(value = "/update")
    public R update(@RequestBody SgGxStepDO sgGxStepDO) {
        sgGxStepService.updateOne(sgGxStepDO);
        return R.success("修改成功");
    }
 
    /**
     * 删除工序步骤
     */
    @GetMapping(value = "/delete")
    public R delete(String id) {
        sgGxStepService.delete(id);
        return R.success("删除成功");
    }
 
    /**
     * 分页
     */
    @GetMapping(value = "/page")
    public R queryPageList(ProjectSearchDTO searchDTO, Query query) {
        IPage<SgGxStepDO> page = sgGxStepService.queryPageList(Condition.getPage(query), searchDTO);
        return R.data(page);
    }
 
    @GetMapping(value = "/sg_list")
    public R sgGxStepList() {
        List<SgGxStepDO> sgGxStepDOS = sgGxStepService.sgGxStepList();
        return R.data(sgGxStepDOS);
    }
 
    /**
     * 详情
     */
    @GetMapping(value = "/detail")
    public R queryPageList(String id) {
        return R.data(sgGxStepService.getById(id));
    }
 
    /**
     * 新增工序角色配置记录
     * @param SgGxRoleVO
     * @return
     */
    @PostMapping(value = "/addSgGxRole")
    public R addSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) {
 
        sgGxStepService.insertSgGxRole(SgGxRoleVO);
        return R.success("添加成功");
    }
    /**
     * 更新工序角色配置记录
     * @param SgGxRoleVO
     * @return
     */
    @PostMapping(value = "/updateSgGxRole")
    public R updateSgGxRole(@RequestBody SgGxRoleVO SgGxRoleVO) {
 
        sgGxStepService.updateSgGxRole(SgGxRoleVO);
        return R.success("修改成功");
    }
 
    @GetMapping(value = "/getSgGxRoles")
    public R getSgGxRoles(String gxDeviceType,String gxStepId) {
        List<String> roleIds=sgGxStepService.getSgGxRoles(gxDeviceType,gxStepId);
        return R.data(roleIds);
    }
}