|
@ -57,13 +57,13 @@ namespace ICSSoft.DataProject |
|
|
|
|
|
|
|
|
string TransType = JsonData.TransType; |
|
|
string TransType = JsonData.TransType; |
|
|
#region SLQ
|
|
|
#region SLQ
|
|
|
string sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2})
|
|
|
|
|
|
|
|
|
string sqlCheck = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2})
|
|
|
BEGIN |
|
|
BEGIN |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); |
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); |
|
|
RETURN |
|
|
RETURN |
|
|
END |
|
|
END |
|
|
|
|
|
|
|
|
SELECT a.ID, |
|
|
|
|
|
|
|
|
";
|
|
|
|
|
|
string sql = @"SELECT a.ID,
|
|
|
{0} |
|
|
{0} |
|
|
a.InvCode, |
|
|
a.InvCode, |
|
|
inv.InvName, |
|
|
inv.InvName, |
|
@ -103,6 +103,9 @@ namespace ICSSoft.DataProject |
|
|
string columns = string.Empty; //查询源头单据表的特殊列名
|
|
|
string columns = string.Empty; //查询源头单据表的特殊列名
|
|
|
string tableName = string.Empty; //查询源头单据表名
|
|
|
string tableName = string.Empty; //查询源头单据表名
|
|
|
string where = string.Empty; //查询源头单据的过滤条件
|
|
|
string where = string.Empty; //查询源头单据的过滤条件
|
|
|
|
|
|
bool isMerge = false; //合并发料
|
|
|
|
|
|
string columnsMerge = string.Empty; //合并发料查询源头单据表的特殊列名
|
|
|
|
|
|
string tableNameMerge = string.Empty; //合并发料查询源头单据表名
|
|
|
#region 出库
|
|
|
#region 出库
|
|
|
#region 采购退货
|
|
|
#region 采购退货
|
|
|
if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) |
|
|
if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) |
|
@ -123,9 +126,20 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='2' "; |
|
|
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='2' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 委外发料
|
|
|
|
|
|
|
|
|
#region 委外发料(合并发料)
|
|
|
else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+b.OOCode AS TransCode,
|
|
|
|
|
|
a.PickID AS DetailID, |
|
|
|
|
|
a.SupplyType AS Type, |
|
|
|
|
|
b.Sequence+'-'+a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSOOPick a
|
|
|
|
|
|
INNER JOIN ICSOutsourcingOrder b ON a.OODetailID=b.OODetailID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.PickID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"b.OOCode AS TransCode,
|
|
|
columns = @"b.OOCode AS TransCode,
|
|
|
a.PickID AS DetailID, |
|
|
a.PickID AS DetailID, |
|
|
a.SupplyType AS Type, |
|
|
a.SupplyType AS Type, |
|
@ -157,9 +171,20 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.ODNCode='{0}' AND a.WorkPoint='{1}' AND a.ODNType='2' "; |
|
|
where = @" a.ODNCode='{0}' AND a.WorkPoint='{1}' AND a.ODNType='2' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 生产发料
|
|
|
|
|
|
|
|
|
#region 生产发料(合并发料)
|
|
|
else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+b.MOCode AS TransCode,
|
|
|
|
|
|
a.PickID AS DetailID, |
|
|
|
|
|
a.SupplyType AS Type, |
|
|
|
|
|
b.Sequence+'-'+a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSMOPick a
|
|
|
|
|
|
INNER JOIN ICSMO b ON a.MODetailID=b.MODetailID AND a.WorkPoint=b.WorkPoint |
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.PickID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"b.MOCode AS TransCode,
|
|
|
columns = @"b.MOCode AS TransCode,
|
|
|
a.PickID AS DetailID, |
|
|
a.PickID AS DetailID, |
|
|
a.SupplyType AS Type, |
|
|
a.SupplyType AS Type, |
|
@ -172,9 +197,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" b.MOCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" b.MOCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 销售出库
|
|
|
|
|
|
|
|
|
#region 销售出库(合并发料)
|
|
|
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.SDNCode AS TransCode,
|
|
|
|
|
|
a.SDNDetailID AS DetailID, |
|
|
|
|
|
a.Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.SDNQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSSDN a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.SDNDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.SDNCode AS TransCode,
|
|
|
columns = @"a.SDNCode AS TransCode,
|
|
|
a.SDNDetailID AS DetailID, |
|
|
a.SDNDetailID AS DetailID, |
|
|
a.Type, |
|
|
a.Type, |
|
@ -190,13 +225,7 @@ namespace ICSSoft.DataProject |
|
|
else if (TransType == TransTypeEnum.Check.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.Check.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
#region SLQ
|
|
|
#region SLQ
|
|
|
sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2})
|
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); |
|
|
|
|
|
RETURN |
|
|
|
|
|
END |
|
|
|
|
|
|
|
|
|
|
|
SELECT a.ID, |
|
|
|
|
|
|
|
|
sql = @"SELECT a.ID,
|
|
|
{0} |
|
|
{0} |
|
|
a.InvCode, |
|
|
a.InvCode, |
|
|
inv.InvName, |
|
|
inv.InvName, |
|
@ -226,18 +255,22 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.CheckCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.CheckCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 一步调拨
|
|
|
|
|
|
|
|
|
#region 一步调拨(合并发料)
|
|
|
else if (TransType == TransTypeEnum.OneStepTransferDocIn.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.OneStepTransferDocIn.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.TransferNO AS TransCode,
|
|
|
|
|
|
a.TransferDetailID AS DetailID, |
|
|
|
|
|
'' AS Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.TransferQuantity AS IssueQuantity, |
|
|
|
|
|
a.ToWarehouseCode,";
|
|
|
|
|
|
|
|
|
#region SLQ
|
|
|
|
|
|
sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2})
|
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); |
|
|
|
|
|
RETURN |
|
|
|
|
|
END |
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSTransfer a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.TransferDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
SELECT a.ID, |
|
|
|
|
|
|
|
|
#region SLQ
|
|
|
|
|
|
sql = @"SELECT a.ID,
|
|
|
{0} |
|
|
{0} |
|
|
a.InvCode, |
|
|
a.InvCode, |
|
|
inv.InvName, |
|
|
inv.InvName, |
|
@ -285,9 +318,20 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.TransferNO='{0}' AND a.WorkPoint='{1}' AND a.Status='1' "; |
|
|
where = @" a.TransferNO='{0}' AND a.WorkPoint='{1}' AND a.Status='1' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 两步调出
|
|
|
|
|
|
|
|
|
#region 两步调出(合并发料)
|
|
|
else if (TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.OutCode AS TransCode,
|
|
|
|
|
|
a.OutDetailID AS DetailID, |
|
|
|
|
|
'' AS Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.OutQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSOtherOut a
|
|
|
|
|
|
INNER JOIN ICSTransfer tra ON a.TransferDetailID=tra.TransferDetailID AND a.WorkPoint=tra.WorkPoint |
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.OutDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.OutCode AS TransCode,
|
|
|
columns = @"a.OutCode AS TransCode,
|
|
|
a.OutDetailID AS DetailID, |
|
|
a.OutDetailID AS DetailID, |
|
|
'' AS Type, |
|
|
'' AS Type, |
|
@ -300,9 +344,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 其他出库
|
|
|
|
|
|
|
|
|
#region 其他出库(合并发料)
|
|
|
else if (TransType == TransTypeEnum.OtherOutDoc.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.OtherOutDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.OutCode AS TransCode,
|
|
|
|
|
|
a.OutDetailID AS DetailID, |
|
|
|
|
|
'' AS Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.OutQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSOtherOut a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.OutDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.OutCode AS TransCode,
|
|
|
columns = @"a.OutCode AS TransCode,
|
|
|
a.OutDetailID AS DetailID, |
|
|
a.OutDetailID AS DetailID, |
|
|
'' AS Type, |
|
|
'' AS Type, |
|
@ -314,9 +368,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.OutCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 领料申请单发料
|
|
|
|
|
|
|
|
|
#region 领料申请单发料(合并发料)
|
|
|
else if (TransType == TransTypeEnum.MOApply.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.MOApply.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.ApplyCode AS TransCode,
|
|
|
|
|
|
a.ApplyDetailID AS DetailID, |
|
|
|
|
|
a.Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSMOApply a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.ApplyDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.ApplyCode AS TransCode,
|
|
|
columns = @"a.ApplyCode AS TransCode,
|
|
|
a.ApplyDetailID AS DetailID, |
|
|
a.ApplyDetailID AS DetailID, |
|
|
a.Type, |
|
|
a.Type, |
|
@ -328,9 +392,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 委外领料申请单发料
|
|
|
|
|
|
|
|
|
#region 委外领料申请单发料(合并发料)
|
|
|
else if (TransType == TransTypeEnum.OOApply.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.OOApply.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.ApplyCode AS TransCode,
|
|
|
|
|
|
a.ApplyDetailID AS DetailID, |
|
|
|
|
|
a.Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSOApply a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.ApplyDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.ApplyCode AS TransCode,
|
|
|
columns = @"a.ApplyCode AS TransCode,
|
|
|
a.ApplyDetailID AS DetailID, |
|
|
a.ApplyDetailID AS DetailID, |
|
|
a.Type, |
|
|
a.Type, |
|
@ -342,9 +416,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.ApplyCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 开立材料出库
|
|
|
|
|
|
|
|
|
#region 开立材料出库(合并发料)
|
|
|
else if (TransType == TransTypeEnum.MOIssue.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.MOIssue.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.IssueCode AS TransCode,
|
|
|
|
|
|
a.IssueDetailID AS DetailID, |
|
|
|
|
|
a.Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSMOIssue a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.IssueDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.IssueCode AS TransCode,
|
|
|
columns = @"a.IssueCode AS TransCode,
|
|
|
a.IssueDetailID AS DetailID, |
|
|
a.IssueDetailID AS DetailID, |
|
|
a.Type, |
|
|
a.Type, |
|
@ -356,9 +440,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.IssueCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
where = @" a.IssueCode='{0}' AND a.WorkPoint='{1}' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 开立委外材料出库
|
|
|
|
|
|
|
|
|
#region 开立委外材料出库(合并发料)
|
|
|
else if (TransType == TransTypeEnum.OOIssue.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.OOIssue.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.IssueCode AS TransCode,
|
|
|
|
|
|
a.IssueDetailID AS DetailID, |
|
|
|
|
|
a.Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.IssueQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSOIssue a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.IssueDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.IssueCode AS TransCode,
|
|
|
columns = @"a.IssueCode AS TransCode,
|
|
|
a.IssueDetailID AS DetailID, |
|
|
a.IssueDetailID AS DetailID, |
|
|
a.Type, |
|
|
a.Type, |
|
@ -398,9 +492,19 @@ namespace ICSSoft.DataProject |
|
|
where = @" a.RCVCode='{0}' AND a.WorkPoint='{1}' AND a.Type='2' "; |
|
|
where = @" a.RCVCode='{0}' AND a.WorkPoint='{1}' AND a.Type='2' "; |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
#region 借用
|
|
|
|
|
|
|
|
|
#region 借用(合并发料)
|
|
|
else if (TransType == TransTypeEnum.BrrowDoc.GetDescription()) |
|
|
else if (TransType == TransTypeEnum.BrrowDoc.GetDescription()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
isMerge = true; |
|
|
|
|
|
columnsMerge = @"mer.MergeID+'-'+a.BrrowCode AS TransCode,
|
|
|
|
|
|
a.BrrowDetailID AS DetailID, |
|
|
|
|
|
'' AS Type, |
|
|
|
|
|
a.Sequence AS TransSequence, |
|
|
|
|
|
a.BrrowQuantity AS IssueQuantity,";
|
|
|
|
|
|
|
|
|
|
|
|
tableNameMerge = @"ICSBrrow a
|
|
|
|
|
|
INNER JOIN ICSMOPickMerge mer ON a.BrrowDetailID=mer.SourceID AND a.WorkPoint=mer.WorkPoint";
|
|
|
|
|
|
|
|
|
columns = @"a.BrrowCode AS TransCode,
|
|
|
columns = @"a.BrrowCode AS TransCode,
|
|
|
a.BrrowDetailID AS DetailID, |
|
|
a.BrrowDetailID AS DetailID, |
|
|
'' AS Type, |
|
|
'' AS Type, |
|
@ -571,16 +675,10 @@ namespace ICSSoft.DataProject |
|
|
#endregion
|
|
|
#endregion
|
|
|
if (string.IsNullOrWhiteSpace(columns) || string.IsNullOrWhiteSpace(tableName) || string.IsNullOrWhiteSpace(where)) |
|
|
if (string.IsNullOrWhiteSpace(columns) || string.IsNullOrWhiteSpace(tableName) || string.IsNullOrWhiteSpace(where)) |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo003")); |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo003")); |
|
|
if (isDeliveryNotice) |
|
|
|
|
|
|
|
|
if (isDeliveryNotice)//送货、到货、含委外
|
|
|
{ |
|
|
{ |
|
|
#region SLQ
|
|
|
#region SLQ
|
|
|
sql = @"IF NOT EXISTS(SELECT a.ID FROM {1} WHERE {2})
|
|
|
|
|
|
BEGIN |
|
|
|
|
|
RAISERROR('" + language.GetNameByCode("WMSAPIInfo035") + @"',16,1); |
|
|
|
|
|
RETURN |
|
|
|
|
|
END |
|
|
|
|
|
|
|
|
|
|
|
SELECT a.ID, |
|
|
|
|
|
|
|
|
sql = sqlCheck + @"SELECT a.ID,
|
|
|
{0} |
|
|
{0} |
|
|
a.InvCode, |
|
|
a.InvCode, |
|
|
inv.InvName, |
|
|
inv.InvName, |
|
@ -609,7 +707,26 @@ namespace ICSSoft.DataProject |
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint |
|
|
WHERE {2} ";
|
|
|
WHERE {2} ";
|
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
else if(isMerge)//合并发料
|
|
|
|
|
|
{ |
|
|
|
|
|
#region SLQ
|
|
|
|
|
|
string sqlMerge = @"IF EXISTS(SELECT ID FROM ICSMOPickMerge WHERE MergeID='{3}' AND WorkPoint='{4}' )
|
|
|
|
|
|
BEGIN |
|
|
|
|
|
"+ sql;
|
|
|
|
|
|
string whereMerge = string.Format("mer.MergeID='{0}' AND mer.WorkPoint='{1}'", JsonData.TransCode, JsonData.WorkPoint); |
|
|
|
|
|
sqlMerge = string.Format(sqlMerge, columnsMerge, tableNameMerge, whereMerge, JsonData.TransCode, JsonData.WorkPoint); |
|
|
|
|
|
sql = sqlMerge + @"
|
|
|
|
|
|
END |
|
|
|
|
|
ELSE |
|
|
|
|
|
BEGIN |
|
|
|
|
|
" + sqlCheck + sql + @" |
|
|
|
|
|
END";
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
sql = sqlCheck + sql; |
|
|
} |
|
|
} |
|
|
where = string.Format(where, JsonData.TransCode, JsonData.WorkPoint); |
|
|
where = string.Format(where, JsonData.TransCode, JsonData.WorkPoint); |
|
|
sql = string.Format(sql, columns, tableName, where, JsonData.TransCode); |
|
|
sql = string.Format(sql, columns, tableName, where, JsonData.TransCode); |
|
@ -722,6 +839,7 @@ namespace ICSSoft.DataProject |
|
|
|| TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription()//开立委外红字入库单
|
|
|
|| TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription()//开立委外红字入库单
|
|
|
|| TransType == TransTypeEnum.BrrowDoc.GetDescription() //借用
|
|
|
|| TransType == TransTypeEnum.BrrowDoc.GetDescription() //借用
|
|
|
|| TransType == TransTypeEnum.TransferLibrary.GetDescription() //移库
|
|
|
|| TransType == TransTypeEnum.TransferLibrary.GetDescription() //移库
|
|
|
|
|
|
//|| TransType == TransTypeEnum.DisassemblyDoc.GetDescription() //拆卸单(散件生成条码入库)
|
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
|
isOut = true; |
|
|
isOut = true; |
|
@ -1314,6 +1432,10 @@ namespace ICSSoft.DataProject |
|
|
BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>(); |
|
|
BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>(); |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
|
|
|
|
|
|
} |
|
|
//入库
|
|
|
//入库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoUp(Identification, itemInfo.LocationCode, itemInfo.LotNo, itemInfo.Quantity, |
|
|
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID); |
|
|
item.User, item.WorkPoint, WHTransType, BusinessCode, cmd, language,itemInfo.LogID); |
|
@ -1436,6 +1558,13 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
|
|
|
throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
|
|
|
} |
|
|
} |
|
|
|
|
|
string[] trans = item.TransCode.Split('-'); |
|
|
|
|
|
string MergeID = ""; |
|
|
|
|
|
if (trans.Length == 2) |
|
|
|
|
|
{ |
|
|
|
|
|
MergeID = trans[0]; |
|
|
|
|
|
item.TransCode = trans[1]; |
|
|
|
|
|
} |
|
|
#region 采购退货
|
|
|
#region 采购退货
|
|
|
if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) |
|
|
if (TransType == TransTypeEnum.PurchaseReceiveDoctNegative.GetDescription()) |
|
|
{ |
|
|
{ |
|
@ -1460,7 +1589,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingIssueDoc.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OutsourcingIssueDoc.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1488,7 +1617,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOIssueDoc.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOIssueDoc.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1502,7 +1631,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.SalesShipmentDoc.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1516,7 +1645,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "6", TransTypeEnum.TwoStepTransferDocOut.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "6", TransTypeEnum.TwoStepTransferDocOut.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1530,7 +1659,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OtherOutDoc.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OtherOutDoc.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1544,7 +1673,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOApply.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOApply.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1558,7 +1687,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OOApply.GetDescription<DBValue>(), cmd, language,MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1572,7 +1701,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOIssue.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.MOIssue.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1586,7 +1715,7 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OOIssue.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.OOIssue.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
@ -1628,10 +1757,14 @@ namespace ICSSoft.DataProject |
|
|
{ |
|
|
{ |
|
|
//出库
|
|
|
//出库
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoDown(Identification, item.TransCode, item.TransSequence, itemInfo.LotNo, itemInfo.CurrentQuantity, |
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.BrrowDoc.GetDescription<DBValue>(), cmd, language); |
|
|
|
|
|
|
|
|
item.User, item.WorkPoint, "3", TransTypeEnum.BrrowDoc.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
throw new Exception(LanguageHelper.GetNameSingle("WMSAPIInfo003"));//"单据类型不存在!"
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//上传ERP
|
|
|
//上传ERP
|
|
|
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"])) |
|
|
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"])) |
|
@ -3431,6 +3564,13 @@ namespace ICSSoft.DataProject |
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo027"));//"调拨单号不能为空!");
|
|
|
throw new Exception(language.GetNameByCode("WMSAPIInfo027"));//"调拨单号不能为空!");
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
string[] trans = item.TransCode.Split('-'); |
|
|
|
|
|
string MergeID = ""; |
|
|
|
|
|
if (trans.Length == 2) |
|
|
|
|
|
{ |
|
|
|
|
|
MergeID = trans[0]; |
|
|
|
|
|
item.TransCode = trans[1]; |
|
|
|
|
|
} |
|
|
//验证信息
|
|
|
//验证信息
|
|
|
sql = @"DECLARE @Status VARCHAR(10)
|
|
|
sql = @"DECLARE @Status VARCHAR(10)
|
|
|
SELECT @Status=Status FROM ICSTransfer WHERE TransferNO='{0}' and WorkPoint='{1}' AND Type = '1' |
|
|
SELECT @Status=Status FROM ICSTransfer WHERE TransferNO='{0}' and WorkPoint='{1}' AND Type = '1' |
|
@ -3477,7 +3617,7 @@ namespace ICSSoft.DataProject |
|
|
|
|
|
|
|
|
//更新条码信息
|
|
|
//更新条码信息
|
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode, |
|
|
ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode, |
|
|
itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", "21", cmd, language); |
|
|
|
|
|
|
|
|
itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", TransTypeEnum.OneStepTransferDocIn.GetDescription<DBValue>(), cmd, language, MergeID); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
ICSWareHouseService.OneStepTransferDocInERP(TransTypeEnum.OneStepTransferDocIn.GetDescription(), Identification, cmd, language); |
|
|
ICSWareHouseService.OneStepTransferDocInERP(TransTypeEnum.OneStepTransferDocIn.GetDescription(), Identification, cmd, language); |
|
@ -4051,8 +4191,8 @@ namespace ICSSoft.DataProject |
|
|
} |
|
|
} |
|
|
sql = @"SELECT a.ContainerCode, a.ContainerName,b.LotNo FROM ICSContainer a
|
|
|
sql = @"SELECT a.ContainerCode, a.ContainerName,b.LotNo FROM ICSContainer a
|
|
|
INNER JOIN ICSContainerLot b ON a.ID=b.ContainerID |
|
|
INNER JOIN ICSContainerLot b ON a.ID=b.ContainerID |
|
|
WHERE a.ContainerCODE+a.WorkPoint='{0}'";
|
|
|
|
|
|
sql = string.Format(sql, codes); |
|
|
|
|
|
|
|
|
WHERE a.ContainerCODE+a.WorkPoint IN({0})";
|
|
|
|
|
|
sql = string.Format(sql, codes.Substring(0,codes.Length - 1)); |
|
|
DataTable table = DBHelper.SQlReturnData(sql, cmd); |
|
|
DataTable table = DBHelper.SQlReturnData(sql, cmd); |
|
|
cmd.Transaction.Commit(); |
|
|
cmd.Transaction.Commit(); |
|
|
return table; |
|
|
return table; |
|
|