Compare commits
4
Commits
0.0.1
...
47317ca033
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
47317ca033 | ||
|
|
83cd4915d8 | ||
|
|
25243c03e6 | ||
|
|
b97bfab44f |
No files matched your search
+63
-50
@@ -2,6 +2,7 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using SunlightAggregationTerminal.Class;
|
||||
using SunlightAggregationTerminal.Models;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Data;
|
||||
using System.Reflection.PortableExecutable;
|
||||
using System.Text.Json;
|
||||
using TouchSocket.Core;
|
||||
@@ -312,8 +313,8 @@ public class InfoMachineItem
|
||||
{
|
||||
ProbuctItem probuctItem = new ProbuctItem();
|
||||
|
||||
probuctItem.ProductCode = item.GetValue("ProductCode").ToString()!;
|
||||
probuctItem.ProductName = item.GetValue("ProductName").ToString()!;
|
||||
probuctItem.ProductCode = SafeGet(item, "ProductCode");
|
||||
probuctItem.ProductName = SafeGet(item, "ProductName");
|
||||
if (item.GetValue("Enabled").ToString()! == "1")
|
||||
{
|
||||
probuctItem.ProductState = "启用";
|
||||
@@ -348,13 +349,13 @@ public class InfoMachineItem
|
||||
{
|
||||
foreach (var item in data!)
|
||||
{
|
||||
string inf_ = "染机: " + item.GetValue("Machine").ToString()! + "\n";
|
||||
inf_ = inf_ + "料单: " + item.GetValue("Dyelot").ToString()!;
|
||||
inf_ = inf_ + "@" + item.GetValue("ReDye").ToString()! + "\n";
|
||||
inf_ = inf_ + "步骤: " + item.GetValue("StepNumber").ToString()! + "\n";
|
||||
inf_ = inf_ + "流程: " + item.GetValue("Process").ToString()! + "\n";
|
||||
inf_ = inf_ + "化料桶: " + item.GetValue("TankNO").ToString()! + "\n";
|
||||
inf_ = inf_ + "染料桶数: " + item.GetValue("TotalNumber").ToString()!;
|
||||
string inf_ = "染机: " + SafeGet(item, "Machine")+ "\n";
|
||||
inf_ = inf_ + "料单: " + SafeGet(item, "Dyelot");
|
||||
inf_ = inf_ + "@" + SafeGet(item, "ReDye") + "\n";
|
||||
inf_ = inf_ + "步骤: " + SafeGet(item, "StepNumber") + "\n";
|
||||
inf_ = inf_ + "流程: " + SafeGet(item, "Process") + "\n";
|
||||
inf_ = inf_ + "化料桶: " + SafeGet(item, "TankNO") + "\n";
|
||||
inf_ = inf_ + "染料桶数: " + SafeGet(item, "TotalNumber");
|
||||
if (item!.TryGetValue("BarrelState", out var _Type) && _Type != null)
|
||||
{
|
||||
string temp = _Type?.ToString() ?? "";
|
||||
@@ -367,7 +368,7 @@ public class InfoMachineItem
|
||||
};
|
||||
inf_ = inf_ + _Type;
|
||||
}
|
||||
inf_ = inf_ + "状态: " + item.GetValue("State").ToString()! + "\n";
|
||||
inf_ = inf_ + "状态: " + SafeGet(item, "State") + "\n";
|
||||
|
||||
InfoMachineItem infoMachineItem = new InfoMachineItem();
|
||||
infoMachineItem.inf = inf_;
|
||||
@@ -380,10 +381,10 @@ public class InfoMachineItem
|
||||
{
|
||||
foreach (var item in data!)
|
||||
{
|
||||
string inf_ = "位置: " + item.GetValue("position").ToString()! + "\n";
|
||||
inf_ = inf_ + "料单: " + item.GetValue("Dyelot").ToString()!;
|
||||
inf_ = inf_ + "@" + item.GetValue("ReDye").ToString()! + "\n";
|
||||
inf_ = inf_ + "步骤: " + item.GetValue("StepNumber").ToString()! + "\n";
|
||||
string inf_ = "位置: " + SafeGet(item, "Position") + "\n";
|
||||
inf_ = inf_ + "料单: " + SafeGet(item, "Dyelot");
|
||||
inf_ = inf_ + "@" + SafeGet(item, "ReDye") + "\n";
|
||||
inf_ = inf_ + "步骤: " + SafeGet(item, "StepNumber") + "\n";
|
||||
if (item!.TryGetValue("BarrelType", out var _Type) && _Type != null)
|
||||
{
|
||||
string temp = _Type?.ToString() ?? "";
|
||||
@@ -406,10 +407,10 @@ public class InfoMachineItem
|
||||
};
|
||||
inf_ = inf_ + _BarrelState;
|
||||
}
|
||||
inf_ = inf_ + "[" + item.GetValue("Barrelserialnumber").ToString()! + "]\n";
|
||||
inf_ = inf_ + "上架时间: " + DateTime.Parse(item.GetValue("createtime").ToString() ?? "")
|
||||
inf_ = inf_ + "[" + SafeGet(item, "Barrelserialnumber") + "]\n";
|
||||
inf_ = inf_ + "上架时间: " + DateTime.Parse(item.GetValue("Createtime").ToString() ?? "")
|
||||
.ToString("yyyy-MM-dd HH:mm:ss") + "\n";
|
||||
inf_ = inf_ + "状态 [" + item.GetValue("State").ToString()! + "]";
|
||||
inf_ = inf_ + "状态 [" + SafeGet(item, "State") + "]";
|
||||
|
||||
InfoMachineItem infoMachineItem = new InfoMachineItem();
|
||||
infoMachineItem.inf = inf_;
|
||||
@@ -422,15 +423,15 @@ public class InfoMachineItem
|
||||
{
|
||||
foreach (var item in data!)
|
||||
{
|
||||
string inf_ = "染机: " + item.GetValue("Machine").ToString()! + "\n";
|
||||
inf_ = inf_ + "料单: " + item.GetValue("Dyelot").ToString()!;
|
||||
inf_ = inf_ + "@" + item.GetValue("ReDye").ToString()! + "\n";
|
||||
inf_ = inf_ + "步骤: " + item.GetValue("StepNumber").ToString()! + "\n";
|
||||
inf_ = inf_ + "总浴量: " + item.GetValue("Volume").ToString()! + "\n";
|
||||
inf_ = inf_ + "计量模组: " + item.GetValue("DispenseModule").ToString()! + "\n";
|
||||
string inf_ = "染机: " + SafeGet(item, "Machine") + "\n";
|
||||
inf_ = inf_ + "料单: " + SafeGet(item, "Dyelot");
|
||||
inf_ = inf_ + "@" + SafeGet(item, "ReDye") + "\n";
|
||||
inf_ = inf_ + "步骤: " + SafeGet(item, "StepNumber") + "\n";
|
||||
inf_ = inf_ + "总浴量: " + SafeGet(item, "Volume")+ "\n";
|
||||
inf_ = inf_ + "计量模组: " + SafeGet(item, "DispenseModule") + "\n";
|
||||
if (item!.TryGetValue("TankNo", out var _TankNo) && _TankNo != null)
|
||||
{
|
||||
inf_ = inf_ + "目标位置: " + item.GetValue("TankNo").ToString()! + "\n";
|
||||
inf_ = inf_ + "目标位置: " + item.GetValue("TankNo") + "\n";
|
||||
}
|
||||
else {
|
||||
inf_ = inf_ + "目标位置: 未指定\n" ;
|
||||
@@ -458,7 +459,6 @@ public class InfoMachineItem
|
||||
{
|
||||
InfoMachineItems.Add(infoMachineItem);
|
||||
}
|
||||
|
||||
}
|
||||
if (InfoMachineItems.Count==0) InfoMachineItems.Add(new InfoMachineItem());
|
||||
}
|
||||
@@ -468,12 +468,12 @@ public class InfoMachineItem
|
||||
foreach (var item in data!)
|
||||
{
|
||||
DyelotDetailsItem dyelotDetailsItem = new DyelotDetailsItem();
|
||||
dyelotDetailsItem.Dyelot = item.GetValue("Dyelot").ToString()!;
|
||||
dyelotDetailsItem.ReDye =int.Parse( item.GetValue("ReDye").ToString()!);
|
||||
dyelotDetailsItem.StepNumber = int.Parse(item.GetValue("StepNumber").ToString()!);
|
||||
dyelotDetailsItem.Notes = "染机: " + item.GetValue("Machine").ToString()!+"\n";
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes +
|
||||
"流程: " + item.GetValue("Process").ToString()!+"\n";
|
||||
dyelotDetailsItem.Dyelot = SafeGet(item,"Dyelot");
|
||||
dyelotDetailsItem.ReDye = int.Parse(SafeGet(item, "ReDye"));
|
||||
dyelotDetailsItem.StepNumber = int.Parse(SafeGet(item, "StepNumber"));
|
||||
dyelotDetailsItem.Notes = "染机: " + SafeGet(item, "Machine") + "\n";
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes +
|
||||
"流程: " + SafeGet(item, "Process") + "\n";
|
||||
if (item!.TryGetValue("State", out var _State) && _State != null)
|
||||
{
|
||||
string temp = _State?.ToString() ?? "";
|
||||
@@ -494,8 +494,9 @@ public class InfoMachineItem
|
||||
{
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + " [" + _TotalNumber+"桶]";
|
||||
}
|
||||
dyelotDetailsItem.DispenseStartTime = item.GetValue("DispenseStartTime").ToString()!.Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseEndTime = item.GetValue("DispenseEndTime").ToString()!.Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseStartTime = SafeGet(item, "DispenseStartTime", "T").Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseEndTime = SafeGet(item, "DispenseEndTime", "T").Replace("T", " ");
|
||||
|
||||
if (item!.TryGetValue("CallTime", out var _CallTime) && _CallTime != null)
|
||||
{
|
||||
if (DateTime.TryParse(_CallTime.ToString(), out DateTime dtc))
|
||||
@@ -513,10 +514,10 @@ public class InfoMachineItem
|
||||
foreach (var item in data!)
|
||||
{
|
||||
DyelotDetailsItem dyelotDetailsItem = new DyelotDetailsItem();
|
||||
dyelotDetailsItem.Dyelot = item.GetValue("Dyelot").ToString()!;
|
||||
dyelotDetailsItem.ReDye = int.Parse(item.GetValue("ReDye").ToString()!);
|
||||
dyelotDetailsItem.StepNumber = int.Parse(item.GetValue("StepNumber").ToString()!);
|
||||
dyelotDetailsItem.Notes = "位置: " + item.GetValue("Position").ToString()! + "\n";
|
||||
dyelotDetailsItem.Dyelot = SafeGet(item, "Dyelot");
|
||||
dyelotDetailsItem.ReDye = int.Parse(SafeGet(item, "ReDye"));
|
||||
dyelotDetailsItem.StepNumber = int.Parse(SafeGet(item, "StepNumber"));
|
||||
dyelotDetailsItem.Notes = "位置: " + SafeGet(item, "Position") + "\n";
|
||||
if (item!.TryGetValue("BarrelType", out var _Type) && _Type != null)
|
||||
{
|
||||
string temp = _Type?.ToString() ?? "";
|
||||
@@ -539,15 +540,16 @@ public class InfoMachineItem
|
||||
};
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + _BarrelState;
|
||||
}
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + "[" + item.GetValue("Barrelserialnumber").ToString()! + "]\n";
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + "[" + SafeGet(item, "Barrelserialnumber") + "]\n";
|
||||
if (item!.TryGetValue("State", out var _State) && _State != null)
|
||||
{
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + "状态: " + _State;
|
||||
}
|
||||
dyelotDetailsItem.DispenseStartTime = "";
|
||||
dyelotDetailsItem.DispenseStartTime = SafeGet(item, "CreateTime", "T").Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseEndTime = "";
|
||||
dyelotDetailsItem.UsageTime = item.GetValue("Createtime").ToString()!.Replace("T", " ");
|
||||
InfoDyelotHistoryItems.Add(dyelotDetailsItem);
|
||||
dyelotDetailsItem.UsageTime = SafeGet(item , "CreateTime","T").Replace("T", " ");
|
||||
dyelotDetailsItem.CallTime = SafeGet(item, "CreateTime", "T").Replace("T", " ");
|
||||
InfoDyelotHistoryItems.Add(dyelotDetailsItem);
|
||||
}
|
||||
if (InfoDyelotHistoryItems.Count == 0) InfoDyelotHistoryItems.Add(new DyelotDetailsItem());
|
||||
}
|
||||
@@ -557,10 +559,10 @@ public class InfoMachineItem
|
||||
foreach (var item in data!)
|
||||
{
|
||||
DyelotDetailsItem dyelotDetailsItem = new DyelotDetailsItem();
|
||||
dyelotDetailsItem.Dyelot = item.GetValue("Dyelot").ToString()!;
|
||||
dyelotDetailsItem.ReDye = int.Parse(item.GetValue("ReDye").ToString()!);
|
||||
dyelotDetailsItem.StepNumber = int.Parse(item.GetValue("StepNumber").ToString()!);
|
||||
dyelotDetailsItem.Notes = "染机: " + item.GetValue("Machine").ToString()! + "\n";
|
||||
dyelotDetailsItem.Dyelot = SafeGet(item, "Dyelot");
|
||||
dyelotDetailsItem.ReDye = int.Parse(SafeGet(item, "ReDye"));
|
||||
dyelotDetailsItem.StepNumber = int.Parse(SafeGet(item, "StepNumber"));
|
||||
dyelotDetailsItem.Notes = "染机: " + SafeGet(item, "Machine") + "\n";
|
||||
if (item!.TryGetValue("State", out var _State) && _State != null)
|
||||
{
|
||||
string temp = _State?.ToString() ?? "";
|
||||
@@ -572,9 +574,9 @@ public class InfoMachineItem
|
||||
_ => "无信息"
|
||||
};
|
||||
dyelotDetailsItem.Notes = dyelotDetailsItem.Notes + "状态: " + _State;
|
||||
}
|
||||
dyelotDetailsItem.DispenseStartTime = item.GetValue("DispenseStartTime").ToString()!.Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseEndTime = item.GetValue("DispenseEndTime").ToString()!.Replace("T", " ");
|
||||
}
|
||||
dyelotDetailsItem.DispenseStartTime = SafeGet(item, "DispenseStartTime", "T").Replace("T", " ");
|
||||
dyelotDetailsItem.DispenseEndTime = SafeGet(item, "DispenseEndTime", "T").Replace("T", " ");
|
||||
if (item!.TryGetValue("CallTime", out var _CallTime) && _CallTime != null)
|
||||
{
|
||||
if (DateTime.TryParse(_CallTime.ToString(), out DateTime dtc))
|
||||
@@ -586,8 +588,19 @@ public class InfoMachineItem
|
||||
}
|
||||
if (InfoDyelotHistoryItems.Count == 0) InfoDyelotHistoryItems.Add(new DyelotDetailsItem());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 辅助查询方法
|
||||
private static string SafeGet(Dictionary<string, object> item, string key, string defaultValue = "0")
|
||||
{
|
||||
//获取值并检查
|
||||
if (item!.TryGetValue(key, out var _dat) && _dat != null)
|
||||
{
|
||||
return _dat.ToString()!;
|
||||
}
|
||||
else
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -25,7 +25,7 @@ public partial class QueryPage : ContentPage
|
||||
QueryDictionary.Add("Command", "QueryDyelot");
|
||||
QueryDictionary.Add("Field", "[Dyelot],[ReDye],[Program],[Color],[CreationTime]," +
|
||||
"[Batch],[OrderNo],[TotalWeight],[LiquidRatio],[TotalVolume],[Final],[UserAccount]," +
|
||||
"[FabricName],[ColorName],[CustomerName],[Notes]");
|
||||
"[FabricName],[ColorName],[CustomerName]");
|
||||
QueryDictionary.Add("DyelotName", scannedValue);
|
||||
Query_Command(QueryDictionary.ToJsonString());
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public partial class QueryPage : ContentPage
|
||||
QueryDictionary.Add("Command", "QueryDyelot");
|
||||
QueryDictionary.Add("Field", "[Dyelot],[ReDye],[Program],[Color],[CreationTime]," +
|
||||
"[Batch],[OrderNo],[TotalWeight],[LiquidRatio],[TotalVolume],[Final],[UserAccount]," +
|
||||
"[FabricName],[ColorName],[CustomerName],[Notes]");
|
||||
"[FabricName],[ColorName],[CustomerName]");
|
||||
QueryDictionary.Add("DyelotName", ResultEntry.Text);
|
||||
Query_Command(QueryDictionary.ToJsonString());
|
||||
}
|
||||
@@ -132,7 +132,7 @@ public partial class QueryPage : ContentPage
|
||||
QueryDictionary.Add("Command", "Query");
|
||||
QueryDictionary.Add("Field", "[Dyelot],[ReDye],[Program],[Color],[CreationTime]," +
|
||||
"[Batch],[OrderNo],[TotalWeight],[LiquidRatio],[TotalVolume],[Final],[UserAccount]," +
|
||||
"[FabricName],[ColorName],[CustomerName],[Notes]");
|
||||
"[FabricName],[ColorName],[CustomerName]");
|
||||
DateTime StartTimee_ = (DateTime)StartTime.Date!;
|
||||
QueryDictionary.Add("StartTime", StartTimee_.ToString("yyyy-MM-dd"));
|
||||
DateTime EndTime_ = (DateTime)EndTime.Date!;
|
||||
|
||||
Reference in new issue
Block a user