Browse Source

料品管控条码已存在时,不调用合批方法

master
FoxV 2 years ago
parent
commit
d23a39640f
  1. 55
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

55
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

@ -552,12 +552,61 @@ namespace ICSSoft.DataProject
throw new Exception(language.GetNameByCode("WMSAPIInfo166")); throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
} }
} }
//当存在料品管控条码时,执行合批
//当存在料品管控条码时,直接将数量叠加
else else
{ {
LotNoMode lotNoMode = modelNew[0];
WareHouseLotInfoMerge(Identification,jointLotNo, LotNo, Quantity,User,WorkPoint,TransType,BusinessCode,cmd,language);
try
{
///更新目标条码库存
sql = @"
IF NOT EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a WHERE a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo171") + @"',16,1);
RETURN
END
UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{2}' WHERE LotNo='{0}' AND WorkPoint='{1}'
";
sql = string.Format(sql, jointLotNo, WorkPoint, Quantity);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo169"));//"目标条码库存更新失败!");
}
///添加日志
sql = @"IF NOT EXISTS(SELECT F_Account FROM Sys_SRM_User WHERE F_Account='{2}' AND F_Location='{1}')
BEGIN
RAISERROR('" + string.Format(language.GetNameByCode("WMSAPIInfo060"), "{2}") + @"',16,1);
RETURN
END
INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity,
Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID,
ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName,
MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID(),'{3}',b.TransCode,b.TransSequence,a.LotNo ,a.InvCode ,
'','',c.WarehouseCode,c.LocationCode,c.Quantity,
'','0','{4}','{5}','0','',
'','','',f.F_Account ,f.F_RealName ,
SYSDATETIME() ,a.WorkPoint ,''
FROM ICSInventoryLot a
INNER JOIN ICSInventoryLotDetail b ON a.LotNo=b.LotNo AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSWareHouseLotInfo c ON a.LotNo=c.LotNo AND a.WorkPoint=c.WorkPoint
INNER 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, jointLotNo, WorkPoint, User, Identification, TransType, BusinessCode);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
}
}
catch (Exception)
{
throw;
}
} }

Loading…
Cancel
Save