|
@ -6,10 +6,6 @@ using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Data; |
|
|
using System.Data; |
|
|
using System.Data.SqlClient; |
|
|
using System.Data.SqlClient; |
|
|
using System.Linq; |
|
|
|
|
|
using System.Net.Http; |
|
|
|
|
|
using System.Text; |
|
|
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSSoft.DataProject |
|
|
namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
@ -723,15 +719,18 @@ namespace ICSSoft.DataProject |
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
string sql = @"
|
|
|
string sql = @"
|
|
|
IF NOT EXISTS(SELECT 1 |
|
|
|
|
|
FROM ICSMO a |
|
|
|
|
|
LEFT JOIN ICSInventoryLotDetail b ON b.TransCode=a.MoCode AND b.TransSequence=a.Sequence AND b.WorkPoint=a.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSInventoryLot c ON c.LotNo=b.LotNo AND c.WorkPoint=b.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSExtension d ON d.ID=c.ExtensionID AND d.WorkPoint=c.WorkPoint |
|
|
|
|
|
LEFT JOIN ICSBackflushBCLog bclog ON a.MOCode=bclog.TransCode AND a.Sequence=bclog.TransSequence AND bclog.BatchCode=d.BatchCode |
|
|
|
|
|
WHERE c.LotNo='{0}') |
|
|
|
|
|
|
|
|
IF NOT EXISTS ( |
|
|
|
|
|
SELECT bcLog.ID |
|
|
|
|
|
FROM ICSMO a |
|
|
|
|
|
INNER JOIN ICSInventoryLotDetail b ON b.TransCode=a.MoCode AND b.TransSequence=a.Sequence AND b.WorkPoint=a.WorkPoint |
|
|
|
|
|
INNER JOIN ICSInventoryLot c ON c.LotNo=b.LotNo AND c.WorkPoint=b.WorkPoint |
|
|
|
|
|
INNER JOIN ICSExtension d ON d.ID=c.ExtensionID AND d.WorkPoint=c.WorkPoint |
|
|
|
|
|
INNER JOIN ICSBackflushBCLog bclog ON a.MOCode=bclog.TransCode AND a.Sequence=bclog.TransSequence AND bclog.BatchCode=d.BatchCode |
|
|
|
|
|
WHERE c.LotNo = '{0}' |
|
|
|
|
|
) |
|
|
BEGIN |
|
|
BEGIN |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo468") + @"',16,1); |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo468") + @"',16,1); |
|
|
|
|
|
RETURN; |
|
|
END |
|
|
END |
|
|
|
|
|
|
|
|
DECLARE @Status VARCHAR(10) |
|
|
DECLARE @Status VARCHAR(10) |
|
@ -763,6 +762,7 @@ namespace ICSSoft.DataProject |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo083") + @"',16,1); |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo083") + @"',16,1); |
|
|
END";
|
|
|
END";
|
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity); |
|
|
sql = string.Format(sql, LotNo, WorkPoint, Quantity); |
|
|
|
|
|
log.Debug("生产入库:" + sql); |
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd)) |
|
|
if (!DBHelper.ExecuteNonQuery(sql, cmd)) |
|
|
{ |
|
|
{ |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo136"));//"生产订单更新失败!");
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo136"));//"生产订单更新失败!");
|
|
@ -993,7 +993,7 @@ ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a. |
|
|
LEFT JOIN ICSInventoryLot b ON b.LotNo=a.LotNo AND b.WorkPoint=a.WorkPoint |
|
|
LEFT JOIN ICSInventoryLot b ON b.LotNo=a.LotNo AND b.WorkPoint=a.WorkPoint |
|
|
LEFT JOIN ICSExtension ext ON ext.ID=b.ExtensionID AND ext.WorkPoint=b.WorkPoint |
|
|
LEFT JOIN ICSExtension ext ON ext.ID=b.ExtensionID AND ext.WorkPoint=b.WorkPoint |
|
|
LEFT JOIN ICSInventoryLotDetail d ON d.LotNo=b.LotNo AND d.WorkPoint=b.WorkPoint |
|
|
LEFT JOIN ICSInventoryLotDetail d ON d.LotNo=b.LotNo AND d.WorkPoint=b.WorkPoint |
|
|
LEFT JOIN ICSMO e ON e.MOCode=d.TransCode AND e.WorkPoint=d.WorkPoint |
|
|
|
|
|
|
|
|
LEFT JOIN ICSMO e ON e.MOCode=d.TransCode AND e.Sequence=d.TransSequence AND e.WorkPoint=d.WorkPoint |
|
|
LEFT JOIN ICSMOPick f ON f.MODetailID=e.MODetailID AND f.WorkPoint=d.WorkPoint |
|
|
LEFT JOIN ICSMOPick f ON f.MODetailID=e.MODetailID AND f.WorkPoint=d.WorkPoint |
|
|
INNER JOIN ICSInventory inv ON f.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
INNER JOIN ICSInventory inv ON f.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON f.InvCode=invBat.InvCode AND f.WHCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|
LEFT JOIN ICSInventoryBatchEnable invBat ON f.InvCode=invBat.InvCode AND f.WHCode=invBat.WHCode AND a.WorkPoint=invBat.WorkPoint |
|
|