2024-12-03 19:21:32 +08:00
|
|
|
using DOAN.Service.Mobile.IService;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers.Mobile;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 工序流转卡
|
|
|
|
|
/// </summary>
|
|
|
|
|
[AllowAnonymous]
|
2024-12-03 19:40:37 +08:00
|
|
|
[Route("mobile/reportflow")]
|
2024-12-03 19:21:32 +08:00
|
|
|
public class ReportFlowController : BaseController
|
|
|
|
|
{
|
|
|
|
|
//IReportFlowService
|
|
|
|
|
private readonly IReportFlowService _reportFlowService;
|
|
|
|
|
|
|
|
|
|
public ReportFlowController(IReportFlowService reportFlowService)
|
|
|
|
|
{
|
|
|
|
|
_reportFlowService = reportFlowService;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO 查询工单详情
|
2024-12-03 19:51:09 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 查询工单详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="workOrder">工单号</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <exception cref="CustomException"></exception>
|
2024-12-03 19:21:32 +08:00
|
|
|
[HttpGet("get_workorder_detail")]
|
|
|
|
|
public IActionResult GetWorkOrderDetail(string workOrder)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(workOrder))
|
|
|
|
|
throw new CustomException("workOrderId 是空");
|
2024-12-03 19:51:09 +08:00
|
|
|
var response = _reportFlowService.GetWorkOrderDetail(workOrder);
|
|
|
|
|
if (response == null)
|
|
|
|
|
{
|
|
|
|
|
return ToResponse(ResultCode.NO_DATA, "工单不存在");
|
|
|
|
|
}
|
|
|
|
|
return SUCCESS(response);
|
2024-12-03 19:21:32 +08:00
|
|
|
}
|
2024-12-03 19:39:52 +08:00
|
|
|
//TODO 查询工序报工详情
|
2024-12-03 19:51:09 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 查询某个工序报工详情
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="workorder"></param>
|
|
|
|
|
/// <param name="process"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <exception cref="CustomException"></exception>
|
2024-12-03 19:39:52 +08:00
|
|
|
[HttpGet("get_process_reportwork_detail")]
|
|
|
|
|
public IActionResult GetProcessReportWorkDetail(string workorder, string process)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(workorder) || string.IsNullOrEmpty(process))
|
|
|
|
|
{
|
|
|
|
|
throw new CustomException("workorder or process is null");
|
|
|
|
|
}
|
|
|
|
|
return SUCCESS(_reportFlowService.GetProcessReportWorkDetail(workorder, process));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO 工序报工
|
2024-12-03 19:51:09 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// 工序报工
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="workorder"></param>
|
|
|
|
|
/// <param name="process"></param>
|
|
|
|
|
/// <param name="finish_num"></param>
|
|
|
|
|
/// <param name="bad_num"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
/// <exception cref="CustomException"></exception>
|
2024-12-03 19:39:52 +08:00
|
|
|
[HttpGet("process_reportwork")]
|
|
|
|
|
public IActionResult ProcessReportWork(string workorder, string process, int finish_num,int bad_num)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(workorder) || string.IsNullOrEmpty(process))
|
|
|
|
|
{
|
|
|
|
|
throw new CustomException("workorder or process is null");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SUCCESS(_reportFlowService.ProcessReportWork(workorder, process, finish_num,bad_num,HttpContext.GetNickName()));
|
|
|
|
|
}
|
2024-12-03 19:21:32 +08:00
|
|
|
|
2024-12-03 19:51:09 +08:00
|
|
|
//TODO 获取工单下的报工列表
|
|
|
|
|
[HttpGet("get_workorder_reportwork_list")]
|
|
|
|
|
public IActionResult GetWorkOrderReportWorkList(string workorder)
|
|
|
|
|
{
|
|
|
|
|
if (string.IsNullOrEmpty(workorder))
|
|
|
|
|
{
|
|
|
|
|
throw new CustomException("workorder is null");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SUCCESS(_reportFlowService.GetWorkOrderReportWorkList(workorder));
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-03 19:21:32 +08:00
|
|
|
|
2024-12-03 19:39:52 +08:00
|
|
|
|
2024-12-03 19:21:32 +08:00
|
|
|
}
|