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.

115 lines
4.1 KiB
C#

using DS.Module.Core;
using DS.Module.DjyServiceStatus;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
using DS.WMS.Core.TaskPlat.Method;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Owin.Security.Provider;
namespace DS.WMS.TaskApi.Controllers
{
/// <summary>
/// 任务台-BC子任务相关接口
/// </summary>
public class TaskManageBCController : ApiController
{
private readonly ITaskManageBCService _taskManageBCService;
public TaskManageBCController(ITaskManageBCService taskManageBCService)
{
_taskManageBCService = taskManageBCService;
}
/// <summary>
/// 通过任务主键获取BC详情
/// </summary>
/// <param name="taskId">BC任务主键</param>
[HttpPost("GetInfoByTaskId")]
public async Task<DataResult<TaskManageOrderResultDto>> GetInfoByTaskId(long taskId)
{
var result = await _taskManageBCService.GetInfoByTaskId(taskId);
return result;
}
/// <summary>
/// 通过任务信息BC生成订舱或舱位
/// </summary>
/// <param name="model">生成订舱或者舱位请求</param>
/// <returns>返回回执</returns>
[HttpPost("CreateBookingAndSlot")]
public async Task<DataResult<TaskManageOrderResultDto>> CreateBookingAndSlot([FromBody] BookingOrSlotGenerateDto model)
{
var result = await _taskManageBCService.CreateBookingAndSlot(model);
return result;
}
#region 获取当前比对结果
/// <summary>
/// 获取当前比对结果
/// </summary>
/// <param name="taskId">BC任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("GetCompareResult")]
public async Task<DataResult<List<CompareResultDetailInfo>>> GetCompareResult(long taskId)
{
return await _taskManageBCService.GetCompareResult(taskId);
}
#endregion
3 months ago
#region 同步舱位变更
/// <summary>
/// 同步舱位变更
/// </summary>
/// <param name="taskPKId">BC任务主键</param>
/// <returns>返回回执</returns>
[HttpGet("SyncBookingSlotChange")]
public async Task<DataResult> SyncBookingSlotChange(long taskPKId)
{
return await _taskManageBCService.SyncBookingSlotChange(taskPKId);
}
#endregion
#region 读取BC详情
/// <summary>
/// 读取BC详情
/// </summary>
/// <param name="carrierCode">船公司代码</param>
/// <param name="file">BC文件</param>
/// <returns>返回解析详情</returns>
[HttpPost("GetReadBC")]
public async Task<DataResult<ParserBCInfoDto>> GetReadBC(string carrierCode, IFormFile file)
{
return await _taskManageBCService.GetReadBC(carrierCode, file);
}
#endregion
#region 读取BC擦写后文件流
/// <summary>
/// 读取BC擦写后文件流
/// </summary>
/// <param name="carrierCode">船公司代码</param>
/// <param name="file">BC文件</param>
/// <returns>返回解析详情</returns>
[HttpPost("GetModifyBCFile")]
public async Task<DataResult<byte[]>> GetModifyBCFile(string carrierCode, IFormFile file)
{
return await _taskManageBCService.GetModifyBCFile(carrierCode, file);
}
#endregion
#region 上传BC文件并触发执行BC任务
/// <summary>
/// 上传BC文件并触发执行BC任务
/// </summary>
/// <param name="taskBaseId">任务主键</param>
/// <param name="carrierCode">船公司代码</param>
/// <param name="file">BC文件</param>
[HttpPost("UploadBcThenRunTask")]
public async Task<DataResult> UploadBcThenRunTask( [FromForm] string carrierCode, [FromForm] IFormFile file)
{
return await _taskManageBCService.UploadBcThenRunTask( carrierCode, file);
}
#endregion
}
}