liuwf 1 year ago
parent 541e8af993
commit 3a8dc275f3

@ -100,7 +100,7 @@ namespace Aucma.Core.HwPLc
{ {
melsecMcNet.ConnectClose(); melsecMcNet.ConnectClose();
IsConnected = false; IsConnected = false;
Console.WriteLine($"连接失败!【{iP}:{port}】{connect.Message} "); //Console.WriteLine($"连接失败!【{iP}:{port}】{connect.Message} ");
return false; return false;
} }
} }

@ -84,12 +84,15 @@ namespace Aucma.Core.ProductOffLine.Business
/// <summary> /// <summary>
/// 扫码信息刷新 /// 扫码信息刷新
/// </summary> /// </summary>
/// <param name="materialCode"></param> public delegate void RefreshScanMateriaCode(TempInfo tempInfo);
/// <param name="materialName"></param> public static event RefreshScanMateriaCode? RefreshScanMateriaCodeEvent;
/// <param name="spaceName"></param>
/// <param name="materialType"></param>
public delegate void RefreshScanMateriaCode(string materialCode, string materialName, string spaceName, string materialType); /// <summary>
public event RefreshScanMateriaCode RefreshScanMateriaCodeEvent; /// 图表刷新
/// </summary>
public delegate void RefreshCharts();
public static event RefreshCharts? RefreshChartsEvent;
/// <summary> /// <summary>
/// 获取入库方向 /// 获取入库方向
/// </summary> /// </summary>
@ -115,23 +118,29 @@ namespace Aucma.Core.ProductOffLine.Business
{ {
// private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness)); // private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OffLineBusiness));
// string result = _productOffLineServices.QueryChecked("1520870000099E2V0004"); // string result = _productOffLineServices.QueryChecked("1520870000099E2V0004");
string result = _productOffLineServices.QueryChecked("1530080CD0098E1V1714"); // string result = _productOffLineServices.QueryChecked("1530080CD0098E1V1714");
Console.WriteLine(result); // Console.WriteLine(result);
string strSave = _productOffLineServices.SaveBarcodeInfo("1520870000099E2V0004", "ILS_SORT", result.Replace("0000",""), 1); // string strSave = _productOffLineServices.SaveBarcodeInfo("1520870000099E2V0004", "ILS_SORT", result.Replace("0000",""), 1);
// LogHelper.Info("成品码:1520870000099E2V0004"+strSave); // LogHelper.Info("成品码:1520870000099E2V0004"+strSave);
// string tt = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000004899@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01"; // string tt = "Y@1104@16160030000000910780@000010034895@@ @000000@000000009000004899@BCD-160C,家电下乡@@BCD-160C@皓月白-家电下乡@161601300@160@1-00版@家电下乡产品@默认@2010-09-01";
//Task.Run(() => Task.Run(() =>
{
//while (true)
//{ //{
// //while (true) Thread.Sleep(5000);
// //{ Random random = new Random();
// Thread.Sleep(5000); MaterialBarScan("32160030000000912" + random.Next(100, 999), "10.10.92.141");
// Random random = new Random(); Thread.Sleep(3000);
// MaterialBarScan("32160030000000912" + random.Next(100, 999), "192.168.1.20"); Random random1 = new Random();
// // } MaterialBarScan("99160030000000912" + random1.Next(100, 999), "10.10.92.141");
Thread.Sleep(3000);
Random random2 = new Random();
MaterialBarScan("44160030000000912" + random2.Next(100, 999), "10.10.92.141");
// }
// // Thread.Sleep(1000); // Thread.Sleep(1000);
// // MaterialBarScanEvent("33160030000000910780", "192.168.1.20"); // MaterialBarScanEvent("33160030000000910780", "192.168.1.20");
//}); });
} }
public void MaterialBarScan(string code, string scannerIp) public void MaterialBarScan(string code, string scannerIp)
@ -163,31 +172,50 @@ namespace Aucma.Core.ProductOffLine.Business
materialType = TempOffLineInfo1.ProductCode; materialType = TempOffLineInfo1.ProductCode;
if (!BackResult) if (!BackResult)
{ {
log.Info("条码:" + TempOffLineInfo1.ProductSNCode + "对接条码系统处理失败,禁止放行,流程结束");
return; return;
} }
TempOffLineInfo1.ProductRefreshFlag = true; // TempOffLineInfo1.ProductRefreshFlag = true;
// 2.更新mes数据库 // 2.更新mes数据库
BackResult = updateMesData(TempOffLineInfo1); BackResult = updateMesData(TempOffLineInfo1);
BackResult = true; // 测试 BackResult = true; // 测试
// 3.plc放行 // 3.plc放行
if (BackResult) if (BackResult)
{ {
bool plcResult = SendAndWaitSignal(ScannerNo, materialType); bool plcResult = SendAndWaitSignal(ScannerNo, materialType);
if (plcResult) //if (plcResult)
{ //{
// TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "plc放行成功"; // // TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "plc放行成功";
//界面刷新 // //界面刷新
// // TempOffLineInfo1.ProductRefreshFlag = true;
//}
//else
//{
// TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "plc放行异常";
// TempOffLineInfo1.MsgAlarmFlag = true;
// //界面刷新
// TempOffLineInfo1.ProductRefreshFlag = true; // TempOffLineInfo1.ProductRefreshFlag = true;
//}
log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo1.ProductOrderNo, TempOffLineInfo1.OrderQty));
try
{
//刷新统计图表
RefreshChartsEvent?.Invoke();
}
catch(Exception ex)
{
log.Error("刷新统计图表出错:"+ex.Message.ToString());
}
} }
else else
{ {
TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "plc放行异常"; log.Info("条码:" + TempOffLineInfo1.ProductSNCode + "更新Mes数据库失败");
TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "更新Mes数据库失败";
TempOffLineInfo1.MsgAlarmFlag = true; TempOffLineInfo1.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo1.ProductRefreshFlag = true; RefreshScanMateriaCodeEvent(TempOffLineInfo1);
}
log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo1.ProductOrderNo, TempOffLineInfo1.OrderQty));
} }
} }
@ -198,15 +226,18 @@ namespace Aucma.Core.ProductOffLine.Business
materialType = TempOffLineInfo2.ProductCode; materialType = TempOffLineInfo2.ProductCode;
if (!BackResult) if (!BackResult)
{ {
log.Info("条码:" + TempOffLineInfo1.ProductSNCode + "对接条码系统处理失败,禁止放行,流程结束");
return; return;
} }
TempOffLineInfo2.ProductRefreshFlag = true; // TempOffLineInfo2.ProductRefreshFlag = true;
// 2.更新mes数据库 // 2.更新mes数据库
BackResult = updateMesData(TempOffLineInfo2); BackResult = updateMesData(TempOffLineInfo2);
BackResult = true; BackResult = true;
// 3.plc放行 // 3.plc放行
if (BackResult) if (BackResult)
{ {
bool plcResult = SendAndWaitSignal(ScannerNo, materialType); bool plcResult = SendAndWaitSignal(ScannerNo, materialType);
//if (plcResult) //if (plcResult)
//{ //{
@ -223,16 +254,33 @@ namespace Aucma.Core.ProductOffLine.Business
// TempOffLineInfo2.ProductRefreshFlag = true; // TempOffLineInfo2.ProductRefreshFlag = true;
//} //}
log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo2.ProductOrderNo, TempOffLineInfo2.OrderQty)); log.Info(String.Format("订单号{0} 订单数量{1}", TempOffLineInfo2.ProductOrderNo, TempOffLineInfo2.OrderQty));
try
{
//刷新统计图表
RefreshChartsEvent?.Invoke();
}catch(Exception ex)
{
log.Error("刷新页面异常"+ex.Message.ToString());
}
}
else
{
log.Info("条码:" + TempOffLineInfo2.ProductSNCode + "更新Mes数据库失败");
TempOffLineInfo2.MsgInfo = TempOffLineInfo2.MsgInfo + "更新Mes数据库失败";
TempOffLineInfo2.MsgAlarmFlag = true;
//界面刷新
RefreshScanMateriaCodeEvent(TempOffLineInfo2);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Error(ex.Message.ToString()); log.Error("MaterialBarScanHandle异常:"+ex.Message.ToString());
} }
} }
/// <summary> /// <summary>
/// 下发plc放行并等待反馈信号 /// 下发plc放行并等待反馈信号
@ -354,7 +402,8 @@ namespace Aucma.Core.ProductOffLine.Business
} }
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return false; return false;
} }
@ -407,7 +456,8 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.ProductCreateDate = FArrayList[17]; TempOffLineInfo.ProductCreateDate = FArrayList[17];
#endregion #endregion
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
// 多码系统校验,暂不启用 // 多码系统校验,暂不启用
// bool flag = TestBarCode(TempOffLineInfo); // bool flag = TestBarCode(TempOffLineInfo);
// if (!flag) // if (!flag)
@ -427,7 +477,7 @@ namespace Aucma.Core.ProductOffLine.Business
#region 实体赋值 #region 实体赋值
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
TempOffLineInfo.MsgInfo = "获取信息失败. " + BarCode + " 返回值:" + FArrayList[0].ToString(); TempOffLineInfo.MsgInfo = "条码系统获取信息失败. " + BarCode + " 返回值:" + FArrayList[0].ToString();
TempOffLineInfo.ProductOrderNo = ""; TempOffLineInfo.ProductOrderNo = "";
TempOffLineInfo.ProductSaleNo = ""; TempOffLineInfo.ProductSaleNo = "";
TempOffLineInfo.ProductSaleLineNo = ""; TempOffLineInfo.ProductSaleLineNo = "";
@ -450,7 +500,8 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.number1 = ""; TempOffLineInfo.number1 = "";
#endregion #endregion
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return false; return false;
} }
@ -460,7 +511,8 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.MsgInfo = "获取产品条码异常:" + ex.Message; TempOffLineInfo.MsgInfo = "获取产品条码异常:" + ex.Message;
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
log.Info(BarCode + "条码验证异常:" + ex.Message.ToString()); log.Info(BarCode + "条码验证异常:" + ex.Message.ToString());
return false; return false;
} }
@ -498,13 +550,14 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",MES查询订单数据异常"; TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",MES查询订单数据异常";
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
// return false; // return false;
} }
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return true; return true;
} }
else else
@ -522,7 +575,8 @@ namespace Aucma.Core.ProductOffLine.Business
log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地已存在,放行"); log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地已存在,放行");
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "条码重复,本地已存在,放行"; TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + "条码重复,本地已存在,放行";
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return true; return true;
// chkout:条码重复是否允许放行 // chkout:条码重复是否允许放行
//if (TempOffLineInfo.ChkOut == true) //if (TempOffLineInfo.ChkOut == true)
@ -532,15 +586,18 @@ namespace Aucma.Core.ProductOffLine.Business
} }
else else
{ {
log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地不存在,已插入,放行"); log.Info(TempOffLineInfo.ProductSNCode + "条码重复,本地不存在,已插入,可以放行");
OffLineInfo info11 = MapperTwo(TempOffLineInfo); OffLineInfo info11 = MapperTwo(TempOffLineInfo);
// 产线
info11.ProductLineCode = "CX_02";
_offLineInfoServices.AddAsync(info11); _offLineInfoServices.AddAsync(info11);
return true; return true;
} }
} }
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return false; return false;
} }
@ -550,7 +607,8 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",条码系统保存接口异常"; TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",条码系统保存接口异常";
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return false; return false;
} }
} }
@ -559,7 +617,8 @@ namespace Aucma.Core.ProductOffLine.Business
TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",生产单号异常"; TempOffLineInfo.MsgInfo = TempOffLineInfo.MsgInfo + ",生产单号异常";
TempOffLineInfo.MsgAlarmFlag = true; TempOffLineInfo.MsgAlarmFlag = true;
//界面刷新 //界面刷新
TempOffLineInfo.ProductRefreshFlag = true; // TempOffLineInfo.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent?.Invoke(TempOffLineInfo);
return false; return false;
} }
} }
@ -588,8 +647,10 @@ namespace Aucma.Core.ProductOffLine.Business
if(scannerNo == 1) // 扫码器1对应的货道地址内侧 if(scannerNo == 1) // 扫码器1对应的货道地址内侧
{ {
log.Info(TempOffLineInfo1.ProductSNCode + ":内侧下发plc放行信号,入库方向ZR1001,放行信号ZR1003分别写:"+ direction.ToString()+"/1" + ",等待反馈");
TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "下发放行,"; TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "下发放行,";
TempOffLineInfo1.ProductRefreshFlag = true; RefreshScanMateriaCodeEvent(TempOffLineInfo1);
//TempOffLineInfo1.ProductRefreshFlag = true;
// 写入入库方向两条道plc地址不同 // 写入入库方向两条道plc地址不同
obj.plc.WriteInt16("ZR1001", direction.ToString()); obj.plc.WriteInt16("ZR1001", direction.ToString());
// 往plc写入放行信号 // 往plc写入放行信号
@ -597,8 +658,10 @@ namespace Aucma.Core.ProductOffLine.Business
} }
else // 外侧 else // 外侧
{ {
log.Info(TempOffLineInfo2.ProductSNCode + ":外侧下发plc放行信号,入库方向ZR1000,放行信号ZR1002分别写:" + direction.ToString() + "/1" + ",等待反馈");
TempOffLineInfo2.MsgInfo = TempOffLineInfo2.MsgInfo + "下发放行,"; TempOffLineInfo2.MsgInfo = TempOffLineInfo2.MsgInfo + "下发放行,";
TempOffLineInfo2.ProductRefreshFlag = true; RefreshScanMateriaCodeEvent(TempOffLineInfo2);
// TempOffLineInfo2.ProductRefreshFlag = true;
// 写入入库方向两条道plc地址不同 // 写入入库方向两条道plc地址不同
obj.plc.WriteInt16("ZR1000", direction.ToString()); obj.plc.WriteInt16("ZR1000", direction.ToString());
// 往plc写入放行信号 // 往plc写入放行信号
@ -606,7 +669,7 @@ namespace Aucma.Core.ProductOffLine.Business
} }
DateTime targetTime = DateTime.Now.AddSeconds(300); DateTime targetTime = DateTime.Now.AddSeconds(18000); // 5h
// 等待plc反馈信号 // 等待plc反馈信号
while (true) while (true)
{ {
@ -622,8 +685,10 @@ namespace Aucma.Core.ProductOffLine.Business
// 读取plc反馈信号 // 读取plc反馈信号
if (obj.plc.ReadInt32("ZR1003") == 2) if (obj.plc.ReadInt32("ZR1003") == 2)
{ {
log.Info(TempOffLineInfo1.ProductSNCode + "内侧plc反馈信号ZR1003读2");
TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "放行成功"; TempOffLineInfo1.MsgInfo = TempOffLineInfo1.MsgInfo + "放行成功";
TempOffLineInfo1.ProductRefreshFlag = true; // TempOffLineInfo1.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent(TempOffLineInfo1);
Console.WriteLine("收到plc放行成功"); Console.WriteLine("收到plc放行成功");
// 清空数据 // 清空数据
// obj.plc.WriteInt32("ZR1001", 0); // obj.plc.WriteInt32("ZR1001", 0);
@ -639,8 +704,10 @@ namespace Aucma.Core.ProductOffLine.Business
// 读取plc反馈信号 // 读取plc反馈信号
if (obj.plc.ReadInt16("ZR1002") == 2) if (obj.plc.ReadInt16("ZR1002") == 2)
{ {
log.Info(TempOffLineInfo2.ProductSNCode + "外侧plc反馈信号ZR1002读2");
TempOffLineInfo2.MsgInfo = TempOffLineInfo2.MsgInfo + "放行成功"; TempOffLineInfo2.MsgInfo = TempOffLineInfo2.MsgInfo + "放行成功";
TempOffLineInfo2.ProductRefreshFlag = true; // TempOffLineInfo2.ProductRefreshFlag = true;
RefreshScanMateriaCodeEvent(TempOffLineInfo2);
Console.WriteLine("收到plc放行成功"); Console.WriteLine("收到plc放行成功");
// 清空数据 // 清空数据
// obj.plc.WriteInt32("ZR1000", 0); // obj.plc.WriteInt32("ZR1000", 0);

@ -52,26 +52,41 @@ namespace Aucma.Core.ProductOffLine.ViewModels
// 成品下线操作mes数据 // 成品下线操作mes数据
private readonly IOffLineInfoServices? _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>(); private readonly IOffLineInfoServices? _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
System.Timers.Timer timer = new System.Timers.Timer(500);//界面刷新定时器 // System.Timers.Timer timer = new System.Timers.Timer(500);//界面刷新定时器
private readonly IBaseBomInfoServices? _baseBomInfoServices; private readonly IBaseBomInfoServices? _baseBomInfoServices;
private OffLineBusiness offLineBusiness = OffLineBusiness.Instance; private OffLineBusiness offLineBusiness = OffLineBusiness.Instance;
private static double aaa = 100.0; private static double aaa = 100.0;
int a = 0; int a = 0;
public IndexPageViewModel() public IndexPageViewModel()
{ {
OffLineBusiness.RefreshScanMateriaCodeEvent += ModelToPage;
OffLineBusiness.RefreshChartsEvent += RefreshCharts;
OffLineQty = "235"; OffLineQty = "235";
_offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>(); _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
_baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>(); _baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
InitEveryDayMethod(); InitEveryDayMethod();
// 刷新界面扫码信息 // 刷新界面扫码信息
RefreshPageListen(); // RefreshPageListen();
LoadData(); LoadData();
// offLineBusiness.test(); //Task.Run(() =>
//{
// Thread.Sleep(5000);
// InitEveryDayMethod();
// // Thread.Sleep(5000);
// // InitEveryDayMethod();
//});
// offLineBusiness.test();
} }
/// <summary>
/// 刷新页面展示图表
/// </summary>
public void RefreshCharts()
{
InitEveryDayMethod();
AddDataGrid();
}
#region 参数定义 #region 参数定义
@ -278,40 +293,40 @@ namespace Aucma.Core.ProductOffLine.ViewModels
#region 界面刷新定时器 #region 界面刷新定时器
public void RefreshPageListen() //public void RefreshPageListen()
{ //{
timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshPage); // timer.Elapsed += new System.Timers.ElapsedEventHandler(RefreshPage);
timer.AutoReset = true; // timer.AutoReset = true;
timer.Enabled = true; // timer.Enabled = true;
timer.Start(); // timer.Start();
} //}
/// <summary> /// <summary>
/// 定时检测两个扫码实体是否需要刷新 /// 定时检测两个扫码实体是否需要刷新
/// </summary> /// </summary>
/// <param name="source"></param> /// <param name="source"></param>
/// <param name="e"></param> /// <param name="e"></param>
public void RefreshPage(object source, System.Timers.ElapsedEventArgs e) //public void RefreshPage(object source, System.Timers.ElapsedEventArgs e)
{ //{
if (OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag == true) // if (OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag == true)
{ // {
OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag = false; // OffLineBusiness.TempOffLineInfo1.ProductRefreshFlag = false;
ModelToPage(OffLineBusiness.TempOffLineInfo1); // ModelToPage(OffLineBusiness.TempOffLineInfo1);
LoadData(); // LoadData();
} // }
else if(OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag == true) // else if(OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag == true)
{ // {
OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag = false; // OffLineBusiness.TempOffLineInfo2.ProductRefreshFlag = false;
ModelToPage(OffLineBusiness.TempOffLineInfo2); // ModelToPage(OffLineBusiness.TempOffLineInfo2);
} // }
} //}
public void ModelToPage(TempInfo tempInfo) public void ModelToPage(TempInfo tempInfo)
{ {
App.Current.Dispatcher.Invoke(() => App.Current.Dispatcher.Invoke(() =>
@ -342,151 +357,153 @@ namespace Aucma.Core.ProductOffLine.ViewModels
await App.Current.Dispatcher.BeginInvoke((Action)(() => await App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
Achievement.Clear();
ProductionHourList = new List<string>(); ProductionHourList = new List<string>();
OffLineQty = "232"; // OffLineQty = "232";
for (int i = 8; i <= 19; i++) for (int i = 8; i <= 19; i++)
{ {
ProductionHourList.Add(i + ":00"); ProductionHourList.Add(i + ":00");
} }
ChartValues<int> achievement2 = new ChartValues<int>(); //ChartValues<int> achievement2 = new ChartValues<int>();
achievement2.Add(74); //achievement2.Add(74);
achievement2.Add(77); //achievement2.Add(77);
achievement2.Add(75); //achievement2.Add(75);
achievement2.Add(6); //achievement2.Add(6);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
achievement2.Add(0); //achievement2.Add(0);
var column2 = new ColumnSeries(); //var column2 = new ColumnSeries();
column2.DataLabels = true; //column2.DataLabels = true;
column2.Title = "产量"; //column2.Title = "产量";
column2.Values = achievement2; //column2.Values = achievement2;
column2.Foreground = Brushes.White; //column2.Foreground = Brushes.White;
Achievement.Add(column2); //Achievement.Add(column2);
MaterialNameList.Add("BCD-162CST,炫金色,A"); //MaterialNameList.Add("BCD-162CST,炫金色,A");
MaterialNameList.Add("BCD-212CHG,炫金色,A"); //MaterialNameList.Add("BCD-212CHG,炫金色,A");
MaterialNameList.Add("BCD-211CGN,星际灰,A"); //MaterialNameList.Add("BCD-211CGN,星际灰,A");
MaterialNameList.Add("BC/BD-310NF,银河灰,A"); //MaterialNameList.Add("BC/BD-310NF,银河灰,A");
MaterialNameList.Add("BC/BD-232WD,银河灰,A"); //MaterialNameList.Add("BC/BD-232WD,银河灰,A");
MaterialNameList.Add("BC/BD-145NF,炫金色,ZS,A"); //MaterialNameList.Add("BC/BD-145NF,炫金色,ZS,A");
ChartValues<int> achievement = new ChartValues<int>(); //ChartValues<int> achievement = new ChartValues<int>();
achievement.Add(41); //achievement.Add(41);
achievement.Add(37); //achievement.Add(37);
achievement.Add(37); //achievement.Add(37);
achievement.Add(47); //achievement.Add(47);
achievement.Add(39); //achievement.Add(39);
achievement.Add(19); //achievement.Add(19);
var column = new ColumnSeries(); //var column = new ColumnSeries();
column.DataLabels = true; //column.DataLabels = true;
column.Title = "型号"; //column.Title = "型号";
column.Values = achievement; //column.Values = achievement;
column.Foreground = Brushes.White; //column.Foreground = Brushes.White;
ModelStatistics.Add(column); //ModelStatistics.Add(column);
#region 小时产量统计 #region 小时产量统计
// List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result; List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
// if (listTime == null) return; if (listTime == null) return;
// // var aa =_offLineInfoServices.Query(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime<= listTime[11].startTime) // var aa =_offLineInfoServices.Query(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime<= listTime[11].startTime)
// // List<dynamic> hourAmount = _offLineInfoServices.QueryCharts1("CX_01"); // List<dynamic> hourAmount = _offLineInfoServices.QueryCharts1("CX_01");
// List<Admin.Core.Model.ViewModels.ChartsByTime> list = _offLineInfoServices.QueryCharts(listTime[0].startTime, listTime[11].startTime).Result; List<Admin.Core.Model.ViewModels.ChartsByTime> list = _offLineInfoServices.QueryCharts(listTime[0].startTime, listTime[11].startTime).Result;
// if (list == null) return; if (list == null) return;
// List<ChartsByTimeAmount> hourList1 = new List<ChartsByTimeAmount>(); List<ChartsByTimeAmount> hourList1 = new List<ChartsByTimeAmount>();
// // 当班下线数量 // 当班下线数量
// int sum = 0; int sum = 0;
// foreach(ChartsByTime item in list) foreach (ChartsByTime item in list)
// { {
// DateTime date = DateTime.ParseExact(item.date + ":00:00", "yyyy-MM-dd/HH:mm:ss", CultureInfo.InvariantCulture); DateTime date = DateTime.ParseExact(item.date + ":00:00", "yyyy-MM-dd/HH:mm:ss", CultureInfo.InvariantCulture);
// ChartsByTimeAmount hour = new ChartsByTimeAmount(); ChartsByTimeAmount hour = new ChartsByTimeAmount();
// hour.ProductCode = item.productLineCode; hour.ProductCode = item.productLineCode;
// hour.ProductDate = date; hour.ProductDate = date;
// hour.ProductAmount = item.Amount; hour.ProductAmount = item.Amount;
// sum += item.Amount; sum += item.Amount;
// hourList1.Add(hour); hourList1.Add(hour);
// } }
// // 当班下线数量页面赋值 // 当班下线数量页面赋值
// OffLineQty = sum.ToString(); OffLineQty = sum.ToString();
// if (hourList1 == null) return; if (hourList1 == null) return;
// var hourList = hourList1.Where(x => x.ProductCode.Equals("CX_02") && x.ProductDate>= listTime[0].startTime && x.ProductDate <= listTime[11].startTime); var hourList = hourList1.Where(x => x.ProductCode.Equals("CX_02") && x.ProductDate >= listTime[0].startTime && x.ProductDate <= listTime[11].startTime);
// List<string> xList = new List<string>(); List<string> xList = new List<string>();
// ChartValues<int> achievement2 = new ChartValues<int>(); ChartValues<int> achievement2 = new ChartValues<int>();
// foreach (var item in hourList) foreach (var item in hourList)
// { {
// xList.Add(item.ProductDate.Hour.ToString()+":00"); xList.Add(item.ProductDate.Hour.ToString() + ":00");
// achievement2.Add(item.ProductAmount); achievement2.Add(item.ProductAmount);
// } }
// var column2 = new ColumnSeries(); var column2 = new ColumnSeries();
// column2.DataLabels = true; column2.DataLabels = true;
// column2.Title = "产量"; column2.Title = "产量";
// column2.Values = achievement2; column2.Values = achievement2;
// column2.Foreground = Brushes.White; column2.Foreground = Brushes.White;
//// Achievement.Clear(); // Achievement.Clear();
// //Achievement.Add(column2);
// if (Achievement.Count > 0)
// {
// for (int i = 0; i < hourList.Count(); i++)
// {
// Achievement.FirstOrDefault().Values[i] = hourList.ElementAt(i).ProductAmount;
// }
// }
// else
// {
//Achievement.Add(column2); //Achievement.Add(column2);
// } if (Achievement.Count > 0)
{
for (int i = 0; i < hourList.Count(); i++)
{
Achievement.FirstOrDefault().Values[i] = hourList.ElementAt(i).ProductAmount;
}
}
else
{
Achievement.Clear();
Achievement.Add(column2);
}
// ProductionHourList = xList; ProductionHourList = xList;
#endregion #endregion
// #region 型号统计 #region 型号统计
// List<string> nameList = new List<string>(); List<string> nameList = new List<string>();
// ChartValues<int> achievement = new ChartValues<int>(); ChartValues<int> achievement = new ChartValues<int>();
// var column = new ColumnSeries(); var column = new ColumnSeries();
// List<OffLineInfo> offList = _offLineInfoServices.QueryAsync(x=>x.ProductScanTime>= listTime[0].startTime && x.ProductScanTime <= listTime[11].startTime).Result; List<OffLineInfo> offList = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].startTime).Result;
// var modelList = offList.GroupBy(x=>x.ProductRemark); var modelList = offList.GroupBy(x => x.ProductModel);
// foreach(var item in modelList) foreach (var item in modelList)
// { {
// achievement.Add(item.Count()); achievement.Add(item.Count());
// nameList.Add(item.Key); nameList.Add(item.Key);
// } }
// column.DataLabels = true; column.DataLabels = true;
// column.Title = "型号"; column.Title = "型号";
// column.Values = achievement; column.Values = achievement;
// column.Foreground = Brushes.White; column.Foreground = Brushes.White;
// // x轴 // x轴
// MaterialNameList = null; MaterialNameList = null;
// MaterialNameList = nameList; MaterialNameList = nameList;
// // y轴 // y轴
// if (ModelStatistics.Count > 0) if (ModelStatistics.Count > 0)
// { {
// for (int i = 0; i < modelList.Count(); i++) for (int i = 0; i < modelList.Count(); i++)
// { {
// Achievement.FirstOrDefault().Values[i] = modelList.ElementAt(i).Count(); Achievement.FirstOrDefault().Values[i] = modelList.ElementAt(i).Count();
// } }
// } }
// else else
// { {
// ModelStatistics.Add(column); ModelStatistics.Add(column);
// } }
})); }));
//#endregion #endregion
} }
//private async void InitEveryDayMethod() //private async void InitEveryDayMethod()
@ -538,23 +555,59 @@ namespace Aucma.Core.ProductOffLine.ViewModels
public void LoadData() public void LoadData()
{ {
OffLineInfo record = _offLineInfoServices.FirstAsync().Result; List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
if (listTime == null) return;
List<OffLineInfo> list = _offLineInfoServices.Query(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].endTime);
if(list==null || list.Count<=0) return;
list = list.OrderBy(x=>x.ProductScanTime).ToList();
// OffLineInfo record = _offLineInfoServices.FirstAsync().Result;
Application.Current.Dispatcher.Invoke(() =>
{
foreach(OffLineInfo record in list)
{
ListItems.Insert(0, new TempInfo()
{
No = ListItems.Count + 1,
ProductOrderNo = record.ProductOrderNo,
ProductSNCode = record.ProductSNCode,
ProductModel = record.ProductModel,
ProductRemark = record.ProductRemark,
QualityResult = "成功",
ProductScanTime = record.ProductScanTime,
});
}
});
}
public void AddDataGrid()
{
List<WorkTime> listTime = _baseBomInfoServices.getWorkTime().Result;
if (listTime == null) return;
List<OffLineInfo> list = _offLineInfoServices.Query(x => x.ProductScanTime >= listTime[0].startTime && x.ProductScanTime <= listTime[11].endTime);
if (list == null || list.Count <= 0) return;
OffLineInfo record = list.OrderByDescending(x => x.ProductScanTime).FirstOrDefault();
//OffLineInfo record = _offLineInfoServices.FirstAsync(x=>x.ProductScanTime).Result;
if(record.ProductSNCode!= ListItems[0].ProductSNCode && record.ProductSNCode != ListItems[1].ProductSNCode)
{
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
ListItems.Insert(0, new TempInfo() ListItems.Insert(0, new TempInfo()
{ {
No = ListItems.Count + 1, No = ListItems.Count + 1,
ProductOrderNo = record.ProductOrderNo, ProductOrderNo = record.ProductOrderNo,
ProductSNCode = record.ProductSNCode.Substring(0, record.ProductSNCode.Length - 3) + new Random().Next(100, 1000).ToString(), ProductSNCode = record.ProductSNCode,
ProductModel = record.ProductModel, ProductModel = record.ProductModel,
ProductRemark = record.ProductRemark, ProductRemark = record.ProductRemark,
QualityResult = "成功", QualityResult = "成功",
ProductScanTime = DateTime.Now ProductScanTime = record.ProductScanTime,
}); });
}); });
} }
}
} }

