|
|
@@ -1698,7 +1698,7 @@ namespace Business.ResourceExamineManagement
|
|
|
/// 数据库快照
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public async Task DbSnapShot(long tenantId, long factoryId, long bangid,List<b_bom_pretreatment> pretreatments)
|
|
|
+ public async Task DbSnapShot(long? companyId, long factoryId, long bangid,List<b_bom_pretreatment> pretreatments)
|
|
|
{
|
|
|
//TODO:申老师明确后续需要调整 根据需要使用的字段,来同步表数据。
|
|
|
|
|
|
@@ -1724,7 +1724,7 @@ namespace Business.ResourceExamineManagement
|
|
|
await _ic_item_stock.InsertManyAsync(moIcitemStokc);
|
|
|
}
|
|
|
//在制工单占用记录表
|
|
|
- var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var mes_mooccupy = _mysql_mes_mooccupy.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (mes_mooccupy.Count > 0)
|
|
|
{
|
|
|
mes_mooccupy.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1733,7 +1733,7 @@ namespace Business.ResourceExamineManagement
|
|
|
await _mes_mooccupy.InsertManyAsync(moMes_mooccupy);
|
|
|
}
|
|
|
//工单主表
|
|
|
- var mes_morder = _mysql_mes_morder.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var mes_morder = _mysql_mes_morder.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (mes_morder.Count > 0)
|
|
|
{
|
|
|
mes_morder.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1742,7 +1742,7 @@ namespace Business.ResourceExamineManagement
|
|
|
await _mes_morder.InsertManyAsync(moMes_morder);
|
|
|
}
|
|
|
//工单子表
|
|
|
- var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var mes_moentry = _mysql_mes_moentry.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (mes_moentry.Count > 0)
|
|
|
{
|
|
|
mes_moentry.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1753,7 +1753,7 @@ namespace Business.ResourceExamineManagement
|
|
|
|
|
|
//TODO:要不要根据某些条件只同步有效的数据
|
|
|
//采购订单
|
|
|
- var srm_po_main = _mysql_srm_po_main.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var srm_po_main = _mysql_srm_po_main.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (srm_po_main.Count > 0)
|
|
|
{
|
|
|
srm_po_main.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1763,7 +1763,7 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
|
|
|
//采购订单明细
|
|
|
- var srm_po_list = _mysql_srm_po_list.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var srm_po_list = _mysql_srm_po_list.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (srm_po_list.Count > 0)
|
|
|
{
|
|
|
srm_po_list.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1773,7 +1773,7 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
|
|
|
//采购订单占用详情
|
|
|
- var srm_po_occupy = _mysql_srm_po_occupy.GetListAsync(x => x.company_id == tenantId && x.factory_id == factoryId).Result;
|
|
|
+ var srm_po_occupy = _mysql_srm_po_occupy.GetListAsync(x => x.company_id == companyId && x.factory_id == factoryId).Result;
|
|
|
if (srm_po_occupy.Count > 0)
|
|
|
{
|
|
|
srm_po_occupy.ForEach(item => { item.bang_id = bangid; });
|
|
|
@@ -1818,9 +1818,9 @@ namespace Business.ResourceExamineManagement
|
|
|
/// <param name="tenantId">企业id</param>
|
|
|
/// <param name="factoryid">工厂id</param>
|
|
|
/// <returns></returns>
|
|
|
- private List<ICItemLeadTimeDto> GetLeadTime(List<mo_ic_item> icItemIds, long tenantId, long factoryid)
|
|
|
+ private List<ICItemLeadTimeDto> GetLeadTime(List<mo_ic_item> icItemIds, long? companyId, long factoryid)
|
|
|
{
|
|
|
- return icItemIds.Where(p => p.factory_id == factoryid && p.company_id == tenantId && !p.IsDeleted).
|
|
|
+ return icItemIds.Where(p => p.factory_id == factoryid && p.company_id == companyId && !p.IsDeleted).
|
|
|
Select(x => new ICItemLeadTimeDto
|
|
|
{
|
|
|
item_id = x.mysql_id,
|
|
|
@@ -1836,9 +1836,9 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
|
|
|
//根据物料id获取物料供应商
|
|
|
- private List<mo_srm_purchase> GetSupplier(List<long> icItemIds, long tenantId, long factoryid)
|
|
|
+ private List<mo_srm_purchase> GetSupplier(List<long> icItemIds, long? companyId, long factoryid)
|
|
|
{
|
|
|
- return _srm_purchase.GetListAsync(p => icItemIds.Contains(p.icitem_id) && p.company_id == tenantId && p.factory_id == factoryid && !p.IsDeleted).Result;
|
|
|
+ return _srm_purchase.GetListAsync(p => icItemIds.Contains(p.icitem_id) && p.company_id == companyId && p.factory_id == factoryid && !p.IsDeleted).Result;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|