lyh
2025-06-25 e756af0f5bfd1addbd5d5c145441fb34aad91a28
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
package org.jeecg.modules.dnc.controller;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.dnc.entity.ProcessStream;
import org.jeecg.modules.dnc.response.CommonCode;
import org.jeecg.modules.dnc.response.QueryListResponseResult;
import org.jeecg.modules.dnc.response.ResponseResult;
import org.jeecg.modules.dnc.request.ProcessStreamRequest;
import org.jeecg.modules.dnc.service.IProcessStreamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.Collections;
import java.util.List;
 
@Slf4j
@Api(tags = "全部工序表")
@RestController
@RequestMapping("/nc/stream/process")
public class ProcessStreamController extends JeecgController<ProcessStream, IProcessStreamService> {
    @Autowired
    private IProcessStreamService processStreamService;
 
    @AutoLog(value = "全部工序表-添加工序")
    @ApiOperation(value = "全部工序表-添加工序", notes = "全部工序表-添加工序")
    @PostMapping("/add")
    public ResponseResult addProcessStream(@RequestBody ProcessStream stream) {
        boolean b = processStreamService.addProcessStream(stream);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "全部工序表-编辑工序信息")
    @ApiOperation(value = "全部工序表-编辑工序信息", notes = "全部工序表-编辑工序信息")
    @PutMapping("/edit/{id}")
    public ResponseResult editProcessStream(@PathVariable("id") String id, @RequestBody ProcessStream stream) {
        boolean b = processStreamService.editProcessStream(id, stream);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "全部工序表-删除工序信息 逻辑删除")
    @ApiOperation(value = "全部工序表-删除工序信息 逻辑删除", notes = "全部工序表-删除工序信息 逻辑删除")
    @DeleteMapping("/delete")
    public ResponseResult deleteProcessStream(@RequestParam("id") String id) {
        boolean b = processStreamService.deleteProcessStream(id);
        if(b) {
            return new ResponseResult(CommonCode.SUCCESS);
        }
        return new ResponseResult(CommonCode.FAIL);
    }
 
    @AutoLog(value = "全部工序表-查询部件/零件节点下的工序列表")
    @ApiOperation(value = "全部工序表-查询部件/零件节点下的工序列表", notes = "全部工序表-查询部件/零件节点下的工序列表")
    @GetMapping("/find/list")
    public QueryListResponseResult<ProcessStream> findByNodeParams(ProcessStreamRequest request) {
        List<ProcessStream> list = processStreamService.findByNodeParams(request);
        if(list == null)
            list = Collections.emptyList();
        return new QueryListResponseResult<>(CommonCode.SUCCESS, list);
    }
 
    @AutoLog(value = "全部工序表-检查PN码对应的设备是否存在可加工工序")
    @ApiOperation(value = "全部工序表-检查PN码对应的设备是否存在可加工工序", notes = "全部工序表-检查PN码对应的设备是否存在可加工工序")
    @GetMapping("/valid/process")
    public ResponseResult validateDeviceProcessInfo(String pnCode, String deviceNo) {
        List<ProcessStream> list = processStreamService.validateDeviceProcessInfo(pnCode, deviceNo);
        if(list == null || list.isEmpty())
            return new ResponseResult(CommonCode.FAIL);
        return new ResponseResult(CommonCode.FAIL);
    }
}