cjy 4 months ago
commit 38925c3da7

@ -1236,4 +1236,39 @@ public class SeaExportRes
/// 所属部门名称
/// </summary>
public string SaleDeptName { get; set; }
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
public string LstShipOrderCompareRlt { get; set; }
/// <summary>
/// 最后下货纸比对时间
/// </summary>
public Nullable<DateTime> LstShipOrderCompareDate { get; set; }
/// <summary>
/// 最后下货纸比对批次号
/// </summary>
public string LstShipOrderCompareId { get; set; }
/// <summary>
/// 最后下货纸比对状态 NO_DIFF-无异常;DIFF-有差异;NO_YARD-无场站数据;EXPT-异常
/// </summary>
public string LstShipOrderCompareRltName { get; set; }
/// <summary>
/// 最后下货纸比对方式 MANUAL-手动 AUTO-自动
/// </summary>
public string LstShipOrderCompareMode { get; set; }
/// <summary>
/// 最后格式单比对状态 NO_DIFF-无异常;DIFF-有差异;
/// </summary>
public string LstDraftCompareRlt { get; set; }
/// <summary>
/// 最后格式单比对时间
/// </summary>
public Nullable<DateTime> LstDraftCompareDate { get; set; }
}

@ -4,7 +4,11 @@ using DS.Module.Core.Helpers;
using DS.Module.DjyServiceStatus;
using DS.Module.SqlSugar;
using DS.Module.UserModule;
using DS.WMS.Core.Code.Interface;
using DS.WMS.Core.Code.Method;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Map.Interface;
using DS.WMS.Core.Map.Method;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.TaskPlat.Dtos;
@ -39,10 +43,16 @@ namespace DS.WMS.Core.TaskPlat.Method
private readonly IUser user;
private readonly ISaasDbService saasService;
private readonly IDjyServiceStatusService _djyServiceStatusService;
private readonly IMappingYardService _mappingYardService;
private readonly IMappingCarrierService _mappingCarrierService;
private readonly ICodePortService _codePortService;
private readonly string shippingOrderCompareUrl;
private readonly string shippingOrderCompareResultUrl;
const string CONST_MAPPING_YARD_MODULE = "BillTrace";
const string CONST_MAPPING_CARRIER_MODULE = "CarrierBaseMapping";
private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger();
public TaskShippingOrderCompareService(IServiceProvider serviceProvider)
@ -52,6 +62,9 @@ namespace DS.WMS.Core.TaskPlat.Method
user = _serviceProvider.GetRequiredService<IUser>();
saasService = _serviceProvider.GetRequiredService<ISaasDbService>();
_djyServiceStatusService = _serviceProvider.GetRequiredService<IDjyServiceStatusService>();
_mappingYardService = _serviceProvider.GetRequiredService<IMappingYardService>();
_mappingCarrierService = _serviceProvider.GetRequiredService<IMappingCarrierService>();
_codePortService = _serviceProvider.GetRequiredService<ICodePortService>();
shippingOrderCompareUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "Url" });
shippingOrderCompareResultUrl = AppSetting.app(new string[] { "ShippingOrderCompare", "ResultUrl" });
@ -121,11 +134,49 @@ namespace DS.WMS.Core.TaskPlat.Method
Logger.Log(NLog.LogLevel.Info, "批次={no}获取订舱数据完成", batchNo);
//附主信息
var mainInfo = model.Adapt<TaskMessageMain>();
//这里需要对场站进行映射翻译
var mapYardList = _mappingYardService.GetAllList().GetAwaiter().GetResult().Data;
if (mapYardList.Count > 0)
mapYardList = mapYardList.Where(a => a.Module.Equals(CONST_MAPPING_YARD_MODULE, StringComparison.OrdinalIgnoreCase)).ToList();
if (mapYardList.Any(a => a.LinkId == model.YardId))
{
mainInfo.YardCode = mapYardList.FirstOrDefault(a => a.LinkId == model.YardId).MapCode;
}
else
{
throw new Exception($"场站:{model.Yard} 没有对应的出口运踪映射代码");
}
var codePortList = _codePortService.GetAllList().GetAwaiter().GetResult().Data;
if (codePortList.Any(a => a.Id == model.LoadPortId))
mainInfo.PortLoad = codePortList.FirstOrDefault(a => a.Id == model.LoadPortId).PortName;
if (codePortList.Any(a => a.Id == model.DischargePortId))
mainInfo.PortDischarge = codePortList.FirstOrDefault(a => a.Id == model.DischargePortId).PortName;
if (codePortList.Any(a => a.Id == model.DeliveryPlaceId))
mainInfo.PlaceDelivery = codePortList.FirstOrDefault(a => a.Id == model.DeliveryPlaceId).PortName;
if (codePortList.Any(a => a.Id == model.DestinationId))
mainInfo.Destination = codePortList.FirstOrDefault(a => a.Id == model.DestinationId).PortName;
var mapCarrierList = _mappingCarrierService.GetAllList().GetAwaiter().GetResult().Data;
if (mapCarrierList.Count > 0)
mapCarrierList = mapCarrierList.Where(a => a.Module.Equals(CONST_MAPPING_CARRIER_MODULE, StringComparison.OrdinalIgnoreCase)).ToList();
if (mapYardList.Any(a => a.LinkId == model.CarrierId))
{
mainInfo.CarrierCode = mapYardList.FirstOrDefault(a => a.LinkId == model.CarrierId).MapCode;
}
mainInfo.BusiPKId = model.Id.ToString();
mainInfo.UserId = user.UserId;

@ -0,0 +1,80 @@
using DS.Module.Core.Attributes;
using DS.WMS.Core.Op.Dtos;
using DS.WMS.Core.TaskPlat.Dtos;
using DS.WMS.Core.TaskPlat.Interface;
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;
public TaskDraftCompareController(ITaskDraftCompareService taskDraftCompareService)
{
_taskDraftCompareService = taskDraftCompareService;
}
#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>
[HttpPost("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>
[HttpPost("/TaskDraftCompare/SaveDraftCompareManual")]
public async Task SaveDraftCompareManual(TaskDraftCompareFeedBackDto model)
{
await _taskDraftCompareService.SaveDraftCompareManual(model);
}
#endregion
}
}
Loading…
Cancel
Save