Browse Source

条码合并增加卡控批次

master
姜鹏 1 year ago
parent
commit
98afc0a4d9
  1. 53
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSWareHouseLotInfoService.cs

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

@ -1464,23 +1464,46 @@ namespace ICSSoft.DataProject
RAISERROR('" + language.GetNameByCode("WMSAPIInfo171") + @"',16,1);
RETURN
END
IF NOT EXISTS(SELECT a.LotNo FROM ICSInventoryLot a
INNER JOIN ICSExtension b ON a.ExtensionID=b.ID AND a.WorkPoint=b.WorkPoint
INNER JOIN (SELECT a.LotNo,b.BatchCode,a.WorkPoint from ICSInventoryLot a
INNER JOIN ICSExtension b on a.ExtensionID=b.ID AND a.WorkPoint=b.WorkPoint where a.LotNo='{3}' ) c ON b.BatchCode=c.BatchCode and a.WorkPoint=c.WorkPoint
IF EXISTS(
SELECT * FROM ICSWareHouseLotInfo a
INNER JOIN ICSInventoryLot c on a.LotNo=c.LotNo and a.WorkPoint=c.WorkPoint
INNER JOIN ICSInventory d on c.invcode=d.invcode and c.WorkPoint=d.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' and d.BatchEnable='1'
)
BEGIN
IF NOT EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a
INNER JOIN ICSWareHouseLotInfo b ON b.LotNo='{3}' AND a.WarehouseCode=b.WarehouseCode AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSInventoryLot c on a.LotNo=c.LotNo and a.WorkPoint=c.WorkPoint
INNER JOIN ICSInventoryLot d on b.LotNo=d.LotNo and b.WorkPoint=d.WorkPoint
INNER JOIN ICSExtension e on c.ExtensionID=e.ID and c.WorkPoint=e.WorkPoint
INNER JOIN ICSExtension f on d.ExtensionID=f.id and d.WorkPoint=f.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' and e.ID=f.ID)
BEGIN
RAISERROR('/',16,1);
RETURN
END
END
IF NOT EXISTS(
SELECT * FROM ICSWareHouseLotInfo a
INNER JOIN ICSInventoryLot c on a.LotNo=c.LotNo and a.WorkPoint=c.WorkPoint
INNER JOIN ICSInventory d on c.invcode=d.invcode and c.WorkPoint=d.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}' and d.BatchEnable='1'
)
BEGIN
IF NOT EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a
INNER JOIN ICSWareHouseLotInfo b ON b.LotNo='{3}' AND a.WarehouseCode=b.WarehouseCode AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSInventoryLot c on a.LotNo=c.LotNo and a.WorkPoint=c.WorkPoint
INNER JOIN ICSInventoryLot d on b.LotNo=d.LotNo and b.WorkPoint=d.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo199") + @"',16,1);
RETURN
END
IF NOT EXISTS(SELECT a.LotNo FROM ICSWareHouseLotInfo a
INNER JOIN ICSWareHouseLotInfo b ON b.LotNo='{3}' AND a.LocationCode=b.LocationCode AND a.WorkPoint=b.WorkPoint
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}')
BEGIN
RAISERROR('" + language.GetNameByCode("WMSAPIInfo200") + @"',16,1);
RETURN
END
BEGIN
RAISERROR('/',16,1);
RETURN
END
END
UPDATE ICSWareHouseLotInfo SET Quantity=ISNULL(Quantity,0)+'{2}' WHERE LotNo='{0}' AND WorkPoint='{1}'
UPDATE ICSInventoryLot SET Amount=(ISNULL(Amount,0)+(select Amount from
ICSInventoryLot where LotNo='{3}' AND WorkPoint='{1}')) WHERE LotNo='{0}' AND WorkPoint='{1}'
";
sql = string.Format(sql, LotNo, WorkPoint, Quantity, CurrentLotNo);

Loading…
Cancel
Save