@ -19,6 +19,13 @@ namespace Aucma.Core.ProductOffLine.ViewModels
{ {
public partial class MainWindowViewModel : ObservableObject public partial class MainWindowViewModel : ObservableObject
{ {
#region 委托定义
/// <summary>
/// 历史记录图表刷新
/// </summary>
public delegate void RefreshCharts();
public static event RefreshCharts? RefreshChartsEvent;
#endregion
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel)); private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPageView firstPage = new IndexPageView();//首页 private IndexPageView firstPage = new IndexPageView();//首页
@ -52,6 +59,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
Task.Run(() => Task.Run(() =>
{ {
Thread.Sleep(2000); Thread.Sleep(2000);
//MvCodeHelper1.DeviceListAcq();//获取创建设备 //MvCodeHelper1.DeviceListAcq();//获取创建设备
// MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据 // MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据
Business.MvCodeHelper.Shell(); Business.MvCodeHelper.Shell();
@ -63,8 +71,21 @@ namespace Aucma.Core.ProductOffLine.ViewModels
//MvCodeHelper1.DeviceListAcq();//获取创建设备 //MvCodeHelper1.DeviceListAcq();//获取创建设备
// MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据 // MvCodeHelper1.StartGrab(); // 开启触发扫码接收数据
Business.MvCodeHelper.Liner(); Business.MvCodeHelper.Liner();
}); });
// 心跳线程
//Task.Run(() =>
//{
// while (true)
// {
// //扫码器心跳监测并重连
// MvCodeHelper.JudgeShellIsConnectedAndReConnect();
// Thread.Sleep(2000);
// }
//});
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -74,15 +95,15 @@ namespace Aucma.Core.ProductOffLine.ViewModels
} }
#endregion #endregion
public void RefreshScanner(string ip) public void RefreshScanner(string ip,bool flag)
{ {
if (ip == "外侧") if (ip == "外侧")
{ {
Scanner1State(true); Scanner1State(flag); ;
} }
else if(ip == "内侧") else if(ip == "内侧")
{ {
Scanner2State(true); Scanner2State(flag);
} }
} }
#region 设备状态刷新 #region 设备状态刷新
@ -245,6 +266,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
UserContent = firstPage; UserContent = firstPage;
break; break;
case "RecordPage": case "RecordPage":
RefreshChartsEvent?.Invoke();
UserContent = recordPage; UserContent = recordPage;
break; break;
case "QualityPage": case "QualityPage":

