XiaoRuby
2023-08-29 844ffa2181d698f3871a62553fe10dd4054b63fa
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
package com.yuanchu.mom.controller;
 
 
import com.yuanchu.mom.pojo.dto.TechnicalModelDto;
import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.yuanchu.mom.service.TechnicalModelService;
 
 
/**
 * 技术指标维护表(TechnicalModel)表控制层
 *
 * @author zss
 * @since 2023-08-28 16:09:19
 */
@Api(tags = "基础数据-->技术指标维护")
@RestController
@RequestMapping("/technicalModel")
public class TechnicalModelController {
 
    @Autowired
    private TechnicalModelService technicalModelService;
 
 
    @ApiOperation(value = "查询技术指标维护列表-->左边二级展示工序和工艺")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "type", value = "类型(为空=0橡胶连接器)", dataTypeClass = Integer.class, required = true),
            @ApiImplicitParam(name = "message", value = "搜索内容", dataTypeClass = String.class)
    })
    @GetMapping("/selectAllTechTem")
    public Result selectAllTechTem(Integer type, String message) {
        return Result.success(technicalModelService.selectAllTechTem(type, message));
    }
 
    @ApiOperation(value = "查询技术指标维护列表-->右边展示该工艺下的检验项目")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/selectAllTechNam")
    public Result selectAllTechNam(Integer id) {
        return Result.success(technicalModelService.selectAllTechNam(id));
    }
 
    @ApiOperation(value = "新增技术指标维护-->选择工序和工艺")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/chooseTechFath")
    public Result chooseTechFath(Integer type) {
        return Result.success(technicalModelService.chooseTechFath(type));
    }
 
    @ApiOperation(value = "新增技术指标维护-->选择项目父类")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
    })
    @GetMapping("/chooseProFath")
    public Result chooseProFath(Integer id) {
        return Result.success(technicalModelService.chooseProFath(id));
    }
 
    @ApiOperation(value = "新增技术指标维护")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true)
    })
    @PostMapping("/addTechMode")
    public Result addTechMode(Integer id, @Validated @RequestBody TechnicalModelDto technicalModelDto) {
        technicalModelService.addTechMode(id, technicalModelDto);
        return Result.success("新增成功!");
    }
 
    @ApiOperation(value = "根据id查询详情")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "技术指标id", dataTypeClass = Integer.class,required = true)
    })
    @GetMapping("/selecTechById")
    public Result selecTechById(Integer id) {
        return Result.success(technicalModelService.selecTechById(id));
    }
 
    @ApiOperation(value = "编辑")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "技术指标id", dataTypeClass = Integer.class,required = true)
    })
    @PostMapping("/writeTechById")
    public Result writeTechById(Integer id,@Validated @RequestBody TechnicalModelDto technicalModelDto) {
        technicalModelService.writeTechById(id,technicalModelDto);
        return Result.success("修改"+id+"成功!");
    }
 
    @ApiOperation(value = "删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "id", value = "技术指标id", dataTypeClass = Integer.class,required = true)
    })
    @PostMapping("/delTechById")
    public Result delTechById(Integer id) {
        technicalModelService.delTechById(id);
        return Result.success("删除"+id+"成功!");
    }
 
    @ApiOperation(value = "批量删除")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "ids", value = "技术指标id", dataTypeClass = String.class,required = true)
    })
    @PostMapping("/delAllTech")
    public Result delAllTech(String ids) {
        technicalModelService.delAllTech(ids);
        return Result.success("批量删除成功!");
    }
 
}