Files
shgx_tz_mes_backend_sync/ZR.Admin.WebApi/Controllers/mes/qc/QcRoughController.cs

49 lines
1.7 KiB
C#
Raw Normal View History

2024-06-07 11:04:26 +08:00
using Microsoft.AspNetCore.Mvc;
2023-11-27 16:28:16 +08:00
using ZR.Model.MES.qc.DTO;
2023-11-23 08:31:14 +08:00
using ZR.Service.mes.qu.IService;
namespace ZR.Admin.WebApi.Controllers.mes.qu
{
2023-11-27 16:28:16 +08:00
[Route("mes/qc/IQC")]
2023-11-24 20:40:45 +08:00
public class QcRoughController : BaseController
2023-11-23 08:31:14 +08:00
{
2023-11-24 20:40:45 +08:00
private readonly IQcRoughService quRoughService;
2023-11-23 08:31:14 +08:00
2023-11-24 20:40:45 +08:00
public QcRoughController(IQcRoughService quRoughService)
2023-11-23 08:31:14 +08:00
{
this.quRoughService = quRoughService;
}
/// <summary>
/// 获取所有排产工单
/// </summary>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <param name="year"></param>
/// <param name="week"></param>
/// <param name="date"></param>
/// <returns></returns>
2023-11-27 16:28:16 +08:00
[HttpGet("getStatisticslist")]
public IActionResult GetStatisticslist(int pageNum, int pageSize, int year = -1, int week = -1, int date = -1)
2023-11-23 08:31:14 +08:00
{
2023-11-27 16:28:16 +08:00
(List<Mr_QuRoughDTO>, int) data = quRoughService.GetStatisticslist(pageNum, pageSize, year, week, date, 1);
2023-11-23 08:31:14 +08:00
return ToResponse(new ApiResult(200, "success", data));
}
2023-11-28 18:18:56 +08:00
/// <summary>
/// 更新统计表
/// </summary>
/// <returns></returns>
[HttpGet("updateStatisticsTable")]
2024-06-07 11:04:26 +08:00
public IActionResult UpdateStatisticsTable(string id, int actualNumber, int randomRate, int ngs, int oks, decimal oksRatio, int Isqualified)
2023-11-28 18:18:56 +08:00
{
2024-06-07 11:04:26 +08:00
if (string.IsNullOrEmpty(id))
2023-11-28 18:18:56 +08:00
return ToResponse(new ApiResult(200, "success", 0));
2024-06-07 11:04:26 +08:00
int result = quRoughService.UpdateStatisticsTable(id, actualNumber, randomRate, ngs, oks, oksRatio, Isqualified);
2023-11-28 18:18:56 +08:00
return ToResponse(new ApiResult(200, "success", result));
}
2023-11-23 08:31:14 +08:00
}
}