102 lines
3.4 KiB
C#
102 lines
3.4 KiB
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using DOAN.Model.BZFM.Dto;
|
|||
|
|
using DOAN.Model.BZFM;
|
|||
|
|
using DOAN.Service.BZFM.IBZFMService;
|
|||
|
|
using DOAN.Admin.WebApi.Filters;
|
|||
|
|
|
|||
|
|
//创建时间:2025-12-25
|
|||
|
|
namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 物料分类表
|
|||
|
|
/// </summary>
|
|||
|
|
[Verify]
|
|||
|
|
[Route("BZFM/MmMaterialCategory")]
|
|||
|
|
public class MmMaterialCategoryController : BaseController
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 物料分类表接口
|
|||
|
|
/// </summary>
|
|||
|
|
private readonly IMmMaterialCategoryService _MmMaterialCategoryService;
|
|||
|
|
|
|||
|
|
public MmMaterialCategoryController(IMmMaterialCategoryService MmMaterialCategoryService)
|
|||
|
|
{
|
|||
|
|
_MmMaterialCategoryService = MmMaterialCategoryService;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询物料分类表列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="parm"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("list")]
|
|||
|
|
[ActionPermissionFilter(Permission = "mmmaterialcategory:list")]
|
|||
|
|
public IActionResult QueryMmMaterialCategory([FromQuery] MmMaterialCategoryQueryDto parm)
|
|||
|
|
{
|
|||
|
|
var response = _MmMaterialCategoryService.GetList(parm);
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询物料分类表详情
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="Id"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("{Id}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "mmmaterialcategory:query")]
|
|||
|
|
public IActionResult GetMmMaterialCategory(int Id)
|
|||
|
|
{
|
|||
|
|
var response = _MmMaterialCategoryService.GetInfo(Id);
|
|||
|
|
|
|||
|
|
var info = response.Adapt<MmMaterialCategoryDto>();
|
|||
|
|
return SUCCESS(info);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 添加物料分类表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost]
|
|||
|
|
[ActionPermissionFilter(Permission = "mmmaterialcategory:add")]
|
|||
|
|
[Log(Title = "物料分类表", BusinessType = BusinessType.INSERT)]
|
|||
|
|
public IActionResult AddMmMaterialCategory([FromBody] MmMaterialCategoryDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<MmMaterialCategory>().ToCreate(HttpContext);
|
|||
|
|
|
|||
|
|
var response = _MmMaterialCategoryService.AddMmMaterialCategory(modal);
|
|||
|
|
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新物料分类表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPut]
|
|||
|
|
[ActionPermissionFilter(Permission = "mmmaterialcategory:edit")]
|
|||
|
|
[Log(Title = "物料分类表", BusinessType = BusinessType.UPDATE)]
|
|||
|
|
public IActionResult UpdateMmMaterialCategory([FromBody] MmMaterialCategoryDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<MmMaterialCategory>().ToUpdate(HttpContext);
|
|||
|
|
var response = _MmMaterialCategoryService.UpdateMmMaterialCategory(modal);
|
|||
|
|
|
|||
|
|
return ToResponse(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除物料分类表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost("delete/{ids}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "mmmaterialcategory:delete")]
|
|||
|
|
[Log(Title = "物料分类表", BusinessType = BusinessType.DELETE)]
|
|||
|
|
public IActionResult DeleteMmMaterialCategory([FromRoute]string ids)
|
|||
|
|
{
|
|||
|
|
var idArr = Tools.SplitAndConvert<int>(ids);
|
|||
|
|
|
|||
|
|
return ToResponse(_MmMaterialCategoryService.Delete(idArr));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|