shgx_tz_mom/ZR.Admin.WebApi/Controllers/mes/pro/ProWorkplanController.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2023-11-14 11:29:05 +08:00
using Microsoft.AspNetCore.Mvc;
using ZR.Model.mes.md;
2023-11-14 14:30:14 +08:00
using ZR.Model.mes.pro;
using ZR.Service.mes.pro.IService;
2023-11-14 11:29:05 +08:00
using ZR.Service.MES.md;
namespace ZR.Admin.WebApi.Controllers.MES.pro
{
[Route("mes/pro/workplan")]
public class ProWorkplanController : BaseController
{
2023-11-14 14:30:14 +08:00
private readonly IProWorkplanService proWorkplanService;
public ProWorkplanController(IProWorkplanService proWorkplanService)
{
this.proWorkplanService = proWorkplanService;
}
2023-11-14 11:29:05 +08:00
[HttpGet("list")]
2023-11-14 14:30:14 +08:00
public IActionResult List(int pageNum, int pageSize, int year, int week, string partNumber = "", string color = "")
2023-11-14 11:29:05 +08:00
{
2023-11-14 14:30:14 +08:00
(List<ProWorkplan>,int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color);
2023-11-14 11:29:05 +08:00
return ToResponse(new ApiResult(200, "success", data));
}
2023-11-14 16:43:35 +08:00
[HttpPost("addworkplan")]
public IActionResult AddWorkPlan(ProWorkplan proWorkplan)
{
int data = 0;
if (proWorkplan!=null)
{
data = proWorkplanService.AddWorkPlan(proWorkplan);
}
2023-11-14 11:29:05 +08:00
2023-11-14 16:43:35 +08:00
return ToResponse(new ApiResult(200, "success", data));
}
2023-11-14 11:29:05 +08:00
}
}