diff --git a/shangjian/.vs/BL/v17/.suo b/shangjian/.vs/BL/v17/.suo
index 35755d7..f2a7f07 100644
Binary files a/shangjian/.vs/BL/v17/.suo and b/shangjian/.vs/BL/v17/.suo differ
diff --git a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.application b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.application
index ef6896e..7b6e3dd 100644
--- a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.application
+++ b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.application
@@ -14,7 +14,7 @@
- 5nsrkfe5IXcthCM2+m3k9Y4yChx8IqJYU3f1Sxq/sG0=
+ BF6HEC9M/jagPc3wN6LzoIFOcqz6U6GkFfq7B5nijQc=
diff --git a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe
index 45a5f7a..656cb6e 100644
Binary files a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe and b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe differ
diff --git a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe.manifest b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe.manifest
index b5b6b9e..ef2ad1f 100644
--- a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe.manifest
+++ b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.exe.manifest
@@ -49,7 +49,7 @@
- RdMRkRfxKcw3U8ADB8Tu6YmAoNCF0PI0PcoxnRKNOUU=
+ iy/mPB9no8LMx3n5XtwTBu3OAI6tw4qGaQVBeTlUnhM=
diff --git a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.pdb b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.pdb
index bd4d823..3f2681d 100644
Binary files a/shangjian/AutoUpdate/bin/Debug/AutoUpdate.pdb and b/shangjian/AutoUpdate/bin/Debug/AutoUpdate.pdb differ
diff --git a/shangjian/AutoUpdate/bin/Debug/app.publish/AutoUpdate.exe b/shangjian/AutoUpdate/bin/Debug/app.publish/AutoUpdate.exe
index 45a5f7a..656cb6e 100644
Binary files a/shangjian/AutoUpdate/bin/Debug/app.publish/AutoUpdate.exe and b/shangjian/AutoUpdate/bin/Debug/app.publish/AutoUpdate.exe differ
diff --git a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.application b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.application
index ef6896e..7b6e3dd 100644
--- a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.application
+++ b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.application
@@ -14,7 +14,7 @@
- 5nsrkfe5IXcthCM2+m3k9Y4yChx8IqJYU3f1Sxq/sG0=
+ BF6HEC9M/jagPc3wN6LzoIFOcqz6U6GkFfq7B5nijQc=
diff --git a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe
index 45a5f7a..656cb6e 100644
Binary files a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe and b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe differ
diff --git a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe.manifest b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe.manifest
index b5b6b9e..ef2ad1f 100644
--- a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe.manifest
+++ b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.exe.manifest
@@ -49,7 +49,7 @@
- RdMRkRfxKcw3U8ADB8Tu6YmAoNCF0PI0PcoxnRKNOUU=
+ iy/mPB9no8LMx3n5XtwTBu3OAI6tw4qGaQVBeTlUnhM=
diff --git a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.pdb b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.pdb
index bd4d823..3f2681d 100644
Binary files a/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.pdb and b/shangjian/AutoUpdate/obj/x86/Debug/AutoUpdate.pdb differ
diff --git a/shangjian/CentralControl/bin/Debug/CentralControl.exe b/shangjian/CentralControl/bin/Debug/CentralControl.exe
index d78b945..c28a040 100644
Binary files a/shangjian/CentralControl/bin/Debug/CentralControl.exe and b/shangjian/CentralControl/bin/Debug/CentralControl.exe differ
diff --git a/shangjian/CentralControl/bin/Debug/CentralControl.pdb b/shangjian/CentralControl/bin/Debug/CentralControl.pdb
index 8134646..49b24d3 100644
Binary files a/shangjian/CentralControl/bin/Debug/CentralControl.pdb and b/shangjian/CentralControl/bin/Debug/CentralControl.pdb differ
diff --git a/shangjian/CentralControl/bin/Debug/CommonFunc.dll b/shangjian/CentralControl/bin/Debug/CommonFunc.dll
index a3e9eb7..7c8518c 100644
Binary files a/shangjian/CentralControl/bin/Debug/CommonFunc.dll and b/shangjian/CentralControl/bin/Debug/CommonFunc.dll differ
diff --git a/shangjian/CentralControl/bin/Debug/CommonFunc.pdb b/shangjian/CentralControl/bin/Debug/CommonFunc.pdb
index 324b426..04a6282 100644
Binary files a/shangjian/CentralControl/bin/Debug/CommonFunc.pdb and b/shangjian/CentralControl/bin/Debug/CommonFunc.pdb differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Data.dll b/shangjian/CentralControl/bin/Debug/XGL.Data.dll
index b2eb9d9..45280c8 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Data.dll and b/shangjian/CentralControl/bin/Debug/XGL.Data.dll differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Data.pdb b/shangjian/CentralControl/bin/Debug/XGL.Data.pdb
index eb05f6f..4f68af5 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Data.pdb and b/shangjian/CentralControl/bin/Debug/XGL.Data.pdb differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Models.dll b/shangjian/CentralControl/bin/Debug/XGL.Models.dll
index 2bb985a..fa5ec7e 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Models.dll and b/shangjian/CentralControl/bin/Debug/XGL.Models.dll differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Models.pdb b/shangjian/CentralControl/bin/Debug/XGL.Models.pdb
index 3cb4a8c..6ac9c55 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Models.pdb and b/shangjian/CentralControl/bin/Debug/XGL.Models.pdb differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Thrift.dll b/shangjian/CentralControl/bin/Debug/XGL.Thrift.dll
index d900f7b..ed604e6 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Thrift.dll and b/shangjian/CentralControl/bin/Debug/XGL.Thrift.dll differ
diff --git a/shangjian/CentralControl/bin/Debug/XGL.Thrift.pdb b/shangjian/CentralControl/bin/Debug/XGL.Thrift.pdb
index b5ddcae..9bb1fbb 100644
Binary files a/shangjian/CentralControl/bin/Debug/XGL.Thrift.pdb and b/shangjian/CentralControl/bin/Debug/XGL.Thrift.pdb differ
diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache b/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache
index 72c6849..c2224cd 100644
Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache and b/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache differ
diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.exe b/shangjian/CentralControl/obj/Debug/CentralControl.exe
index d78b945..c28a040 100644
Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.exe and b/shangjian/CentralControl/obj/Debug/CentralControl.exe differ
diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.pdb b/shangjian/CentralControl/obj/Debug/CentralControl.pdb
index 8134646..49b24d3 100644
Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.pdb and b/shangjian/CentralControl/obj/Debug/CentralControl.pdb differ
diff --git a/shangjian/LanJuLib/bin/Debug/CommonFunc.dll b/shangjian/LanJuLib/bin/Debug/CommonFunc.dll
index a3e9eb7..7c8518c 100644
Binary files a/shangjian/LanJuLib/bin/Debug/CommonFunc.dll and b/shangjian/LanJuLib/bin/Debug/CommonFunc.dll differ
diff --git a/shangjian/LanJuLib/bin/Debug/CommonFunc.pdb b/shangjian/LanJuLib/bin/Debug/CommonFunc.pdb
index 324b426..04a6282 100644
Binary files a/shangjian/LanJuLib/bin/Debug/CommonFunc.pdb and b/shangjian/LanJuLib/bin/Debug/CommonFunc.pdb differ
diff --git a/shangjian/LanJuLib/bin/Debug/XGL.Models.dll b/shangjian/LanJuLib/bin/Debug/XGL.Models.dll
index 2bb985a..fa5ec7e 100644
Binary files a/shangjian/LanJuLib/bin/Debug/XGL.Models.dll and b/shangjian/LanJuLib/bin/Debug/XGL.Models.dll differ
diff --git a/shangjian/LanJuLib/bin/Debug/XGL.Models.pdb b/shangjian/LanJuLib/bin/Debug/XGL.Models.pdb
index 3cb4a8c..6ac9c55 100644
Binary files a/shangjian/LanJuLib/bin/Debug/XGL.Models.pdb and b/shangjian/LanJuLib/bin/Debug/XGL.Models.pdb differ
diff --git a/shangjian/LanJuLib/obj/Debug/LanJuLib.csproj.AssemblyReference.cache b/shangjian/LanJuLib/obj/Debug/LanJuLib.csproj.AssemblyReference.cache
index 93cbdb5..a42fc34 100644
Binary files a/shangjian/LanJuLib/obj/Debug/LanJuLib.csproj.AssemblyReference.cache and b/shangjian/LanJuLib/obj/Debug/LanJuLib.csproj.AssemblyReference.cache differ
diff --git a/shangjian/WPFupdate/obj/Debug/WPFupdate.csproj.AssemblyReference.cache b/shangjian/WPFupdate/obj/Debug/WPFupdate.csproj.AssemblyReference.cache
index fba2e64..293b360 100644
Binary files a/shangjian/WPFupdate/obj/Debug/WPFupdate.csproj.AssemblyReference.cache and b/shangjian/WPFupdate/obj/Debug/WPFupdate.csproj.AssemblyReference.cache differ
diff --git a/shangjian/XGL.Data/DBService/FormingMachineService.cs b/shangjian/XGL.Data/DBService/FormingMachineService.cs
index ef41e3a..fbd9b63 100644
--- a/shangjian/XGL.Data/DBService/FormingMachineService.cs
+++ b/shangjian/XGL.Data/DBService/FormingMachineService.cs
@@ -316,6 +316,30 @@ VALUES
return issucc;//> 0 ? true : false;
}
+ ///
+ /// 插入消耗表
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public bool InsertConsumeInfo(string qty, string remark, DataRowView selectedRow, string newReportCode, string siteCode)
+ {
+ string sql = $@" INSERT INTO [dbo].[mes_report_work_consume]
+ ([record_id], [workorder_code], [material_code], [material_name], [material_spc],
+ [quantity], [unit], [remark], [attr1], [attr2],
+ [attr3], [attr4], [create_by], [create_time], [update_by],
+ [update_time], [factory_code], [report_code], [del_flag])
+ VALUES
+ ('{Common.GetUUID()}', '{selectedRow["workorder_code"]}', '{selectedRow["product_code"]}', '{selectedRow["product_name"]}', '{selectedRow["product_spc"]}',
+ '{qty}','{selectedRow["unit"]}', '{remark}', NULL, NULL,
+ NULL, NULL, '{LoginUser.UserName}', GetDate(), '{LoginUser.UserName}',
+ GetDate(), '{siteCode}', '{newReportCode}', '0'); ";
+ int ret = Utils.netClientDBHelper.executeUpdate(sql);
+ return ret > 0 ? true : false;
+ }
+
///
/// 根据设备编码获取当前机台最新的吊满的RFID信息
diff --git a/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs b/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
index a93515e..9f60daa 100644
--- a/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
+++ b/shangjian/XGL.Data/DBServiceFinishProd/FinishProdDBService.cs
@@ -177,6 +177,24 @@ where CONVERT(VARCHAR(10), upload_time , 120)= CONVERT(VARCHAR(10), GetDate() ,
return null;
}
+
+
+ public DataTable GetCosumeData(string workorder)
+ {
+ string sql = $@"select '0' as qty, workorder_code, material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
+detail.create_by,detail.create_time,detail.update_by,detail.update_time,locator,need_date,
+recoil,fund_quanlity,detail.del_flag
+from mes_prepare_detail detail
+LEFT JOIN mes_prepare pre on detail.prepare_id = pre.prepare_id
+where detail.parent_work_order ='{workorder}'";
+ DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
+ if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
+ {
+ return dtset.Tables[0];
+ }
+ return null;
+ }
+
public DataTable GetCostCenter()
{
string sql = $"select factory_code,factory_name from sys_factory where f_type = 'c'";
@@ -494,7 +512,7 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
public DataTable GetWetPlanInfo(string deviceCode, string date)
{
string sql = $@"select workorder.factory_code,workorder.product_date as plan_time, workorder.workorder_id,workorder.workorder_code, product_code,product_name,
-product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no
+product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no,product_spc
from pro_order_workorder workorder
left JOIN base_shifts_t shifts on workorder.shift_id = shifts.shift_id
left JOIN pro_order_workorder_batch batch on workorder.workorder_id = batch.workorder_id
@@ -654,7 +672,7 @@ detail.create_by,detail.create_time,detail.update_by,detail.update_time,locator,
recoil,fund_quanlity,detail.del_flag
from mes_prepare_detail detail
LEFT JOIN mes_prepare pre on detail.prepare_id = pre.prepare_id
-where pre.workorder_code = '{processid}'"; //where CONVERT(VARCHAR(10), wet.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120)
+where detail.parent_work_order = '{processid}'"; //where CONVERT(VARCHAR(10), wet.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120)
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
diff --git a/shangjian/XGL.Model/bin/Debug/XGL.Models.dll b/shangjian/XGL.Model/bin/Debug/XGL.Models.dll
index 2bb985a..fa5ec7e 100644
Binary files a/shangjian/XGL.Model/bin/Debug/XGL.Models.dll and b/shangjian/XGL.Model/bin/Debug/XGL.Models.dll differ
diff --git a/shangjian/XGL.Model/bin/Debug/XGL.Models.pdb b/shangjian/XGL.Model/bin/Debug/XGL.Models.pdb
index 3cb4a8c..6ac9c55 100644
Binary files a/shangjian/XGL.Model/bin/Debug/XGL.Models.pdb and b/shangjian/XGL.Model/bin/Debug/XGL.Models.pdb differ
diff --git a/shangjian/XGL.Model/obj/Debug/XGL.Models.dll b/shangjian/XGL.Model/obj/Debug/XGL.Models.dll
index 2bb985a..fa5ec7e 100644
Binary files a/shangjian/XGL.Model/obj/Debug/XGL.Models.dll and b/shangjian/XGL.Model/obj/Debug/XGL.Models.dll differ
diff --git a/shangjian/XGL.Model/obj/Debug/XGL.Models.pdb b/shangjian/XGL.Model/obj/Debug/XGL.Models.pdb
index 3cb4a8c..6ac9c55 100644
Binary files a/shangjian/XGL.Model/obj/Debug/XGL.Models.pdb and b/shangjian/XGL.Model/obj/Debug/XGL.Models.pdb differ
diff --git a/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.dll b/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.dll
index d900f7b..ed604e6 100644
Binary files a/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.dll and b/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.dll differ
diff --git a/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.pdb b/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.pdb
index b5ddcae..9bb1fbb 100644
Binary files a/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.pdb and b/shangjian/XGL.Thrift/bin/Debug/XGL.Thrift.pdb differ
diff --git a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.csproj.AssemblyReference.cache b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.csproj.AssemblyReference.cache
index 3b7402d..5f076da 100644
Binary files a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.csproj.AssemblyReference.cache and b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.csproj.AssemblyReference.cache differ
diff --git a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.dll b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.dll
index d900f7b..ed604e6 100644
Binary files a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.dll and b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.dll differ
diff --git a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.pdb b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.pdb
index b5ddcae..9bb1fbb 100644
Binary files a/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.pdb and b/shangjian/XGL.Thrift/obj/Debug/XGL.Thrift.pdb differ
diff --git a/shangjian/XGL/HFstatus.xaml.cs b/shangjian/XGL/HFstatus.xaml.cs
index 060e848..0ec0421 100644
--- a/shangjian/XGL/HFstatus.xaml.cs
+++ b/shangjian/XGL/HFstatus.xaml.cs
@@ -48,50 +48,50 @@ namespace XGL
}
DBService userDbWareHouse = new DBService();
-
+
public void selectHFvalue(object sender, EventArgs e)
{
- var dt= userDbWareHouse.GetHFStatusInfo();
+ var dt = userDbWareHouse.GetHFStatusInfo();
foreach (var item in dt)
{
- if (item.device_code=="H18")
+ if (item.device_code == "H18")
{
if (item.property == "Intheoven")
{
shuliang18.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian18.Text = "有车";
- menqian18.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian18.Text = "无";
- menqian18.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian18.Text = "有车:" + item.isvalue.ToString();
+ menqian18.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian18.Text = "无";
+ menqian18.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi18.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi18.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze18.IsChecked == true)
{
serialHelper.ComOn();
serialHelper.redLightOn();
serialHelper.buzzerOn();
serialHelper.ComOff();
- MessageBox.Show("烘房18门前小车数量值保持超过"+ menqian + "分钟请查看!!!");
- bianhao18.Background= new SolidColorBrush(Colors.Wheat);
+ MessageBox.Show("烘房18门前小车数量值保持超过" + menqian + "分钟请查看!!!");
+ bianhao18.Background = new SolidColorBrush(Colors.Wheat);
}
}
else
@@ -99,58 +99,59 @@ namespace XGL
bianhao18.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai18.Text = "自动";
+ zhuangtai18.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai18.Text = "自动";
- zhuangtai18.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai18.Foreground = new SolidColorBrush(Colors.Red);
- zhuangtai18.Text = "手动或异常";
- }
-
+ zhuangtai18.Foreground = new SolidColorBrush(Colors.Red);
+ zhuangtai18.Text = "手动或异常";
}
-
- }else if (item.device_code == "H17")
+
+ }
+
+ }
+ else if (item.device_code == "H17")
{
if (item.property == "Intheoven")
{
shuliang17.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian17.Text = "有车";
- menqian17.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian17.Text = "无";
- menqian17.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian17.Text = "有车:" + item.isvalue.ToString();
+ menqian17.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian17.Text = "无";
+ menqian17.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi17.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi17.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze17.IsChecked == true)
{
serialHelper.ComOn();
@@ -159,7 +160,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房17门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao17.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -167,28 +168,28 @@ namespace XGL
bianhao17.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai17.Text = "自动";
+ zhuangtai17.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai17.Text = "自动";
- zhuangtai17.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai17.Text = "手动或异常";
- zhuangtai17.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai17.Text = "手动或异常";
+ zhuangtai17.Foreground = new SolidColorBrush(Colors.Red);
}
-
-
+
+ }
+
+
}
else if (item.device_code == "H16")
{
@@ -197,29 +198,29 @@ namespace XGL
shuliang16.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian16.Text = "有车";
- menqian16.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian16.Text = "无";
- menqian16.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian16.Text = "有车:" + item.isvalue.ToString();
+ menqian16.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian16.Text = "无";
+ menqian16.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi16.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi16.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze16.IsChecked == true)
{
serialHelper.ComOn();
@@ -228,7 +229,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房16门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao16.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -236,27 +237,27 @@ namespace XGL
bianhao16.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai16.Text = "自动";
+ zhuangtai16.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai16.Text = "自动";
- zhuangtai16.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai16.Text = "手动或异常";
- zhuangtai16.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai16.Text = "手动或异常";
+ zhuangtai16.Foreground = new SolidColorBrush(Colors.Red);
}
-
+
+ }
+
}
else if (item.device_code == "H15")
{
@@ -265,29 +266,29 @@ namespace XGL
shuliang15.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian15.Text = "有车";
- menqian15.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian15.Text = "无";
- menqian15.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian15.Text = "有车:" + item.isvalue.ToString();
+ menqian15.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian15.Text = "无";
+ menqian15.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi15.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi15.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze15.IsChecked == true)
{
serialHelper.ComOn();
@@ -296,7 +297,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房15门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao15.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -304,26 +305,26 @@ namespace XGL
bianhao15.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai15.Text = "自动";
+ zhuangtai15.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai15.Text = "自动";
- zhuangtai15.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai15.Text = "手动或异常";
- zhuangtai15.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai15.Text = "手动或异常";
+ zhuangtai15.Foreground = new SolidColorBrush(Colors.Red);
}
+
+ }
}
else if (item.device_code == "H14")
{
@@ -332,29 +333,29 @@ namespace XGL
shuliang14.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian14.Text = "有车";
- menqian14.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian14.Text = "无";
- menqian14.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian14.Text = "有车:" + item.isvalue.ToString();
+ menqian14.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian14.Text = "无";
+ menqian14.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi14.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi14.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze14.IsChecked == true)
{
serialHelper.ComOn();
@@ -363,7 +364,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房14门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao14.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -371,27 +372,27 @@ namespace XGL
bianhao14.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai14.Text = "自动";
+ zhuangtai14.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai14.Text = "自动";
- zhuangtai14.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai14.Text = "手动或异常";
- zhuangtai14.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai14.Text = "手动或异常";
+ zhuangtai14.Foreground = new SolidColorBrush(Colors.Red);
}
-
+
+ }
+
}
else if (item.device_code == "H13")
{
@@ -400,29 +401,29 @@ namespace XGL
shuliang13.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian13.Text = "有车";
- menqian13.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian13.Text = "无";
- menqian13.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian13.Text = "有车:" + item.isvalue.ToString();
+ menqian13.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian13.Text = "无";
+ menqian13.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi13.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi13.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze13.IsChecked == true)
{
serialHelper.ComOn();
@@ -431,7 +432,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房13门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao13.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -439,27 +440,27 @@ namespace XGL
bianhao13.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai13.Text = "自动";
+ zhuangtai13.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai13.Text = "自动";
- zhuangtai13.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai13.Text = "手动或异常";
- zhuangtai13.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai13.Text = "手动或异常";
+ zhuangtai13.Foreground = new SolidColorBrush(Colors.Red);
}
-
+
+ }
+
}
else if (item.device_code == "H12")
{
@@ -469,29 +470,29 @@ namespace XGL
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian12.Text = "有车";
- menqian12.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian12.Text = "无";
- menqian12.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian12.Text = "有车:" + item.isvalue.ToString();
+ menqian12.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian12.Text = "无";
+ menqian12.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi12.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi12.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze12.IsChecked == true)
{
serialHelper.ComOn();
@@ -500,7 +501,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房12门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao12.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -508,26 +509,26 @@ namespace XGL
bianhao12.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai12.Text = "自动";
+ zhuangtai12.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai12.Text = "自动";
- zhuangtai12.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai12.Text = "手动或异常";
- zhuangtai12.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai12.Text = "手动或异常";
+ zhuangtai12.Foreground = new SolidColorBrush(Colors.Red);
}
+
+ }
}
else if (item.device_code == "H11")
{
@@ -536,29 +537,29 @@ namespace XGL
shuliang11.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian11.Text = "有车";
- menqian11.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian11.Text = "无";
- menqian11.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian11.Text = "有车:" + item.isvalue.ToString();
+ menqian11.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian11.Text = "无";
+ menqian11.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi11.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi11.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze11.IsChecked == true)
{
serialHelper.ComOn();
@@ -567,7 +568,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房11门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao11.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -575,26 +576,26 @@ namespace XGL
bianhao11.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai11.Text = "自动";
+ zhuangtai11.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai11.Text = "自动";
- zhuangtai11.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai11.Text = "手动或异常";
- zhuangtai11.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai11.Text = "手动或异常";
+ zhuangtai11.Foreground = new SolidColorBrush(Colors.Red);
}
+
+ }
}
else if (item.device_code == "H10")
{
@@ -603,29 +604,29 @@ namespace XGL
shuliang10.Text = item.isvalue;
}
else if (item.property == "dollyNumber")
+ {
+ if (item.isvalue.ToString() != "0")
{
- if (item.isvalue.ToString() == "1")
- {
- menqian10.Text = "有车";
- menqian10.Foreground = new SolidColorBrush(Colors.Red);
- }
- else
- {
- menqian10.Text = "无";
- menqian10.Foreground = new SolidColorBrush(Colors.Green);
- }
- // 获取当前时间
- DateTime currentTime = DateTime.Now;
+ menqian10.Text = "有车:" + item.isvalue.ToString();
+ menqian10.Foreground = new SolidColorBrush(Colors.Red);
+ }
+ else
+ {
+ menqian10.Text = "无";
+ menqian10.Foreground = new SolidColorBrush(Colors.Green);
+ }
+ // 获取当前时间
+ DateTime currentTime = DateTime.Now;
- // 将查询到的时间字符串转换为 DateTime 对象
- if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
- {
- // 计算时间差
- TimeSpan timeDifference = currentTime - lastUpdateTime;
+ // 将查询到的时间字符串转换为 DateTime 对象
+ if (DateTime.TryParse(item.last_update_time, out DateTime lastUpdateTime))
+ {
+ // 计算时间差
+ TimeSpan timeDifference = currentTime - lastUpdateTime;
- daojishi10.Text = timeDifference.TotalMinutes.ToString("F2");
- if (timeDifference.TotalMinutes > menqian)
- {
+ daojishi10.Text = timeDifference.TotalMinutes.ToString("F2");
+ if (timeDifference.TotalMinutes > menqian)
+ {
if (xuanze10.IsChecked == true)
{
serialHelper.ComOn();
@@ -634,7 +635,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房10门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao10.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -642,26 +643,26 @@ namespace XGL
bianhao10.Background = new SolidColorBrush(Colors.White);
}
}
- else
- {
- // 如果解析失败,处理异常情况
- Console.WriteLine("Failed to parse last_update_time");
- }
+ else
+ {
+ // 如果解析失败,处理异常情况
+ Console.WriteLine("Failed to parse last_update_time");
+ }
+ }
+ else
+ {
+ if (item.isvalue.ToString() == "5")
+ {
+ zhuangtai10.Text = "自动";
+ zhuangtai10.Foreground = new SolidColorBrush(Colors.Green);
}
else
{
- if (item.isvalue.ToString() == "5")
- {
- zhuangtai10.Text = "自动";
- zhuangtai10.Foreground = new SolidColorBrush(Colors.Green);
- }
- else
- {
- zhuangtai10.Text = "手动或异常";
- zhuangtai10.Foreground = new SolidColorBrush(Colors.Red);
- }
-
+ zhuangtai10.Text = "手动或异常";
+ zhuangtai10.Foreground = new SolidColorBrush(Colors.Red);
}
+
+ }
}
else if (item.device_code == "H61")
{
@@ -671,9 +672,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian61.Text = "有车";
+ menqian61.Text = "有车:" + item.isvalue.ToString();
menqian61.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -701,7 +702,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房61门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao61.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -738,9 +739,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian62.Text = "有车";
+ menqian62.Text = "有车:" + item.isvalue.ToString();
menqian62.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -768,7 +769,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房62门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao62.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -805,9 +806,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian63.Text = "有车";
+ menqian63.Text = "有车:" + item.isvalue.ToString();
menqian63.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -835,7 +836,7 @@ namespace XGL
serialHelper.ComOff();
MessageBox.Show("烘房63门前小车数量值保持超过" + menqian + "分钟请查看!!!");
bianhao63.Background = new SolidColorBrush(Colors.Wheat);
-
+
}
}
else
@@ -872,9 +873,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian9.Text = "有车";
+ menqian9.Text = "有车:" + item.isvalue.ToString();
menqian9.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -939,9 +940,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian8.Text = "有车";
+ menqian8.Text = "有车:" + item.isvalue.ToString();
menqian8.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1006,9 +1007,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian7.Text = "有车";
+ menqian7.Text = "有车:" + item.isvalue.ToString();
menqian7.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1073,9 +1074,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian6.Text = "有车";
+ menqian6.Text = "有车:" + item.isvalue.ToString();
menqian6.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1141,9 +1142,9 @@ namespace XGL
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian5.Text = "有车";
+ menqian5.Text = "有车:" + item.isvalue.ToString();
menqian5.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1208,9 +1209,9 @@ namespace XGL
}
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian4.Text = "有车";
+ menqian4.Text = "有车:" + item.isvalue.ToString();
menqian4.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1276,9 +1277,9 @@ namespace XGL
else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian3.Text = "有车";
+ menqian3.Text = "有车:" + item.isvalue.ToString();
menqian3.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1341,11 +1342,11 @@ namespace XGL
{
shuliang2.Text = item.isvalue;
}
- else if(item.property == "dollyNumber")
+ else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian2.Text = "有车";
+ menqian2.Text = "有车:" + item.isvalue.ToString();
menqian2.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1408,11 +1409,11 @@ namespace XGL
{
shuliang1.Text = item.isvalue;
}
- else if (item.property == "dollyNumber")
+ else if (item.property == "dollyNumber")
{
- if (item.isvalue.ToString() == "1")
+ if (item.isvalue.ToString() != "0")
{
- menqian1.Text = "有车";
+ menqian1.Text = "有车:" + item.isvalue.ToString();
menqian1.Foreground = new SolidColorBrush(Colors.Red);
}
else
@@ -1474,8 +1475,8 @@ namespace XGL
private void sos_Click(object sender, RoutedEventArgs e)
{
- menqian =Convert.ToInt32(fenzhong.Text);
- MessageBox.Show("设置成功!当前分钟数为"+ menqian);
+ menqian = Convert.ToInt32(fenzhong.Text);
+ MessageBox.Show("设置成功!当前分钟数为" + menqian);
}
private void cloce_Click(object sender, RoutedEventArgs e)
diff --git a/shangjian/XGLFinishPro/App.xaml.cs b/shangjian/XGLFinishPro/App.xaml.cs
index 7f95bd9..eb83cb6 100644
--- a/shangjian/XGLFinishPro/App.xaml.cs
+++ b/shangjian/XGLFinishPro/App.xaml.cs
@@ -20,7 +20,8 @@ namespace XGL
{
public App()
{
- var processs = Process.GetProcessesByName(Process.GetCurrentProcess().MainModule.ModuleName.Replace(".exe", ""));
+ string name = Process.GetCurrentProcess().MainModule.ModuleName.Replace(".exe", "");
+ var processs = Process.GetProcessesByName(name);
if (processs.Length > 1)
{
Environment.Exit(0);
diff --git a/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml b/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml
index 2f1d250..ddcf355 100644
--- a/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml
+++ b/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XGLFinishPro.Views"
mc:Ignorable="d"
- Title="CheckUserWin" Height="550" Width="1050" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
+ Title="CheckUserWin" Height="850" Width="1250" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
+
-
+
@@ -120,10 +128,11 @@
+
-
+
@@ -152,15 +161,51 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
diff --git a/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml.cs b/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml.cs
index 47acd9e..257d897 100644
--- a/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml.cs
+++ b/shangjian/XGLFinishPro/Views/ExecReportWorkWin.xaml.cs
@@ -1,4 +1,6 @@
-using CommonFunc.Tools;
+using CommonFunc;
+using CommonFunc.Tools;
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
@@ -16,7 +18,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Xceed.Wpf.DataGrid;
using XGL.Data;
+using XGL.Data.DBService;
using XGL.Dats.DBServiceFinishProd;
+using XGL.Models.Model.OrderPrepare;
namespace XGLFinishPro.Views
{
@@ -26,27 +30,46 @@ namespace XGLFinishPro.Views
public partial class ExecReportWorkWin : Window
{
FinishProdDBService userDbWareHouse = new FinishProdDBService();
+ FormingMachineService formingMachineService = new FormingMachineService();
+
public bool loginFlag;
public string _workTime = "";
public string _useMan = "";
public string _costCenter = "";
public string _workQuntity = "";
- public string workOrdercode = "";
+ public string _workOrdercode = "";
+ public string _workOrderId = "";
public string batchCode = "";
public bool? _isEndReport = false;
+ public string _deviceCode = "";
+ public string _siteCode = "";
+ DataRowView selectedRow = null;
public ExecReportWorkWin()
{
InitializeComponent();
}
- public ExecReportWorkWin(string workOrder, string quantity,string workOrdercode,string batch_code)
+ public ExecReportWorkWin(string workOrder, string quantity,string workOrdercode, string batch_code, string siteCode)
{
InitializeComponent();
- this.workOrdercode = workOrdercode;
+ this._workOrdercode = workOrdercode;
this.lbCurrOrderNo.Content = workOrder;
this.txtQuantity.Text = quantity;
this.comboBoxBatch.Text = batch_code;
+ _siteCode = siteCode;
+ }
+ public ExecReportWorkWin(DataRowView _selectedRow,string deviceCode, string siteCode)
+ {
+ InitializeComponent();
+ selectedRow = _selectedRow;
+ _deviceCode = deviceCode;
+ this._workOrdercode = selectedRow["workorder_code"].ToString();
+ this.lbCurrOrderNo.Content = selectedRow["workorder_code"].ToString();
+ this._workOrderId = selectedRow["workorder_id"].ToString();
+ this.txtQuantity.Text = selectedRow["quantity_split"].ToString();
+ this.comboBoxBatch.Text = selectedRow["batch_code"].ToString();
+ _siteCode = siteCode;
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
@@ -55,7 +78,7 @@ namespace XGLFinishPro.Views
this.Close();
}
- private void btnOK_Click(object sender, RoutedEventArgs e)
+ private async void btnOK_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(this.txtQuantity.Text))
{
@@ -131,21 +154,124 @@ namespace XGLFinishPro.Views
this.DialogResult = true;
}
}
-
-
-
+ //获取报工编码
+ string newReportCode = "";
+ DataTable dtNewReportCode = formingMachineService.GetReportCode();
+ if (dtNewReportCode == null || dtNewReportCode.Rows.Count == 0)
+ {
+ newReportCode = DateTime.Now.ToString("yyyyMMdd") + "0001";
+ }
+ else
+ {
+ if (string.IsNullOrEmpty(dtNewReportCode.Rows[0]["report_code"].ToString()))
+ {
+ newReportCode = DateTime.Now.ToString("yyyyMMdd") + "0001";
+ }
+ else
+ {
+ newReportCode = (Convert.ToInt64(dtNewReportCode.Rows[0]["report_code"].ToString()) + 1).ToString();
+ }
+ }
+
+ string isEndReport = _isEndReport == true ? "1" : "0";
+ bool issucc = formingMachineService.ExecuteReportWork(selectedRow, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
+ if (issucc)
+ {
+ //调用报工接口
+ string apiUrl = formingMachineService.InterfaceUrl("reportWork");
+ ReportWork reportWork = new ReportWork();
+ reportWork.factoryCode = Utils.GetAppSetting("SiteCode");
+ reportWork.reportCode = newReportCode;
+ // 将要发送的数据序列化为JSON格式
+ var jsonContent = JsonConvert.SerializeObject(reportWork);
+ LogHelper.instance.log.Info("开始报工>>" + jsonContent);
+ RestHelper restClient = new RestHelper();
+ //var response =;
+
+ Rootobjectresu result = Utils.DeJson(await restClient.PostAsync(apiUrl, jsonContent));
+
+ if (result.code == 200)
+ {
+ AddConsumInfo(newReportCode);
+ }
+ else
+ {
+ CustomMessageBox.Show("调用报工接口失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
+ }
+ }
+ else
+ {
+ CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
+ }
+ }
+
+ private void AddConsumInfo(string newReportCode)
+ {
+ try
+ {
+ //报工消耗数量
+ // 获取第二列的值
+ int columnIndex = 1; // 列索引,这里假设为第一列
+
+ foreach (var row in dgConsumeInfo.Items)
+ {
+ // 获取 DataGridRow
+ var dataGridRow = dgConsumeInfo.ItemContainerGenerator.ContainerFromItem(row) as DataGridRow;
+
+ if (dataGridRow != null)
+ {
+ // 获取该行的单元格内容
+ var cellQtyContent = dgConsumeInfo.Columns[columnIndex].GetCellContent(dataGridRow);
+ var cellRemarkContent = dgConsumeInfo.Columns[columnIndex+1].GetCellContent(dataGridRow);
+ if (cellQtyContent != null)
+ {
+ // 获取单元格的值
+ var qty = (cellQtyContent as TextBlock)?.Text;
+ var remark = (cellRemarkContent as TextBlock)?.Text;
+ // 插入表
+ if (qty != null)
+ {
+ // 处理 cellValue
+ formingMachineService.InsertConsumeInfo(qty,remark,selectedRow, newReportCode, _siteCode);
+ }
+ else
+ continue;
+ }
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ CustomMessageBox.Show("报工失败:生成消耗数据发生异常:"+ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
+ }
+ }
- }
private void pw_PasswordChanged(object sender, RoutedEventArgs e)
{
tbMsg.Content = "";
}
private void Window_Loaded(object sender, RoutedEventArgs e)
- {
+ {
InitComBoboxData();
piciInitComBoboxData();
+ InitConsumeData();
+ }
+
+ private void InitConsumeData()
+ {
+ DataTable dt = userDbWareHouse.GetCosumeData(_workOrdercode);
+ if (dt == null)
+ {
+ this.tbMsg.Content = "没有找到该工单的消耗信息";
+ //CustomMessageBox.Show("没有维护成本中心,请联系管理员!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
+ return;
+ }
+
+ //绑定
+ dgConsumeInfo.ItemsSource = dt.DefaultView;
+
}
private void txtQuantity_TextChanged(object sender, TextChangedEventArgs e)
@@ -214,7 +340,7 @@ namespace XGLFinishPro.Views
}
private void piciInitComBoboxData()
{
- DataTable dt = userDbWareHouse.piciGetCostCenter(this.workOrdercode);
+ DataTable dt = userDbWareHouse.piciGetCostCenter(this._workOrderId);
if (dt == null)
{
CustomMessageBox.Show("没有找到批次号,请联系管理员!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
@@ -239,6 +365,16 @@ namespace XGLFinishPro.Views
{
}
+
+ private void dgConsumeInfo_LoadingRow(object sender, DataGridRowEventArgs e)
+ {
+ e.Row.Header = (e.Row.GetIndex() + 1).ToString();
+ }
+
+ private void dgConsumeInfo_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
+ {
+ //dgConsumeInfo.CommitEdit();
+ }
}
public class CostCenter
{
diff --git a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
index 3626ed2..6dc7f0c 100644
--- a/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
+++ b/shangjian/XGLFinishPro/Views/LanJu_Operator.xaml
@@ -486,6 +486,20 @@
FontSize="28"
Text="出入记录" />
-->
+