yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
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
package com.qianwen.smartman.modules.cps.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.validation.Valid;
import com.qianwen.core.boot.ctrl.BladeController;
import com.qianwen.core.scanner.modular.annotation.DeleteResource;
import com.qianwen.core.scanner.modular.annotation.GetResource;
import com.qianwen.core.scanner.modular.annotation.PostResource;
import com.qianwen.core.scanner.modular.annotation.PutResource;
import com.qianwen.core.scanner.modular.stereotype.ApiResource;
import com.qianwen.core.secure.annotation.PreAuth;
import com.qianwen.core.tenant.annotation.NonDS;
import com.qianwen.core.tool.api.R;
import com.qianwen.smartman.modules.cps.dto.WorkstationWcsDTO;
import com.qianwen.smartman.modules.cps.service.IMachineService;
import com.qianwen.smartman.modules.cps.service.IWorkstationWcsService;
import com.qianwen.smartman.modules.cps.vo.WorkstationWcsSaveNewVO;
import com.qianwen.smartman.modules.cps.vo.WorkstationWcsSaveVO;
import com.qianwen.smartman.modules.cps.vo.WorkstationWcsVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
@Api(value = "工位工况参数", tags = {"工位工况参数"})
@RestController
@ApiResource({"smis/workstation-wcs"})
@NonDS
@Validated
public class WorkstationWcsController extends BladeController {
    private final IWorkstationWcsService workstationWcsService;
    private final IMachineService machineService;
 
    public WorkstationWcsController(final IWorkstationWcsService workstationWcsService, final IMachineService machineService) {
        this.workstationWcsService = workstationWcsService;
        this.machineService = machineService;
    }
 
    /**
     * 就是工位界面 配置工位采集 保存的,这个应该不要了,我们改为数据点配置了
     * @param workstationWcsSaveVOList
     * @return
     */
    //20241021 yangys注释
    /*
    @PreAuth
    @PostResource({"/save"})
    @ApiOperation("新增或更改工况参数信息")
    public R<List<WorkstationWcsVO>> save(@Valid @RequestBody List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
        return R.data(this.workstationWcsService.insert(workstationWcsSaveVOList));
    }
 
    @PreAuth
    @PostResource({"/save/setting"})
    @ApiOperation("新增工位采集模板")
    public R<List<WorkstationWcsVO>> saveSetting(@Valid @RequestBody List<WorkstationWcsSaveVO> workstationWcsSaveVOList) {
        return R.data(this.workstationWcsService.saveSetting(workstationWcsSaveVOList));
    }
 
    @PreAuth
    @PutResource({"/update"})
    @ApiOperation("更新工位采集模板")
    public R<WorkstationWcsVO> update(@Valid @RequestBody WorkstationWcsSaveVO workstationWcsSaveVO) {
        return R.data(this.workstationWcsService.updateSetting(workstationWcsSaveVO));
    }
 
    @PreAuth
    @PostResource({"/batchSave"})
    @ApiOperation("批量编辑工位参数信息")
    public R<List<WorkstationWcsVO>> batchSave(@Valid @RequestBody List<WorkstationWcsSaveNewVO> workstationWcsSaveNewVOList, @RequestParam List<Long> workstationIdList) {
        return R.data(this.workstationWcsService.insertNew(workstationWcsSaveNewVOList, workstationIdList));
    }
 
    @PostResource({"/isExists"})
    @ApiOperation("是否工况参数已存在 工位名称(逗号隔开)-已存在 空-不存在")
    public R<String> isExists(@Valid @RequestBody List<WorkstationWcsSaveNewVO> workstationWcsSaveNewVOList, @RequestParam List<Long> workstationIdList) {
        return R.data(this.workstationWcsService.isExists(workstationWcsSaveNewVOList, workstationIdList));
    }
 
    @PreAuth
    @DeleteResource({""})
    @ApiOperation("删除工况参数信息")
    public R<Boolean> deleteByWorkstationIdList(@RequestBody List<Long> workstationWcsIdList) {
        return R.data(this.workstationWcsService.delete(workstationWcsIdList));
    }
 
    @PreAuth
    @GetResource({"/getWcsByMachineId"})
    @ApiOperation("根据机器id查询工况参数")
    public R<List<WorkstationWcsDTO>> get(Long machineId) {
        return R.data(this.machineService.getWorkstationWcsByMachineId(machineId, ""));
    }
 
    @PreAuth
    @GetResource({"/getWcsByWorkstationId"})
    @ApiOperation("根据工位id查询工况参数")
    public R<List<WorkstationWcsVO>> listByWorkstationId(Long workstationId) {
        return R.data(this.workstationWcsService.listWorkstationWcsByWorkstationId(workstationId));
    }
 
    @PreAuth
    @GetResource({"/listWcsSetting"})
    @ApiOperation("列表查询工况参数设置")
    public R<List<WorkstationWcsVO>> listWcsSetting() {
        return R.data(this.workstationWcsService.listWcsSetting());
    }
    */
}