yl
2023-02-27 adc65b06d255664c2f7b763aad04572d5a96ff46
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using VueWebApi.DLL.BLL;
using VueWebApi.Models;
using VueWebApi.Tools;
 
namespace VueWebApi.Controllers
{
    [RoutePrefix(prefix: "api/AppDeviceManage")]
    [ControllerGroup("App设备管理", "在线接口")]
    [ChannelActionFilterAttributeApp]
    public class AppDeviceManageController : ApiController
    {
        //定义全局信息返回变量
        ToMessage mes = new ToMessage();
        RedisHelper redis = new RedisHelper();
 
        #region[日常点检,扫描工位/设备二维码]
        /// <summary>
        /// 日常点检,扫描工位/设备二维码
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <returns></returns>
        [Route(template: "CheckScanDeviceQrCodeData")]
        [HttpGet]
        public HttpResponseMessage CheckScanDeviceQrCodeData(string eqpcode)
        {
            mes = AppDeviceManageBLL.CheckScanDeviceQrCodeData(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[日常点检,扫描工位/设备二维码查找点检标准]
        /// <summary>
        /// 日常点检,扫描工位/设备二维码查找点检标准
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <returns></returns>
        [Route(template: "CheckScanDeviceTemp")]
        [HttpGet]
        public HttpResponseMessage CheckScanDeviceTemp(string eqpcode)
        {
            mes = AppDeviceManageBLL.CheckScanDeviceTemp(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[日常点检,选择扫码设备、点检标准带出点检项]
        /// <summary>
        /// 日常点检,选择扫码设备、点检标准带出点检项
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="checktempcode">点检标准编码</param>
        /// <returns></returns>
        [Route(template: "SelectScanDeviceQrCodeItem")]
        [HttpGet]
        public HttpResponseMessage SelectScanDeviceQrCodeItem(string eqpcode,string checktempcode)
        {
            mes = AppDeviceManageBLL.SelectScanDeviceQrCodeItem(eqpcode, checktempcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[日常点检、提交保存]
        /// <summary>
        /// 日常点检、提交保存
        /// </summary>
        /// <param name="username">登录人员(点检人)</param>
        /// <param name="json">提交数据</param>
        /// <returns></returns>
        [Route(template: "AppDeviceCheckSave")]
        [HttpPost]
        public HttpResponseMessage AppDeviceCheckSave(string username, AppDevicecCheck json)
        {
            mes = AppDeviceManageBLL.AppDeviceCheckSave(username, json);
            return TJson.toJson(mes);
        }
        #endregion
 
 
        #region[定期保养,扫描工位/设备二维码]
        /// <summary>
        /// 定期保养,扫描工位/设备二维码
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <returns></returns>
        [Route(template: "RepairScanDeviceQrCodeData")]
        [HttpGet]
        public HttpResponseMessage RepairScanDeviceQrCodeData(string eqpcode)
        {
            mes = AppDeviceManageBLL.RepairScanDeviceQrCodeData(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[定期保养,扫描工位/设备二维码查找保养标准]
        /// <summary>
        /// 定期保养,扫描工位/设备二维码查找保养标准
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <returns></returns>
        [Route(template: "RepairScanDeviceTemp")]
        [HttpGet]
        public HttpResponseMessage RepairScanDeviceTemp(string eqpcode)
        {
            mes = AppDeviceManageBLL.RepairScanDeviceTemp(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[日常保养,选择扫码设备列表带出保养项]
        /// <summary>
        /// 日常保养,选择扫码设备列表带出保养项
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="repartempcode">保养标准编码</param>
        /// <returns></returns>
        [Route(template: "RepairSelectScanDeviceQrCodeItem")]
        [HttpGet]
        public HttpResponseMessage RepairSelectScanDeviceQrCodeItem(string eqpcode,string repartempcode)
        {
            mes = AppDeviceManageBLL.RepairSelectScanDeviceQrCodeItem(eqpcode, repartempcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[日常保养,提交保存]
        /// <summary>
        /// 日常保养,提交保存
        /// </summary>
        /// <param name="username">登录人员(保养人)</param>
        /// <param name="maintcyc">保养周期</param>
        /// <param name="json">提交数据</param>
        /// <returns></returns>
        [Route(template: "AppDeviceRepairSave")]
        [HttpPost]
        public HttpResponseMessage AppDeviceRepairSave(string username, string maintcyc, AppDevicecCheck json)
        {
            mes = AppDeviceManageBLL.AppDeviceRepairSave(username, maintcyc, json);
            return TJson.toJson(mes);
        }
        #endregion
 
 
        #region[设备维修申请,扫描工位/设备二维码]
        /// <summary>
        /// 设备维修申请,扫描工位/设备二维码
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <returns></returns>
        [Route(template: "MaintainScanDeviceApplyQrCodeData")]
        [HttpGet]
        public HttpResponseMessage MaintainScanDeviceApplyQrCodeData(string eqpcode)
        {
            mes = AppDeviceManageBLL.MaintainScanDeviceApplyQrCodeData(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[设备维修申请,提交保存]
        /// <summary>
        /// 设备维修申请,提交保存
        /// </summary>
        /// <returns></returns>
        [Route(template: "MaintainScanDeviceApplySave")]
        [HttpPost]
        public HttpResponseMessage MaintainScanDeviceApplySave()
        {
            string username = HttpContext.Current.Request["username"].ToString();//操作人员
            string eqpcode = HttpContext.Current.Request["eqpcode"].ToString();//设备编码
            string wkshpcode = HttpContext.Current.Request["wkshpcode"].ToString(); //车间编码
            string faultsourcecode = HttpContext.Current.Request["faultsourcecode"].ToString(); //故障来源编码
            string faultdescr = HttpContext.Current.Request["faultdescr"].ToString(); //故障描述
            HttpFileCollection files = HttpContext.Current.Request.Files;
            mes = AppDeviceManageBLL.MaintainScanDeviceApplySave(username, eqpcode, wkshpcode, faultsourcecode, faultdescr, files);
            return TJson.toJson(mes);
        }
        #endregion
 
 
        #region[设备维修列表]
        /// <summary>
        /// 设备维修列表
        /// </summary>
        /// <returns></returns>
        [Route(template: "RepairScanDeviceQrCodeDataList")]
        [HttpGet]
        public HttpResponseMessage RepairScanDeviceQrCodeDataList()
        {
            mes = AppDeviceManageBLL.RepairScanDeviceQrCodeDataList();
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[设备维修提交]
        /// <summary>
        /// 设备维修提交
        /// </summary>
        /// <returns></returns>
        [Route(template: "RepairScanDeviceSave")]
        [HttpPost]
        public HttpResponseMessage RepairScanDeviceSave()
        {
            string docu_code = HttpContext.Current.Request["docu_code"].ToString();//维修申请单号
            string username = HttpContext.Current.Request["username"].ToString();//操作人员
            string eqpcode = HttpContext.Current.Request["eqpcode"].ToString();//设备编码
            string wkshpcode = HttpContext.Current.Request["wkshpcode"].ToString(); //车间编码
            string faultdescr = HttpContext.Current.Request["faultdescr"].ToString(); //故障描述
            string is_stoprepair = HttpContext.Current.Request["is_stoprepair"].ToString(); //停机维修
            string repaircontent = HttpContext.Current.Request["repaircontent"].ToString(); //维修内容
            string replaceparts = HttpContext.Current.Request["replaceparts"].ToString(); //更换备件
            HttpFileCollection files = HttpContext.Current.Request.Files;
            mes = AppDeviceManageBLL.RepairScanDeviceSave(docu_code, username, eqpcode, wkshpcode, faultdescr, is_stoprepair, repaircontent, replaceparts, files);
            return TJson.toJson(mes);
        }
        #endregion
 
 
        #region[维修验证列表]
        /// <summary>
        /// 维修验证列表
        /// </summary>
        /// <returns></returns>
        [Route(template: "RepairVerificationScanDeviceData")]
        [HttpGet]
        public HttpResponseMessage RepairVerificationScanDeviceData()
        {
            mes = AppDeviceManageBLL.RepairVerificationScanDeviceData();
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[维修验证详情信息]
        /// <summary>
        /// 维修验证详情信息
        /// </summary>
        /// <param name="repair_code">维修单号</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="wkshpcode">车间编码</param>
        /// <returns></returns>
        [Route(template: "RepairVerificationScanDeviceDataSub")]
        [HttpGet]
        public HttpResponseMessage RepairVerificationScanDeviceDataSub(string repair_code, string eqpcode, string wkshpcode)
        {
            mes = AppDeviceManageBLL.RepairVerificationScanDeviceDataSub(repair_code, eqpcode, wkshpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[维修验证提交]
        /// <summary>
        /// 维修验证提交
        /// </summary>
        /// <returns></returns>
        [Route(template: "RepairVerificationScanDeviceSave")]
        [HttpPost]
        public HttpResponseMessage RepairVerificationScanDeviceSave()
        {
            string username = HttpContext.Current.Request["username"].ToString();//操作人员
            string repairwo = HttpContext.Current.Request["repairwo"].ToString();//维修单号
            string eqpcode = HttpContext.Current.Request["eqpcode"].ToString();//设备编码
            string wkshpcode = HttpContext.Current.Request["wkshpcode"].ToString(); //车间编码
            string result = HttpContext.Current.Request["result"].ToString(); //验证结果
            mes = AppDeviceManageBLL.RepairVerificationScanDeviceSave(username, repairwo, eqpcode, wkshpcode, result);
            return TJson.toJson(mes);
        }
        #endregion
 
 
        #region[安灯呼叫扫描工位]
        /// <summary>
        /// 安灯呼叫扫描工位
        /// </summary>
        /// <param name="eqpcode">设备码</param>
        /// <returns></returns>
        [Route(template: "AppDeviceAnDengCallScanSearch")]
        [HttpPost]
        public HttpResponseMessage AppDeviceAnDengCallScanSearch(string eqpcode)
        {
            mes = AppDeviceManageBLL.AppDeviceAnDengCallScanSearch(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[安灯呼叫,选择扫描工位带出呼叫类型选项及对应人员数据]
        /// <summary>
        /// 安灯呼叫,选择扫描工位带出呼叫类型选项及对应人员数据
        /// </summary>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="wkshpcode">车间编码</param>
        /// <returns></returns>
        [Route(template: "AppDeviceAnDengCallItemSearch")]
        [HttpPost]
        public HttpResponseMessage AppDeviceAnDengCallItemSearch(string eqpcode, string wkshpcode)
        {
            mes = AppDeviceManageBLL.AppDeviceAnDengCallItemSearch(eqpcode, wkshpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[安灯呼叫提交]
        /// <summary>
        /// 安灯呼叫提交
        /// </summary>
        /// <param name="username">登录人员</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="wkshpcode">车间编码</param>
        /// <param name="json">提交数据</param>
        /// <returns></returns>
        [Route(template: "AppDeviceAnDengCallSave")]
        [HttpPost]
        public HttpResponseMessage AppDeviceAnDengCallSave(string username, string eqpcode, string wkshpcode, List<AnDnDate> json)
        {
            mes = AppDeviceManageBLL.AppDeviceAnDengCallSave(username, eqpcode, wkshpcode, json);
            return TJson.toJson(mes);
        }
        #endregion
 
 
 
        #region[安灯响应扫描工位/设备]
        /// <summary>
        /// 安灯响应扫描工位/设备
        /// </summary>
        /// <param name="eqpcode">设备/工位编码</param>
        /// <returns></returns>
        [Route(template: "AppDeviceAnDengLampResponseScanSearch")]
        [HttpPost]
        public HttpResponseMessage AppDeviceAnDengLampResponseScanSearch(string eqpcode)
        {
            mes = AppDeviceManageBLL.AppDeviceAnDengLampResponseScanSearch(eqpcode);
            return TJson.toJson(mes);
        }
        #endregion
 
        #region[安灯响应提交]
        /// <summary>
        /// 安灯响应提交
        /// </summary>
        /// <param name="username">登录人员</param>
        /// <param name="eqpcode">设备编码</param>
        /// <param name="wkshpcode">车间编码</param>
        /// <param name="json">提交数据</param>
        /// <returns></returns>
        [Route(template: "AppDeviceAnDengLampResponseSave")]
        [HttpPost]
        public HttpResponseMessage AppDeviceAnDengLampResponseSave(string username, string eqpcode, string wkshpcode, List<ObjectData> json)
        {
            mes = AppDeviceManageBLL.AppDeviceAnDengLampResponseSave(username, eqpcode, wkshpcode, json);
            return TJson.toJson(mes);
        }
        #endregion
    }
}