You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.2 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Interface;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.FeeApi.Controllers
{
/// <summary>
/// 费用代码服务
/// </summary>
public class FeeCodeController : ApiController
{
private readonly IFeeCodeService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public FeeCodeController(IFeeCodeService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetFeeCodeList")]
public DataResult<List<FeeCodeRes>> GetFeeCodeList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditFeeCode")]
public DataResult EditFeeCode([FromBody] FeeCodeReq model)
{
var res = _invokeService.EditFeeCode(model);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetFeeCodeInfo")]
public DataResult<FeeCodeRes> GetFeeCodeInfo([FromQuery] string id)
{
var res = _invokeService.GetFeeCodeInfo(id);
return res;
}
/// <summary>
/// 按Excel导入费用代码信息
/// </summary>
/// <param name="file">Excel文件</param>
/// <returns></returns>
[HttpPost]
[Route("ImportFeeCodeByExcel")]
public async Task<DataResult<string>> ImportFeeCodeByExcel(IFormFile file)
{
var res = await _invokeService.ImportFeeCodeByExcel(file);
return res;
}
}
}