新增BZFM物料管理相关后端接口与服务实现

本次提交为BZFM模块新增了物料管理相关的核心后端能力,包括库位、物料、物料分类、出入库记录、出入库类别等6张表的Controller、实体、DTO、Service及接口定义,实现了标准的增删改查接口,支持权限校验、AOP日志、分页查询等,完善了物料管理基础后端支撑。
This commit is contained in:
2025-12-25 12:02:03 +08:00
parent 8ef5202077
commit 4fa187e11d
30 changed files with 2057 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
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));
}
}
}