From fc47b123b85f912fca2c6fa80def7e928149c95c Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期六, 18 一月 2025 09:21:13 +0800
Subject: [PATCH] 抽检修改
---
Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs | 35 +++++++++++++++++++++++------------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
index 016a51a..acf4038 100644
--- a/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
+++ b/Wms/WMS.BLL/BllCheckServer/StockCheckServer.cs
@@ -1378,20 +1378,31 @@
if (endLocate != null && endLocate.AreaNo == "B12") //鏄惁鏄�3妤肩紦瀛樺尯 鏄細鍒犻櫎搴撳瓨
{
- //璁板綍鎵樼洏涓婁俊鎭粰MES
-
- data.Add(new RequertBeiliaoInfoModel()
+ if (string.IsNullOrWhiteSpace(item.SONo))
{
- materiel_no = item.SkuNo,
- materiel_name = item.SkuName,
- qty = item.Qty,
- batch = item.LotNo,
- producttime = item.ProductionTime,
- expiry = item.ExpirationTime
-
- });
- //搴撳瓨绠辩爜鏄庣粏鍒犻櫎
+ throw new Exception("褰撳墠鎵樼洏涓嶆槸鎷兼墭鍑哄簱鎵樼洏");
+ }
+ //璁板綍鎵樼洏涓婁俊鎭粰MES
var boxInfo = Db.Queryable<DataBoxInfo>().Where(m => m.IsDel == "0" && m.StockDetailId == item.Id).ToList();
+ if (boxInfo.Count == 0)
+ {
+ throw new Exception("鎵樼洏涓婄墿鏂欑鐮佷俊鎭笉瀛樺湪,璇锋鏌�!");
+ }
+ foreach (var item2 in boxInfo)
+ {
+ data.Add(new RequertBeiliaoInfoModel()
+ {
+ no = item2.BoxNo,
+ materiel_no = item.SkuNo,
+ materiel_name = item.SkuName,
+ qty = item.Qty,
+ batch = item.LotNo,
+ producttime = item.ProductionTime.ToString().Substring(1, 8),
+ expiry = item.ExpirationTime.ToString().Substring(1, 8)
+
+ });
+ }
+ //搴撳瓨绠辩爜鏄庣粏鍒犻櫎
Db.Deleteable(boxInfo).ExecuteCommand();
//鍒犻櫎搴撳瓨鎵樼洏淇℃伅
Db.Deleteable(item).ExecuteCommand();
--
Gitblit v1.8.0