李林
2023-10-07 658d4927d468c47208fd012d9128b09249c07eff
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.chinaztt.mes.plan.controller;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chinaztt.mes.common.wrapper.QueryWrapperUtil;
import com.chinaztt.mes.plan.dto.ManufacturingOrderDTO;
import com.chinaztt.mes.plan.dto.MoTestStandardDTO;
import com.chinaztt.mes.plan.entity.MoTestStandard;
import com.chinaztt.mes.plan.service.MoTestStandardService;
import com.chinaztt.ztt.common.core.util.R;
import com.chinaztt.ztt.common.log.annotation.SysLog;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
 
/**
 * 制造订单-检测标准主表
 *
 * @author cxf
 * @date 2021-04-27 13:27:47
 */
@RestController
@AllArgsConstructor
@RequestMapping("/plan/moTestStandard")
@Api(value = "moTestStandard", tags = "制造订单-检测标准主表管理")
public class MoTestStandardController {
 
    private final MoTestStandardService moTestStandardService;
 
    /**
     * 根据工艺工序id关联添加检测标准
     *
     * @param manufacturingOrderDTO
     * @return
     */
    @ApiOperation(value = "根据工艺工序id关联添加检测标准", notes = "根据工艺工序id关联添加检测标准")
    @PostMapping("/addRoutingTestStandard")
    public R addRoutingTestStandard(@RequestBody ManufacturingOrderDTO manufacturingOrderDTO) {
        return R.ok(moTestStandardService.addRoutingTestStandard(manufacturingOrderDTO));
    }
 
    /**
     * 根据工艺id和工序id获取复制的检测标准
     *
     * @param manufacturingOrderDTO 制造订单表
     * @return
     */
    @ApiOperation(value = "根据工艺id和工序id获取复制的检测标准", notes = "根据工艺id和工序id获取复制的检测标准")
    @GetMapping("/getRoutingTestStandardList")
    public R getRoutingTestStandardList(ManufacturingOrderDTO manufacturingOrderDTO) {
        return R.ok(moTestStandardService.getRoutingTestStandardList(manufacturingOrderDTO));
    }
 
    /**
     * 根据复制检测标准的id删除
     *
     * @param id id
     * @return R
     */
    @ApiOperation(value = "根据复制检测标准的id删除", notes = "根据复制检测标准的id删除")
    @SysLog("根据复制检测标准的id删除")
    @DeleteMapping("/deleteRoutingTestStandard/{id}")
    public R deleteRoutingTestStandard(@PathVariable Long id) {
        return R.ok(moTestStandardService.deleteRoutingTestStandard(id));
    }
 
    /**
     * 通过id查询制造订单-检测标准主表
     *
     * @param id id
     * @return R
     */
    @ApiOperation(value = "通过id查询", notes = "通过id查询")
    @GetMapping("/getMoTestStandardById/{id}")
    public R getMoTestStandardById(@PathVariable("id") Long id) {
        return R.ok(moTestStandardService.getById(id));
    }
 
    /**
     * 新增制造订单-检测标准主表
     *
     * @param moTestStandard 制造订单-检测标准主表
     * @return R
     */
    @ApiOperation(value = "新增制造订单-检测标准主表", notes = "新增制造订单-检测标准主表")
    @SysLog("新增制造订单-检测标准主表")
    @PostMapping("/addMoTestStandard")
    public R addMoTestStandard(@RequestBody MoTestStandard moTestStandard) {
        moTestStandardService.save(moTestStandard);
        return R.ok(moTestStandard);
    }
 
    /**
     * 修改制造订单-检测标准主表
     *
     * @param moTestStandard 制造订单-检测标准主表
     * @return R
     */
    @ApiOperation(value = "修改制造订单-检测标准主表", notes = "修改制造订单-检测标准主表")
    @SysLog("修改制造订单-检测标准主表")
    @PutMapping("/updateMoTestStandardById")
    public R updateMoTestStandardById(@RequestBody MoTestStandard moTestStandard) {
        moTestStandardService.updateById(moTestStandard);
        return R.ok(moTestStandard);
    }
 
    /**
     * 查询制造订单的检测项目
     *
     * @param moTestStandardDTO
     * @return
     */
    @ApiOperation(value = "查询制造订单的检测项目", notes = "查询制造订单的检测项目")
    @GetMapping("/getManufacturingOrderStand")
    public R getManufacturingOrderStand(Page page, MoTestStandardDTO moTestStandardDTO) {
        return R.ok(moTestStandardService.getManufacturingOrderStand(page, QueryWrapperUtil.gen(moTestStandardDTO)));
    }
 
    /**
     * 查询检测标准列表
     * @param moTestStandard
     */
    @ApiOperation(value = "查询检测标准列表", notes = "查询检测标准列表")
    @GetMapping("/getMoTestStandardList")
    public R<List<MoTestStandard>> getMoTestStandardList(MoTestStandard moTestStandard) {
        return R.ok(moTestStandardService.list(Wrappers.query(moTestStandard)));
    }
}