@ -553,6 +553,7 @@ namespace ICSSoft.DataProject
string LocationCode = "" ;
string WHCode = "" ;
string LotNo = "" ;
DateTime createDate = DateTime . Now ;
#region 根据传入的料号和数量自动生成条码
if ( BusinessCode = = "2" )
{
@ -649,6 +650,17 @@ namespace ICSSoft.DataProject
{
throw new Exception ( language . GetNameByCode ( "WMSAPIInfo215" ) ) ;
}
var getDate = string . Format ( @ "SELECT top 1 MTIME FROM ICSWareHouseLotInfo WHERE InvCode=(select InvCode
from ICSMOApplyNegDetail where ApplyNegCode = ' { 1 } ' and Sequence = ' { 2 } ' and WorkPoint = ' { 0 } ' ) AND Quantity > 0 ORDER BY MTIME ",
WorkPoint , TransCode , TransLine ) ;
var date = DBHelper . ExecuteScalar ( getDate , cmd ) ;
if ( date ! = null )
{
createDate = Convert . ToDateTime ( date ) . AddDays ( - 1 ) ;
}
}
#endregion
#region 正常入库
@ -713,12 +725,12 @@ namespace ICSSoft.DataProject
}
string sql = string . Empty ;
sql = @ " INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID ( ) , a . LotNo , ' { 4 } ',' { 5 } ' , a . InvCode , ' { 3 } ' , SYSDATETIME ( ) , '0' , ' { 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) , SYSDATETIME ( ) , a . WorkPoint , ' '
SELECT NEWID ( ) , a . LotNo , ' { 4 } ',' { 5 } ' , a . InvCode , ' { 3 } ',' { 6 } ',' 0 ', '{ 2 } ' , isnull ( f . F_RealName , ' { 2 } ' ) , ' { 6 } ' , a . WorkPoint , ' '
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
left JOIN Sys_SRM_User f ON f . F_Account = ' { 2 } ' AND a . WorkPoint = f . F_Location
WHERE a . LotNo = ' { 0 } ' AND a . WorkPoint = ' { 1 } ' ";
sql = string . Format ( sql , LotNo , WorkPoint , User , Quantity , WHCode , LocationCode ) ;
sql = string . Format ( sql , LotNo , WorkPoint , User , Quantity , WHCode , LocationCode , createDate ) ;
if ( ! DBHelper . ExecuteNonQuery ( sql , cmd ) )
{
@ -1950,7 +1962,7 @@ namespace ICSSoft.DataProject
, InDate = ( SELECT MIN ( MTIME ) FROM ICSWareHouseLotInfo WHERE LotNo IN ( ' { 4 } ' ) )
WHERE LotNo = ' { 0 } ' AND WorkPoint = ' { 1 } '
";
sql = string . Format ( sql , LotNo , WorkPoint , Quantity , CurrentLotNo , LotNo + "','" + CurrentLotNo ) ;
sql = string . Format ( sql , LotNo , WorkPoint , Quantity , CurrentLotNo , LotNo + "','" + CurrentLotNo ) ;
if ( ! DBHelper . ExecuteNonQuery ( sql , cmd ) )
{
@ -3403,7 +3415,7 @@ WHERE LotNo='{0}' AND WorkPoint='{1}'
select ' { 7 } ',' { 0 } ',' { 1 } ',' { 2 } ',' { 3 } ',' { 4 } ' , GETDATE ( ) , ' { 5 } ',' { 6 } ' ";
if ( IsOverLoad = = true )
{
sql = string . Format ( sql , TaskCode , ContainerCode , Location , "是" , User , WorkPoint , TransType , data ) ;
sql = string . Format ( sql , TaskCode , ContainerCode , Location , "是" , User , WorkPoint , TransType , data ) ;
}
else
{