diff --git a/12306.sln.vsdoc b/12306.sln.vsdoc new file mode 100644 index 0000000..4e38450 --- /dev/null +++ b/12306.sln.vsdoc @@ -0,0 +1,118 @@ + + + + default + + + + + + + + + + + + + + + + + + + + + + VSdocman]]> + + + +]]> + + + + + showFormsSeparate + showInherited + pageFooterText + outputPath + templatePath + templateFolder + externalFilesFolder + templateLocale + fileNamingConvention + generateVbSyntax + generateCsharpSyntax + generateCppSyntax + generateJscriptSyntax + helpTitle + customTopics + emptyOutputFolder +]]> + + + + + + + + + + + + + + + + + + + + + + + + normal + yes + SOLUTION-WIDE PROPERTIES Reference + solutionwide_properties_reference + vsdocman_escaped_]_]_> + + + + placeholder + no + + 421550cecbb34c889da962a973d57471 + + + + + + +]]> + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TrainInfomationProviderService/Program.cs b/TrainInfomationProviderService/Program.cs index f26bd40..9da2b85 100644 --- a/TrainInfomationProviderService/Program.cs +++ b/TrainInfomationProviderService/Program.cs @@ -113,7 +113,7 @@ namespace TrainInfomationProviderService var opt = new TrainTransitSearchOptions(); opt.InitLimit(1357); - var altLines = searchProvider.FindOnceTransitTrains(DateTime.Parse("2016-01-28"), "WMR", "WHN", opt).ToArray(); + var altLines = searchProvider.FindOnceTransitTrains(DateTime.Parse("2016-02-03"), "BJP", "ZHQ", opt).ToArray(); //var availableLines = lines.Select(s => s.Train.Code + "," + s.FromStation.Name + "," + s.ToStation.Name + "," + s.ElapsedTime).ToArray(); Array.ForEach(altLines.Select(s => diff --git a/TrainInfomationProviderService/Properties/AssemblyInfo.cs b/TrainInfomationProviderService/Properties/AssemblyInfo.cs index dbe6e1c..1d21209 100644 --- a/TrainInfomationProviderService/Properties/AssemblyInfo.cs +++ b/TrainInfomationProviderService/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ using System.Runtime.InteropServices; // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.5810.3")] +[assembly: AssemblyFileVersion("1.0.5818.7")] diff --git a/TrainInfomationProviderService/TrainInfo/TrainInfoSearchProvider.cs b/TrainInfomationProviderService/TrainInfo/TrainInfoSearchProvider.cs index 6ef86a2..f8eaceb 100644 --- a/TrainInfomationProviderService/TrainInfo/TrainInfoSearchProvider.cs +++ b/TrainInfomationProviderService/TrainInfo/TrainInfoSearchProvider.cs @@ -67,7 +67,7 @@ namespace TrainInfomationProviderService.TrainInfo while (date >= minDate) { infoStorage = Storage.TrainInfoStorages.GetValue(date.ToString("yyyy-MM-dd")); - if (infoStorage == null) + if (infoStorage == null || infoStorage.Trains.Count == 0) date = date.AddDays(-1); else break; } @@ -102,7 +102,7 @@ namespace TrainInfomationProviderService.TrainInfo while (date >= minDate) { infoStorage = Storage.TrainInfoStorages.GetValue(date.ToString("yyyy-MM-dd")); - if (infoStorage == null) + if (infoStorage == null || infoStorage.Trains.Count == 0) date = date.AddDays(-1); else break; } diff --git a/TrainInfomationProviderService/TrainInfo/WebDataProvider.cs b/TrainInfomationProviderService/TrainInfo/WebDataProvider.cs index 6ccec2d..4974920 100644 --- a/TrainInfomationProviderService/TrainInfo/WebDataProvider.cs +++ b/TrainInfomationProviderService/TrainInfo/WebDataProvider.cs @@ -121,9 +121,17 @@ namespace TrainInfomationProviderService.TrainInfo var data = JsonConvert.DeserializeObject(body); var station = StationManager.Instance.Storage.StationNameMap; + var nowDate = DateTime.Now.Date; foreach (var date in data.Keys) { + if (DateTime.Parse(date) < nowDate) + { + Trace.TraceInformation($"[TRAIN_DATA_WEB_PROVIDER] 忽略过期日期:{date}"); + + continue; + } + var dateSt = data[date]; var curStorage = indexStorage.TrainInfoStorages.GetValue(date); if (curStorage == null) diff --git a/Web12306/.project b/Web12306/.project new file mode 100644 index 0000000..6fb2241 --- /dev/null +++ b/Web12306/.project @@ -0,0 +1,17 @@ + + + Web12306 + + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.aptana.projects.webnature + + diff --git a/Web12306/.vscode/launch.json b/Web12306/.vscode/launch.json new file mode 100644 index 0000000..abcdf46 --- /dev/null +++ b/Web12306/.vscode/launch.json @@ -0,0 +1,4 @@ +{ + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/Web12306/Web12306.csproj b/Web12306/Web12306.csproj index 6adeac5..31be3f3 100644 --- a/Web12306/Web12306.csproj +++ b/Web12306/Web12306.csproj @@ -23,7 +23,7 @@ ..\ true - 1.6 + 1.7 16ae31ba