来源erp的工单才调生产报告接口

This commit is contained in:
2024-09-02 09:03:07 +08:00
parent 9f33a4ec15
commit 7e778243b7

View File

@@ -1667,7 +1667,15 @@ namespace Tnb.ProductionMgr
if (qcCheckPlanAdds.Count == 1) if (qcCheckPlanAdds.Count == 1)
{ {
int hour = int.Parse(qcCheckPlanAdds[0].content.Split(" ")[2].Split("/")[1]); int hour = int.Parse(qcCheckPlanAdds[0].content.Split(" ")[2].Split("/")[1]);
int minute = int.Parse(qcCheckPlanAdds[0].content.Split(" ")[1].Split("/")[1]);
if (hour > 0)
{
TimerPoolHelper.GetInstance().StartTimer(TimeCallback2,prdTaskList.Where(p => p.mo_task_status == "Pause" || p.mo_task_status == "ToBeStarted").ToList(),TimeSpan.FromHours(hour),Timeout.InfiniteTimeSpan,false); TimerPoolHelper.GetInstance().StartTimer(TimeCallback2,prdTaskList.Where(p => p.mo_task_status == "Pause" || p.mo_task_status == "ToBeStarted").ToList(),TimeSpan.FromHours(hour),Timeout.InfiniteTimeSpan,false);
}else if (minute > 0)
{
TimerPoolHelper.GetInstance().StartTimer(TimeCallback2,prdTaskList.Where(p => p.mo_task_status == "Pause" || p.mo_task_status == "ToBeStarted").ToList(),TimeSpan.FromMinutes(minute),Timeout.InfiniteTimeSpan,false);
}
} }
} }
@@ -2452,6 +2460,9 @@ namespace Tnb.ProductionMgr
{ {
throw Oops.Bah(result2.msg !=null ? result2.msg : "生产入库接口报错"); throw Oops.Bah(result2.msg !=null ? result2.msg : "生产入库接口报错");
} }
//来源erp需要调接口
if (prdMo.data_sources == "1")
{
List<DictionaryDataEntity> unitDatas = await db.Queryable<DictionaryTypeEntity>() List<DictionaryDataEntity> unitDatas = await db.Queryable<DictionaryTypeEntity>()
.LeftJoin<DictionaryDataEntity>((x, y) => x.Id == y.DictionaryTypeId) .LeftJoin<DictionaryDataEntity>((x, y) => x.Id == y.DictionaryTypeId)
.Where((x, y) => x.EnCode == DictConst.MeasurementUnit && y.EnCode==report.unit_id) .Where((x, y) => x.EnCode == DictConst.MeasurementUnit && y.EnCode==report.unit_id)
@@ -2531,6 +2542,9 @@ namespace Tnb.ProductionMgr
thirdWebapiRecord.create_time = DateTime.Now; thirdWebapiRecord.create_time = DateTime.Now;
await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync(); await _db.Insertable(thirdWebapiRecord).ExecuteCommandAsync();
}
if (prdMoTask.schedule_type == 2) if (prdMoTask.schedule_type == 2)
{ {