diff --git a/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs b/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs index 542c6b3..2e0869c 100644 --- a/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs +++ b/DOAN.Admin.WebApi/Controllers/JobKanban/WorkOrderProgressController.cs @@ -40,9 +40,9 @@ namespace DOAN.WebApi.Controllers.JobKanban //TODO 根据班组 ,产线 和日期获取all工单 [HttpGet("get_workorder_list")] - public IActionResult GetWorkOrderList(string group_code,string line_code,DateTime handleDate) + public IActionResult GetWorkOrderList(string group_code, string line_code, DateTime handleDate) { - if(string.IsNullOrEmpty(group_code)||string.IsNullOrEmpty(line_code)||handleDate==DateTime.MinValue) + if (string.IsNullOrEmpty(group_code) || string.IsNullOrEmpty(line_code) || handleDate == DateTime.MinValue) { return SUCCESS(null); } @@ -51,7 +51,33 @@ namespace DOAN.WebApi.Controllers.JobKanban return SUCCESS(response); } + //TODO 开始某个工单 + [HttpGet("start_workorder")] + public IActionResult StartWorkOrder(string workorder) + { + if (string.IsNullOrEmpty(workorder)) + { + return SUCCESS(null); + } + var response = workorderProgressService.StartWorkOrder(workorder); + return SUCCESS(response); + } + + //TODO 完成某一个工单 + [HttpGet("finish_workorder")] + public IActionResult FinishWorkOrder(string workorder) + { + if (string.IsNullOrEmpty(workorder)) + { + return SUCCESS(null); + } + var response = workorderProgressService.FinishWorkOrder(workorder); + + return SUCCESS(response); + } + + //TODO 获取某条产线 某个日期,某个班组的生产中的工单 } diff --git a/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs b/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs index 88f9870..f0cfcde 100644 --- a/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs +++ b/DOAN.Service/JobKanban/IService/IWorkorderProgressService.cs @@ -15,5 +15,9 @@ namespace DOAN.Service.JobKanban.IService List GetWorkOrderList(string group_code, string line_code, DateTime handleDate); + + + int StartWorkOrder(string workorder); + int FinishWorkOrder(string workorder); } } diff --git a/DOAN.Service/JobKanban/WorkorderProgressService.cs b/DOAN.Service/JobKanban/WorkorderProgressService.cs index 6f69828..205f883 100644 --- a/DOAN.Service/JobKanban/WorkorderProgressService.cs +++ b/DOAN.Service/JobKanban/WorkorderProgressService.cs @@ -34,6 +34,18 @@ namespace DOAN.Service.JobKanban .Where(it => it.WorkorderDate == handleDate) .ToList(); } + + public int StartWorkOrder(string workorder) + { + return Context.Updateable().SetColumns(it => it.Status == 2) + .Where(it => it.Workorder == workorder).ExecuteCommand(); + } + + public int FinishWorkOrder(string workorder) + { + return Context.Updateable().SetColumns(it => it.Status == 3) + .Where(it => it.Workorder == workorder).ExecuteCommand(); + } } }