@ -553,6 +553,7 @@ namespace ICSSoft.DataProject
string LocationCode = "" ;
string LocationCode = "" ;
string WHCode = "" ;
string WHCode = "" ;
string LotNo = "" ;
string LotNo = "" ;
DateTime createDate = DateTime . Now ;
#region 根据传入的料号和数量自动生成条码
#region 根据传入的料号和数量自动生成条码
if ( BusinessCode = = "2" )
if ( BusinessCode = = "2" )
{
{
@ -649,6 +650,17 @@ namespace ICSSoft.DataProject
{
{
throw new Exception ( language . GetNameByCode ( "WMSAPIInfo215" ) ) ;
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
#endregion
#region 正常入库
#region 正常入库
@ -713,12 +725,12 @@ namespace ICSSoft.DataProject
}
}
string sql = string . Empty ;
string sql = string . Empty ;
sql = @ " INSERT INTO ICSWareHouseLotInfo(ID,LotNO,WarehouseCode,LocationCode,InvCode,Quantity,InDate,LockQuantity,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
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
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a . LotNo = b . LotNo AND a . WorkPoint = b . WorkPoint
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
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 } ' ";
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 ) )
if ( ! DBHelper . ExecuteNonQuery ( sql , cmd ) )
{
{