@ -13,6 +13,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Documents; using System.Windows.Documents;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Tab;
namespace Aucma.Core.ProductOffLine.ViewModels namespace Aucma.Core.ProductOffLine.ViewModels
{ {
@ -23,6 +24,7 @@ namespace Aucma.Core.ProductOffLine.ViewModels
public StatisticsPageViewModel() { public StatisticsPageViewModel() {
_offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>(); _offLineInfoServices = App.ServiceProvider.GetService<IOffLineInfoServices>();
MainWindowViewModel.RefreshChartsEvent += LoadData;
LoadData(); LoadData();
} }
@ -31,11 +33,14 @@ namespace Aucma.Core.ProductOffLine.ViewModels
#region 加载DataGrid数据 #region 加载DataGrid数据
private void LoadData() private void LoadData()
{ {
ListItems.Clear();
TotalItem.Clear();
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
List<OffLineInfo> list = _offLineInfoServices.QueryAsync().Result List<OffLineInfo> list = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= DateTime.Now.AddDays(-2)).Result;
.OrderByDescending(x => x.ProductScanTime) if(list==null || list.Count<=0) return;
.ToList(); list = list.OrderByDescending(x => x.ProductScanTime).ToList();
if (list != null) if (list != null)
{ {
foreach (OffLineInfo record in list) foreach (OffLineInfo record in list)
@ -96,45 +101,64 @@ namespace Aucma.Core.ProductOffLine.ViewModels
[RelayCommand] [RelayCommand]
private void ExecQuery(object obj) private void ExecQuery(object obj)
{ {
//List<CodeBindingRecord> list; List<OffLineInfo> list = null;
//var result = (StatisticModel)obj; var result = (StatisticModel)obj;
//if (string.IsNullOrEmpty(result.BeginTime) && string.IsNullOrEmpty(result.EndTime)) if (string.IsNullOrEmpty(result.BeginTime) && string.IsNullOrEmpty(result.EndTime))
//{ {
// list = await _codeBindingRecordServices.QueryAllByTime(null, null); return;
//} }
//else if (string.IsNullOrEmpty(result.BeginTime)) else if (string.IsNullOrEmpty(result.BeginTime))
//{ {
// list = await _codeBindingRecordServices.QueryAllByTime(result.BeginTime, null); DateTime EndTime = Convert.ToDateTime(result.EndTime);
//}
//else if (string.IsNullOrEmpty(result.EndTime)) list = _offLineInfoServices.QueryAsync(x => x.ProductScanTime <= EndTime.AddDays(1)).Result;
//{ }
// list = await _codeBindingRecordServices.QueryAllByTime(null, result.EndTime); else if (string.IsNullOrEmpty(result.EndTime))
//} {
//else DateTime BeginTime = Convert.ToDateTime(result.BeginTime);
//{ list = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= BeginTime).Result;
// DateTime theBeginTime = Convert.ToDateTime(result.BeginTime); }
// DateTime theEndTime = Convert.ToDateTime(result.EndTime); else
// if (theBeginTime > theEndTime) {
// { DateTime BeginTime = Convert.ToDateTime(result.BeginTime);
// MessageBox.Show("结束时间要大于开始时间!"); DateTime EndTime = Convert.ToDateTime(result.EndTime);
// return; if (BeginTime > EndTime)
// } {
// list = await _codeBindingRecordServices.QueryAllByTime(result.BeginTime, result.EndTime); MessageBox.Show("结束时间要大于开始时间!");
//} return;
}
list = _offLineInfoServices.QueryAsync(x => x.ProductScanTime >= BeginTime && x.ProductScanTime<= EndTime.AddDays(1)).Result;
//if (list != null) }
//{
// System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
// { if (list != null)
// MaterialDataGrid.Clear(); {
// foreach (CodeBindingRecord item in list) list = list.OrderByDescending(x => x.ProductScanTime).ToList();
// {
// MaterialDataGrid.Add(new ReaderInfo() { No = item.ObjId, BoxCode = item.BoxCode, BoxName = item.BoxName, ProductCode = item.ProductCode, BindingResult = item.BindingResult, RecordTime = item.RecordTime1.ToString() }); ListItems.Clear();
// } TotalItem.Clear();
Application.Current.Dispatcher.Invoke(() =>
// })); {
//} foreach (OffLineInfo record in list)
{
ListItems.Add(new TempInfo() { No = ListItems.Count + 1, ProductOrderNo = record.ProductOrderNo, ProductSNCode = record.ProductSNCode, ProductModel = record.ProductModel, ProductRemark = record.ProductRemark, ProductScanTime = record.ProductScanTime });
}
var countByProductModel = list.GroupBy(x => x.ProductModel).Select(group => new
{
ProductCode = group.First().ProductCode,
ProductRemark = group.First().ProductRemark,
ProductModel = group.Key,
Count = group.Count()
}).ToList();
foreach (var item in countByProductModel)
{
TotalItem.Add(new TempInfo() { No = TotalItem.Count + 1, ProductCode = item.ProductCode, ProductModel = item.ProductModel, ProductRemark = item.ProductRemark, Count = item.Count });
}
});
}
} }
#endregion #endregion
} }

