using Azure.Storage.Blobs.Models;
using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Owin.Security.Provider;
using Org.BouncyCastle.Crypto;
using SqlSugar;
namespace DS.WMS.OpApi.Controllers
{
///
/// 舱位管理
///
public class BookingSlotServiceController : ApiController
{
private readonly IBookingSlotService _bookingSlotService;
public BookingSlotServiceController(IBookingSlotService bookingSlotService)
{
_bookingSlotService = bookingSlotService;
}
#region 舱位接收保存、取消接口
///
/// 舱位接收保存、取消接口
///
/// 请求详情(JSON)
/// BC附件
/// BC修改附件
///
[HttpPost]
[Route("ApiReceive")]
public async Task> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null)
{
return await _bookingSlotService.ApiReceive(jsonData, file, modifyFile);
}
#endregion
#region 获取舱位详情
///
/// 获取舱位详情
///
/// 舱位ID
/// 返回详情
[HttpGet]
[Route("Detail")]
public async Task> Detail(long id)
{
return await _bookingSlotService.Detail(id);
}
#endregion
#region 查询可用的舱位及箱子列表
///
/// 查询可用的舱位及箱子列表
///
/// 筛选条件1:舱位信息、箱型
/// 筛选条件2:舱位主键列表
/// 筛选条件3:分页
/// 可用的舱位列表(含可用的箱子列表)
[HttpGet]
[Route("GetAvailableSlots")]
public async Task>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
List slotIdListInput = null,
PageWithTotal pageInfo = null)
{
return await _bookingSlotService.GetAvailableSlots(slotInput, slotIdListInput, pageInfo);
}
#endregion
#region 检查指定订舱记录,是否可以引入舱位列表
///
/// 检查指定订舱记录,是否可以引入舱位列表
///
/// 待引入的舱位列表
/// 待关联的订舱记录
/// (指定订舱记录是否已经引入过舱位数据,现有舱位及箱子是否满足需求,提示信息)
[HttpPost]
[Route("CheckImportSlots")]
public async Task<(bool isExists, bool isEnough, string message)> CheckImportSlots(List slots, long bookingOrderId)
{
return await _bookingSlotService.CheckImportSlots(slots, bookingOrderId);
}
#endregion
#region 为指定订舱记录引入舱位信息
///
/// 为指定订舱记录引入舱位信息
///
/// 待引入的舱位列表
/// 待关联的订舱记录
/// 是否进行剩余量检查
/// 额外的用于生成管理记录的信息
/// (是否成功,提示消息)
[HttpPost]
[Route("ImportSlots")]
public async Task<(bool isSuccess, string message)> ImportSlots(List slots, long bookingOrderId, bool isCheck, BookingGenerateDto generateModel = null)
{
return await _bookingSlotService.ImportSlots(slots, bookingOrderId, isCheck, generateModel);
}
#endregion
#region 舱位库存台账
///
/// 舱位库存台账
///
/// 请求参数
/// 返回列表
[HttpPost]
[Route("PageStock")]
public async Task PageStock([FromBody] BookingSlotStockPageInput input)
{
return await _bookingSlotService.PageStock(input);
}
#endregion
#region 舱位库存刷新
///
/// 舱位库存刷新
///
/// 请求参数
/// 返回列表
[HttpPost]
[Route("RefreshStock")]
public async Task RefreshStock([FromBody] BookingSlotStockUpdateModel input)
{
await _bookingSlotService.RefreshStock(input);
}
#endregion
#region 保存舱位
///
/// 保存舱位
///
/// 舱位详情
/// 返回输出
[HttpPost]
[Route("Save")]
public async Task> Save([FromBody] BookingSlotBaseSaveInput input)
{
return await _bookingSlotService.Save(input);
}
#endregion
#region 获取附件
///
/// 获取附件
///
/// 舱位主键
/// 返回附件列表
[HttpGet]
[Route("GetFile")]
public async Task>> GetFile(long id)
{
return await _bookingSlotService.GetFile(id);
}
#endregion
#region 分页查询订舱舱位
///
/// 分页查询订舱舱位
///
///
///
[HttpPost]
[Route("Page")]
public async Task Page([FromBody] BookingSlotBasePageInput input)
{
return await _bookingSlotService.Page(input);
}
#endregion
#region 舱位接收保存、取消接口
///
/// 舱位接收保存、取消接口
///
///
///
///
///
[HttpPost]
[Route("InnerApiReceive")]
public async Task InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null)
{
return await _bookingSlotService.InnerApiReceive(dto, file, modifyFile);
}
#endregion
#region 获取舱位变更比对结果
///
/// 获取舱位变更比对结果
///
/// 舱位主键
/// 批次号
/// 返回舱位变更比对结果
[HttpGet]
[Route("GetSlotCompareResult")]
public async Task> GetSlotCompareResult(long id, string batchNo)
{
return await _bookingSlotService.GetSlotCompareResult(id, batchNo);
}
#endregion
#region 导入舱位
///
/// 导入舱位
///
/// 导入舱位文件
/// 返回回执
[HttpPost]
[Route("ImportSlotFromFile")]
public async Task ImportSlotFromFile(IFormFile file)
{
return await _bookingSlotService.ImportSlotFromFile(file);
}
#endregion
#region 生成订舱订单
///
/// 生成订舱订单
///
/// 生成订舱订单请求
/// 返回回执
[HttpPost]
[Route("CreateBookingOrder")]
public async Task CreateBookingOrder([FromBody] BookingGenerateDto model)
{
return await _bookingSlotService.CreateBookingOrder(model);
}
#endregion
#region 检索舱位对应的订舱订单(BY 舱位主键)
///
/// 检索舱位对应的订舱订单(BY 舱位主键)
///
///
/// 返回回执
[HttpGet]
[Route("SearchBookingSlotWithOrderById")]
public async Task SearchBookingSlotWithOrderById(long id)
{
return await _bookingSlotService.SearchBookingSlotWithOrderById(id);
}
#endregion
#region 检索舱位对应的订舱订单(BY 订舱编号)
///
/// 检索舱位对应的订舱订单(BY 订舱编号)
///
/// 订舱编号
/// 租户ID
/// 返回回执
[HttpGet]
[Route("SearchBookingSlotWithOrderByNo")]
public async Task SearchBookingSlotWithOrderByNo(string slotBookingNo, long tenantId)
{
return await _bookingSlotService.SearchBookingSlotWithOrderByNo(slotBookingNo, tenantId);
}
#endregion
#region 请求BC比对
///
/// 请求BC比对
///
/// BC详情
/// BC变更后详情
/// 返回回执
[HttpPost]
[Route("ExcuteCompare")]
public async Task ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto)
{
return await _bookingSlotService.ExcuteCompare(bcSrcDto, bcTargetDto);
}
#endregion
#region 推送BC变更比对
///
/// 推送BC变更比对
///
/// 原舱位详情
/// 变更后舱位详情
/// 舱位主键
/// 请求批次号用来区分对应的哪个批次任务
///
[HttpPost]
[Route("PushCompareBCInfo")]
public async Task PushCompareBCInfo(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId, string reqBatchNo)
{
await _bookingSlotService.PushCompareBCInfo(bcSrcDto, bcTargetDto, slotId, reqBatchNo);
}
#endregion
#region 估算差异重要提醒
///
/// 估算差异重要提醒
///
/// 原舱位详情
/// 新舱位详情
/// 舱位ID
///
[HttpPost]
[Route("MeasureDiffCautionTask")]
public async Task MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId)
{
await _bookingSlotService.MeasureDiffCautionTask(bcSrcDto, bcTargetDto, slotId);
}
#endregion
#region 订舱编号检索舱位信息
///
/// 订舱编号检索舱位信息
///
/// 订舱编号
/// 船公司ID
///
[HttpGet]
[Route("QueryBookingSlot")]
public async Task QueryBookingSlot(string slotBookingNo, string CarrierId)
{
return await _bookingSlotService.QueryBookingSlot(slotBookingNo, CarrierId);
}
#endregion
#region 获取舱位详情列表
///
/// 获取舱位详情列表
///
/// 舱位ID组
/// 返回舱位详情
[HttpPost]
[Route("GetSlotList")]
public async Task> GetSlotList(long[] ids)
{
return await _bookingSlotService.GetSlotList(ids);
}
#endregion
#region 获取合票详情(生成合票需要先调此方法)
///
/// 获取合票详情(生成合票需要先调此方法)
///
///
///
[HttpPost]
[Route("GetMergeList")]
public async Task GetMergeList(QueryMergeSlotDto model)
{
return await _bookingSlotService.GetMergeList(model);
}
#endregion
#region 生成合票订舱订单
///
/// 生成合票订舱订单
///
/// 生成订舱订单请求
/// 返回回执
[HttpPost]
[Route("MergeCreateBookingOrder")]
public async Task MergeCreateBookingOrder(BookingGenerateDto model)
{
return await _bookingSlotService.MergeCreateBookingOrder(model);
}
#endregion
}
}