| | |
| | | /// <returns></returns> |
| | | public string QueryPageDeviceGeneralInfo(string param) |
| | | { |
| | | msgss<deviceGeneralInfo> msg = new msgss<deviceGeneralInfo>(); |
| | | msgss<deviceGeneralInfoForDetail> msg = new msgss<deviceGeneralInfoForDetail>(); |
| | | DeviceGeneralInfoInput page = JsonConvert.DeserializeObject<DeviceGeneralInfoInput>(param); |
| | | try |
| | | { |
| | | using (dbModel mod = new dbModel()) |
| | | { |
| | | List<deviceGeneralInfo> fiveDayDeviceInfo = null; |
| | | List<deviceGeneralInfoForDetail> fiveDayDeviceInfo = null; |
| | | if (page.datatime == null) |
| | | { |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfo |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfoForDetail |
| | | .OrderByDescending(x => x.createTime) |
| | | .ToList(); |
| | | } |
| | |
| | | { |
| | | DateTime _startTime = Convert.ToDateTime(page.datatime[0]); |
| | | DateTime _endTime = Convert.ToDateTime(page.datatime[1]); |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfo |
| | | fiveDayDeviceInfo = mod.deviceGeneralInfoForDetail |
| | | .Where(x => x.createTime >= _startTime && x.createTime <= _endTime) |
| | | .OrderByDescending(x => x.createTime) |
| | | .ToList(); |
| | |
| | | //重新计算等待时间 |
| | | item.deviceWaitTime = 1440 - ((item.deviceRunTime ?? 0M) + (item.deviceAlarmTime ?? 0M)); |
| | | } |
| | | if (!string.IsNullOrEmpty(page.search.ext1)) |
| | | { |
| | | fiveDayDeviceInfo = fiveDayDeviceInfo.Where(x => x.ext1 == page.search.ext1).ToList(); |
| | | } |
| | | } |
| | | |
| | | List<deviceGeneralInfo> fenyeRerult = new List<deviceGeneralInfo>(); |
| | | List<deviceGeneralInfoForDetail> fenyeRerult = new List<deviceGeneralInfoForDetail>(); |
| | | if (fiveDayDeviceInfo.Count > 0) |
| | | { |
| | | msg.status = 200; |