2025-03-21 13:02:20 +08:00

108 lines
3.5 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 DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.mm.line;
using DOAN.Model.MES.mm.line.Dto;
using DOAN.Service.MES.mm.line.IService;
//创建时间2025-03-21
namespace DOAN.WebApi.Controllers.MES.mm.line
{
/// <summary>
/// mm_line_location
/// </summary>
[Verify]
[Route("mes/materialManagement/MmLineLocation")]
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);
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)
{
string[] idsArr = Tools.SpitStrArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _MmLineLocationService.Delete(idsArr);
return ToResponse(response);
}
}
}