Browse Source

更新手动任务

master
zxy 3 weeks ago
parent
commit
389b9e1898
  1. 53
      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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save