|
|
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
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 舱位管理
|
|
|
/// </summary>
|
|
|
public class BookingSlotServiceController : ApiController
|
|
|
{
|
|
|
private readonly IBookingSlotService _bookingSlotService;
|
|
|
|
|
|
/// <summary>
|
|
|
///
|
|
|
/// </summary>
|
|
|
/// <param name="bookingSlotService"></param>
|
|
|
public BookingSlotServiceController(IBookingSlotService bookingSlotService)
|
|
|
{
|
|
|
_bookingSlotService = bookingSlotService;
|
|
|
}
|
|
|
|
|
|
#region 舱位接收保存、取消接口
|
|
|
/// <summary>
|
|
|
/// 舱位接收保存、取消接口
|
|
|
/// </summary>
|
|
|
/// <param name="jsonData">请求详情(JSON)</param>
|
|
|
/// <param name="file">BC附件</param>
|
|
|
/// <param name="modifyFile">BC修改附件</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[Route("ApiReceive")]
|
|
|
public async Task<DataResult<long>> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null)
|
|
|
{
|
|
|
return await _bookingSlotService.ApiReceive(jsonData, null, null);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 获取舱位详情
|
|
|
/// <summary>
|
|
|
/// 获取舱位详情
|
|
|
/// </summary>
|
|
|
/// <param name="id">舱位ID</param>
|
|
|
/// <returns>返回详情</returns>
|
|
|
[HttpGet]
|
|
|
[Route("Detail")]
|
|
|
public async Task<DataResult<BookingSlotBaseSaveOutput>> Detail([FromQuery] long id)
|
|
|
{
|
|
|
return await _bookingSlotService.Detail(id);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 查询可用的舱位及箱子列表
|
|
|
/// <summary>
|
|
|
/// 查询可用的舱位及箱子列表
|
|
|
/// </summary>
|
|
|
/// <param name="slotInput">筛选条件1:舱位信息、箱型</param>
|
|
|
/// <param name="slotIdListInput">筛选条件2:舱位主键列表</param>
|
|
|
/// <param name="pageInfo">筛选条件3:分页</param>
|
|
|
/// <returns>可用的舱位列表(含可用的箱子列表)</returns>
|
|
|
[HttpPost]
|
|
|
[Route("GetAvailableSlots")]
|
|
|
public async Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableSlots([FromBody] BookingSlotBaseDto slotInput )
|
|
|
{
|
|
|
return await _bookingSlotService.GetAvailableSlots(slotInput, null, null);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 检查指定订舱记录,是否可以引入舱位列表
|
|
|
/// <summary>
|
|
|
/// 检查指定订舱记录,是否可以引入舱位列表
|
|
|
/// </summary>
|
|
|
/// <param name="slots">待引入的舱位列表</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpPost]
|
|
|
[Route("CheckImportSlots")]
|
|
|
public async Task<DataResult> CheckImportSlots([FromBody] List<BookingSlotBaseWithCtnDto> slots)
|
|
|
{
|
|
|
return null;//await _bookingSlotService.CheckImportSlots(slots, 0);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 为指定订舱记录引入舱位信息
|
|
|
/// <summary>
|
|
|
/// 为指定订舱记录引入舱位信息
|
|
|
/// </summary>
|
|
|
/// <param name="model">引入舱位参数</param>
|
|
|
/// <returns>(是否成功,提示消息)</returns>
|
|
|
[HttpPost]
|
|
|
[Route("ImportSlots")]
|
|
|
public async Task<DataResult<string>> ImportSlots([FromBody] ImportSlotsDto model)
|
|
|
{
|
|
|
return await _bookingSlotService.ImportSlots(model);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 舱位库存台账
|
|
|
/// <summary>
|
|
|
/// 舱位库存台账
|
|
|
/// </summary>
|
|
|
/// <param name="input">请求参数</param>
|
|
|
/// <returns>返回列表</returns>
|
|
|
[HttpPost]
|
|
|
[Route("PageStock")]
|
|
|
public async Task<DataResult<List<BookingSlotStockDto>>> PageStock([FromBody] PageRequest querySearch)
|
|
|
{
|
|
|
return await _bookingSlotService.GetPageStockAsync(querySearch);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 舱位库存刷新
|
|
|
/// <summary>
|
|
|
/// 舱位库存刷新
|
|
|
/// </summary>
|
|
|
/// <param name="input">请求参数</param>
|
|
|
/// <returns>返回列表</returns>
|
|
|
[HttpPost]
|
|
|
[Route("RefreshStock")]
|
|
|
public async Task<DataResult<string>> RefreshStock([FromBody] BookingSlotStockUpdateModel input)
|
|
|
{
|
|
|
return await _bookingSlotService.RefreshStock(input);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 保存舱位
|
|
|
/// <summary>
|
|
|
/// 保存舱位
|
|
|
/// </summary>
|
|
|
/// <param name="input">舱位详情</param>
|
|
|
/// <returns>返回输出</returns>
|
|
|
[HttpPost]
|
|
|
[Route("Save")]
|
|
|
public async Task<DataResult<BookingSlotBaseSaveOutput>> Save([FromBody] BookingSlotBaseSaveInput input)
|
|
|
{
|
|
|
return await _bookingSlotService.Save(input);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 获取附件
|
|
|
/// <summary>
|
|
|
/// 获取附件
|
|
|
/// </summary>
|
|
|
/// <param name="id">舱位主键</param>
|
|
|
/// <returns>返回附件列表</returns>
|
|
|
[HttpGet]
|
|
|
[Route("GetFile")]
|
|
|
public async Task<DataResult<List<OpFileRes>>> GetFile([FromQuery] long id)
|
|
|
{
|
|
|
return await _bookingSlotService.GetFile(id);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 分页查询订舱舱位
|
|
|
/// <summary>
|
|
|
/// 舱位台账查询
|
|
|
/// </summary>
|
|
|
/// <param name="querySearch">查询条件</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[Route("GetPage")]
|
|
|
public async Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch)
|
|
|
{
|
|
|
return await _bookingSlotService.GetPageAsync(querySearch);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 获取舱位变更比对结果
|
|
|
/// <summary>
|
|
|
/// 获取舱位变更比对结果
|
|
|
/// </summary>
|
|
|
/// <param name="id">舱位主键</param>
|
|
|
/// <param name="batchNo">批次号</param>
|
|
|
/// <returns>返回舱位变更比对结果</returns>
|
|
|
[HttpGet]
|
|
|
[Route("GetSlotCompareResult")]
|
|
|
public async Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult([FromQuery] long id, [FromQuery] string batchNo)
|
|
|
{
|
|
|
return null;//await _bookingSlotService.GetSlotCompareResult(id, batchNo);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 导入舱位
|
|
|
/// <summary>
|
|
|
/// 导入舱位
|
|
|
/// </summary>
|
|
|
/// <param name="file">导入舱位文件</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpPost]
|
|
|
[Route("ImportSlotFromFile")]
|
|
|
public async Task<DataResult> ImportSlotFromFile([FromBody] IFormFile file)
|
|
|
{
|
|
|
return null;//await _bookingSlotService.ImportSlotFromFile(file);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 生成订舱订单
|
|
|
/// <summary>
|
|
|
/// 生成订舱订单
|
|
|
/// </summary>
|
|
|
/// <param name="model">生成订舱订单请求</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpPost]
|
|
|
[Route("CreateBookingOrder")]
|
|
|
public async Task<DataResult> CreateBookingOrder([FromBody] BookingGenerateDto model)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.CreateBookingOrder(model);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 检索舱位对应的订舱订单(BY 舱位主键)
|
|
|
/// <summary>
|
|
|
/// 检索舱位对应的订舱订单(BY 舱位主键)
|
|
|
/// </summary>
|
|
|
/// <param name="id"></param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpGet]
|
|
|
[Route("SearchBookingSlotWithOrderById")]
|
|
|
public async Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById([FromQuery] long id)
|
|
|
{
|
|
|
return await _bookingSlotService.SearchBookingSlotWithOrderById(id);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 检索舱位对应的订舱订单(BY 订舱编号)
|
|
|
/// <summary>
|
|
|
/// 检索舱位对应的订舱订单(BY 订舱编号)
|
|
|
/// </summary>
|
|
|
/// <param name="slotBookingNo">订舱编号</param>
|
|
|
/// <param name="tenantId">租户ID</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpGet]
|
|
|
[Route("SearchBookingSlotWithOrderByNo")]
|
|
|
public async Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderByNo([FromQuery] string slotBookingNo, [FromQuery] long tenantId)
|
|
|
{
|
|
|
return null; //await _bookingSlotService.SearchBookingSlotWithOrderByNo(slotBookingNo, tenantId);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 请求BC比对
|
|
|
/// <summary>
|
|
|
/// 请求BC比对
|
|
|
/// </summary>
|
|
|
/// <param name="bcSrcDto">BC详情</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpPost]
|
|
|
[Route("ExcuteCompare")]
|
|
|
public async Task<DataResult<string>> ExcuteCompare([FromBody] ParserBCInfoDto bcSrcDto)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.ExcuteCompare(bcSrcDto, null);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 推送BC变更比对
|
|
|
/// <summary>
|
|
|
/// 推送BC变更比对
|
|
|
/// </summary>
|
|
|
/// <param name="bcSrcDto">原舱位详情</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[Route("PushCompareBCInfo")]
|
|
|
public async Task<DataResult<string>> PushCompareBCInfo([FromBody] ParserBCInfoDto bcSrcDto)
|
|
|
{
|
|
|
return null;// _bookingSlotService.PushCompareBCInfo(bcSrcDto, null, 0, "");
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 估算差异重要提醒
|
|
|
/// <summary>
|
|
|
/// 估算差异重要提醒
|
|
|
/// </summary>
|
|
|
/// <param name="bcSrcDto">原舱位详情</param>
|
|
|
/// <param name="bcTargetDto">新舱位详情</param>
|
|
|
/// <param name="slotId">舱位ID</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[Route("MeasureDiffCautionTask")]
|
|
|
public async Task<DataResult> MeasureDiffCautionTask([FromBody] ParserBCInfoDto bcSrcDto)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.MeasureDiffCautionTask(bcSrcDto, null, 0);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 订舱编号检索舱位信息
|
|
|
/// <summary>
|
|
|
/// 订舱编号检索舱位信息
|
|
|
/// </summary>
|
|
|
/// <param name="slotBookingNo">订舱编号</param>
|
|
|
/// <param name="CarrierId">船公司ID</param>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
[Route("QueryBookingSlot")]
|
|
|
public async Task<DataResult<long>> QueryBookingSlot([FromQuery] string slotBookingNo, [FromQuery] string CarrierId)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.QueryBookingSlot(slotBookingNo, CarrierId);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 获取舱位详情列表
|
|
|
/// <summary>
|
|
|
/// 获取舱位详情列表
|
|
|
/// </summary>
|
|
|
/// <param name="ids">舱位ID组</param>
|
|
|
/// <returns>返回舱位详情</returns>
|
|
|
[HttpPost]
|
|
|
[Route("GetSlotList")]
|
|
|
public async Task<DataResult<List<BookingSlotBaseSaveOutput>>> GetSlotList([FromBody] long[] ids)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.GetSlotList(ids);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 获取合票详情(生成合票需要先调此方法)
|
|
|
/// <summary>
|
|
|
/// 获取合票详情(生成合票需要先调此方法)
|
|
|
/// </summary>
|
|
|
/// <param name="model"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
[Route("GetMergeList")]
|
|
|
public async Task<DataResult<BookingSlotMergeResultDto>> GetMergeList([FromBody] QueryMergeSlotDto model)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.GetMergeList(model);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 生成合票订舱订单
|
|
|
/// <summary>
|
|
|
/// 生成合票订舱订单
|
|
|
/// </summary>
|
|
|
/// <param name="model">生成订舱订单请求</param>
|
|
|
/// <returns>返回回执</returns>
|
|
|
[HttpPost]
|
|
|
[Route("MergeCreateBookingOrder")]
|
|
|
public async Task<DataResult<TaskManageOrderResultDto>> MergeCreateBookingOrder([FromBody] BookingGenerateDto model)
|
|
|
{
|
|
|
return null;// await _bookingSlotService.MergeCreateBookingOrder(model);
|
|
|
}
|
|
|
#endregion
|
|
|
}
|
|
|
}
|