From 670dbb3d580f9273b5b4b3ebe391f33be1a6adce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=92=E6=9E=97=E6=9D=B0?= <1205395967@qq.com> Date: Fri, 16 Sep 2022 17:27:02 +0800 Subject: [PATCH] Mao --- ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs index dde0972..6667c97 100644 --- a/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs +++ b/ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs @@ -4937,7 +4937,12 @@ namespace ICSSoft.DataProject foreach (var itemInfo in item.detail) { int len = itemInfo.SelectLevel.Length; - sql = @"INSERT INTO ICSCheck (ID,CheckCode,SelectLevel,Status,Quantity,Amount,MUSER,MUSERName,MTIME,WorkPoint) + sql = @"IF NOT EXISTS(SELECT id FROM ICSWareHouseLotInfo WHERE SUBSTRING(LocationCode,1,{4}) = '{1}') + BEGIN + RAISERROR('" + language.GetNameByCode("WMSAPIInfo460") + @"',16,1); + RETURN + END + INSERT INTO ICSCheck (ID,CheckCode,SelectLevel,Status,Quantity,Amount,MUSER,MUSERName,MTIME,WorkPoint) SELECT NEWID(),'{0}','{1}','2',SUM(a.Quantity),0,b.F_Account,b.F_RealName,GETDATE(),b.F_Location FROM ICSWareHouseLotInfo a INNER JOIN Sys_SRM_User b ON b.F_Account='{2}' AND b.F_Location='{3}'