74 lines
2.1 KiB
C#
74 lines
2.1 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using ZR.Model.mes.md;
|
|
using ZR.Service.mes.md.IService;
|
|
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;
|
|
|
|
namespace ZR.Admin.WebApi.Controllers.mes.md
|
|
{
|
|
[Route("mes/md/Worksort")]
|
|
public class MdWorksortController : BaseController
|
|
{
|
|
IMdWorksortService worksortService;
|
|
|
|
public MdWorksortController(IMdWorksortService worksortService)
|
|
{
|
|
this.worksortService = worksortService;
|
|
}
|
|
|
|
[HttpGet("list")]
|
|
public IActionResult List(int pageNum, int pageSize, string WorksortCode = "", string WorksortName = "")
|
|
{
|
|
|
|
(int, List<MdWorksort>) data = worksortService.GetAll(WorksortCode, WorksortName, pageNum, pageSize);
|
|
|
|
return ToResponse(new ApiResult(200, "success", data));
|
|
|
|
}
|
|
/// <summary>
|
|
/// 插入车间
|
|
/// </summary>
|
|
/// <param name="worksort"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("addWorksort")]
|
|
public IActionResult AddWorksort([FromBody] MdWorksort worksort)
|
|
{
|
|
if (worksort != null)
|
|
worksort.ToCreate(HttpContext);
|
|
int result = worksortService.AddWorksort(worksort);
|
|
return SUCCESS(result);
|
|
}
|
|
|
|
|
|
[HttpPost("updateWorksort")]
|
|
public IActionResult UpdateWorksort([FromBody] MdWorksort worksort)
|
|
{
|
|
if (worksort != null)
|
|
worksort.ToUpdate(HttpContext);
|
|
int result = worksortService.UpdateWorksort(worksort);
|
|
return SUCCESS(result);
|
|
}
|
|
|
|
|
|
[HttpPost("delWorksort")]
|
|
public IActionResult deleteWorksort([FromBody] List<int> ids)
|
|
{
|
|
if (ids != null)
|
|
{
|
|
int result = worksortService.deleteWorksort(ids.ToArray());
|
|
return ToResponse(result);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|