115 lines
3.8 KiB
C#
115 lines
3.8 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Factory_Model.Dto;
|
||
using DOAN.Model.Factory_Model;
|
||
using DOAN.Service.Factory_Model.IService;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2024-08-26
|
||
namespace DOAN.Admin.WebApi.Controllers.Factory_Model
|
||
{
|
||
/// <summary>
|
||
/// 产线
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("Factory_Model/BaseProductionLine")]
|
||
public class BaseProductionLineController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 产线接口
|
||
/// </summary>
|
||
private readonly IBaseProductionLineService _BaseProductionLineService;
|
||
|
||
public BaseProductionLineController(IBaseProductionLineService BaseProductionLineService)
|
||
{
|
||
_BaseProductionLineService = BaseProductionLineService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询产线列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:list")]
|
||
public IActionResult QueryBaseProductionLine([FromQuery] BaseProductionLineQueryDto parm)
|
||
{
|
||
var response = _BaseProductionLineService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询产线列表 没有分页
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:list")]
|
||
public IActionResult QueryBaseProductionLine_NO_page([FromQuery] BaseProductionLineQueryDto parm)
|
||
{
|
||
var response = _BaseProductionLineService.GetList_NO_page(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询产线详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:query")]
|
||
public IActionResult GetBaseProductionLine(int Id)
|
||
{
|
||
var response = _BaseProductionLineService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<BaseProductionLineDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加产线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:add")]
|
||
[Log(Title = "产线", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddBaseProductionLine([FromBody] BaseProductionLineDto parm)
|
||
{
|
||
var modal = parm.Adapt<BaseProductionLine>().ToCreate(HttpContext);
|
||
|
||
var response = _BaseProductionLineService.AddBaseProductionLine(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新产线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:edit")]
|
||
[Log(Title = "产线", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateBaseProductionLine([FromBody] BaseProductionLineDto parm)
|
||
{
|
||
var modal = parm.Adapt<BaseProductionLine>().ToUpdate(HttpContext);
|
||
var response = _BaseProductionLineService.UpdateBaseProductionLine(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除产线
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "baseproductionline:delete")]
|
||
[Log(Title = "产线", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteBaseProductionLine([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||
|
||
return ToResponse(_BaseProductionLineService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |