|
|
@@ -2259,7 +2259,7 @@ namespace TeamAAS_VP.Core
|
|
|
code = plc.ReadNode<string>(string.Format(addressConfig.In_Code.Address, i));
|
|
|
}
|
|
|
productSn = code;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//询问mes
|
|
|
if (state == 1)
|
|
|
@@ -2288,12 +2288,13 @@ namespace TeamAAS_VP.Core
|
|
|
string ProductMainSN_Temp = "";
|
|
|
LogHelper.WriteLogMes($"询问mes成功");
|
|
|
SendTaskMessage($"询问mes成功:{response}", MessageLevel.Debug);
|
|
|
-
|
|
|
string[] item = response.Split('\n');
|
|
|
- if (item[2].Contains("sn="))
|
|
|
+ //获取过度件sn
|
|
|
+ string snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
{
|
|
|
- ProductMainSN_Temp = item[2].Replace("sn=", "");
|
|
|
- SendTaskMessage($"流程sn:{ProductMainSN_Temp}", MessageLevel.Info);
|
|
|
+ ProductMainSN_Temp = snItem.Replace("sn=", "").Trim();
|
|
|
+ SendTaskMessage($"过度件sn:{ProductMainSN_Temp}", MessageLevel.Info);
|
|
|
}
|
|
|
|
|
|
LogHelper.WriteLogMes($"询问mes成功");
|
|
|
@@ -2307,28 +2308,31 @@ namespace TeamAAS_VP.Core
|
|
|
SendTaskMessage($"询问mes成功:{response2}", MessageLevel.Debug);
|
|
|
|
|
|
item = response2.Split('\n');
|
|
|
-
|
|
|
- if (item[1].Contains("color="))
|
|
|
+ snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
{
|
|
|
- color[i] = item[1].Replace("color=", "");
|
|
|
- SendTaskMessage($"产品color:{color[i]}", MessageLevel.Info);
|
|
|
+ ProductMainSN[i] = snItem.Replace("sn=", "").Trim();
|
|
|
+ _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ _eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
+ SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[3].Contains("model_num="))
|
|
|
+ string woItem = item.FirstOrDefault(f => f.Contains("wo="));
|
|
|
+ if (woItem != null)
|
|
|
{
|
|
|
- model_num[i] = item[3].Replace("model_num=", "");
|
|
|
- SendTaskMessage($"产品model_num:{model_num[i]}", MessageLevel.Info);
|
|
|
+ wo[i] = woItem.Replace("wo=", "").Trim();
|
|
|
+ SendTaskMessage($"工单信息:{wo[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[4].Contains("sn="))
|
|
|
+ string modelItem = item.FirstOrDefault(f => f.Contains("model_num="));
|
|
|
+ if (modelItem != null)
|
|
|
{
|
|
|
- ProductMainSN[i] = item[4].Replace("sn=", "");
|
|
|
- SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
- _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
- _eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
+ model_num[i] = modelItem.Replace("model_num=", "").Trim();
|
|
|
+ SendTaskMessage($"model_num:{model_num[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[5].Contains("wo="))
|
|
|
+ string colorItem = item.FirstOrDefault(f => f.Contains("color="));
|
|
|
+ if (colorItem != null)
|
|
|
{
|
|
|
- wo[i] = item[5].Replace("wo=", "");
|
|
|
- SendTaskMessage($"产品主wo:{wo[i]}", MessageLevel.Info);
|
|
|
+ color[i] = colorItem.Replace("color=", "").Trim();
|
|
|
+ SendTaskMessage($"color:{color[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
|
|
|
LogHelper.WriteLogMes($"第二次询问mes成功");
|
|
|
@@ -2396,28 +2400,31 @@ namespace TeamAAS_VP.Core
|
|
|
SendTaskMessage($"询问mes成功:{response}", MessageLevel.Debug);
|
|
|
|
|
|
var item = response.Split('\n');
|
|
|
-
|
|
|
- if (item[1].Contains("color="))
|
|
|
+ string snItem = item.FirstOrDefault(f => f.Contains("sn="));
|
|
|
+ if (snItem != null)
|
|
|
{
|
|
|
- color[i] = item[1].Replace("color=", "");
|
|
|
- SendTaskMessage($"产品color:{color[i]}", MessageLevel.Info);
|
|
|
+ ProductMainSN[i] = snItem.Replace("sn=", "").Trim();
|
|
|
+ _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
+ _eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
+ SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[3].Contains("model_num="))
|
|
|
+ string woItem = item.FirstOrDefault(f => f.Contains("wo="));
|
|
|
+ if (woItem != null)
|
|
|
{
|
|
|
- model_num[i] = item[3].Replace("model_num=", "");
|
|
|
- SendTaskMessage($"产品model_num:{model_num[i]}", MessageLevel.Info);
|
|
|
+ wo[i] = woItem.Replace("wo=", "").Trim();
|
|
|
+ SendTaskMessage($"工单信息:{wo[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[4].Contains("sn="))
|
|
|
+ string modelItem = item.FirstOrDefault(f => f.Contains("model_num="));
|
|
|
+ if (modelItem != null)
|
|
|
{
|
|
|
- ProductMainSN[i] = item[4].Replace("sn=", "");
|
|
|
- SendTaskMessage($"产品主sn:{ProductMainSN[i]}", MessageLevel.Info);
|
|
|
- _productService.CurrentProductCode = ProductMainSN[i];
|
|
|
- _eventAggregator.GetEvent<DelaySaveImageNotification>().Publish(true);//通知界面延迟保存图片,等待MES查询结果返回,避免图片和数据不同步
|
|
|
+ model_num[i] = modelItem.Replace("model_num=", "").Trim();
|
|
|
+ SendTaskMessage($"model_num:{model_num[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
- if (item[5].Contains("wo="))
|
|
|
+ string colorItem = item.FirstOrDefault(f => f.Contains("color="));
|
|
|
+ if (colorItem != null)
|
|
|
{
|
|
|
- wo[i] = item[5].Replace("wo=", "");
|
|
|
- SendTaskMessage($"产品主wo:{wo[i]}", MessageLevel.Info);
|
|
|
+ color[i] = colorItem.Replace("color=", "").Trim();
|
|
|
+ SendTaskMessage($"color:{color[i]}", MessageLevel.Info);
|
|
|
}
|
|
|
|
|
|
//切换产品
|