|
|
|
@ -29,6 +29,7 @@ using Yitter.IdGenerator;
|
|
|
|
|
using Myshipping.Core.Entity;
|
|
|
|
|
using Furion.RemoteRequest.Extensions;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using Myshipping.Core.Service;
|
|
|
|
|
|
|
|
|
|
namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
@ -48,11 +49,13 @@ namespace Myshipping.Application
|
|
|
|
|
private readonly SqlSugarRepository<DjyWebsiteAccountConfig> _webconfig;
|
|
|
|
|
private readonly SqlSugarRepository<SysDictData> _dicdata;
|
|
|
|
|
private readonly ILogger<BookingOrderService> _logger;
|
|
|
|
|
|
|
|
|
|
private readonly ISysCacheService _cache;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BookingOrderService(SqlSugarRepository<BookingOrder> rep, SqlSugarRepository<BookingCtn> repCtn, SqlSugarRepository<BookingCtnDetail> ctndetailrep,
|
|
|
|
|
SqlSugarRepository<BookingLog> bookinglog, SqlSugarRepository<BookingLogDetail> bookinglogdetail, SqlSugarRepository<BookingRemark> bookingremark,
|
|
|
|
|
SqlSugarRepository<BookingFile> bookingfile, SqlSugarRepository<DjyWebsiteAccountConfig> webconfig, SqlSugarRepository<SysDictData> dicdata,
|
|
|
|
|
ILogger<BookingOrderService> logger)
|
|
|
|
|
ILogger<BookingOrderService> logger, ISysCacheService cache)
|
|
|
|
|
{
|
|
|
|
|
this._logger = logger;
|
|
|
|
|
this._rep = rep;
|
|
|
|
@ -64,6 +67,7 @@ namespace Myshipping.Application
|
|
|
|
|
this._bookingfile = bookingfile;
|
|
|
|
|
this._webconfig = webconfig;
|
|
|
|
|
this._dicdata = dicdata;
|
|
|
|
|
this._cache = cache;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -253,7 +257,9 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("提单号:" + input.MBLNO + " 调用运踪接口");
|
|
|
|
|
var key = _webconfig.FirstOrDefault(x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.TypeCode == "seae_billtraceurl");
|
|
|
|
|
var url = _dicdata.FirstOrDefault(x => x.Code == "seae_billtraceurl");
|
|
|
|
|
|
|
|
|
|
var url = _cache.GetAllDictData().Result;
|
|
|
|
|
|
|
|
|
|
BillTraceDto billdto = new BillTraceDto();
|
|
|
|
|
List<BillTraceList> billTraceList = new List<BillTraceList>();
|
|
|
|
|
billTraceList.Add(new BillTraceList
|
|
|
|
@ -261,16 +267,16 @@ namespace Myshipping.Application
|
|
|
|
|
MBLNO = input.MBLNO,
|
|
|
|
|
YARD = input.YARD,
|
|
|
|
|
YardCode = input.YARDID,
|
|
|
|
|
CARRIER=null,
|
|
|
|
|
CARRIERID=null,
|
|
|
|
|
isBook=false
|
|
|
|
|
CARRIER = null,
|
|
|
|
|
CARRIERID = null,
|
|
|
|
|
isBook = false
|
|
|
|
|
});
|
|
|
|
|
billdto.Children = billTraceList;
|
|
|
|
|
billdto.Key = key.Account;
|
|
|
|
|
billdto.PWD = key.Password;
|
|
|
|
|
var json=billdto.ToJsonString();
|
|
|
|
|
var html= await url.Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
|
|
|
|
|
_logger.LogInformation("提单号:" + input.MBLNO + " 调用运踪接口返回"+ html.ToJsonString());
|
|
|
|
|
var json = billdto.ToJsonString();
|
|
|
|
|
var html = await url.FirstOrDefault(x=>x.TypeCode== "url_set"&&x.Code== "seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
|
|
|
|
|
_logger.LogInformation("提单号:" + input.MBLNO + " 调用运踪接口返回" + html.ToJsonString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -372,13 +378,14 @@ namespace Myshipping.Application
|
|
|
|
|
OldValue = _oldvalue,
|
|
|
|
|
NewValue = _value,
|
|
|
|
|
});
|
|
|
|
|
if (descriptor.Name== "YARDID"|| descriptor.Name == "YARD"|| descriptor.Name == "MBLNO") {
|
|
|
|
|
if (descriptor.Name == "YARDID" || descriptor.Name == "YARD" || descriptor.Name == "MBLNO")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(input.YARDID) && !string.IsNullOrWhiteSpace(input.YARD) && !string.IsNullOrWhiteSpace(input.MBLNO))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("提单号:" + input.MBLNO + " 调用运踪接口");
|
|
|
|
|
var key = _webconfig.FirstOrDefault(x => x.TenantId == Convert.ToInt64(UserManager.TENANT_ID) && x.TypeCode == "seae_billtraceurl");
|
|
|
|
|
var url = _dicdata.FirstOrDefault(x => x.Code == "seae_billtraceurl");
|
|
|
|
|
var url = _cache.GetAllDictData().Result;
|
|
|
|
|
BillTraceDto billdto = new BillTraceDto();
|
|
|
|
|
List<BillTraceList> billTraceList = new List<BillTraceList>();
|
|
|
|
|
billTraceList.Add(new BillTraceList
|
|
|
|
@ -394,7 +401,7 @@ namespace Myshipping.Application
|
|
|
|
|
billdto.Key = key.Account;
|
|
|
|
|
billdto.PWD = key.Password;
|
|
|
|
|
var json = billdto.ToJsonString();
|
|
|
|
|
var html = await url.Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
|
|
|
|
|
var html = await url.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "seae_billtraceurl").Value.SetHttpMethod(HttpMethod.Post).SetQueries(new { msg = json }).SetRetryPolicy(3, 5000).SendAsAsync<RespCommon>();
|
|
|
|
|
_logger.LogInformation("提单号:" + input.MBLNO + " 调用运踪接口返回" + html.ToJsonString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -447,7 +454,6 @@ namespace Myshipping.Application
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取备注
|
|
|
|
|
/// </summary>
|
|
|
|
@ -473,7 +479,6 @@ namespace Myshipping.Application
|
|
|
|
|
await _bookingremark.InsertAsync(entity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 增加订舱附件
|
|
|
|
|
/// </summary>
|
|
|
|
@ -534,8 +539,6 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取附件
|
|
|
|
|
/// </summary>
|
|
|
|
|