|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|