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.

282 lines
11 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using DS.Module.Core;
using DS.Module.Core.Data;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.Op.Interface
{
/// <summary>
/// 舱位管理
/// </summary>
public interface IBookingSlotService
{
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="jsonData">请求详情(JSON)</param>
/// <param name="file">BC附件</param>
/// <param name="modifyFile">BC修改附件</param>
/// <returns></returns>
Task<DataResult<long>> ApiReceive(string jsonData, IFormFile file = null, IFormFile modifyFile = null);
/// <summary>
/// 舱位接收保存、取消接口(任务台使用)
/// </summary>
Task<DataResult<BookingSlotBase?>> ApiReceiveTask(TaskFlowDataContext dataContext);
/// <summary>
/// 获取舱位详情
/// </summary>
/// <param name="id">舱位ID</param>
/// <returns>返回详情</returns>
Task<DataResult<BookingSlotBaseSaveOutput>> Detail(long id);
// <summary>
/// 分页查询可用的舱位及箱子列表
/// </summary>
/// <param name="input">可选:舱位查询条件</param>
/// <param name="pageInfo">可选:分页信息</param>
Task<DataResult<SqlSugarPagedList<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto input, PageWithTotal pageInfo);
/// <summary>
/// 查询可用的舱位及箱子列表
/// </summary>
/// <param name="slotInput">筛选条件1舱位信息、箱型</param>
/// <param name="slotIdListInput">筛选条件2舱位主键列表</param>
/// <param name="pageInfo">筛选条件3分页</param>
/// <returns>可用的舱位列表(含可用的箱子列表)</returns>
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableSlots(BookingSlotBaseDto slotInput = null,
List<long> slotIdListInput = null,
PageWithTotal pageInfo = null);
/// <summary>
/// 检查指定订舱记录,是否可以引入舱位列表
/// </summary>
/// <param name="slots">待引入的舱位列表</param>
/// <param name="bookingOrderId">待关联的订舱记录</param>
/// <returns>(指定订舱记录是否已经引入过舱位数据,现有舱位及箱子是否满足需求,提示信息)</returns>
Task<(bool isExists, bool isEnough, string message)> CheckImportSlots(List<BookingSlotBaseWithCtnDto> slots, long bookingOrderId);
/// <summary>
/// 为指定订舱记录引入舱位信息
/// </summary>
/// <param name="model">引入的舱位请求参数</param>
/// <returns>(是否成功,提示消息)</returns>
Task<DataResult<string>> ImportSlots(ImportSlotsDto model);
/// <summary>
/// 库存台账查询
/// </summary>
/// <param name="input">查询条件</param>
/// <returns></returns>
Task<DataResult<List<BookingSlotStockDto>>> GetPageStockAsync(PageRequest querySearch);
/// <summary>
/// 刷新库存
/// </summary>
/// <param name="input">请求参数</param>
/// <returns>返回回执</returns>
Task<DataResult<string>> RefreshStock(BookingSlotStockUpdateModel input);
/// <summary>
/// 保存舱位
/// </summary>
/// <param name="input">舱位详情</param>
/// <returns>返回输出</returns>
Task<DataResult<BookingSlotBaseSaveOutput>> Save(BookingSlotBaseSaveInput input);
/// <summary>
/// 获取附件
/// </summary>
/// <param name="id">舱位主键</param>
/// <returns>返回附件列表</returns>
Task<DataResult<List<OpFileRes>>> GetFile(long id);
/// <summary>
/// 舱位台账查询
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns></returns>
Task<DataResult<List<BookingSlotBaseDto>>> GetPageAsync(PageRequest querySearch);
/// <summary>
/// 舱位接收保存、取消接口
/// </summary>
/// <param name="dto"></param>
/// <param name="file"></param>
/// <param name="modifyFile"></param>
/// <returns></returns>
Task<DataResult<BookingSlotBase?>> InnerApiReceive(BookingSlotBaseApiDto dto, DynameFileInfo file = null, DynameFileInfo modifyFile = null);
/// <summary>
/// 获取舱位变更比对结果
/// </summary>
/// <param name="id">舱位主键</param>
/// <param name="batchNo">批次号</param>
/// <returns>返回舱位变更比对结果</returns>
Task<DataResult<List<CompareResultDetailInfo>>> GetSlotCompareResult(long id, string batchNo);
/// <summary>
/// 导入舱位
/// </summary>
/// <param name="file">导入舱位文件</param>
/// <returns>返回回执</returns>
Task<DataResult<List<object>>> ImportSlotFromFile(IFormFile file);
/// <summary>
/// 生成订舱订单
/// </summary>
/// <param name="model">生成订舱订单请求</param>
/// <returns>返回回执</returns>
Task<DataResult<long>> CreateBookingOrder(BookingGenerateDto model);
/// <summary>
/// 检索舱位对应的订舱订单(BY 舱位主键)
/// </summary>
/// <param name="id"></param>
/// <returns>返回回执</returns>
Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderById(long id);
/// <summary>
/// 检索舱位对应的订舱订单(BY 订舱编号)
/// </summary>
/// <param name="slotBookingNo">订舱编号</param>
/// <param name="tenantId">租户ID</param>
/// <returns>返回回执</returns>
Task<DataResult<BookingSlotWithOrderDto>> SearchBookingSlotWithOrderByNo(string slotBookingNo, long tenantId);
/// <summary>
/// 请求BC比对
/// </summary>
/// <param name="bcSrcDto">BC详情</param>
/// <param name="bcTargetDto">BC变更后详情</param>
/// <returns>返回回执</returns>
Task<DataResult<TaskManageExcuteResultDto>> ExcuteCompare(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto);
/// <summary>
/// 推送BC变更比对
/// </summary>
/// <param name="bcSrcDto">原舱位详情</param>
/// <param name="bcTargetDto">变更后舱位详情</param>
/// <param name="slotId">舱位主键</param>
/// <param name="reqBatchNo">请求批次号用来区分对应的哪个批次任务</param>
/// <returns></returns>
Task<DataResult<string>> PushCompareBCInfo(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId, string reqBatchNo);
/// <summary>
/// 估算差异重要提醒
/// </summary>
/// <param name="bcSrcDto">原舱位详情</param>
/// <param name="bcTargetDto">新舱位详情</param>
/// <param name="slotId">舱位ID</param>
/// <returns></returns>
Task<DataResult> MeasureDiffCautionTask(ParserBCInfoDto bcSrcDto, ParserBCInfoDto bcTargetDto, long slotId);
/// <summary>
/// 订舱编号检索舱位信息
/// </summary>
/// <param name="slotBookingNo">订舱编号</param>
/// <param name="CarrierId">船公司ID</param>
/// <returns></returns>
Task<DataResult<long>> QueryBookingSlot(string slotBookingNo, string CarrierId);
/// <summary>
/// 获取舱位详情列表
/// </summary>
/// <param name="ids">舱位ID组</param>
/// <returns>返回舱位详情</returns>
Task<DataResult<List<BookingSlotBaseSaveOutput>>> GetSlotList(long[] ids);
/// <summary>
/// 获取合票详情(生成合票需要先调此方法)
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
Task<DataResult<BookingSlotMergeResultDto>> GetMergeList(QueryMergeSlotDto model);
/// <summary>
/// 生成合票订舱订单
/// </summary>
/// <param name="model">生成订舱订单请求</param>
/// <returns>返回回执</returns>
Task<DataResult<TaskManageOrderResultDto>> MergeCreateBookingOrder(BookingGenerateDto model);
/// <summary>
/// 导出舱位为Excel
/// </summary>
/// <param name="querySearch">请求参数</param>
/// <returns></returns>
Task<DataResult<string>> ExportOrder(PageRequest querySearch);
/// <summary>
/// 作废舱位(可以批量)
/// </summary>
/// <param name="ids">舱位主键数组</param>
/// <returns>返回回执</returns>
Task<DataResult> Delete(long[] ids);
/// <summary>
/// 查询指定舱位可用的箱子列表
/// </summary>
/// <param name="slotId">舱位主键</param>
/// <returns>可用的箱子列表</returns>
Task<DataResult<List<BookingSlotCtnDto>>> GetAvailableCtnsBySlot(long slotId);
/// <summary>
/// 生成订舱
/// </summary>
/// <param name="bookingSlotBase">舱位详情</param>
/// <param name="bookingSlotFileList">舱位附件列表</param>
/// <param name="generateModel">订舱请求详情</param>
/// <param name="masterBookingSlotNo">合票的主舱位提单号(合票时必传)</param>
/// <returns>返回订舱ID</returns>
Task<long> GenerateBookingOrder(BookingSlotBase bookingSlotBase, List<OpFileRes> bookingSlotFileList, BookingGenerateDto generateModel, string masterBookingSlotNo);
/// <summary>
/// 获取现舱位查询
/// </summary>
/// <param name="querySearch">查询条件</param>
/// <returns></returns>
Task<DataResult<List<BookingSlotBaseWithCtnDto>>> GetAvailableBookingSlots(PageRequest<string> querySearch);
/// <summary>
/// 引入现舱关联海运出口
/// </summary>
/// <param name="model">请求参数</param>
/// <returns></returns>
Task<DataResult<string>> BringInBookingSlotToOrder(BringInBookingSlotReq model);
/// <summary>
/// 获取舱位用途配置列表
/// </summary>
/// <returns></returns>
Task<DataResult<List<BookingSlotUseToConfigDto>>> GetSlotUseToConfig();
/// <summary>
/// 舱位对外开放更新接口
/// </summary>
/// <param name="req">舱位更新请求</param>
/// <returns>返回回执</returns>
Task<DataResult> BookingSlotOpenEdit(BookingSlotOpenEditReq req);
/// <summary>
/// 同步订单更新舱位
/// </summary>
/// <param name="req">同步订单更新舱位请求</param>
/// <returns>返回回执</returns>
Task<DataResult> SyncBookingOrderToSlot(BookingOrderToSlotDto req);
}
}