|
@@ -14,6 +14,7 @@ using Business.StructuredDB.MES.IC;
|
|
|
using Business.StructuredDB.Replenishment;
|
|
using Business.StructuredDB.Replenishment;
|
|
|
using Business.StructuredDB.SaleFcst;
|
|
using Business.StructuredDB.SaleFcst;
|
|
|
using Business.StructuredDB.WMS;
|
|
using Business.StructuredDB.WMS;
|
|
|
|
|
+using Business.SystemJobManagement;
|
|
|
using EFCore.BulkExtensions;
|
|
using EFCore.BulkExtensions;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
using MongoDB.Driver;
|
|
using MongoDB.Driver;
|
|
@@ -390,6 +391,8 @@ namespace Business.ResourceExamineManagement
|
|
|
public List<HolidayMaster> holidays = new List<HolidayMaster>();
|
|
public List<HolidayMaster> holidays = new List<HolidayMaster>();
|
|
|
public IDataFilter dataFilter { get; set; }
|
|
public IDataFilter dataFilter { get; set; }
|
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
|
|
|
+
|
|
|
|
|
+ private readonly SystemJobAppService _systemJobAppService;
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
|
#region 构造函数
|
|
#region 构造函数
|
|
@@ -502,7 +505,8 @@ namespace Business.ResourceExamineManagement
|
|
|
HolidayHelper holidayHelper,
|
|
HolidayHelper holidayHelper,
|
|
|
ReplenishmentAppService replenishmentAppService,
|
|
ReplenishmentAppService replenishmentAppService,
|
|
|
IRepository<ReplenishmentWeekPlan, long> replenishmentWeekPlan,
|
|
IRepository<ReplenishmentWeekPlan, long> replenishmentWeekPlan,
|
|
|
- ISqlRepository<InvMaster> invMaster
|
|
|
|
|
|
|
+ ISqlRepository<InvMaster> invMaster,
|
|
|
|
|
+ SystemJobAppService systemJobAppService
|
|
|
)
|
|
)
|
|
|
{
|
|
{
|
|
|
_mes_technique = mes_technique;
|
|
_mes_technique = mes_technique;
|
|
@@ -600,6 +604,7 @@ namespace Business.ResourceExamineManagement
|
|
|
_replenishmentAppService = replenishmentAppService;
|
|
_replenishmentAppService = replenishmentAppService;
|
|
|
_replenishmentWeekPlan = replenishmentWeekPlan;
|
|
_replenishmentWeekPlan = replenishmentWeekPlan;
|
|
|
_invMaster = invMaster;
|
|
_invMaster = invMaster;
|
|
|
|
|
+ _systemJobAppService = systemJobAppService;
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
|
@@ -722,7 +727,7 @@ namespace Business.ResourceExamineManagement
|
|
|
AutoCreateBomBill(param.company_id.ToString(), autoCreates);
|
|
AutoCreateBomBill(param.company_id.ToString(), autoCreates);
|
|
|
pretreatments = _mysql_b_bom_pretreatment.GetListAsync(s => boms.Select(c => c.mysql_id).ToList().Contains(s.sourceid)).Result;
|
|
pretreatments = _mysql_b_bom_pretreatment.GetListAsync(s => boms.Select(c => c.mysql_id).ToList().Contains(s.sourceid)).Result;
|
|
|
}
|
|
}
|
|
|
- AsyncItemStockFromWMS(pretreatments);
|
|
|
|
|
|
|
+ await AsyncItemStockFromWMS(pretreatments);
|
|
|
|
|
|
|
|
//数据库快照-同步mysql库数据到mongoDB中
|
|
//数据库快照-同步mysql库数据到mongoDB中
|
|
|
await DbSnapShot(input.company_id, input.factoryId, bangid, pretreatments);
|
|
await DbSnapShot(input.company_id, input.factoryId, bangid, pretreatments);
|
|
@@ -3681,7 +3686,7 @@ namespace Business.ResourceExamineManagement
|
|
|
AutoCreateBomBill(param.company_id.ToString(), autoCreates);
|
|
AutoCreateBomBill(param.company_id.ToString(), autoCreates);
|
|
|
pretreatments = _mysql_b_bom_pretreatment.GetListAsync(s => boms.Select(c => c.mysql_id).ToList().Contains(s.sourceid)).Result;
|
|
pretreatments = _mysql_b_bom_pretreatment.GetListAsync(s => boms.Select(c => c.mysql_id).ToList().Contains(s.sourceid)).Result;
|
|
|
}
|
|
}
|
|
|
- AsyncItemStockFromWMS(pretreatments);
|
|
|
|
|
|
|
+ await AsyncItemStockFromWMS(pretreatments);
|
|
|
|
|
|
|
|
//增加特殊工单的预处理结果,因为特殊工单是自定义物料清单
|
|
//增加特殊工单的预处理结果,因为特殊工单是自定义物料清单
|
|
|
List<string> tsWork = new List<string> { "试制工单", "返工工单" };
|
|
List<string> tsWork = new List<string> { "试制工单", "返工工单" };
|
|
@@ -4453,8 +4458,10 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void AsyncItemStockFromWMS(List<b_bom_pretreatment> bom_Pretreatments)
|
|
|
|
|
|
|
+ public async Task AsyncItemStockFromWMS(List<b_bom_pretreatment> bom_Pretreatments)
|
|
|
{
|
|
{
|
|
|
|
|
+ //释放库存占用记录
|
|
|
|
|
+ await _systemJobAppService.SyncItemStockOccupyClear();
|
|
|
//产品编码
|
|
//产品编码
|
|
|
var itemList = bom_Pretreatments.Select(a => a.item_number).Distinct().ToList();
|
|
var itemList = bom_Pretreatments.Select(a => a.item_number).Distinct().ToList();
|
|
|
List<string> itemChildList = new List<string>();
|
|
List<string> itemChildList = new List<string>();
|