本次提交为BZFM模块新增了物料管理相关的核心后端能力,包括库位、物料、物料分类、出入库记录、出入库类别等6张表的Controller、实体、DTO、Service及接口定义,实现了标准的增删改查接口,支持权限校验、AOP日志、分页查询等,完善了物料管理基础后端支撑。
102 lines
3.1 KiB
C#
102 lines
3.1 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/MmLocation")]
|
||
public class MmLocationController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 库位表接口
|
||
/// </summary>
|
||
private readonly IMmLocationService _MmLocationService;
|
||
|
||
public MmLocationController(IMmLocationService MmLocationService)
|
||
{
|
||
_MmLocationService = MmLocationService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询库位表列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "mmlocation:list")]
|
||
public IActionResult QueryMmLocation([FromQuery] MmLocationQueryDto parm)
|
||
{
|
||
var response = _MmLocationService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询库位表详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "mmlocation:query")]
|
||
public IActionResult GetMmLocation(int Id)
|
||
{
|
||
var response = _MmLocationService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<MmLocationDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加库位表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "mmlocation:add")]
|
||
[Log(Title = "库位表", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddMmLocation([FromBody] MmLocationDto parm)
|
||
{
|
||
var modal = parm.Adapt<MmLocation>().ToCreate(HttpContext);
|
||
|
||
var response = _MmLocationService.AddMmLocation(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新库位表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "mmlocation:edit")]
|
||
[Log(Title = "库位表", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateMmLocation([FromBody] MmLocationDto parm)
|
||
{
|
||
var modal = parm.Adapt<MmLocation>().ToUpdate(HttpContext);
|
||
var response = _MmLocationService.UpdateMmLocation(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除库位表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "mmlocation:delete")]
|
||
[Log(Title = "库位表", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteMmLocation([FromRoute]string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<int>(ids);
|
||
|
||
return ToResponse(_MmLocationService.Delete(idArr));
|
||
}
|
||
|
||
}
|
||
} |