|
@@ -348,7 +348,7 @@ namespace Business.ResourceExamineManagement
|
|
|
/// 数据库快照
|
|
/// 数据库快照
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
|
- public async Task SyncData(long factoryId,long bangid)
|
|
|
|
|
|
|
+ public async Task SyncData(long factoryId, long bangid)
|
|
|
{
|
|
{
|
|
|
//同步物料库存数据
|
|
//同步物料库存数据
|
|
|
var icitemStokc = _mysql_ic_item_stock.GetListAsync(p => p.factory_id == factoryId).Result;
|
|
var icitemStokc = _mysql_ic_item_stock.GetListAsync(p => p.factory_id == factoryId).Result;
|
|
@@ -363,24 +363,28 @@ namespace Business.ResourceExamineManagement
|
|
|
var icBom = _mysql_ic_bom.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
var icBom = _mysql_ic_bom.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
|
if (icBom.Count > 0)
|
|
if (icBom.Count > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ icBom.ForEach(item => { item.bang_id = bangid; });
|
|
|
await _ic_bom.InsertMany(icBom);
|
|
await _ic_bom.InsertMany(icBom);
|
|
|
}
|
|
}
|
|
|
//在制工单占用记录表
|
|
//在制工单占用记录表
|
|
|
var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
|
if (mes_mooccupy.Count > 0)
|
|
if (mes_mooccupy.Count > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ mes_mooccupy.ForEach(item => { item.bang_id = bangid; });
|
|
|
await _mes_mooccupy.InsertMany(mes_mooccupy);
|
|
await _mes_mooccupy.InsertMany(mes_mooccupy);
|
|
|
}
|
|
}
|
|
|
//工单主表
|
|
//工单主表
|
|
|
var mes_morder = _mysql_mes_morder.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
var mes_morder = _mysql_mes_morder.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
|
if (mes_morder.Count > 0)
|
|
if (mes_morder.Count > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ mes_morder.ForEach(item => { item.bang_id = bangid; });
|
|
|
await _mes_morder.InsertMany(mes_morder);
|
|
await _mes_morder.InsertMany(mes_morder);
|
|
|
}
|
|
}
|
|
|
//工单子表
|
|
//工单子表
|
|
|
var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.factory_id == factoryId).Result;
|
|
|
if (mes_moentry.Count > 0)
|
|
if (mes_moentry.Count > 0)
|
|
|
{
|
|
{
|
|
|
|
|
+ mes_moentry.ForEach(item => { item.bang_id = bangid; });
|
|
|
await _mes_moentry.InsertMany(mes_moentry);
|
|
await _mes_moentry.InsertMany(mes_moentry);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -479,7 +483,7 @@ namespace Business.ResourceExamineManagement
|
|
|
if (curProcess != null)
|
|
if (curProcess != null)
|
|
|
{
|
|
{
|
|
|
sortProcesses.AddFirst(curProcess);
|
|
sortProcesses.AddFirst(curProcess);
|
|
|
- SortProcess(Processes, curProcess.Id,sortProcesses);
|
|
|
|
|
|
|
+ SortProcess(Processes, curProcess.Id, sortProcesses);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|