diff --git a/Seyounth.Hyosung.Ava/ViewModels/VarietyManagerViewModel.cs b/Seyounth.Hyosung.Ava/ViewModels/VarietyManagerViewModel.cs
index 48122d5..0d8a25b 100644
--- a/Seyounth.Hyosung.Ava/ViewModels/VarietyManagerViewModel.cs
+++ b/Seyounth.Hyosung.Ava/ViewModels/VarietyManagerViewModel.cs
@@ -148,13 +148,25 @@ public partial class VarietyManagerViewModel : ObservableObject
if(mod is null)
{
_toastManager.CreateToast()
- .WithTitle("请检查产品代码是否错误")
+ .WithTitle("保存失败")
+ .WithContent("无法从上游获取产品信息,请检查产品代码是否正确!")
.Dismiss().After(TimeSpan.FromSeconds(3))
.OfType(NotificationType.Error)
.Dismiss().ByClicking()
.Queue();
return;
}
+ if (variety.GrossWeight < variety.NetWeight)
+ {
+ _toastManager.CreateToast()
+ .WithTitle("保存失败")
+ .WithContent("毛重小于净重,请检查是否输入错误!")
+ .Dismiss().After(TimeSpan.FromSeconds(3))
+ .OfType(NotificationType.Error)
+ .Dismiss().ByClicking()
+ .Queue();
+ return;
+ }
await _varietyService.AddVarietyAsync(variety);
_toastManager.CreateToast()
.WithTitle("保存成功")
diff --git a/Seyounth.Hyosung.Ava/nlog.config b/Seyounth.Hyosung.Ava/nlog.config
index 75c64ff..c7dee5b 100644
--- a/Seyounth.Hyosung.Ava/nlog.config
+++ b/Seyounth.Hyosung.Ava/nlog.config
@@ -12,7 +12,7 @@
+ layout="${longdate} ${uppercase:${level}} ${message} ${onexception:${exception:format=tostring} | ${stacktrace}}" />
diff --git a/Seyounth.Hyosung.Core/Plc/HyosungPlcService.cs b/Seyounth.Hyosung.Core/Plc/HyosungPlcService.cs
index 60473d5..f98956c 100644
--- a/Seyounth.Hyosung.Core/Plc/HyosungPlcService.cs
+++ b/Seyounth.Hyosung.Core/Plc/HyosungPlcService.cs
@@ -149,11 +149,15 @@ public class HyosungPlcService(ILogger logger) : IHyosungPlcS
}
if (color == 1)
- await _writer.WriteShortsAsync(13050, [1, 1, 1, 2]);
+ {
+ await _writer.WriteShortsAsync(13050, [1, 1, 1, masterCount]);
+ await _writer.WriteShortsAsync(13055, [1, 1]);
+ }
+
else
{
await _writer.WriteShortsAsync(13050, [1, 1, 1, 1]);
- await _writer.WriteShortsAsync(13056, 2);
+ await _writer.WriteShortsAsync(13055, [1, masterCount]);
}
}
diff --git a/Seyounth.Hyosung.Runtime/HyosungRuntime.cs b/Seyounth.Hyosung.Runtime/HyosungRuntime.cs
index c53227b..21cf92b 100644
--- a/Seyounth.Hyosung.Runtime/HyosungRuntime.cs
+++ b/Seyounth.Hyosung.Runtime/HyosungRuntime.cs
@@ -408,8 +408,10 @@ public class HyosungRuntime(
}
else
{
- await printer.PrintMasterLabelAsync(arg1 - 1, tray.TrayCode);
- // await hyosungWmsService.AddLabelResult(new LabelResult(tray, variety));
+ //if (arg1 == 3)
+ // arg1 = 2;
+ await printer.PrintMasterLabelAsync(arg1-1, tray.TrayCode);
+ await hyosungWmsService.AddLabelResult(new LabelResult(tray, variety));
}
await hyosungPlcService.WritePrintLabelResultAsync(arg1, true);