|
|
@@ -82,7 +82,9 @@ namespace TeamAAS_VP.Services
|
|
|
// 如果已经释放,则抛出异常,防止在已释放资源上继续操作。
|
|
|
if (_disposed) throw new ObjectDisposedException(nameof(MesService));
|
|
|
|
|
|
- var device = _configService.GetDeviceInfo();
|
|
|
+ var device = _configService.GetDeviceInfo(deviceNo);
|
|
|
+ if (device == null)
|
|
|
+ device = _configService.GetDeviceInfo();
|
|
|
if (device == null || !device.EnableMES)
|
|
|
{
|
|
|
return (true, "MES功能未启用!");
|
|
|
@@ -98,34 +100,21 @@ namespace TeamAAS_VP.Services
|
|
|
}
|
|
|
|
|
|
string url = "";
|
|
|
- string[] station = new string[3];
|
|
|
- string[] fixtureId = new string[3];
|
|
|
- station = device.Station.Split(',');
|
|
|
- fixtureId = device.FixtureId.Split(',');
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- string str = station[deviceNo];
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
- return (false, "本机应该有多站,station应该有多个值");
|
|
|
- }
|
|
|
|
|
|
if (deviceNo == 0)//组装站
|
|
|
{
|
|
|
if (device.F == "PTL")
|
|
|
{
|
|
|
- url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={station[deviceNo]}&fixtureid={fixtureId[deviceNo]}&sn={sn}&comp={device.comp}:{comp}&p=unit_process_check,message,model,sn,wo";
|
|
|
+ url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&comp={device.comp}:{comp}&p=unit_process_check,message,model,sn,wo";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={station[deviceNo]}&fixtureid={fixtureId[deviceNo]}&sn={sn}&p=unit_process_check,message,model,sn,wo";
|
|
|
+ url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&p=unit_process_check,message,model,sn,wo";
|
|
|
}
|
|
|
}
|
|
|
else//保压站
|
|
|
{
|
|
|
- url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={station[deviceNo]}&fixtureid={fixtureId[deviceNo]}&sn={sn}&p=unit_process_check,message,model,sn,wo";
|
|
|
+ url = $"{device.MesUrl}?c=QUERY_RECORD&line={device.Line}&station={device.Station}&fixtureid={device.FixtureId}&sn={sn}&p=unit_process_check,message,model,sn,wo";
|
|
|
}
|
|
|
|
|
|
LogHelper.WriteLogMes($"【询问URL】{url}");
|
|
|
@@ -288,7 +277,9 @@ namespace TeamAAS_VP.Services
|
|
|
// 如果已经释放,则抛出异常,防止在已释放资源上继续操作。
|
|
|
if (_disposed) throw new ObjectDisposedException(nameof(MesService));
|
|
|
|
|
|
- var device = _configService.GetDeviceInfo();
|
|
|
+ var device = _configService.GetDeviceInfo(deviceNo);
|
|
|
+ if (device == null)
|
|
|
+ device = _configService.GetDeviceInfo();
|
|
|
if (device == null || !device.EnableMES)
|
|
|
{
|
|
|
return (true, "MES功能未启用!");
|