108 lines
3.5 KiB
C#
Raw Normal View History

2025-03-21 11:14:59 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Admin.WebApi.Filters;
2025-03-21 11:23:00 +08:00
using DOAN.Model.MES.mm.line;
using DOAN.Model.MES.mm.line.Dto;
using DOAN.Service.MES.mm.line.IService;
2025-03-21 11:14:59 +08:00
//创建时间2025-03-21
2025-03-21 11:23:00 +08:00
namespace DOAN.WebApi.Controllers.MES.mm.line
2025-03-21 11:14:59 +08:00
{
/// <summary>
/// mm_line_location
/// </summary>
[Verify]
2025-03-21 11:23:00 +08:00
[Route("mes/materialManagement/MmLineLocation")]
2025-03-21 11:14:59 +08:00
public class MmLineLocationController : BaseController
{
/// <summary>
/// mm_line_location接口
/// </summary>
private readonly IMmLineLocationService _MmLineLocationService;
public MmLineLocationController(IMmLineLocationService MmLineLocationService)
{
_MmLineLocationService = MmLineLocationService;
}
/// <summary>
/// 查询mm_line_location列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:mmlinelocation:list")]
public IActionResult QueryMmLineLocation([FromQuery] MmLineLocationQueryDto parm)
{
var response = _MmLineLocationService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询mm_line_location详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:mmlinelocation:query")]
public IActionResult GetMmLineLocation(string Id)
{
var response = _MmLineLocationService.GetInfo(Id);
2025-03-21 11:23:00 +08:00
2025-03-21 11:14:59 +08:00
var info = response.Adapt<MmLineLocation>();
return SUCCESS(info);
}
/// <summary>
/// 添加mm_line_location
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:mmlinelocation:add")]
[Log(Title = "mm_line_location", BusinessType = BusinessType.INSERT)]
public IActionResult AddMmLineLocation([FromBody] MmLineLocationDto parm)
{
var modal = parm.Adapt<MmLineLocation>().ToCreate(HttpContext);
var response = _MmLineLocationService.AddMmLineLocation(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新mm_line_location
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:mmlinelocation:edit")]
[Log(Title = "mm_line_location", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateMmLineLocation([FromBody] MmLineLocationDto parm)
{
var modal = parm.Adapt<MmLineLocation>().ToUpdate(HttpContext);
var response = _MmLineLocationService.UpdateMmLineLocation(modal);
return ToResponse(response);
}
/// <summary>
/// 删除mm_line_location
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:mmlinelocation:delete")]
[Log(Title = "mm_line_location", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteMmLineLocation(string ids)
{
2025-03-21 13:02:20 +08:00
string[] idsArr = Tools.SpitStrArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
2025-03-21 11:14:59 +08:00
var response = _MmLineLocationService.Delete(idsArr);
return ToResponse(response);
}
}
}