|
|
@ -561,5 +561,102 @@ namespace Myshipping.Application
|
|
|
|
return await InnerExcuteShippingOrderCompareAsync(bookingId, "AUTO");
|
|
|
|
return await InnerExcuteShippingOrderCompareAsync(bookingId, "AUTO");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取下货纸比对结果
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="bookingId">订舱主键</param>
|
|
|
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
|
|
|
[HttpGet("/TaskShippingOrderCompare/GetShippingOrderCompareResult")]
|
|
|
|
|
|
|
|
public async Task<TaskManageExcuteResultDto> GetShippingOrderCompareResult(long bookingId)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string batchNo = IDGen.NextID().ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskManageExcuteResultDto result = new TaskManageExcuteResultDto();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var model = _bookingOrderRepository.AsQueryable().Filter(null, true)
|
|
|
|
|
|
|
|
.First(a => a.Id == bookingId && !a.IsDeleted && a.TenantId == UserManager.TENANT_ID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateTime nowDate = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TaskMessageInfoDto msgModel = new TaskMessageInfoDto
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Head = new TaskMessageHead
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
GID = batchNo,
|
|
|
|
|
|
|
|
MessageType = "DRAFT_COMPARE",
|
|
|
|
|
|
|
|
SenderId = App.Configuration["RulesEngineSender"],
|
|
|
|
|
|
|
|
SenderName = App.Configuration["RulesEngineSenderName"],
|
|
|
|
|
|
|
|
ReceiverId = "RulesEngine",
|
|
|
|
|
|
|
|
ReceiverName = "大简云规则引擎",
|
|
|
|
|
|
|
|
Version = "1.0",
|
|
|
|
|
|
|
|
RequestDate = nowDate.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
|
|
|
RequestAction = "Compare",
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
Main = new TaskMessageMain
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
BusiPKId = bookingId.ToString(),
|
|
|
|
|
|
|
|
TaskCompareId = model.LstShipOrderCompareId,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation($"开始请求查询 msg={JSON.Serialize(msgModel)}");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = await GetCompareResult(msgModel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_logger.LogInformation("获取Draft比对结果异常,原因:{error}", ex.Message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw Oops.Oh($"获取Draft比对结果异常,原因:{ex.Message}");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 获取Draft比对结果
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 获取Draft比对结果
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="info">请求报文</param>
|
|
|
|
|
|
|
|
/// <returns>返回回执</returns>
|
|
|
|
|
|
|
|
[NonAction]
|
|
|
|
|
|
|
|
private async Task<TaskManageExcuteResultDto> GetCompareResult(TaskMessageInfoDto info)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TaskManageExcuteResultDto model = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var url = App.Configuration["GetShippingOrderCompareUrl"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var res = await url.SetHttpMethod(HttpMethod.Post)
|
|
|
|
|
|
|
|
.SetBody(JSON.Serialize(info), "application/json")
|
|
|
|
|
|
|
|
.SetContentEncoding(Encoding.UTF8)
|
|
|
|
|
|
|
|
.PostAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("批次={no} 对应请求报文完成 res={res}", info.Head.GID, JSON.Serialize(res));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.StatusCode == System.Net.HttpStatusCode.OK)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var userResult = await res.Content.ReadAsStringAsync();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogInformation("对应请求报文 userResult={userResult}", userResult);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model = JSON.Deserialize<TaskManageExcuteResultDto>(userResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//写日志
|
|
|
|
|
|
|
|
if (ex is HttpRequestException)
|
|
|
|
|
|
|
|
throw Oops.Oh(10000002);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return model;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|