任务备料状态切换

This commit is contained in:
qianhao.xu 2024-09-07 15:39:26 +08:00
parent dd93f7cc8d
commit a05f2cdffe
3 changed files with 23 additions and 8 deletions

View File

@ -120,6 +120,14 @@ namespace DOAN.WebApi.Controllers.MES.mm
return SUCCESS(response);
}
//TODO 任务备料状态切换
[HttpGet("switch_task_preparation")]
public IActionResult SwitchTaskPreparation(string task_code,int preparation_status)
{
if(string.IsNullOrEmpty(task_code)) { return SUCCESS(null); };
var response = preparantTaskService.SwitchTaskPreparation(task_code, preparation_status);
return SUCCESS(response);
}
}

View File

@ -33,6 +33,6 @@ namespace DOAN.Service.MES.mm.IService
PagedInfo<FormsWorkoderAndTaskInfo> TableQuerytaskInfo(FormsWorkoderAndTaskQuery parm);
int SwitchTaskPreparation(string task_code, int preparation_status);
}
}

View File

@ -295,12 +295,12 @@ namespace DOAN.Service.MES.mm
SerialNum = t.SerialNum,
TaskCode = t.TaskCode,
FkWorkorder = q.Workorder,
RouteCode=q.FkRouteCode,
DeliveryNum=q.DeliveryNum,
ProductionName= q.ProductionName,
ProductionCode=q.ProductionCode,
CustomCode=q.CustomCode,
WorkorderDate=q.WorkorderDate,
RouteCode = q.FkRouteCode,
DeliveryNum = q.DeliveryNum,
ProductionName = q.ProductionName,
ProductionCode = q.ProductionCode,
CustomCode = q.CustomCode,
WorkorderDate = q.WorkorderDate,
FkTaskCode = i.FkTaskCode,
PreparationStatus = t.PreparationStatus,
CreatedBy = t.CreatedBy,
@ -308,7 +308,7 @@ namespace DOAN.Service.MES.mm
UpdatedTime = t.UpdatedTime,
UpdatedBy = t.UpdatedBy,
SubId = i.Id,
MaterialCode = i.MaterialCode,
MaterialName = i.MaterialName,
Specification = i.Specification,
@ -329,5 +329,12 @@ namespace DOAN.Service.MES.mm
}
public int SwitchTaskPreparation(string task_code, int preparation_status)
{
return Context.Updateable<MmPreparationTask>().Where(it => it.TaskCode == task_code)
.SetColumns(it => it.PreparationStatus == preparation_status)
.ExecuteCommand();
}
}
}