完成某一个工单

This commit is contained in:
qianhao.xu 2024-09-19 09:53:04 +08:00
parent 6800b2cc51
commit aa3e9a4008
3 changed files with 44 additions and 2 deletions

View File

@ -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 获取某条产线 某个日期,某个班组的生产中的工单
}

View File

@ -15,5 +15,9 @@ namespace DOAN.Service.JobKanban.IService
List<ProWorkorder> GetWorkOrderList(string group_code, string line_code, DateTime handleDate);
int StartWorkOrder(string workorder);
int FinishWorkOrder(string workorder);
}
}

View File

@ -34,6 +34,18 @@ namespace DOAN.Service.JobKanban
.Where(it => it.WorkorderDate == handleDate)
.ToList();
}
public int StartWorkOrder(string workorder)
{
return Context.Updateable<ProWorkorder>().SetColumns(it => it.Status == 2)
.Where(it => it.Workorder == workorder).ExecuteCommand();
}
public int FinishWorkOrder(string workorder)
{
return Context.Updateable<ProWorkorder>().SetColumns(it => it.Status == 3)
.Where(it => it.Workorder == workorder).ExecuteCommand();
}
}
}