ÎļþÃû´Ó IStation.Service/08-hydraulic/01-/DayValueHelper.cs ÐÞ¸Ä |
| | |
| | | { |
| | | public class DayValueHelper |
| | | { |
| | | |
| | | |
| | | public static List<DayValue> GetDayValues(int station) |
| | | { |
| | | string folderPath; |
| | | if (station==1) |
| | | if (station == 1) |
| | | { |
| | | folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}Eapnetéªè¯æ°æ®\\éè¡ä¸è¾"; |
| | | folderPath = $"{AppDomain.CurrentDomain.BaseDirectory}Eapnetéªè¯æ°æ®\\éè¡ä¸è¾"; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | if (!Directory.Exists(folderPath)) |
| | | return default; |
| | | var fileList=Directory.GetFiles(folderPath); |
| | | return default; |
| | | var fileList = Directory.GetFiles(folderPath); |
| | | if (fileList == null || !fileList.Any()) |
| | | return default; |
| | | |
| | |
| | | var fileName = Path.GetFileNameWithoutExtension(file); |
| | | if (!DateTime.TryParse(fileName, out DateTime day)) |
| | | continue; |
| | | var json=File.ReadAllText(file); |
| | | var json = File.ReadAllText(file); |
| | | var timeValues = JsonHelper.Json2Object<List<TimeValue>>(json); |
| | | if (timeValues == null || !timeValues.Any()) |
| | | continue; |
| | |
| | | dayValue.Month = day.Month; |
| | | dayValue.Day = day.Day; |
| | | dayValue.TimeValueList = timeValues; |
| | | list.Add(dayValue); |
| | | list.Add(dayValue); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | } |
| | | } |
| | | } |