Commit 3f14a996 by lizefeng

fix

parent bf6e325e
......@@ -284,6 +284,13 @@ namespace AutoTurnOver.Services
public void SynchroReportIdByCreate(ReportTypes reportTypeEnum, int version = 8, string account = "", string site = "",DateTime? btime =null ,DateTime? etime = null)
{
if(btime!=null &&etime!=null)
{
if (etime.Value < btime.Value)
{
return;
}
}
// 拉取亚马逊账号
var amazonAccounts = ApiServices.GetAmazonAccountList();
if (!string.IsNullOrWhiteSpace(account))
......@@ -839,9 +846,25 @@ namespace AutoTurnOver.Services
else
{
var filePath = DownloadReportData(pamsAccount, ana_task.report_id);
var reportData = DownloadReportData(pamsAccount, ana_task.report_id);
if (string.IsNullOrWhiteSpace(reportData.ReportDocumentId))
{
if (reportData.ProcessingStatus == Report.ProcessingStatusEnum.FATAL || reportData.ProcessingStatus == Report.ProcessingStatusEnum.CANCELLED)
{
ana_task.ana_status = -2;
MyMySqlConnection._connection.Update(ana_task);
return;
}
else
{
ana_task.report_par_json = reportData.ToJson();
MyMySqlConnection._connection.Update(ana_task);
return;
}
}
StringBuilder response_str = new StringBuilder() { };
using (StreamReader sr = new StreamReader(filePath.ReportDocumentId))
using (StreamReader sr = new StreamReader(reportData.ReportDocumentId))
{
response_str.AppendLine(sr.ReadToEnd());
sr.Close();
......@@ -850,7 +873,7 @@ namespace AutoTurnOver.Services
string jsonText = response_str.ToString();
ana_task.content = jsonText;
table = CsvFileHelper.ReadFromCSV(filePath.ReportDocumentId, true, '\t');
table = CsvFileHelper.ReadFromCSV(reportData.ReportDocumentId, true, '\t');
}
foreach (DataRow row in table.Rows)
......
......@@ -701,7 +701,7 @@ namespace ResetOutofstock
FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_INVENTORY_PLANNING_DATA,
version: 19,
btime: DateTime.Now.GetMonthFirstDay().ToDayHome(),
etime: DateTime.Now.ToDayEnd());
etime: DateTime.Now.ToDayEnd().AddDays(-1));
Console.WriteLine($"结束 拉取亚马逊 长期仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3);
}
......@@ -735,7 +735,7 @@ namespace ResetOutofstock
FikaAmazonAPI.Utils.Constants.ReportTypes.GET_FBA_STORAGE_FEE_CHARGES_DATA,
version: 23,
btime: DateTime.Now.GetMonthFirstDay().ToDayHome(),
etime: DateTime.Now.ToDayEnd());
etime: DateTime.Now.AddDays(-1).ToDayEnd());
Console.WriteLine($"结束 拉取亚马逊 月度仓储费,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
Thread.Sleep(1000 * 60 * 3);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment