using DS.Module.Core;
using DS.Module.Core.Data;
using DS.WMS.ContainerManagement.Info.Dtos;
using DS.WMS.ContainerManagement.Info.Entity;
using DS.WMS.ContainerManagement.Info.Interface;
using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.Op.View;
using Microsoft.AspNetCore.Mvc;
namespace DS.WMS.ContainerManagementApi.Controllers;
///
/// 单程业务 租出
///
public class CM_RentOneWayController : ApiController
{
private readonly ICM_RentOneWayService _invokeService;
///
/// 构造函数
///
///
public CM_RentOneWayController(ICM_RentOneWayService invokeService)
{
_invokeService = invokeService;
}
///
/// 列表
///
///
///
[HttpPost]
[Route("GetCM_RentOneWayList")]
public async Task>> GetCM_RentOneWayList([FromBody] PageRequest request)
{
var res = await _invokeService.GetListByPage(request);
return res;
}
///
/// 直接编辑
///
///
[HttpPost]
[Route("EditCM_RentOneWay")]
public Task EditCM_RentOneWay([FromBody] CM_RentOneWayReq model)
{
var res = _invokeService.EditCM_RentOneWay(model);
return res;
}
///
/// 查看单程业务详情
///
///
///
[HttpGet]
[Route("GetCM_RentOneWay")]
public DataResult GetCM_RentOneWay([FromQuery] string id)
{
var res = _invokeService.GetCM_RentOneWay(id);
return res;
}
///
/// 删除单程业务
///
/// 删除单程业务
///
[HttpPost, Route("DeleteCM_RentOneWay")]
public async Task DeleteCM_RentOneWayAsync([FromBody] IdModel model)
{
if (!ModelState.IsValid)
return DataResult.Failed(ModelState.GetErrorMessage(), MultiLanguageConst.IllegalRequest);
return await _invokeService.DeleteCM_RentOneWayAsync(model.Ids);
}
///
/// 单程_确认
///
///
///
[HttpPost]
[Route("CM_RentOneWay_Confirm")]
public Task CM_RentOneWay_Confirm([FromBody] IdModel model)
{
if (string.IsNullOrWhiteSpace(model.Id))
{
var res = _invokeService.CM_RentOneWay_Confirm(model.Ids);
return res;
}
else
{
var res = _invokeService.CM_RentOneWay_Confirm(model.Id, model.Ids);
return res;
}
}
///
/// 单程业务_取消
///
///
///
[HttpPost]
[Route("CM_RentOneWay_Cancel")]
public Task CM_RentOneWay_Cancel([FromBody] IdModel model)
{
if (string.IsNullOrWhiteSpace(model.Id))
{
var res = _invokeService.CM_RentOneWay_Cancel(model.Ids);
return res;
}
else
{
var res = _invokeService.CM_RentOneWay_Cancel(model.Id, model.Ids);
return res;
}
}
///
/// 单程业务_添加
///
///
///
[HttpPost]
[Route("CM_RentOneWay_AddCtn")]
public async Task CM_RentOneWay_AddCtn([FromBody] IdModel model)
{
return await _invokeService.CM_RentOneWay_AddCtn(long.Parse(model.Id), model.Ids);
//return res;
}
}