From 0a379b1772ea76fe6a7a53396a3c9a614b29df1b Mon Sep 17 00:00:00 2001 From: hwh <332078369@qq.com> Date: 星期五, 14 六月 2024 17:00:13 +0800 Subject: [PATCH] 1 --- Wms_09/WMS.BLL/SysServer/PalletsServer.cs | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Wms_09/WMS.BLL/SysServer/PalletsServer.cs b/Wms_09/WMS.BLL/SysServer/PalletsServer.cs index adbdd82..d18ef71 100644 --- a/Wms_09/WMS.BLL/SysServer/PalletsServer.cs +++ b/Wms_09/WMS.BLL/SysServer/PalletsServer.cs @@ -101,7 +101,7 @@ codeId = int.Parse("00001"); } int liuShuiId = codeId; - var pallet = "T"+time2 + Convert.ToString(liuShuiId).PadLeft(5, '0'); + var pallet = "T" + time2 + Convert.ToString(liuShuiId).PadLeft(5, '0'); return pallet; } } @@ -125,17 +125,26 @@ var str = pallNo.Substring(3, 5); string remove = pallNo.Substring(0, 3); - int sibelius = Convert.ToInt16(str); + int sibelius = 0; var num = 0; + if (remove != "T" + DateTime.Now.ToString("yy")) + { + remove = "T" + DateTime.Now.ToString("yy"); + sibelius = 0; + } + else + { + sibelius = Convert.ToInt16(str); + } for (int i = 0; i < groupCount; i++) { sibelius += 1; - if (sibelius>99999) + if (sibelius > 99999) { throw new Exception("鎵樼洏鐮佷綅鏁板凡杈句笂绾�"); } string code = remove + Convert.ToString(sibelius).PadLeft(5, '0'); - if (db.Queryable<SysPallets>().Count(m=>m.PalletNo == code)>=1) + if (db.Queryable<SysPallets>().Count(m => m.PalletNo == code) >= 1) { continue; } @@ -158,7 +167,7 @@ { await _operation.InsertOperation("浠撳簱璁剧疆", "鏉$爜绠$悊", item.PalletNo, "娣诲姞", "娣诲姞鎵樼洏淇℃伅 鎵樼洏鍙凤細" + item.PalletNo, userId); } - + } } -- Gitblit v1.8.0