From 88a65ffc61b124e2d46897e96ce85d239f5a16e1 Mon Sep 17 00:00:00 2001
From: zhangzhuo <512464164@qq.com>
Date: Mon, 21 Apr 2025 09:42:01 +0800
Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ViewModels/VarietyManagerViewModel.cs | 14 +++++++++++++-
Seyounth.Hyosung.Ava/nlog.config | 2 +-
Seyounth.Hyosung.Core/Plc/HyosungPlcService.cs | 8 ++++++--
Seyounth.Hyosung.Runtime/HyosungRuntime.cs | 6 ++++--
4 files changed, 24 insertions(+), 6 deletions(-)
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);