|
|
@@ -365,7 +365,7 @@ namespace Business.ResourceExamineManagement
|
|
|
List<crm_seorderentry> sentrys = await _mysql_crm_seorderentry.GetListAsync(p => p.tenant_id == input.tenantId && p.factory_id == input.factoryId && p.seorder_id == input.sorderId && !p.IsDeleted);
|
|
|
|
|
|
//数据库快照-同步mysql库数据到mongoDB中
|
|
|
- //await DbSnapShot(input.tenantId, input.factoryId, bangid);
|
|
|
+ await DbSnapShot(input.tenantId, input.factoryId, bangid);
|
|
|
|
|
|
//通过订单行的产品代码获取物料BOM数据
|
|
|
//FilterDefinition<ic_bom> filter = Builders<ic_bom>.Filter.In(s => s.bom_number, sentrys.Select(m => m.bom_number).ToList());
|
|
|
@@ -400,7 +400,7 @@ namespace Business.ResourceExamineManagement
|
|
|
List<mo_ic_item> icitemlist = _ic_item.GetManyByCondition(p => itemIds.Contains(p.mysql_id) && !p.IsDeleted).Result;
|
|
|
|
|
|
//物料库存
|
|
|
- var stocklist = _ic_item_stock.GetManyByCondition(p => p.factory_id == param.factoryId && itemIds.Contains(p.icitem_id)).Result;
|
|
|
+ var stocklist = _ic_item_stock.GetManyByCondition(p => p.factory_id == param.factoryId && p.bang_id == bangid && itemIds.Contains(p.icitem_id)).Result;
|
|
|
|
|
|
//物料提前期
|
|
|
leadTimeList = GetLeadTime(itemIds, input.tenantId, input.factoryId);//提前期列表
|
|
|
@@ -507,6 +507,7 @@ namespace Business.ResourceExamineManagement
|
|
|
//设置当前计算bangid
|
|
|
icitemStokc.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moIcitemStokc = ObjectMapper.Map<List<ic_item_stock>, List<mo_ic_item_stock>>(icitemStokc);
|
|
|
+ moIcitemStokc.ForEach(item => { item.id = help.NextId(); });
|
|
|
//插入数据
|
|
|
await _ic_item_stock.InsertMany(moIcitemStokc);
|
|
|
}
|
|
|
@@ -516,6 +517,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
mes_mooccupy.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moMes_mooccupy = ObjectMapper.Map<List<mes_mooccupy>, List<mo_mes_mooccupy>>(mes_mooccupy);
|
|
|
+ moMes_mooccupy.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _mes_mooccupy.InsertMany(moMes_mooccupy);
|
|
|
}
|
|
|
//工单主表
|
|
|
@@ -524,6 +526,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
mes_morder.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moMes_morder = ObjectMapper.Map<List<mes_morder>, List<mo_mes_morder>>(mes_morder);
|
|
|
+ moMes_morder.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _mes_morder.InsertMany(moMes_morder);
|
|
|
}
|
|
|
//工单子表
|
|
|
@@ -532,6 +535,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
mes_moentry.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moMes_moentry = ObjectMapper.Map<List<mes_moentry>, List<mo_mes_moentry>>(mes_moentry);
|
|
|
+ moMes_moentry.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _mes_moentry.InsertMany(moMes_moentry);
|
|
|
}
|
|
|
|
|
|
@@ -542,6 +546,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
srm_po_main.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moSrm_po_main = ObjectMapper.Map<List<srm_po_main>, List<mo_srm_po_main>>(srm_po_main);
|
|
|
+ moSrm_po_main.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _srm_po_main.InsertMany(moSrm_po_main);
|
|
|
}
|
|
|
|
|
|
@@ -551,6 +556,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
srm_po_list.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moSrm_po_list = ObjectMapper.Map<List<srm_po_list>, List<mo_srm_po_list>>(srm_po_list);
|
|
|
+ moSrm_po_list.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _srm_po_list.InsertMany(moSrm_po_list);
|
|
|
}
|
|
|
|
|
|
@@ -560,6 +566,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
srm_po_occupy.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moSrm_po_occupy = ObjectMapper.Map<List<srm_po_occupy>, List<mo_srm_po_occupy>>(srm_po_occupy);
|
|
|
+ moSrm_po_occupy.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _srm_po_occupy.InsertMany(moSrm_po_occupy);
|
|
|
}
|
|
|
|
|
|
@@ -569,6 +576,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
ic_factory_details.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moIc_factory_details = ObjectMapper.Map<List<ic_factory_details>, List<mo_ic_factory_details>>(ic_factory_details);
|
|
|
+ moIc_factory_details.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _ic_factory_details.InsertMany(moIc_factory_details);
|
|
|
}
|
|
|
|
|
|
@@ -578,6 +586,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
ic_plan.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moIc_plan = ObjectMapper.Map<List<ic_plan>, List<mo_ic_plan>>(ic_plan);
|
|
|
+ moIc_plan.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _ic_plan.InsertMany(moIc_plan);
|
|
|
}
|
|
|
|
|
|
@@ -587,6 +596,7 @@ namespace Business.ResourceExamineManagement
|
|
|
{
|
|
|
ic_item_pur.ForEach(item => { item.bang_id = bangid; });
|
|
|
var moIc_item_pur = ObjectMapper.Map<List<ic_item_pur>, List<mo_ic_item_pur>>(ic_item_pur);
|
|
|
+ moIc_item_pur.ForEach(item => { item.id = help.NextId(); });
|
|
|
await _ic_item_pur.InsertMany(moIc_item_pur);
|
|
|
}
|
|
|
}
|