From d8c53f8bee9535f0c691afc2e1cfb5eec15c9c01 Mon Sep 17 00:00:00 2001 From: zhangzhuo <512464164@qq.com> Date: Wed, 26 Mar 2025 17:56:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=9A=E4=BA=86=E4=B8=AA.0?= =?UTF-8?q?=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Seyounth.Hyosung.Data/Services/TrayService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Seyounth.Hyosung.Data/Services/TrayService.cs b/Seyounth.Hyosung.Data/Services/TrayService.cs index e0bc5b8..9e1df35 100644 --- a/Seyounth.Hyosung.Data/Services/TrayService.cs +++ b/Seyounth.Hyosung.Data/Services/TrayService.cs @@ -88,8 +88,11 @@ public class TrayService : ITrayService tray.Unit = itemInfo.UNIT; tray.NetWeight = variety.NetWeight ?? itemInfo.NET_WEIGHT; tray.GrossWeight = variety.GrossWeight ?? itemInfo.GROSS_WEIGHT; + var netWeight = tray.NetWeight.ToString("0.0"); + if (netWeight.EndsWith(".0")) + netWeight = netWeight.Replace(".0", ""); tray.Barcode = - $"{itemInfo.ITEM_CODE} {DateTime.Now:yyMMdd}{tray.NetWeight.ToString("0.0").PadLeft(6,'0')}{itemInfo.LOTNO.PadLeft(4, '0')}{tray.ControlNo?.ToString().PadLeft(4, '0')}0"; + $"{itemInfo.ITEM_CODE} {DateTime.Now:yyMMdd}{netWeight.PadLeft(6,'0')}{itemInfo.LOTNO.PadLeft(4, '0')}{tray.ControlNo?.ToString().PadLeft(4, '0')}0"; await _db.Updateable(tray.ToEntity()).ExecuteCommandAsync(); // _cache.Remove(tray.TrayCode, out _); return tray;