using DS.Module.Core.Attributes;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Interface;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
using DS.WMS.Core.TaskPlat.Method;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using ThirdParty.Json.LitJson;
namespace DS.WMS.TaskApi.Controllers
{
///
/// 格式单比对
///
public class TaskDraftCompareController : ApiController
{
private readonly ITaskDraftCompareService _taskDraftCompareService;
private readonly IOpFileService _opFileService;
public TaskDraftCompareController(ITaskDraftCompareService taskDraftCompareService, IOpFileService opFileService)
{
_taskDraftCompareService = taskDraftCompareService;
_opFileService = opFileService;
}
#region 执行邮件Draft比对
///
/// 执行邮件Draft比对
///
/// 请求文件
/// 邮件Draft比对请求报文
/// 返回回执
[HttpPost("ExcuteEmailDraftCompare")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task ExcuteEmailDraftCompareAsync(IFormFile file, [FromForm] string jsonData)
{
return await _taskDraftCompareService.ExcuteEmailDraftCompareAsync(file, jsonData);
}
#endregion
#region 获取Draft比对结果详情
///
/// 获取Draft比对结果详情
///
/// 订舱主键
/// 返回回执
[HttpGet("GetDraftCompareResultInfo")]
public async Task GetDraftCompareResultInfo([FromQuery] long bookingId)
{
return await _taskDraftCompareService.GetDraftCompareResultInfo(bookingId);
}
#endregion
#region 执行邮件Draft比对(含有附件文件-针对TSL货描附件处理)
///
/// 执行邮件Draft比对(含有附件文件-针对TSL货描附件处理)
///
/// 请求文件
/// 请求附件文件
/// 邮件Draft比对请求报文
/// 返回回执
[HttpPost("ExcuteEmailAttachedSheetDraftCompare")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task ExcuteEmailAttachedSheetDraftCompareAsync(IFormFile file, IFormFile fileAttach, string jsonData)
{
return await _taskDraftCompareService.ExcuteEmailAttachedSheetDraftCompareAsync(file, fileAttach, jsonData);
}
#endregion
#region 保存格式单比对反馈
///
/// 保存格式单比对反馈
///
/// 请求详情
/// 返回回执
[HttpPost("SaveDraftCompareManual")]
public async Task SaveDraftCompareManual([FromBody] TaskDraftCompareFeedBackDto model)
{
await _taskDraftCompareService.SaveDraftCompareManual(model);
}
#endregion
#region 根据文件ID下载附件
///
/// 根据文件ID下载附件
///
/// 文件主键
/// 返回数据流
[HttpGet("DownloadFile")]
public async Task DownloadFile([FromQuery] long Id)
{
return await _opFileService.DownloadFile(Id.ToString());
}
#endregion
}
}