111 lines
3.3 KiB
C#
111 lines
3.3 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using ZR.Model.Dto;
|
||
|
||
using ZR.Admin.WebApi.Extensions;
|
||
using ZR.Admin.WebApi.Filters;
|
||
using ZR.Service.mes.wms.IService;
|
||
using ZR.Model.MES.wms.Dto;
|
||
using ZR.Model.MES.wms;
|
||
|
||
//创建时间:2024-03-17
|
||
namespace ZR.Admin.WebApi.Controllers.mes.wms
|
||
{
|
||
/// <summary>
|
||
/// 客户信息
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("/mes/wm/WmCustom")]
|
||
public class WmCustomController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 客户信息接口
|
||
/// </summary>
|
||
private readonly IWmCustomService _WmCustomService;
|
||
|
||
public WmCustomController(IWmCustomService WmCustomService)
|
||
{
|
||
_WmCustomService = WmCustomService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询客户信息列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmcustom:list")]
|
||
public IActionResult QueryWmCustom([FromQuery] WmCustomQueryDto parm)
|
||
{
|
||
var response = _WmCustomService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询客户信息详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmcustom:query")]
|
||
public IActionResult GetWmCustom(int Id)
|
||
{
|
||
var response = _WmCustomService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<WmCustom>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加客户信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmcustom:add")]
|
||
[Log(Title = "客户信息", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddWmCustom([FromBody] WmCustomDto parm)
|
||
{
|
||
var modal = parm.Adapt<WmCustom>().ToCreate(HttpContext);
|
||
|
||
var response = _WmCustomService.AddWmCustom(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新客户信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmcustom:edit")]
|
||
[Log(Title = "客户信息", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateWmCustom([FromBody] WmCustomDto parm)
|
||
{
|
||
var modal = parm.Adapt<WmCustom>().ToUpdate(HttpContext);
|
||
var response = _WmCustomService.UpdateWmCustom(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除客户信息
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "wmsManagement:wmcustom:delete")]
|
||
[Log(Title = "客户信息", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteWmCustom(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _WmCustomService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |