2025-11-11 15:37:11 +08:00

130 lines
4.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using RIZO.Model.Mes.Dto;
using RIZO.Model.Mes;
using RIZO.Service.Mes.IMesService;
using RIZO.Service.Mes.IMesService.MasterData;
using RIZO.Model.Mes.Dto.MasterData;
using RIZO.Model.Mes.MasterData;
//创建时间2025-11-11
namespace RIZO.Admin.WebApi.Controllers.Mes
{
/// <summary>
/// 产线管理基础信息表
/// </summary>
[Route("mes/ProductionLine")]
[AllowAnonymous]
public class ProductionLineController : BaseController
{
/// <summary>
/// 产线管理基础信息表接口
/// </summary>
private readonly IProductionLineService _ProductionLineService;
public ProductionLineController(IProductionLineService ProductionLineService)
{
_ProductionLineService = ProductionLineService;
}
/// <summary>
/// 查询产线管理基础信息表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "productionline:list")]
public IActionResult QueryProductionLine([FromQuery] ProductionLineQueryDto parm)
{
var response = _ProductionLineService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询产线管理基础信息表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "productionline:query")]
public IActionResult GetProductionLine(long Id)
{
var response = _ProductionLineService.GetInfo(Id);
var info = response.Adapt<ProductionLineDto>();
return SUCCESS(info);
}
/// <summary>
/// 添加产线管理基础信息表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "productionline:add")]
[Log(Title = "产线管理基础信息表", BusinessType = BusinessType.INSERT)]
public IActionResult AddProductionLine([FromBody] ProductionLineDto parm)
{
var modal = parm.Adapt<ProductionLine>().ToCreate(HttpContext);
var response = _ProductionLineService.AddProductionLine(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新产线管理基础信息表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "productionline:edit")]
[Log(Title = "产线管理基础信息表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateProductionLine([FromBody] ProductionLineDto parm)
{
var modal = parm.Adapt<ProductionLine>().ToUpdate(HttpContext);
var response = _ProductionLineService.UpdateProductionLine(modal);
return ToResponse(response);
}
/// <summary>
/// 删除产线管理基础信息表
/// </summary>
/// <returns></returns>
[HttpPost("delete/{ids}")]
[ActionPermissionFilter(Permission = "productionline:delete")]
[Log(Title = "产线管理基础信息表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteProductionLine([FromRoute]string ids)
{
var idArr = Tools.SplitAndConvert<long>(ids);
return ToResponse(_ProductionLineService.Delete(idArr));
}
/// <summary>
/// 查询所有产线信息下拉列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("getAllLine")]
[ActionPermissionFilter(Permission = "productionline:list")]
public IActionResult GetAllLine()
{
var response = _ProductionLineService.GetAllLine();
return SUCCESS(response);
}
/// <summary>
/// 停用产线管理基础信息表
/// </summary>
/// <returns></returns>
[HttpPost("stop/{ids}")]
[ActionPermissionFilter(Permission = "productionline:delete")]
[Log(Title = "产线管理基础信息表", BusinessType = BusinessType.DELETE)]
public IActionResult StopProductionLine([FromRoute] string ids)
{
var idArr = Tools.SplitAndConvert<long>(ids);
return ToResponse(_ProductionLineService.Stop(idArr));
}
}
}