工作单元关系确认
This commit is contained in:
73
ZR.Admin.WebApi/Controllers/mes/md/MdWorklineController.cs
Normal file
73
ZR.Admin.WebApi/Controllers/mes/md/MdWorklineController.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Service.mes.md;
|
||||
using ZR.Service.mes.md.IService;
|
||||
using ZR.Service.MES.md.IService;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.mes.md
|
||||
{
|
||||
|
||||
[Route("mes/md/workline")]
|
||||
public class MdWorklineController : BaseController
|
||||
{
|
||||
IMdWorklineService worklineService;
|
||||
public MdWorklineController(IMdWorklineService worklineService)
|
||||
{
|
||||
this.worklineService = worklineService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pageNum"></param>
|
||||
/// <param name="pageSize"></param>
|
||||
/// <param name="deviceCode"></param>
|
||||
/// <param name="deviceName"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public IActionResult List(int pageNum, int pageSize, string lineCode = "", string lineName = "")
|
||||
{
|
||||
(int, List<MdWorkline>) data = worklineService.GetAll(lineCode, lineName, pageNum, pageSize);
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("addWorkline")]
|
||||
public IActionResult AddWorkline([FromBody] MdWorkline workline)
|
||||
{
|
||||
if (workline != null)
|
||||
workline.ToCreate(HttpContext);
|
||||
int result = worklineService.AddWorkline(workline);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
[HttpPost("updateWorkline")]
|
||||
public IActionResult UpdateWorkline([FromBody] MdWorkline workline)
|
||||
{
|
||||
if (workline != null)
|
||||
{
|
||||
workline.ToUpdate(HttpContext);
|
||||
}
|
||||
|
||||
int result = worklineService.UpdateWorkline(workline);
|
||||
return SUCCESS(result);
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("delWorkline")]
|
||||
public IActionResult DelWorkline([FromBody] List<int> ids)
|
||||
{
|
||||
if (ids != null)
|
||||
{
|
||||
int result = worklineService.deleteWorkline(ids.ToArray());
|
||||
return ToResponse(result);
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user