From 839c6afdc0ed75570ab86a6f648527796b66f37b Mon Sep 17 00:00:00 2001 From: "1005539536@qq.com" <58543wxm> Date: Thu, 9 Jun 2022 10:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E6=88=90=E6=9D=A1=E7=A0=81=E5=8A=A0?= =?UTF-8?q?=E5=A4=B1=E6=95=88=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WMS/WMSCreateItemLotApp.cs | 90 +++++++++---------- .../WMS/Views/WMSCreateItemLot/From.cshtml | 60 ++++++++++++- 2 files changed, 104 insertions(+), 46 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs index aa9fac9..e9887e9 100644 --- a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs +++ b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs @@ -90,7 +90,7 @@ where d.Type='1'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSMOApplyNegDetail a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join ( @@ -171,9 +171,9 @@ where d.Type='1'"; sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','1','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','1','{3}','{4}', getdate(),'{5}','{9}' from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -300,7 +300,7 @@ WHERE d.Type='1' "; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSOApplyNegDetail a left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint @@ -371,9 +371,9 @@ left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.Wo sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','2','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','2','{3}','{4}', getdate(),'{5}','{9}' from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -444,7 +444,7 @@ left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint "; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSMO a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint @@ -516,9 +516,9 @@ left join ICSExtension f on a.ExtensionID=f.ID and a.WorkPoint=f.WorkPoint "; sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','3','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','3','{3}','{4}', getdate(),'{5}','{9}' from ICSMO where MOCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, MOCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, MOCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -592,7 +592,7 @@ where a.Type='2'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSSDN a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint @@ -665,9 +665,9 @@ where a.Type='2'"; insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','4','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','4','{3}','{4}', getdate(),'{5}','{9}' from ICSSDN where Type='2' and SDNCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, SDNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, SDNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -738,7 +738,7 @@ where a.Status='1'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSOtherIn a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint @@ -812,9 +812,9 @@ where a.Status='1'"; insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','5','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','5','{3}','{4}', getdate(),'{5}','{9}' from ICSOtherIn where InCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, InCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, InCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1061,7 +1061,7 @@ where a.Status='1' and a.Type='1'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSODeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1086,7 +1086,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSManufactureReceive a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1112,7 +1112,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSDeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1137,7 +1137,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSReturn a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1207,9 +1207,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','6','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','6','{3}','{4}', getdate(),'{5}','{9}' from ICSReturn where ReturnCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ReturnCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ReturnCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1273,9 +1273,9 @@ insert into ICSInventoryLot insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','7','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','7','{3}','{4}', getdate(),'{5}','{9}' from ICSDeliveryNotice where DNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1338,9 +1338,9 @@ insert into ICSInventoryLot insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','8','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','8','{3}','{4}', getdate(),'{5}','{9}' from ICSODeliveryNotice where ODNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1406,9 +1406,9 @@ insert into ICSInventoryLot insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','9','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','9','{3}','{4}', getdate(),'{5}','{9}' from ICSManufactureReceive where RCVCode='{6}' and Sequence='{7}' and WorkPoint='{5}'", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, RCVCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, RCVCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1653,9 +1653,9 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','10','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','10','{3}','{4}', getdate(),'{5}','{9}' from ICSDeliveryNotice where DNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, DNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1717,9 +1717,9 @@ insert into ICSInventoryLot insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','11','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','11','{3}','{4}', getdate(),'{5}','{9}' from ICSODeliveryNotice where ODNCode='{6}' and Sequence='{7}' and WorkPoint='{5}'", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ODNCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1738,7 +1738,7 @@ insert into ICSInventoryLot //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSDeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1762,7 +1762,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSODeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY from ICSInventoryLot a @@ -1783,7 +1783,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSMOApplyNegDetail a left join ICSMOApplyNeg d on a.ApplyNegCode=d.ApplyNegCode and a.WorkPoint=d.WorkPoint left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint @@ -1848,9 +1848,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','12','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','12','{3}','{4}', getdate(),'{5}','{9}' from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -1920,7 +1920,7 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @" select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSMOApplyNegDetail a left join ICSMOApplyNeg d on a.ApplyNegCode=d.ApplyNegCode and a.WorkPoint=d.WorkPoint left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint @@ -1986,9 +1986,9 @@ left join (select b.TransCode,b.TransSequence,sum(isnull(Quantity,0)) LOTQTY fro sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','13','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','13','{3}','{4}', getdate(),'{5}','{9}' from ICSMOApplyNegDetail where ApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, ApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -2059,7 +2059,7 @@ WHERE d.Type='2'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSOApplyNegDetail a left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint @@ -2125,9 +2125,9 @@ WHERE d.Type='2'"; sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','14','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','14','{3}','{4}', getdate(),'{5}','{9}' from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} @@ -2197,7 +2197,7 @@ WHERE d.Type='3'"; //var queryParam = queryJson.ToJObject(); List parameter = new List(); string sql = @"select a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.Quantity,a.Amount,ISNULL(c.LOTQTY,0) AS CreatedQty, - (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty + (a.Quantity-ISNULL(c.LOTQTY,0)) as thisCreateQty,isnull(b.EffectiveEnable,0) as EffectiveEnable,isnull(b.EffectiveDays,0) as EffectiveDays from ICSOApplyNegDetail a left join ICSOApplyNeg d on a.OApplyNegCode=d.OApplyNegCode AND a.WorkPoint=d.WorkPoint @@ -2263,9 +2263,9 @@ WHERE d.Type='3'"; sql += string.Format(@"insert into ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,ExtensionID,Type,MUSER,MUSERName,MTIME,WorkPoint,Amount) select - newid(),'{0}',InvCode,'{1}','2999-12-31 00:00:00.000','{2}','{8}','15','{3}','{4}', getdate(),'{5}','{9}' + newid(),'{0}',InvCode,'{1}','{10}','{2}','{8}','15','{3}','{4}', getdate(),'{5}','{9}' from ICSOApplyNegDetail where OApplyNegCode='{6}' and Sequence='{7}' and WorkPoint='{5}' ", - LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString()); + LotNo, PRODUCTDATE, LOTQTY, MUSER, MUSERNAME, WorkPoints, OApplyNegCode, Sequence, ExtensionID, queryParam["Amount"].ToString(), queryParam["ExpirationDate"].ToString()); sql += "\r\n"; //} diff --git a/WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/From.cshtml b/WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/From.cshtml index 21fabc5..7e80cf5 100644 --- a/WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/From.cshtml +++ b/WMS-BS/NFine.Web/Areas/WMS/Views/WMSCreateItemLot/From.cshtml @@ -59,6 +59,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -95,6 +97,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -131,6 +135,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -167,6 +173,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -203,6 +211,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -239,6 +249,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -274,6 +286,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -310,6 +324,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -346,6 +362,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -381,6 +399,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -417,6 +437,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -453,6 +475,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -489,6 +513,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -525,6 +551,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -561,6 +589,8 @@ $("#CreatedQty").val(data.rows[0].CreatedQty); $("#thisCreateQty").val(data.rows[0].thisCreateQty); $("#YAmount").val(data.rows[0].Amount); + $("#EffectiveEnable").val(data.rows[0].EffectiveEnable); + $("#EffectiveDays").val(data.rows[0].EffectiveDays); VenCode = data.rows[0].VenCode; WorkPoint = data.rows[0].WorkPoint; if (data.rows[0].Quantity == data.rows[0].CreatedQty) { @@ -692,6 +722,8 @@ minPackQty_Change(); } + + function submitForm() { debugger; @@ -719,12 +751,22 @@ if (Quantity == CreatedQty ) { return false; } + var ExpirationDate = '';//条码失效日期 + var EffectiveEnable = $("#EffectiveEnable").val();//料品是否启用有效天数 + var EffectiveDays = $("#EffectiveDays").val();//料品有效期天数 + var PRODUCTDATE = $("#PRODUCTDATE").val();//条码生产日期 + if (EffectiveEnable=='1') { + var ExpirationDate= dateChange(EffectiveDays, PRODUCTDATE); + } else { + var ExpirationDate = '2999-12-31 00:00:00.000'; + } var obj = { thisCreateQty: thisCreateQty, minPackQty: minPackQty, createPageCount: createPageCount, VendorLot: VendorLot, - PRODUCTDATE: $("#PRODUCTDATE").val(), + PRODUCTDATE: PRODUCTDATE, + ExpirationDate:ExpirationDate, Amount: $("#Amount").val(), //自由项 ProjectCode: $("#ProjectCode").val(), @@ -909,6 +951,20 @@ }) } } + + + function dateChange(num ,date ) { + if (!date) { + date = new Date();//没有传入值时,默认是当前日期 + date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); + } + date += " 00:00:00";//设置为当天凌晨12点 + date = Date.parse(new Date(date))/1000;//转换为时间戳 + date += (86400) * num;//修改后的时间戳 + var newDate = new Date(parseInt(date) * 1000);//转换为时间 + return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate(); + } +
@@ -968,6 +1024,8 @@ *生产日期 + +