| | |
| | | { |
| | | todayDeviceInfo = new deviceGeneralInfoForDetail(); |
| | | todayDeviceInfo.ext1 = str_srmNo;//赋值 机号 |
| | | todayDeviceInfo.ext2 = GetCurrentPeriod(); |
| | | todayDeviceInfo.createTime = DateTime.Now; |
| | | mod.deviceGeneralInfoForDetail.Add(todayDeviceInfo); |
| | | //计时复位 |
| | |
| | | { |
| | | deviceGeneralInfoForDetail creatTodayDeviceInfo = new deviceGeneralInfoForDetail(); |
| | | creatTodayDeviceInfo.ext1 = str_srmNo;//机号赋值 |
| | | creatTodayDeviceInfo.ext2 = GetCurrentPeriod(); |
| | | //设备报警时间 |
| | | creatTodayDeviceInfo.deviceAlarmTime = Convert.ToDecimal(deviceAlarmTime.Hours * 60M) + deviceAlarmTime.Minutes;//单位分钟 |
| | | //设备运行时间 |
| | |
| | | //重新计算设备等待时间 【Editby shaocx,2024-12-30】 |
| | | todayDeviceInfo.deviceWaitTime = 1440 - (todayDeviceInfo.deviceRunTime + todayDeviceInfo.deviceAlarmTime); |
| | | } |
| | | |
| | | |
| | | |
| | | public static string GetCurrentPeriod() |
| | | { |
| | | DateTime today = DateTime.Today; |
| | | DateTime startDate = new DateTime(today.Year, today.Month, today.Day, 0, 0, 0); |
| | | DateTime endDate = new DateTime(today.Year, today.Month, today.Day, 23, 59, 59); |
| | | |
| | | return string.Format("{0:yyyy-MM-dd HH:mm:ss} 至 {1:yyyy-MM-dd HH:mm:ss}", |
| | | startDate, endDate); |
| | | } |
| | | } |
| | | } |