sql=sql+@" AND log.BusinessCode IN('"+type+@"') GROUP BY log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,a.WarehouseCode,
sql=sql+@" AND log.BusinessCode IN('"+type+@"') GROUP BY log.ID,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,inv.EATTRIBUTE1,a.WarehouseCode,
sqlString.Append($@" INSERT INTO ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,Amount,ExtensionID,Type,PrintTimes,LastPrintUser,
sqlString.Append($@" INSERT INTO ICSInventoryLot (ID,LotNo,InvCode,ProductDate,ExpirationDate,Quantity,Amount,ExtensionID,Type,PrintTimes,LastPrintUser,
sqlString.Append($@" INSERT INTO ICSInventoryLotDetail SELECT '{mode.CurrentLotNo}', TransCode, TransSequence,'{models.User} ', '{models.User}', '{models.MTIME}', WorkPoint, EATTRIBUTE1 FROM ICSInventoryLotDetail WHERE LotNo='{models.LotNo}';");
sqlString.Append($@" INSERT INTO ICSInventoryLotDetail SELECT '{mode.CurrentLotNo}', TransCode, TransSequence,'{user}','{userName}', '{models.MTIME}', WorkPoint, EATTRIBUTE1 FROM ICSInventoryLotDetail WHERE LotNo='{models.LotNo}';");
sqlString.Append($@" UPDATE [dbo].[ICSWareHouseLotInfoLog] SET [Quantity] = Quantity-{mode.CurrentQuantity.ToInt()} Where [LotNo]='{models.LotNo}' ");
sqlString.Append($@" UPDATE [dbo].[ICSWareHouseLotInfoLog] SET [Quantity] = Quantity-{mode.CurrentQuantity.ToInt()} Where [LotNo]='{models.LotNo}' ");