wet 2 years ago
commit 41641e9b01

@ -151,13 +151,15 @@ namespace Myshipping.Application.EDI
attFile.TenantName = order.TenantName;
repBookingFile.Insert(attFile);
SplitFtpServerAndPort(paraServer.Value, out string server, out int port);
//发送ftp
var ftpPostObj = new
{
host = paraServer.Value,
host = server,
username = paraUser.Value,
pwd = paraPwd.Value,
path = "/"
path = "/",
port = port,
};
var ftpSpiderUrl = dicData.FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "booking_edi_ftp_server").Value;
Log.Information($"准备请求发送ftp{ftpSpiderUrl} ,参数:{ftpPostObj.ToJsonString()},文件:{ediFileName}");
@ -411,13 +413,15 @@ namespace Myshipping.Application.EDI
attFile.TenantName = order.TenantName;
await repBookingFile.InsertAsync(attFile);
SplitFtpServerAndPort(ftpset.SERVERIP, out string server, out int port);
//后续发送
var ftpPostObj = new
{
host = ftpset.SERVERIP,
host = server,
username = ftpset.USERNAME,
pwd = ftpset.PASSWORD,
path = ftpset.FOLDERNAME
path = ftpset.FOLDERNAME,
port = port,
};
var ftpSpiderUrl = (await cacheService.GetAllDictData()).FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "booking_edi_ftp_server").Value;
Log.Information($"准备请求发送ftp{ftpSpiderUrl} ,参数:{ftpPostObj.ToJsonString()},文件:{ediFileName}");
@ -512,13 +516,15 @@ namespace Myshipping.Application.EDI
attFile.TenantName = order.TenantName;
repBookingFile.Insert(attFile);
SplitFtpServerAndPort(ftpset.SERVERIP, out string server, out int port);
//后续发送
var ftpPostObj = new
{
host = ftpset.SERVERIP,
host = server,
username = ftpset.USERNAME,
pwd = ftpset.PASSWORD,
path = ftpset.FOLDERNAME
path = ftpset.FOLDERNAME,
port = port
};
var ftpSpiderUrl = (await cacheService.GetAllDictData()).FirstOrDefault(x => x.TypeCode == "url_set" && x.Code == "booking_edi_ftp_server").Value;
Log.Information($"准备请求发送ftp{ftpSpiderUrl} ,参数:{ftpPostObj.ToJsonString()},文件:{ediFileName}");
@ -1030,5 +1036,24 @@ namespace Myshipping.Application.EDI
return list;
}
/// <summary>
/// 分割ftp服务器地址和端口
/// </summary>
/// <param name="str"></param>
private static void SplitFtpServerAndPort(string str, out string server, out int port)
{
if (str.IndexOf(':') > -1)
{
var arr = str.Split(':');
server = arr[0];
port = Convert.ToInt32(arr[1]);
}
else
{
server = str;
port = 21;
}
}
}
}

@ -172,6 +172,7 @@ namespace Myshipping.Report.Controllers
log.Debug($"准备获取订舱数据:{bookingId}");
var order = sqlSugarClient.Queryable<BookingOrder>().First(x => x.Id == bookingId);
var ctns = sqlSugarClient.Queryable<BookingCtn>().Where(x => x.BILLID == bookingId).ToList();
var bookingEdi = sqlSugarClient.Queryable<BookingEDIExt>().First(x => x.BookingId == bookingId);
var letterYard = sqlSugarClient.Queryable<BookingLetteryard>().First(x => x.BookingId == bookingId);
DjyCustomer customer = null;
@ -186,6 +187,7 @@ namespace Myshipping.Report.Controllers
ctns = ctns,
letterYard,
agentCustomer = customer,
ediExt = bookingEdi,
});
log.Debug($"订舱数据:{strObj}");

@ -175,6 +175,9 @@
<Compile Include="..\Myshipping.Application\Entity\BookingCtnDetail.cs">
<Link>DB\BookingCtnDetail.cs</Link>
</Compile>
<Compile Include="..\Myshipping.Application\Entity\BookingEDIExt.cs">
<Link>DB\BookingEDIExt.cs</Link>
</Compile>
<Compile Include="..\Myshipping.Application\Entity\BookingLetteryard.cs">
<Link>DB\BookingLetteryard.cs</Link>
</Compile>

Loading…
Cancel
Save