@ -313,7 +313,7 @@
<DataGridTextColumn Binding="{Binding ProductModel}" Header="产品型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" /> <DataGridTextColumn Binding="{Binding ProductModel}" Header="产品型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding ProductRemark}" Header="特征信息" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductRemark}" Header="特征信息" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding QualityResult}" Header="质检结果" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding QualityResult}" Header="质检结果" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductScanTime,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="扫描时间" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductScanTime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="扫描时间" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>

@ -45,8 +45,8 @@
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding ShiftStr}" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> <TextBlock Grid.Row="0" Text="{Binding ShiftStr}" FontSize="20" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Row="1" Text="{Binding CurrentDateTime}" FontSize="20" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> <TextBlock Grid.Row="1" Text="{Binding CurrentDateTime}" FontSize="20" Foreground="White" FontWeight="Bold" Margin="0,0,30,10"/>
<!--<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/> <!--<TextBlock Grid.Column="1" Text="|" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,30,0"/>
<TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>--> <TextBlock Grid.Column="2" Text="SCADA" FontSize="25" Foreground="White" FontWeight="Bold" Margin="0,0,10,0"/>-->
</Grid> </Grid>

@ -149,7 +149,7 @@
<DataGridTextColumn Binding="{Binding ProductSNCode}" Header="产品条码" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductSNCode}" Header="产品条码" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductModel}" Header="产品型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductModel}" Header="产品型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductRemark}" Header="特征信息" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductRemark}" Header="特征信息" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductScanTime,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="扫描时间" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/> <DataGridTextColumn Binding="{Binding ProductScanTime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="扫描时间" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
</UniformGrid> </UniformGrid>

@ -208,12 +208,14 @@
"ScannerServer": [ "ScannerServer": [
{ {
"Id": 1, "Id": 1,
"Ip": "10.10.92.140", //"Ip": "10.10.92.140",
"Ip": "10.10.92.121",
"Name": "内侧扫码器1" "Name": "内侧扫码器1"
}, },
{ {
"Id": 2, "Id": 2,
"Ip": "10.10.92.141", // "Ip": "10.10.92.141",
"Ip": "10.10.92.122",
"Name": "外侧扫码器2" "Name": "外侧扫码器2"
} }
], ],

Loading…
Cancel
Save