4
hao
2025-04-16 c5fb1fbcbb2bf4d511773d348f9ef625855c61fc
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
package com.web.pda.lyt.lytPda.controller;
 
import com.app.base.control.WebController;
import com.app.base.data.ApiResponseResult;
import com.web.pda.lyt.lytPda.service.DefectInputService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
 
@Api(description = "不良投入")
@CrossOrigin
@ControllerAdvice
//@RestController
@Controller
@RequestMapping(value = "defect_input")
public class DefectIputController extends WebController {
 
    @Autowired
    private DefectInputService defectInputService;
    
    @ApiOperation(value = "获取出现频率最高排序不良类型", notes = "获取出现频率最高排序不良类型")
    @RequestMapping(value = "/getDefect", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getDefect(@RequestParam(value = "factory") String factory,
    @RequestParam(value = "company") String company,
    @RequestParam(value = "procLine") String procLine) {
        try {
            return defectInputService.getDefect(factory,company,procLine);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取其他不良类型选择(低频率)", notes = "获取其他不良类型选择(低频率)")
    @RequestMapping(value = "/getDefectOther", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getDefectOther(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "procLine") String procLine) {
        try {
            return defectInputService.getDefectOther(factory,company,procLine);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取其他不良类型选择(低频率)-查询", notes = "获取其他不良类型选择(低频率)-查询 ")
    @RequestMapping(value = "/searchDefectOther", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult searchDefectOther(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "procLine") String procLine,
            @RequestParam(value = "keyword") String keyword) {
        try {
            return defectInputService.searchDefectOther(factory,company,procLine,keyword);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取设备编码", notes = "获取设备编码")
    @RequestMapping(value = "/getDeviceCode", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getDeviceCode() {
        try {
            return defectInputService.getDeviceCode();
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取工单", notes = "获取工单")
    @RequestMapping(value = "/getTaskNo", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getTaskNo(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "procLine") String procLine,
            @RequestParam(value = "keyword") String keyword) {
        try {
            return defectInputService.getTaskNo( factory, company, procLine, keyword);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取工序线体", notes = "获取工序线体")
    @RequestMapping(value = "/getProcLine", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getProcLine(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "userNo") String userNo) {
        try {
            return defectInputService.getProcLine(factory,company,userNo);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "通过工号获取对应工序线体", notes = "通过工号获取对应工序线体")
    @RequestMapping(value = "/getProcLineByUser", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getProcLineByUser(@RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "userNo") String userNo) {
        try {
            return defectInputService.getProcLineByUser(factory,company,userNo);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取投入明细", notes = "获取投入明细")
    @RequestMapping(value = "/getRecord", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getRecord(
            @RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "taskNo") String taskNo,
            @RequestParam(value = "procLine") String procLine,
            @RequestParam(value = "devCode") String devCode) {
        try {
            return defectInputService.getRecord( factory, company, taskNo,procLine, devCode);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "保存结果", notes = "保存结果")
    @RequestMapping(value = "/setDefectData", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult setDefectData(
            @RequestParam(value = "userNo") String userNo,
            @RequestParam(value = "taskNo") String taskNo,
            @RequestParam(value = "procLine") String procLine,
            @RequestParam(value = "defCode") String defCode,
            @RequestParam(value = "num") int num,
            @RequestParam(value = "type") int type,
            @RequestParam(value = "devCode") String devCode,
            @RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company) {
        try {
            return defectInputService.setDefectData(userNo, taskNo, procLine,defCode,num,type,devCode,factory,company);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
    
    @ApiOperation(value = "获取不良列表及明细", notes = "获取不良列表及明细")
    @RequestMapping(value = "/getBadList", method = RequestMethod.POST, produces = "application/json")
    @ResponseBody
    public ApiResponseResult getBadList(
            @RequestParam(value = "factory") String factory,
            @RequestParam(value = "company") String company,
            @RequestParam(value = "keyword") String keyword,
            @RequestParam(value = "releaseNo") String releaseNo,
            @RequestParam(value = "size") int size,
            @RequestParam(value = "page") int page) {
        try {
            return defectInputService.getBadList(factory, company, keyword,releaseNo,size,page);
        } catch (Exception e) {
            e.printStackTrace();
            return ApiResponseResult.failure(e.toString());
        }
    }
}