|
|
@@ -412,14 +412,21 @@ namespace Business.ResourceExamineManagement
|
|
|
//数据库快照-同步mysql库数据到mongoDB中
|
|
|
await SyncData(input.tenantId, input.factoryId, bangid);
|
|
|
|
|
|
- List<entryDtl> entryDtls = new List<entryDtl>();
|
|
|
-
|
|
|
+ //资源检查结果list
|
|
|
+ List<ExamineResult> examines = new List<ExamineResult>();
|
|
|
+ ExamineResult dtl;
|
|
|
#region
|
|
|
var bomlist = _ic_bom.GetAll().Result;
|
|
|
var bomchildlist = _ic_bom_child.GetAll().Result;
|
|
|
var icitemlist = _ic_item.GetAll().Result;
|
|
|
foreach (var o in sentrys)
|
|
|
{
|
|
|
+ //工单资源检查信息
|
|
|
+ dtl = new ExamineResult();
|
|
|
+ dtl.sentry_id = o.Id;
|
|
|
+ //TODO:最早开始时间默认3天后(后期调整)
|
|
|
+ dtl.earliest_times = DateTime.Now.Date.AddDays(3);
|
|
|
+
|
|
|
//bom层级组装
|
|
|
var getBomList = BomPretreatment(o.Id, 160162, o.qty.GetInt(), bomlist, bomchildlist, icitemlist);
|
|
|
//bom替代关系组装
|
|
|
@@ -428,10 +435,19 @@ namespace Business.ResourceExamineManagement
|
|
|
BomStock(getBomList, bangid, input.factoryId);
|
|
|
//
|
|
|
calcTest(getBomList, bangid, o.Id, o.qty.Value);
|
|
|
+
|
|
|
+ //最晚开工时间
|
|
|
+ dtl.latest_times = o.plan_date.GetValueOrDefault();
|
|
|
+ //物料齐套时间
|
|
|
+ dtl.kitting_times = getBomList.Where(p => p.is_use).OrderByDescending(m => m.kitting_time).First().kitting_time.GetValueOrDefault();
|
|
|
+ //替代关系展开list
|
|
|
+ dtl.substitutes = getBomList;
|
|
|
+ //添加订单行开工信息
|
|
|
+ examines.Add(dtl);
|
|
|
}
|
|
|
#endregion
|
|
|
- rtn.entryDtls = entryDtls;
|
|
|
- rtn.substitutes = null;
|
|
|
+ //订单行资源检查明细list
|
|
|
+ rtn.examines = examines;
|
|
|
|
|
|
|
|
|
//数据准备
|