PDAController.cs
6.94 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using Hh.Mes.Api.Controllers;
using Hh.Mes.Common.Json;
using Hh.Mes.POJO.Entity;
using Hh.Mes.POJO.EnumEntitys;
using Hh.Mes.Service;
using Hh.Mes.Service.WebService.Planned;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Headers;
using Microsoft.AspNetCore.Mvc;
namespace Hh.Mes.Api.Controllers
{
/// <summary>
/// pda 查询接口
/// ps:新增方法需要在SystemVariable 注册 APIList、EnumLog 新增枚举 ,方便接口日志定位查询
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class PDAController : BaseController
{
private readonly PDAService service;
public PDAController(PDAService pdaService, IHttpContextAccessor accessor)
{
service = pdaService;
context = accessor.HttpContext;
var sysUserApi = base.GetUser(context);
this.service.sysUserApi = sysUserApi;
}
/// <summary>
/// PDA物料追溯查询
/// 1:使用动态类型、或者使用实体类
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/GetMaterialByPDABarCode")]
public string GetMaterialInfoByBarCode(dynamic requestData)
{
var result = service.GetMaterialInfoByBarCode(requestData);
return Serialize(result);
}
#region 组对、焊接
/// <summary>
/// 获取匹配的组对信息
/// </summary>
/// <param name="pipe">管段码</param>
/// <param name="batch">批次码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetMatchTeamList")]
public string GetMatchTeamList(string pipe, string batch)
{
var result = service.GetMatchTeamList(pipe, batch);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 获取组对开始列表
/// </summary>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetTeamStartList")]
public string GetTeamStartList()
{
var result = service.GetTeamStartList();
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 保存组对开始列表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/SaveTeamStartList")]
public string SaveTeamStartList(List<bus_workOrder_detail> details)
{
var result = service.SaveTeamStartList(details);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 保存组对结束列表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/SaveTeamEndList")]
public string SaveTeamEndList(List<bus_workOrder_detail> details)
{
var result = service.SaveTeamEndList(details);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 获取匹配的焊接信息
/// </summary>
/// <param name="pipe">管段码</param>
/// <param name="batch">批次码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetMatchWeldList")]
public string GetMatchWeldList(string pipe)
{
var result = service.GetMatchWeldList(pipe);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 获取焊接开始列表
/// </summary>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetWeldStartList")]
public string GetWeldStartList()
{
var result = service.GetWeldStartList();
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 保存焊接开始列表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/SaveWeldStartList")]
public string SaveWeldStartList(List<bus_workOrder_detail> details)
{
var result = service.SaveWeldStartList(details);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 保存焊接结束列表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionName("Mes/V1/SaveWeldEndList")]
public string SaveWeldEndList(List<bus_workOrder_detail> details)
{
var result = service.SaveWeldEndList(details);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 焊接工艺下发保存
/// </summary>
/// <param name="equipmentCode">设备编码</param>
/// <param name="barCode">管段码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/SaveWeldTechnology")]
public string SaveWeldTechnology(string equipmentCode,string barCode)
{
var result = service.SaveWeldTechnology(equipmentCode,barCode);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 批次码获取物料信息
/// </summary>
/// <param name="lotNo">批次码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetMaterialBylotNo")]
public string GetMaterialBylotNo(string lotNo)
{
var result = service.GetMaterialBylotNo(lotNo);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 设备编码获取设备信息
/// </summary>
/// <param name="equipmentCode">设备编码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/GetEquipmentByCode")]
public string GetEquipmentByCode(string equipmentCode)
{
var result = service.GetEquipmentByCode(equipmentCode);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// 呼叫Agv接料
/// </summary>
/// <param name="equipmentCode">设备编码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/AgvCollectingStart")]
public string AgvCollectingStart(string equipmentCode)
{
var result = service.AgvCollectingStart(equipmentCode);
return JsonHelper.Instance.Serialize(result);
}
/// <summary>
/// Agv接料完成
/// </summary>
/// <param name="equipmentCode">设备编码</param>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/AgvCollectingEnd")]
public string AgvCollectingEnd(string equipmentCode)
{
var result = service.AgvCollectingEnd(equipmentCode);
return JsonHelper.Instance.Serialize(result);
}
#endregion
}
}