Browse Source

退料类型区分

master
lixh 3 years ago
parent
commit
9600784768
  1. 1
      ICSSoft.WMS.WebAPI/ICSSoft.Common/HTTPHelper.cs
  2. 326
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

1
ICSSoft.WMS.WebAPI/ICSSoft.Common/HTTPHelper.cs

@ -14,6 +14,7 @@ namespace ICSSoft.Common
{
try
{
//log.Debug(url + Environment.NewLine + body);
Encoding encoding = Encoding.UTF8;
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(url);
request.Method = "POST";

326
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -959,9 +959,9 @@ namespace ICSSoft.DataProject
//1 - 不管控
//2 - 提醒
//3 - 限制
if(resultEffective == "2")
if (resultEffective == "2")
{
msg += string.Format(language.GetNameByCode("WMSAPIInfo181"), Lot)+Environment.NewLine;
msg += string.Format(language.GetNameByCode("WMSAPIInfo181"), Lot) + Environment.NewLine;
}
else if (resultEffective == "3")
{
@ -974,9 +974,9 @@ namespace ICSSoft.DataProject
//1 - 不管控
//2 - 提醒
//3 - 限制
if(result=="2")
if (result == "2")
{
msg += string.Format(language.GetNameByCode("WMSAPIInfo178"), Lot)+Environment.NewLine;
msg += string.Format(language.GetNameByCode("WMSAPIInfo178"), Lot) + Environment.NewLine;
}
else if (result == "3")
{
@ -990,7 +990,7 @@ namespace ICSSoft.DataProject
Result res = new Result();
res.Success = true;
res.Message = msg;// "接口调用成功!";
if(!isLimit)
if (!isLimit)
res.Data = table;
return res;
//出库时
@ -1119,7 +1119,7 @@ namespace ICSSoft.DataProject
|| TransType == TransTypeEnum.ICSOutsourcingIssueDoNegativeIssue.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OutsourcingIssueDoNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingIssueDoNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.ICSOutsourcingIssueDoNegative.GetDescription<DBValue>();
}
#endregion
@ -1127,7 +1127,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OutsourcingReceiveDoc.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OutsourcingReceiveDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingReceiveDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.OutsourcingReceiveDoc.GetDescription<DBValue>();
}
#endregion
@ -1137,7 +1137,7 @@ namespace ICSSoft.DataProject
|| TransType == TransTypeEnum.MOIssueDocNegativeIssue.GetDescription())
{
//更新源头单据数量
ICSManufactureService.MOIssueDocNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.MOIssueDocNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.MOIssueDocNegative.GetDescription<DBValue>();
}
#endregion
@ -1145,7 +1145,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.ManufactureReceiveDoc.GetDescription())
{
//更新源头单据数量
ICSManufactureService.ManufactureReceiveDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.ManufactureReceiveDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.ManufactureReceiveDoc.GetDescription<DBValue>();
}
#endregion
@ -1153,7 +1153,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.ManufactureReceive.GetDescription())
{
//更新源头单据数量
ICSManufactureService.ManufactureReceive(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.ManufactureReceive(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.ManufactureReceive.GetDescription<DBValue>();
}
#endregion
@ -1161,7 +1161,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.SalesShipmentDocNegative.GetDescription())
{
//更新源头单据数量
ICSSalesService.SalesShipmentDocNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSSalesService.SalesShipmentDocNegative(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.SalesShipmentDocNegative.GetDescription<DBValue>();
}
#endregion
@ -1169,14 +1169,14 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OtherInDoc.GetDescription())
{
//更新源头单据数量
ICSWareHouseService.OtherInDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.OtherInDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.OtherInDoc.GetDescription<DBValue>();
}
#endregion
#region 拆卸单
else if (TransType == TransTypeEnum.DisassemblyDoc.GetDescription())
{
ICSWareHouseService.DisassemblyDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.DisassemblyDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
WHTransType = "11";
BusinessCode = TransTypeEnum.DisassemblyDoc.GetDescription<DBValue>();
}
@ -1185,7 +1185,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.ReturnDoc.GetDescription())
{
//更新源头单据数量
ICSWareHouseService.ReturnDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.ReturnDoc(itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
BusinessCode = TransTypeEnum.ReturnDoc.GetDescription<DBValue>();
}
#endregion
@ -1193,7 +1193,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.SalesReturnBack.GetDescription())
{
//更新源头单据数量
ICSSalesService.SalesReturnBackIn(itemInfo.TransCode, itemInfo.TransSequence, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd,language);
ICSSalesService.SalesReturnBackIn(itemInfo.TransCode, itemInfo.TransSequence, itemInfo.LotNo, itemInfo.Quantity, item.WorkPoint, cmd, language);
//入库
BusinessCode = TransTypeEnum.SalesReturnBack.GetDescription<DBValue>();
@ -1209,7 +1209,7 @@ namespace ICSSoft.DataProject
if (TransType == TransTypeEnum.DisassemblyDoc.GetDescription())
{
//更新套件锁定数量
ICSWareHouseService.DisassemblyDoc(Identification, cmd,language);
ICSWareHouseService.DisassemblyDoc(Identification, cmd, language);
}
#endregion}
}
@ -1227,47 +1227,47 @@ namespace ICSSoft.DataProject
ICSPurchaseService.PurchaseRejectDocInERP(TransType, Identification, cmd, language);
//审核的委外到货单
else if (TransType == TransTypeEnum.ODeliveryNotice.GetDescription())
ICSOutsourcingService.ODeliveryNoticeInERP(TransType, Identification, cmd,language);
ICSOutsourcingService.ODeliveryNoticeInERP(TransType, Identification, cmd, language);
//委外拒收
else if (TransType == TransTypeEnum.OutsourcingRejectDoc.GetDescription())
ICSOutsourcingService.OutsourcingRejectDocInERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingRejectDocInERP(TransType, Identification, cmd, language);
//委外退料
else if (TransType == TransTypeEnum.ICSOutsourcingIssueDoNegative.GetDescription()
|| TransType == TransTypeEnum.ICSOutsourcingIssueDoNegativeApply.GetDescription()
|| TransType == TransTypeEnum.ICSOutsourcingIssueDoNegativeIssue.GetDescription())
ICSOutsourcingService.OutsourcingIssueDoNegativeERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingIssueDoNegativeERP(TransType, Identification, cmd, language);
//委外入库
else if (TransType == TransTypeEnum.OutsourcingReceiveDoc.GetDescription())
ICSOutsourcingService.OutsourcingReceiveDocERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingReceiveDocERP(TransType, Identification, cmd, language);
//生产退料
else if (TransType == TransTypeEnum.MOIssueDocNegative.GetDescription()
|| TransType == TransTypeEnum.MOIssueDocNegativeApply.GetDescription()
|| TransType == TransTypeEnum.MOIssueDocNegativeIssue.GetDescription())
ICSManufactureService.MOIssueDocNegativeERP(TransType, Identification, cmd,language);
ICSManufactureService.MOIssueDocNegativeERP(TransType, Identification, cmd, language);
//生产入库
else if (TransType == TransTypeEnum.ManufactureReceiveDoc.GetDescription())
ICSManufactureService.ManufactureReceiveDocERP(TransType, Identification, cmd,language);
ICSManufactureService.ManufactureReceiveDocERP(TransType, Identification, cmd, language);
//开立的生产入库单
else if (TransType == TransTypeEnum.ManufactureReceive.GetDescription())
ICSManufactureService.ManufactureReceiveERP(TransType, Identification, cmd,language);
ICSManufactureService.ManufactureReceiveERP(TransType, Identification, cmd, language);
//销售退货
else if (TransType == TransTypeEnum.SalesShipmentDocNegative.GetDescription())
ICSSalesService.SalesShipmentDocNegativeERP(TransType, Identification, cmd,language);
ICSSalesService.SalesShipmentDocNegativeERP(TransType, Identification, cmd, language);
//两步调入
else if (TransType == TransTypeEnum.TwoStepTransferDocIn.GetDescription())
ICSWareHouseService.TwoStepTransferDocInERP(TransType, Identification, cmd,language);
ICSWareHouseService.TwoStepTransferDocInERP(TransType, Identification, cmd, language);
//销售退货-原条码
else if (TransType == TransTypeEnum.SalesReturnBack.GetDescription())
ICSSalesService.SalesReturnBackInERP(TransType, Identification, cmd,language);
ICSSalesService.SalesReturnBackInERP(TransType, Identification, cmd, language);
//其他入库
else if (TransType == TransTypeEnum.OtherInDoc.GetDescription())
ICSWareHouseService.OtherInDocERP(TransType, Identification, cmd,language);
ICSWareHouseService.OtherInDocERP(TransType, Identification, cmd, language);
//拆卸单
if (TransType == TransTypeEnum.DisassemblyDoc.GetDescription())
ICSWareHouseService.DisassemblyDocERP(TransType, Identification, cmd,language);
ICSWareHouseService.DisassemblyDocERP(TransType, Identification, cmd, language);
//归还
else if (TransType == TransTypeEnum.ReturnDoc.GetDescription())
ICSWareHouseService.ReturnDocERP(TransType, Identification, cmd,language);
ICSWareHouseService.ReturnDocERP(TransType, Identification, cmd, language);
}
DataTable table = GetData(Identification, 1, cmd);
cmd.Transaction.Commit();
@ -1339,7 +1339,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OutsourcingIssueDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingIssueDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1353,7 +1353,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OutsourcingReturnBack.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OutsourcingReturnBack(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingReturnBack(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1367,7 +1367,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription())
{
//更新源头单据数量
ICSManufactureService.MOIssueDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.MOIssueDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1381,7 +1381,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription())
{
//更新源头单据数量
ICSSalesService.SalesShipmentDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSSalesService.SalesShipmentDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1395,7 +1395,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription())
{
//更新源头单据数量
ICSWareHouseService.TwoStepTransferDocOut(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.TwoStepTransferDocOut(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1409,7 +1409,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OtherOutDoc.GetDescription())
{
//更新源头单据数量
ICSWareHouseService.OtherOutDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.OtherOutDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1423,7 +1423,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.MOApply.GetDescription())
{
//更新源头单据数量
ICSManufactureService.MOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.MOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1437,7 +1437,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OOApply.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OOApply(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1451,7 +1451,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.MOIssue.GetDescription())
{
//更新源头单据数量
ICSManufactureService.MOIssue(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSManufactureService.MOIssue(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1465,7 +1465,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OOIssue.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OOIssue(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OOIssue(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1493,7 +1493,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription())
{
//更新源头单据数量
ICSOutsourcingService.OutsourcingReceiveDocNegative(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingReceiveDocNegative(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1507,7 +1507,7 @@ namespace ICSSoft.DataProject
else if (TransType == TransTypeEnum.BrrowDoc.GetDescription())
{
//更新源头单据数量
ICSWareHouseService.BrrowDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd,language);
ICSWareHouseService.BrrowDoc(item.TransCode, item.TransSequence, item.Quantity, item.WorkPoint, cmd, language);
foreach (var itemInfo in item.detail)
{
@ -1526,43 +1526,43 @@ namespace ICSSoft.DataProject
ICSPurchaseService.PurchaseReceiveDoctNegativeERP(TransType, Identification, cmd, language);
//委外发料
else if (TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription())
ICSOutsourcingService.OutsourcingIssueDocERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingIssueDocERP(TransType, Identification, cmd, language);
//委外退货
else if (TransType == TransTypeEnum.OutsourcingReturnBack.GetDescription())
ICSOutsourcingService.OutsourcingReturnBackERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingReturnBackERP(TransType, Identification, cmd, language);
//生产发料
else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription())
ICSManufactureService.MOIssueDocERP(TransType, Identification, cmd,language);
ICSManufactureService.MOIssueDocERP(TransType, Identification, cmd, language);
//销售出库
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription())
ICSSalesService.SalesShipmentDocERP(TransType, Identification, cmd,language);
ICSSalesService.SalesShipmentDocERP(TransType, Identification, cmd, language);
//两步调出
else if (TransType == TransTypeEnum.TwoStepTransferDocOut.GetDescription())
ICSWareHouseService.TwoStepTransferDocOutERP(TransType, Identification, cmd,language);
ICSWareHouseService.TwoStepTransferDocOutERP(TransType, Identification, cmd, language);
//其他出库
else if (TransType == TransTypeEnum.OtherOutDoc.GetDescription())
ICSWareHouseService.OtherOutDocERP(TransType, Identification, cmd,language);
ICSWareHouseService.OtherOutDocERP(TransType, Identification, cmd, language);
//领料申请单发料
if (TransType == TransTypeEnum.MOApply.GetDescription())
ICSManufactureService.MOApplyERP(TransType, Identification, cmd,language);
ICSManufactureService.MOApplyERP(TransType, Identification, cmd, language);
//委外领料申请单发料
if (TransType == TransTypeEnum.OOApply.GetDescription())
ICSOutsourcingService.OOApplyERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OOApplyERP(TransType, Identification, cmd, language);
//开立材料出库
if (TransType == TransTypeEnum.MOIssue.GetDescription())
ICSManufactureService.MOIssueERP(TransType, Identification, cmd,language);
ICSManufactureService.MOIssueERP(TransType, Identification, cmd, language);
//开立委外材料出库
if (TransType == TransTypeEnum.OOIssue.GetDescription())
ICSOutsourcingService.OOIssueERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OOIssueERP(TransType, Identification, cmd, language);
//开立红字入库单
if (TransType == TransTypeEnum.PurchaseReceive.GetDescription())
ICSPurchaseService.PurchaseReceiveERP(TransType, Identification, cmd, language);
//开立委外红字入库单
if (TransType == TransTypeEnum.OutsourcingReceiveDocNegative.GetDescription())
ICSOutsourcingService.OutsourcingReceiveDocNegativeERP(TransType, Identification, cmd,language);
ICSOutsourcingService.OutsourcingReceiveDocNegativeERP(TransType, Identification, cmd, language);
//借用
if (TransType == TransTypeEnum.BrrowDoc.GetDescription())
ICSWareHouseService.BrrowDocERP(TransType, Identification, cmd,language);
ICSWareHouseService.BrrowDocERP(TransType, Identification, cmd, language);
}
DataTable table = GetData(Identification, 2, cmd);
@ -1693,7 +1693,7 @@ namespace ICSSoft.DataProject
{
throw new Exception(language.GetNameByCode("WMSAPIInfo011")); //"到货单信息创建失败!");
}
ICSPurchaseService.DeliveryNoticeERP(Code, item.WorkPoint, cmd,language);
ICSPurchaseService.DeliveryNoticeERP(Code, item.WorkPoint, cmd, language);
asncodes += "'" + item.ASNCode + item.WorkPoint + "',";
}
if (string.IsNullOrWhiteSpace(asncodes))
@ -2012,23 +2012,7 @@ namespace ICSSoft.DataProject
}
}
//校验退料数量是否超出领料数量
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSOApplyNegDetail a
INNER JOIN ICSOOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSOApplyNeg c ON a.OApplyNegCode=c.OApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
sql = string.Format(sql, item.id, item.WorkPoint);
sql = CheckOutsourcingIssueDoc(item.Type, item.id, item.WorkPoint, language);
DBHelper.ExecuteNonQuery(sql, cmd);
codes += "'" + Code + item.WorkPoint + "',";
}
@ -2096,6 +2080,74 @@ namespace ICSSoft.DataProject
}
}
private static string CheckOutsourcingIssueDoc(string Type, string ID, string WorkPoint, Dictionary<string, string> language)
{
string sql = string.Empty;
if (Type == "1")
{
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSOApplyNegDetail a
INNER JOIN ICSOOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSOApplyNeg c ON a.OApplyNegCode=c.OApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSOOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else if (Type == "2")
{
sql = @"DECLARE @ApplyDetailID VARCHAR(10)
SELECT @ApplyDetailID=b.ApplyDetailID
FROM ICSOApplyNegDetail a
INNER JOIN ICSOApply b ON a.SourceDetailID=b.ApplyDetailID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSOApplyNeg c ON a.OApplyNegCode=c.OApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.ApplyDetailID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@ApplyDetailID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSOApply WHERE ApplyDetailID=@ApplyDetailID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else if (Type == "3")
{
sql = @"DECLARE @IssueDetailID VARCHAR(10)
SELECT @IssueDetailID=b.IssueDetailID
FROM ICSOApplyNegDetail a
INNER JOIN ICSOIssue b ON a.SourceDetailID=b.IssueDetailID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSOApplyNeg c ON a.OApplyNegCode=c.OApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.IssueDetailID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@IssueDetailID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSOIssue WHERE IssueDetailID=@IssueDetailID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else
{
throw new Exception(language.GetNameByCode("WMSAPIInfo003"));//"类型不符!");
}
sql = string.Format(sql, ID, WorkPoint, Type);
return sql;
}
/// <summary>
/// 委外退料 修改
/// </summary>
@ -2181,23 +2233,7 @@ namespace ICSSoft.DataProject
}
}
//校验退料数量是否超出领料数量
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSOApplyNegDetail a
INNER JOIN ICSOOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSOApplyNeg c ON a.OApplyNegCode=c.OApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
sql = string.Format(sql, item.id, item.WorkPoint);
sql = CheckOutsourcingIssueDoc(item.Type, item.id, item.WorkPoint, language);
DBHelper.ExecuteNonQuery(sql, cmd);
ids += "'" + item.id + "',";
}
@ -2494,7 +2530,7 @@ namespace ICSSoft.DataProject
{
throw new Exception(language.GetNameByCode("WMSAPIInfo011")); //"到货单信息创建失败!");
}
ICSOutsourcingService.OutsourcingDeliveryNoticeERP(Code, item.WorkPoint, cmd,language);
ICSOutsourcingService.OutsourcingDeliveryNoticeERP(Code, item.WorkPoint, cmd, language);
asncodes += "'" + item.OASNCode + item.WorkPoint + "',";
}
if (string.IsNullOrWhiteSpace(asncodes))
@ -2791,7 +2827,7 @@ namespace ICSSoft.DataProject
INSERT INTO ICSMOApplyNeg(ID,ApplyNegCode,WHCode,Status,Type,Memo,CreatePerson,CreateDateTime,MUSER,MUSERName,MTIME,WorkPoint,EATTRIBUTE1)
VALUES (NEWID(),'{0}','{1}','1','{5}','','{2}','{3}','{2}',(select F_RealName from Sys_SRM_User where F_Account='{2}' and F_Location='{4}'),'{3}','{4}','')";
sql = string.Format(sql, Code, item.WHCode, item.User, item.MTime, item.WorkPoint,item.Type);
sql = string.Format(sql, Code, item.WHCode, item.User, item.MTime, item.WorkPoint, item.Type);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
@ -2814,23 +2850,7 @@ namespace ICSSoft.DataProject
}
}
//校验退料数量是否超出领料数量
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSMOApplyNegDetail a
INNER JOIN ICSMOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSMOApplyNeg c ON a.ApplyNegCode=c.ApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
sql = string.Format(sql, item.ID, item.WorkPoint);
sql = CheckMOIssueDoc(item.Type, item.ID, item.WorkPoint, language);
DBHelper.ExecuteNonQuery(sql, cmd);
codes += "'" + Code + item.WorkPoint + "',";
}
@ -2897,7 +2917,73 @@ namespace ICSSoft.DataProject
}
}
}
private static string CheckMOIssueDoc(string Type, string ID, string WorkPoint, Dictionary<string, string> language)
{
string sql = string.Empty;
if (Type == "1")
{
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSMOApplyNegDetail a
INNER JOIN ICSMOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSMOApplyNeg c ON a.ApplyNegCode=c.ApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else if (Type == "2")
{
sql = @"DECLARE @ApplyDetailID VARCHAR(10)
SELECT @ApplyDetailID=b.ApplyDetailID
FROM ICSMOApplyNegDetail a
INNER JOIN ICSMOApply b ON a.SourceDetailID=b.ApplyDetailID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSMOApplyNeg c ON a.ApplyNegCode=c.ApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.ApplyDetailID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@ApplyDetailID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOApply WHERE ApplyDetailID=@ApplyDetailID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else if (Type == "3")
{
sql = @"DECLARE @IssueDetailID VARCHAR(10)
SELECT @IssueDetailID=b.IssueDetailID
FROM ICSMOApplyNegDetail a
INNER JOIN ICSMOIssue b ON a.SourceDetailID=b.IssueDetailID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSMOApplyNeg c ON a.ApplyNegCode=c.ApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND c.Type='{2}' AND a.WorkPoint='{1}'
GROUP BY b.IssueDetailID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@IssueDetailID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOIssue WHERE IssueDetailID=@IssueDetailID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
}
else
{
throw new Exception(language.GetNameByCode("WMSAPIInfo003"));//"类型不符!");
}
sql = string.Format(sql, ID, WorkPoint, Type);
return sql;
}
/// <summary>
/// 生产退料 修改
/// </summary>
@ -2982,23 +3068,7 @@ namespace ICSSoft.DataProject
}
}
//校验退料数量是否超出领料数量
sql = @"DECLARE @PickID VARCHAR(10)
SELECT @PickID=b.PickID
FROM ICSMOApplyNegDetail a
INNER JOIN ICSMOPick b ON a.SourceDetailID=b.PickID AND a.WorkPoint=b.WorkPoint
INNER JOIN ICSMOApplyNeg c ON a.ApplyNegCode=c.ApplyNegCode AND a.WorkPoint=c.WorkPoint
WHERE c.ID='{0}' AND a.WorkPoint='{1}'
GROUP BY b.PickID
HAVING MAX(b.Quantity)<SUM(a.Quantity)
IF (@PickID IS NOT NULL)
BEGIN
DECLARE @InvCode VARCHAR(100)
SELECT @InvCode='" + language.GetNameByCode("WMSAPIInfo064") + @"' FROM ICSMOPick WHERE PickID=@PickID AND WorkPoint='{1}'
RAISERROR(@InvCode,16,1);
RETURN
END ";
sql = string.Format(sql, item.ID, item.WorkPoint);
sql = CheckMOIssueDoc(item.Type, item.ID, item.WorkPoint, language);
DBHelper.ExecuteNonQuery(sql, cmd);
ids += "'" + item.ID + "',";
}
@ -3264,14 +3334,14 @@ namespace ICSSoft.DataProject
DBHelper.ExecuteNonQuery(sql, cmd);
//更新源头单据信息
ICSWareHouseService.OneStepTransferDocIn(item.TransCode, item.TransSequence, item.WorkPoint, itemInfo.CurrentQuantity, cmd,language);
ICSWareHouseService.OneStepTransferDocIn(item.TransCode, item.TransSequence, item.WorkPoint, itemInfo.CurrentQuantity, cmd, language);
//更新条码信息
ICSWareHouseLotInfoService.WareHouseLotInfoTransfer(Identification, item.TransCode, item.TransSequence, itemInfo.WarehouseCode, itemInfo.LocationCode,
itemInfo.LotNo, itemInfo.CurrentQuantity, item.User, item.WorkPoint, "6", "21", cmd, language);
}
}
ICSWareHouseService.OneStepTransferDocInERP(TransTypeEnum.OneStepTransferDocIn.GetDescription(), Identification, cmd,language);
ICSWareHouseService.OneStepTransferDocInERP(TransTypeEnum.OneStepTransferDocIn.GetDescription(), Identification, cmd, language);
DataTable table = GetData(Identification, 3, cmd);
cmd.Transaction.Commit();
@ -3648,7 +3718,7 @@ namespace ICSSoft.DataProject
//2 - 提醒
//3 - 限制
sql = string.Format(sql, LotNo, WorkPoitCode);
if(!string.IsNullOrWhiteSpace(ScanLotCode))
if (!string.IsNullOrWhiteSpace(ScanLotCode))
{
sql = sql.Replace("1=1", "a.LotNO NOT IN (" + ScanLotCode + ")");
}

Loading…
Cancel
Save