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.

127 lines
3.3 KiB
C#

using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
namespace DS.WMS.OpApi.Controllers;
/// <summary>
/// 舱单-服务
/// </summary>
public class ShippingBillController : ApiController
{
private readonly IShippingBillService _invokeService;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="invokeService"></param>
public ShippingBillController(IShippingBillService invokeService)
{
_invokeService = invokeService;
}
/// <summary>
/// 舱单列表
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost]
[Route("GetShippingBillShortList")]
public async Task<DataResult<List<ShippingBillShortRes>>> GetShippingBillShortList([FromQuery] string id)
{
var res = await _invokeService.GetShippingBillShortList(id);
return res;
}
/// <summary>
/// 列表
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
[Route("GetShippingBillList")]
public DataResult<List<ShippingBillRes>> GetShippingBillList([FromBody] PageRequest request)
{
var res = _invokeService.GetListByPage(request);
return res;
}
/// <summary>
/// 编辑
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
[HttpPost]
[Route("EditShippingBill")]
public DataResult EditShippingBill([FromBody] ShippingBillReq model)
{
var res = _invokeService.EditShippingBill(model);
return res;
}
/// <summary>
/// 批量保存
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SaveShippingBillAsync")]
public async Task<DataResult> SaveShippingBillAsync([FromBody] List<ShippingBillReq> req)
{
var res = await _invokeService.SaveShippingBillAsync(req);
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("GetShippingBillInfo")]
public DataResult<ShippingBillRes> GetShippingBillInfo([FromQuery] string id)
{
var res = _invokeService.GetShippingBillInfo(id);
return res;
}
/// <summary>
/// 删除
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
[Route("DelShippingBill")]
public DataResult DelShippingBill([FromQuery] string id)
{
var res = _invokeService.DelShippingBill(id);
return res;
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("BatchDelShippingBill")]
public DataResult BatchDelShippingBill([FromBody] IdModel req)
{
var res = _invokeService.BatchDelShippingBill(req);
return res;
}
/// <summary>
/// 舱单发送
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
[Route("SendShippingBill")]
public async Task<DataResult<string>> SendShippingBill([FromBody] ShippingBillSendReq req)
{
var res = await _invokeService.SendShippingBill(req);
return res;
}
}