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.

98 lines
3.8 KiB
C#

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
{
/// <summary>
/// 格式单比对
/// </summary>
public class TaskDraftCompareController : ApiController
{
private readonly ITaskDraftCompareService _taskDraftCompareService;
private readonly IOpFileService _opFileService;
public TaskDraftCompareController(ITaskDraftCompareService taskDraftCompareService, IOpFileService opFileService)
{
_taskDraftCompareService = taskDraftCompareService;
_opFileService = opFileService;
}
#region 执行邮件Draft比对
/// <summary>
/// 执行邮件Draft比对
/// </summary>
/// <param name="file">请求文件</param>
/// <param name="jsonData">邮件Draft比对请求报文</param>
/// <returns>返回回执</returns>
[HttpPost("ExcuteEmailDraftCompare")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<TaskManageExcuteResultDto> ExcuteEmailDraftCompareAsync(IFormFile file, [FromForm] string jsonData)
{
return await _taskDraftCompareService.ExcuteEmailDraftCompareAsync(file, jsonData);
}
#endregion
#region 获取Draft比对结果详情
/// <summary>
/// 获取Draft比对结果详情
/// </summary>
/// <param name="bookingId">订舱主键</param>
/// <returns>返回回执</returns>
[HttpGet("GetDraftCompareResultInfo")]
public async Task<TaskManageExcuteResultDto> GetDraftCompareResultInfo([FromQuery] long bookingId)
{
return await _taskDraftCompareService.GetDraftCompareResultInfo(bookingId);
}
#endregion
#region 执行邮件Draft比对含有附件文件-针对TSL货描附件处理
/// <summary>
/// 执行邮件Draft比对含有附件文件-针对TSL货描附件处理
/// </summary>
/// <param name="file">请求文件</param>
/// <param name="fileAttach">请求附件文件</param>
/// <param name="jsonData">邮件Draft比对请求报文</param>
/// <returns>返回回执</returns>
[HttpPost("ExcuteEmailAttachedSheetDraftCompare")]
[ApiUser(ApiCode = "BCTaskManage"), AllowAnonymous]
public async Task<TaskManageExcuteResultDto> ExcuteEmailAttachedSheetDraftCompareAsync(IFormFile file, IFormFile fileAttach, string jsonData)
{
return await _taskDraftCompareService.ExcuteEmailAttachedSheetDraftCompareAsync(file, fileAttach, jsonData);
}
#endregion
#region 保存格式单比对反馈
/// <summary>
/// 保存格式单比对反馈
/// </summary>
/// <param name="model">请求详情</param>
/// <returns>返回回执</returns>
4 months ago
[HttpPost("SaveDraftCompareManual")]
public async Task SaveDraftCompareManual([FromBody] TaskDraftCompareFeedBackDto model)
{
await _taskDraftCompareService.SaveDraftCompareManual(model);
}
#endregion
#region 根据文件ID下载附件
/// <summary>
/// 根据文件ID下载附件
/// </summary>
/// <param name="taskId">文件主键</param>
/// <returns>返回数据流</returns>
[HttpGet("DownloadFile")]
public async Task<IActionResult> DownloadFile([FromQuery] long Id)
{
return await _opFileService.DownloadFile(Id.ToString());
}
#endregion
}
}