140 lines
4.4 KiB
C#
Raw Normal View History

2024-09-19 09:34:54 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Admin.WebApi.Filters;
using DOAN.Service.JobKanban.IService;
2024-09-19 10:03:04 +08:00
using DOAN.Service.JobKanban;
2024-09-19 09:34:54 +08:00
namespace DOAN.WebApi.Controllers.JobKanban
{
/// <summary>
/// 工单进度接口
/// </summary>
[Route("kanban/workorderProgress")]
public class WorkOrderProgressController : BaseController
{
private readonly IWorkorderProgressService workorderProgressService;
public WorkOrderProgressController(IWorkorderProgressService workorderProgressService)
{
this.workorderProgressService = workorderProgressService;
}
//TODO 获取产线
[HttpGet("get_routes")]
public IActionResult GetRoutes()
{
var response = workorderProgressService.GetRoutes();
return SUCCESS(response);
}
//TODO 获取班组
[HttpGet("get_group")]
public IActionResult GetGroups()
{
var response = workorderProgressService.GetGroups();
return SUCCESS(response);
}
//TODO 根据班组 ,产线 和日期获取all工单
[HttpGet("get_workorder_list")]
2024-09-19 09:53:04 +08:00
public IActionResult GetWorkOrderList(string group_code, string line_code, DateTime handleDate)
{
2024-09-19 09:53:04 +08:00
if (string.IsNullOrEmpty(group_code) || string.IsNullOrEmpty(line_code) || handleDate == DateTime.MinValue)
{
return SUCCESS(null);
}
var response = workorderProgressService.GetWorkOrderList(group_code, line_code, handleDate);
return SUCCESS(response);
}
2024-09-19 10:03:04 +08:00
/// <summary>
/// 工单list (未完成的)
/// </summary>
/// <param name="today"></param>
/// <param name="LineCode"></param>
/// <returns></returns>
[HttpGet("get_workorder_nofinish")]
public IActionResult GetWorkOrderListNoFinish(DateTime today, string LineCode)
{
if (today == DateTime.MinValue || string.IsNullOrEmpty(LineCode))
{
return SUCCESS(null);
}
var response = workorderProgressService.GetWorkOrderListNoFinish(today, LineCode);
return SUCCESS(response);
}
// 获取工单详情
[HttpGet("get_workorder_detail")]
public IActionResult GetWorkOrderDetail(string workorder)
{
if (string.IsNullOrEmpty(workorder))
{
return SUCCESS(null);
}
var response = workorderProgressService.GetWorkOrderDetail(workorder);
return SUCCESS(response);
}
// 获取今日总任务数 ,剩余任务数
[HttpGet("get_num_list")]
public IActionResult GetKanbanNum(DateTime today, string LineCode)
{
if (today == DateTime.MinValue || string.IsNullOrEmpty(LineCode))
{
return SUCCESS(null);
}
var response = workorderProgressService.GetKanbanNum(today, LineCode);
return SUCCESS(response);
}
2024-09-19 09:53:04 +08:00
//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);
}
2024-09-19 09:53:04 +08:00
//TODO 获取某条产线 某个日期,某个班组的生产中的工单
2024-09-19 10:03:04 +08:00
[HttpGet("get_producting_workorder")]
public IActionResult GetProductingWorkorder(string group_code, string line_code, DateTime handleDate)
{
if (string.IsNullOrEmpty(group_code) || string.IsNullOrEmpty(line_code) || handleDate == DateTime.MinValue)
{
return SUCCESS(null);
}
var response = workorderProgressService.GetProductingWorkorder(group_code, line_code, handleDate);
2024-09-19 10:03:04 +08:00
return SUCCESS(response);
}
2024-09-19 09:34:54 +08:00
}
}