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
{
///
/// 任务台-BC子任务相关接口
///
public class TaskManageBCController : ApiController
{
private readonly ITaskManageBCService _taskManageBCService;
public TaskManageBCController(ITaskManageBCService taskManageBCService)
{
_taskManageBCService = taskManageBCService;
}
///
/// 通过任务主键获取BC详情
///
/// BC任务主键
[HttpPost("GetInfoByTaskId")]
public async Task> GetInfoByTaskId(long taskId)
{
var result = await _taskManageBCService.GetInfoByTaskId(taskId);
return result;
}
///
/// 通过任务信息(BC)生成订舱或舱位
///
/// 生成订舱或者舱位请求
/// 返回回执
[HttpPost("CreateBookingAndSlot")]
public async Task> CreateBookingAndSlot([FromBody] BookingOrSlotGenerateDto model)
{
var result = await _taskManageBCService.CreateBookingAndSlot(model);
return result;
}
#region 获取当前比对结果
///
/// 获取当前比对结果
///
/// BC任务主键
/// 返回回执
[HttpGet("GetCompareResult")]
public async Task>> GetCompareResult(long taskId)
{
return await _taskManageBCService.GetCompareResult(taskId);
}
#endregion
#region 同步舱位变更
///
/// 同步舱位变更
///
/// BC任务主键
/// 返回回执
[HttpGet("SyncBookingSlotChange")]
public async Task SyncBookingSlotChange(long taskPKId)
{
return await _taskManageBCService.SyncBookingSlotChange(taskPKId);
}
#endregion
#region 读取BC详情
///
/// 读取BC详情
///
/// 船公司代码
/// BC文件
/// 返回解析详情
[HttpPost("GetReadBC")]
public async Task> GetReadBC(string carrierCode, IFormFile file)
{
return await _taskManageBCService.GetReadBC(carrierCode, file);
}
#endregion
#region 读取BC擦写后文件流
///
/// 读取BC擦写后文件流
///
/// 船公司代码
/// BC文件
/// 返回解析详情
[HttpPost("GetModifyBCFile")]
public async Task> GetModifyBCFile(string carrierCode, IFormFile file)
{
return await _taskManageBCService.GetModifyBCFile(carrierCode, file);
}
#endregion
}
}