Browse Source

更新手动任务

master
zxy 3 weeks ago
parent
commit
389b9e1898
  1. 55
      API/Wood.Service/Controllers/TaskConifgureController.cs
  2. 1
      API/Wood.Service/Datas/SupplierEmployeeDtService.cs
  3. 2
      API/Wood.Service/Datas/SupplierInfoDtService.cs
  4. 2
      API/Wood.Service/Datas/SupplierProProcessEquipmentDtService.cs

55
API/Wood.Service/Controllers/TaskConifgureController.cs

@ -121,123 +121,123 @@ namespace TaskManager.Controllers
_context.TaskSub.Add(task);
_context.SaveChanges();
await Task.Delay(TimeSpan.FromSeconds(2));
var hangfireid = string.Empty;
switch (taskName)
{
case "来料检验数据":
BackgroundJob.Schedule<SupplierProMaterialStockService>(
hangfireid = BackgroundJob.Schedule<SupplierProMaterialStockService>(
//"materialstock",
x => x.CustomInvokeAsync(taskName, client,taskId ),
TimeSpan.FromSeconds(1)
);
break;
case "排产数据":
BackgroundJob.Schedule<CherySupplierProSchedulingService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProSchedulingService>(
//"scheduling",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "供应商基础信息":
BackgroundJob.Schedule<CherySupplierInfoService>(
hangfireid = BackgroundJob.Schedule<CherySupplierInfoService>(
//"info",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "人员资质信息":
BackgroundJob.Schedule<CherySupplierEmployeeService>(
hangfireid = BackgroundJob.Schedule<CherySupplierEmployeeService>(
//"employee",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "BOM主数据":
BackgroundJob.Schedule<CherySupplierBomService>(
hangfireid = BackgroundJob.Schedule<CherySupplierBomService>(
//"bom",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "过程控制项质量数据":
BackgroundJob.Schedule<CherySupplierProCpsService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProCpsService>(
//"cps",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "生产过程数据":
BackgroundJob.Schedule<CherySupplierProDataService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProDataService>(
//"data",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "产品一次合格率":
BackgroundJob.Schedule<CherySupplierProFirstPassyieldService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProFirstPassyieldService>(
// "firstpassyield",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "工位一次合格率":
BackgroundJob.Schedule<CherySupplierProStationFirstPassyieldService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProStationFirstPassyieldService>(
//"stationfirstpassyield",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "缺陷业务数据":
BackgroundJob.Schedule<CherySupplierProFlawService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProFlawService>(
//"flaw",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
);
break;
case "环境业务数据":
BackgroundJob.Schedule<CherySupplierProEnvironmentService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProEnvironmentService>(
//"environment",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "设备OEE达成率":
BackgroundJob.Schedule<CherySupplierProOeeAchievementRateService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProOeeAchievementRateService>(
//"oeeachievementrate",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "OEE时间明细":
BackgroundJob.Schedule<CherySupplierProOeeTimeDetailsService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProOeeTimeDetailsService>(
//"oeetimedetails",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "物料主数据":
BackgroundJob.Schedule<CherySupplierProMaterialDataService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProMaterialDataService>(
//"maaterialdata", // 注意:这里可能存在拼写错误,原始代码中也有
x => x.CustomInvokeAsync(taskName, client,taskId),
TimeSpan.FromSeconds(1)
);
break;
case "附件类数据":
BackgroundJob.Schedule<CherySupplierProAttachmentDataService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProAttachmentDataService>(
// "attachmentdata",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "工艺装备":
BackgroundJob.Schedule<CherySupplierProProcessEquipmentService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProProcessEquipmentService>(
//"processequipment",
x => x.CustomInvokeAsync(taskName, client),
TimeSpan.FromSeconds(1)
);
break;
case "工艺":
BackgroundJob.Schedule<CherySupplierProProcessService>(
hangfireid = BackgroundJob.Schedule<CherySupplierProProcessService>(
// "process",
x => x.CustomInvokeAsync(taskName, client, taskId),
TimeSpan.FromSeconds(1)
@ -245,26 +245,29 @@ namespace TaskManager.Controllers
break;
case "供应商共享库存-上午":
BackgroundJob.Schedule<CherySupplierSinvDataService>(
hangfireid = BackgroundJob.Schedule<CherySupplierSinvDataService>(
// "process",
x => x.CustomInvokeAsync(taskName, client,taskId),
TimeSpan.FromSeconds(1)
);
break;
case "供应商共享库存-下午":
BackgroundJob.Schedule<CherySupplierSinvDataService>(
hangfireid = BackgroundJob.Schedule<CherySupplierSinvDataService>(
// "process",
x => x.CustomInvokeAsync(taskName, client,taskId),
TimeSpan.FromSeconds(1)
);
break;
}
var taskupdate =await _context.TaskSub.FirstOrDefaultAsync(p => p.TaskId==taskId);
if (taskupdate != null)
{
taskupdate.Remark = hangfireid;
_context.Update(taskupdate);
_context.SaveChanges();
}
return new JsonResult(new

1
API/Wood.Service/Datas/SupplierEmployeeDtService.cs

@ -97,6 +97,7 @@ namespace Wood.Service.Datas
foreach (var empDtObj in entityLst)
{
empDtObj.SupplierCode = VendCode;
empDtObj.ReadState = true;
SUPPLIER_EMPLOYEE empObj = new SUPPLIER_EMPLOYEE();
empObj.InjectFrom(empDtObj);
empObj.ReadState = true;

2
API/Wood.Service/Datas/SupplierInfoDtService.cs

@ -97,6 +97,8 @@ namespace Wood.Service.Datas
foreach (var empDtObj in entityLst)
{
empDtObj.SupplierCode = VendCode;
empDtObj.ReadState = true;
SUPPLIER_INFO empObj = new SUPPLIER_INFO();
empObj.InjectFrom(empDtObj);
empObj.TaskId = taskSubObj.TaskId;

2
API/Wood.Service/Datas/SupplierProProcessEquipmentDtService.cs

@ -98,6 +98,8 @@ namespace Wood.Service.Datas
foreach (var empDtObj in entityLst)
{
empDtObj.SupplierCode = VendCode;
empDtObj.ReadState = true;
SUPPLIER_PRO_PROCESS_EQUIPMENT empObj = new SUPPLIER_PRO_PROCESS_EQUIPMENT();
empObj.InjectFrom(empDtObj);
empObj.TaskId = taskSubObj.TaskId;

Loading…
Cancel
Save