68 lines
1.9 KiB
C#
68 lines
1.9 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ZR.Model.mes.md;
|
|
using ZR.Model.mes.pro;
|
|
using ZR.Service.mes.pro.IService;
|
|
using ZR.Service.MES.md;
|
|
|
|
namespace ZR.Admin.WebApi.Controllers.MES.pro
|
|
{
|
|
|
|
|
|
[Route("mes/pro/workplan")]
|
|
public class ProWorkplanController : BaseController
|
|
{
|
|
private readonly IProWorkplanService proWorkplanService;
|
|
|
|
public ProWorkplanController(IProWorkplanService proWorkplanService)
|
|
{
|
|
this.proWorkplanService = proWorkplanService;
|
|
|
|
|
|
}
|
|
|
|
[HttpGet("list")]
|
|
public IActionResult List(int pageNum, int pageSize, int year, int week, string partNumber = "", string color = "")
|
|
{
|
|
(List<ProWorkplan>,int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color);
|
|
|
|
return ToResponse(new ApiResult(200, "success", data));
|
|
}
|
|
|
|
[HttpPost("addworkplan")]
|
|
public IActionResult AddWorkPlan([FromBody] ProWorkplan proWorkplan)
|
|
{
|
|
int data = 0;
|
|
if (proWorkplan!=null)
|
|
{
|
|
data = proWorkplanService.AddWorkPlan(proWorkplan);
|
|
}
|
|
|
|
return ToResponse(new ApiResult(200, "success", data));
|
|
}
|
|
|
|
[HttpPost("updateworkplan")]
|
|
public IActionResult UpdateWorkPlan([FromBody] ProWorkplan proWorkplan)
|
|
{
|
|
int data = 0;
|
|
if (proWorkplan != null)
|
|
{
|
|
data = proWorkplanService.UpdateWorkPlan(proWorkplan);
|
|
}
|
|
|
|
return ToResponse(new ApiResult(200, "success", data));
|
|
}
|
|
|
|
[HttpGet("deleteitem/{id}")]
|
|
public IActionResult DeleteItem(string id)
|
|
{
|
|
int data = 0;
|
|
if (!string.IsNullOrEmpty(id))
|
|
{
|
|
data = proWorkplanService.DeleteWorkPlan(id);
|
|
}
|
|
|
|
return ToResponse(new ApiResult(200, "success", data));
|
|
}
|
|
}
|
|
}
|