😎更改数量取值方式
This commit is contained in:
parent
f707e57880
commit
278f8064a6
@ -59,7 +59,7 @@ public class SyncProductManagementBomToSap : IJob
|
|||||||
y.ChildObjID,
|
y.ChildObjID,
|
||||||
y.childVersion,
|
y.childVersion,
|
||||||
y.ConfigId,
|
y.ConfigId,
|
||||||
y.Quantity,
|
y.QtyManual,
|
||||||
y.PartNumber,
|
y.PartNumber,
|
||||||
y.fld004936,
|
y.fld004936,
|
||||||
y.fld004937,
|
y.fld004937,
|
||||||
@ -92,7 +92,7 @@ public class SyncProductManagementBomToSap : IJob
|
|||||||
ConfigId = g.ConfigId,
|
ConfigId = g.ConfigId,
|
||||||
childVersion = g.childVersion,
|
childVersion = g.childVersion,
|
||||||
ParentVersion = g.VersionIndex,
|
ParentVersion = g.VersionIndex,
|
||||||
Quantity = g.Quantity,
|
QtyManual = g.QtyManual,
|
||||||
SORTF = g.fld004936,
|
SORTF = g.fld004936,
|
||||||
ITISOB = g.fld004937,
|
ITISOB = g.fld004937,
|
||||||
ALPGR = g.fld004938,
|
ALPGR = g.fld004938,
|
||||||
@ -152,5 +152,21 @@ public class SyncProductManagementBomToSap : IJob
|
|||||||
ReturnResult = output,
|
ReturnResult = output,
|
||||||
Elapsed = elapsedMilliseconds.ToLong()
|
Elapsed = elapsedMilliseconds.ToLong()
|
||||||
}).ExecuteCommand();
|
}).ExecuteCommand();
|
||||||
|
|
||||||
|
string FailureMessage = "<p>以下编码在" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss") + "同步失败,请到Manage系统中,查看详细信息。</p>";
|
||||||
|
|
||||||
|
var sapOutputsFailur = sapOutputs.Where(x => x.code != "成功").ToList();
|
||||||
|
|
||||||
|
for (int i = 0; i < sapOutputsFailur.Count; i++)
|
||||||
|
{
|
||||||
|
if (sapOutputsFailur[i].code != "成功")
|
||||||
|
{
|
||||||
|
FailureMessage = FailureMessage + sapOutputsFailur[i].materialCode + " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sapOutputsFailur.Count > 0)
|
||||||
|
{
|
||||||
|
await _scopeFactory.CreateScope().ServiceProvider.GetRequiredService<SysEmailService>().SapSyncFailureSendEmail(FailureMessage, "启威星PLM平台-产品管理同步bom到SAP");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = "",//组件序号 sun.ToString()
|
POSNR = "",//组件序号 sun.ToString()
|
||||||
IDNRK = input[i].PartNumber,//组件物料号
|
IDNRK = input[i].PartNumber,//组件物料号
|
||||||
MENGE = input[i].Quantity.ToString(),//组件数量
|
MENGE = input[i].QtyManual.ToString(),//组件数量
|
||||||
SORTF = input[i].fld004936,
|
SORTF = input[i].fld004936,
|
||||||
ITISOB = input[i].fld004937,
|
ITISOB = input[i].fld004937,
|
||||||
ALPGR = input[i].fld004938,
|
ALPGR = input[i].fld004938,
|
||||||
@ -331,7 +331,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = "",//组件序号 sun.ToString()
|
POSNR = "",//组件序号 sun.ToString()
|
||||||
IDNRK = BomData[i].PartNumber,//组件物料号
|
IDNRK = BomData[i].PartNumber,//组件物料号
|
||||||
MENGE = BomData[i].Quantity.ToString(),//组件数量
|
MENGE = BomData[i].QtyManual.ToString(),//组件数量
|
||||||
SORTF = BomData[i].fld004936,
|
SORTF = BomData[i].fld004936,
|
||||||
ITISOB = BomData[i].fld004937,
|
ITISOB = BomData[i].fld004937,
|
||||||
ALPGR = BomData[i].fld004938,
|
ALPGR = BomData[i].fld004938,
|
||||||
@ -713,7 +713,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = (bomData.IndexOf(bomItem) + 1).ToString(),
|
POSNR = (bomData.IndexOf(bomItem) + 1).ToString(),
|
||||||
IDNRK = bomItem.PartNumber,
|
IDNRK = bomItem.PartNumber,
|
||||||
MENGE = bomItem.Quantity.ToString(),
|
MENGE = bomItem.QtyManual.ToString(),
|
||||||
SORTF = bomItem.fld004936,
|
SORTF = bomItem.fld004936,
|
||||||
ITISOB = bomItem.fld004937,
|
ITISOB = bomItem.fld004937,
|
||||||
ALPGR = bomItem.fld004938,
|
ALPGR = bomItem.fld004938,
|
||||||
@ -749,7 +749,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = "",//组件序号 sun.ToString()
|
POSNR = "",//组件序号 sun.ToString()
|
||||||
IDNRK = BomDataold[i].PartNumber,//组件物料号
|
IDNRK = BomDataold[i].PartNumber,//组件物料号
|
||||||
MENGE = BomDataold[i].Quantity.ToString(),//组件数量
|
MENGE = BomDataold[i].QtyManual.ToString(),//组件数量
|
||||||
SORTF = BomDataold[i].fld004936,
|
SORTF = BomDataold[i].fld004936,
|
||||||
ITISOB = BomDataold[i].fld004937,
|
ITISOB = BomDataold[i].fld004937,
|
||||||
ALPGR = BomDataold[i].fld004938,
|
ALPGR = BomDataold[i].fld004938,
|
||||||
@ -884,7 +884,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = (data.Bom.IndexOf(item) + 1).ToString(),
|
POSNR = (data.Bom.IndexOf(item) + 1).ToString(),
|
||||||
IDNRK = item.PartNumber,
|
IDNRK = item.PartNumber,
|
||||||
MENGE = item.Quantity.ToString(),
|
MENGE = item.QtyManual.ToString(),
|
||||||
SORTF = item.SORTF,
|
SORTF = item.SORTF,
|
||||||
ITISOB = item.ITISOB,
|
ITISOB = item.ITISOB,
|
||||||
ALPGR = item.ALPGR,
|
ALPGR = item.ALPGR,
|
||||||
@ -958,7 +958,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = "",//组件序号 sun.ToString()
|
POSNR = "",//组件序号 sun.ToString()
|
||||||
IDNRK = item.PartNumber,//组件物料号
|
IDNRK = item.PartNumber,//组件物料号
|
||||||
MENGE = item.Quantity.ToString(),//组件数量
|
MENGE = item.QtyManual.ToString(),//组件数量
|
||||||
SORTF = item.fld004936,
|
SORTF = item.fld004936,
|
||||||
ITISOB = item.fld004937,
|
ITISOB = item.fld004937,
|
||||||
ALPGR = item.fld004938,
|
ALPGR = item.fld004938,
|
||||||
@ -1382,6 +1382,7 @@ public class ProductManagementService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
var output = new SapOutput()
|
var output = new SapOutput()
|
||||||
{
|
{
|
||||||
|
materialCode = data._System_objNBS,
|
||||||
parameter = apiOutput.parameter,
|
parameter = apiOutput.parameter,
|
||||||
code = codeVal,
|
code = codeVal,
|
||||||
msg = msg,
|
msg = msg,
|
||||||
|
@ -366,7 +366,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = sun.ToString(),//组件序号
|
POSNR = sun.ToString(),//组件序号
|
||||||
IDNRK = input[i].PartNumber,//组件物料号
|
IDNRK = input[i].PartNumber,//组件物料号
|
||||||
MENGE = input[i].Quantity.ToString(),//组件数量
|
MENGE = input[i].QtyManual.ToString(),//组件数量
|
||||||
SORTF = input[i].fld004936,
|
SORTF = input[i].fld004936,
|
||||||
ITISOB = input[i].fld004937,
|
ITISOB = input[i].fld004937,
|
||||||
ALPGR = input[i].fld004938,
|
ALPGR = input[i].fld004938,
|
||||||
@ -599,7 +599,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
{
|
{
|
||||||
POSNR = (bomData.IndexOf(bomItem) + 1).ToString(),
|
POSNR = (bomData.IndexOf(bomItem) + 1).ToString(),
|
||||||
IDNRK = bomItem.PartNumber,
|
IDNRK = bomItem.PartNumber,
|
||||||
MENGE = bomItem.Quantity.ToString(),
|
MENGE = bomItem.QtyManual.ToString(),
|
||||||
SORTF = bomItem.fld004936,
|
SORTF = bomItem.fld004936,
|
||||||
ITISOB = bomItem.fld004937,
|
ITISOB = bomItem.fld004937,
|
||||||
ALPGR = bomItem.fld004938,
|
ALPGR = bomItem.fld004938,
|
||||||
@ -900,6 +900,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
}
|
}
|
||||||
var output = new SapOutput()
|
var output = new SapOutput()
|
||||||
{
|
{
|
||||||
|
materialCode = item._System_objNBS,
|
||||||
parameter = apiOutput.parameter,
|
parameter = apiOutput.parameter,
|
||||||
code = codeVal,
|
code = codeVal,
|
||||||
msg = msg,
|
msg = msg,
|
||||||
@ -1160,7 +1161,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
};
|
};
|
||||||
|
|
||||||
var output = await _sapService.SapCreateWBS(sapInput);
|
var output = await _sapService.SapCreateWBS(sapInput);
|
||||||
|
output.materialCode = hierarchicalCoding1;
|
||||||
if (output.code == "S")
|
if (output.code == "S")
|
||||||
{
|
{
|
||||||
//await _obj126Rep.AsUpdateable()
|
//await _obj126Rep.AsUpdateable()
|
||||||
@ -1328,10 +1329,12 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
string hierarchicalCoding4 = "";
|
string hierarchicalCoding4 = "";
|
||||||
int i = 0;
|
int i = 0;
|
||||||
long projectIdRecord = 0;
|
long projectIdRecord = 0;
|
||||||
|
string materialCode = "";
|
||||||
var sortList = list.OrderBy(x => x.OrderIndex).ToList();
|
var sortList = list.OrderBy(x => x.OrderIndex).ToList();
|
||||||
foreach (var item in sortList)
|
foreach (var item in sortList)
|
||||||
{
|
{
|
||||||
projectIdRecord = item.projectIdRecord;
|
projectIdRecord = item.projectIdRecord;
|
||||||
|
materialCode = item.System_objNBS109;
|
||||||
//if (string.IsNullOrEmpty(item.fld006745))
|
//if (string.IsNullOrEmpty(item.fld006745))
|
||||||
//{
|
//{
|
||||||
// var errParam = new SapOutput()
|
// var errParam = new SapOutput()
|
||||||
@ -1691,6 +1694,7 @@ public class ProjectManagementService : IDynamicApiController, ITransient
|
|||||||
SapUpdateWBSItem = sapUpdateInputItem
|
SapUpdateWBSItem = sapUpdateInputItem
|
||||||
};
|
};
|
||||||
var output = await _sapService.SapUpdateWBS(sapInput);
|
var output = await _sapService.SapUpdateWBS(sapInput);
|
||||||
|
output.materialCode = materialCode;
|
||||||
sapOutput.Add(output);
|
sapOutput.Add(output);
|
||||||
if (output.code == "S")
|
if (output.code == "S")
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user