using DS.Module.Core;
using DS.Module.Core.Attributes;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Org.BouncyCastle.Crypto;
namespace DS.WMS.OpApi.Controllers
{
///
/// 预订舱马士基API合约订舱
///
public class SpaceBookingMSKAPIController : ApiController
{
private readonly ISpaceBookingMSKAPIService _spaceBookingMSKAPIService;
public SpaceBookingMSKAPIController(ISpaceBookingMSKAPIService spaceBookingMSKAPIService)
{
_spaceBookingMSKAPIService = spaceBookingMSKAPIService;
}
#region 检索海运船期详情
///
/// 检索海运船期详情
///
/// 请求船期详情
/// 返回船期结果
[HttpPost]
[Route("SearchShipSailingSchedule")]
public async Task>> SearchShipSailingSchedule(QueryShipSailingScheduleDto model)
{
return await _spaceBookingMSKAPIService.SearchShipSailingSchedule(model);
}
#endregion
#region 发送马士基订舱请求
///
/// 发送马士基订舱请求
///
/// 请求订舱详情
/// 返回检索结果
[HttpPost]
[Route("SendMSKBooking")]
public async Task> SendMSKBooking(MSKBookingDto model)
{
return await _spaceBookingMSKAPIService.SendMSKBooking(model);
}
#endregion
#region 检索商品名称
///
/// 检索商品名称
///
/// 请求详情
/// 返回检索结果
[HttpPost]
[Route("SearchCommodities")]
public async Task>> SearchCommodities(QueryCommoditiesDto model)
{
return await _spaceBookingMSKAPIService.SearchCommodities(model);
}
#endregion
#region 检索始发地、目的港口信息
///
/// 检索始发地、目的港口信息
///
/// 请求详情
/// 返回检索结果
[HttpPost]
[Route("SearchLocations")]
public async Task>> SearchLocations(QueryLocationsDto model)
{
return await _spaceBookingMSKAPIService.SearchLocations(model);
}
#endregion
#region 查询台账
///
/// 查询台账
///
///
/// 返回台账结果
[HttpPost]
[Route("GetPageAsync")]
public async Task>> GetPageAsync([FromBody] PageRequest querySearch)
{
return await _spaceBookingMSKAPIService.GetPageAsync(querySearch);
}
#endregion
#region 获取马士基API订舱详情
///
/// 获取马士基API订舱详情
///
/// 马士基API订舱ID
/// 返回详情
[HttpGet]
[Route("GetInfo")]
public async Task> GetInfo(long id)
{
return await _spaceBookingMSKAPIService.GetInfo(id);
}
#endregion
#region 保存
///
/// 保存
///
/// 请求订舱详情
/// 返回ID
[HttpPost]
[Route("Save")]
public async Task> Save([FromBody] MSKBookingDto model)
{
return await _spaceBookingMSKAPIService.Save(model);
}
#endregion
#region 删除
///
/// 删除
///
/// 请求订舱ID
///
[HttpGet]
[Route("Delete")]
public async Task> Delete(long id)
{
return await _spaceBookingMSKAPIService.Delete(id);
}
#endregion
#region 批量发送API前调取校验预警
///
/// 批量发送API前调取校验预警
///
/// 马士基API订舱ID组
/// 返回提示信息
[HttpPost]
[Route("CheckWarningBatchSend")]
public async Task> CheckWarningBatchSend([FromBody] long[] ids)
{
return await _spaceBookingMSKAPIService.CheckWarningBatchSend(ids);
}
#endregion
#region 批量发送
///
/// 批量发送
///
/// 马士基API订舱ID组
/// 返回执行结果消息
[HttpPost]
[Route("BatchSend")]
public async Task> BatchSend([FromBody] long[] ids)
{
return await _spaceBookingMSKAPIService.BatchSend(ids);
}
#endregion
#region 批量复制前调取校验预警
///
/// 批量复制前调取校验预警
///
/// 马士基API批量复制指定数据
/// 返回提示信息
[HttpPost]
[Route("CheckWarningBatchCopy")]
public async Task> CheckWarningBatchCopy(MSKAPIBookingCopyDto model)
{
return await _spaceBookingMSKAPIService.CheckWarningBatchCopy(model);
}
#endregion
#region 批量复制
///
/// 批量复制
///
/// 马士基API批量复制指定数据
/// 返回执行结果消息
[HttpPost]
[Route("BatchCopy")]
public async Task> BatchCopy(MSKAPIBookingCopyDto model)
{
return await _spaceBookingMSKAPIService.BatchCopy(model);
}
#endregion
#region 同步BC状态(BC,Cancellation)
///
/// 同步BC状态(BC,Cancellation)
///
/// 提单号
/// 租户ID
/// 操作类型 BC-同步BC状态 Cancellation-同步取消状态
/// 返回回执
[HttpGet]
[Route("SyncBCInfo")]
public async Task> SyncBCInfo(string mblno, long tenantId, string opTypeName = "BookingConfirmation")
{
return await _spaceBookingMSKAPIService.SyncBCInfo(mblno, tenantId, opTypeName);
}
#endregion
#region 获取初始化页面默认值
///
/// 获取初始化页面默认值
///
/// 返回详情
[HttpGet]
[Route("GetInitInfo")]
public async Task> GetInitInfo()
{
return await _spaceBookingMSKAPIService.GetInitInfo();
}
#endregion
#region 获取预订舱途径选择
///
/// 获取预订舱途径选择
///
/// 返回结果
[HttpGet]
[Route("ChannelSelectShow")]
public async Task>> GetBookingChannelSelectShow()
{
return await _spaceBookingMSKAPIService.GetBookingChannelSelectShow();
}
#endregion
#region 生成订舱报告邮件并自动转发
///
/// 生成订舱报告邮件并自动转发
///
///
[HttpGet("GenerateTimerReportEmail")]
public async Task> GenerateTimerReportEmail()
{
return await _spaceBookingMSKAPIService.GenerateTimerReportEmail();
}
#endregion
#region 批量取消定时订舱时间
///
/// 批量取消定时订舱时间
///
/// 马士基API订舱ID组
/// 返回回执
[HttpPost("BatchCancelTimerBooking")]
public async Task> BatchCancelTimerBooking([FromBody] long[] ids)
{
return await _spaceBookingMSKAPIService.BatchCancelTimerBooking(ids);
}
#endregion
#region 获取定时订舱方案列表
///
/// 获取定时订舱方案列表
///
///
[HttpGet("GetTimerSchemeList")]
public async Task>> GetTimerSchemeList()
{
return await _spaceBookingMSKAPIService.GetTimerSchemeList();
}
#endregion
#region 批量设定定时订舱时间
///
/// 批量设定定时订舱时间
///
/// 请求详情
/// 返回回执
[HttpPost("BatchSetupTimerBooking")]
public async Task> BatchSetupTimerBooking([FromBody] MSKAPITimerBookingDto model)
{
return await _spaceBookingMSKAPIService.BatchSetupTimerBooking(model);
}
#endregion
#region 发送马士基订舱请求
///
/// 发送马士基订舱请求
///
/// 请求订舱ID
/// 返回检索结果
[HttpGet("SendMSKBookingById"), AllowAnonymous, ApiUser(ApiCode = "BCTaskManage")]
public async Task> SendMSKBookingById([FromQuery] long id)
{
return await _spaceBookingMSKAPIService.SendMSKBookingById(id);
}
#endregion
}
}