public void Execute(IJobExecutionContext context) { list = wellInfoService.GetReportInfo(); if (isEnabled) { for (int i = 0; i < list.Count; i++) { if ((DateTime.Parse(dateTime) - DateTime.Parse(list[i].WellCurrentStateInfo.Report_Time.Trim())).Hours > reportInterval) { wellInfoService.UpdateNotReportTimes(list[i].WellCurrentStateInfo.Terminal_ID.Trim()); Thread.Sleep(500); } } } else { for (int i = 0; i < list.Count; i++) { if ((DateTime.Parse(dateTime) - DateTime.Parse(list[i].WellCurrentStateInfo.Report_Time.Trim())).Hours > list[i].ReportInterval) { wellInfoService.UpdateNotReportTimes(list[i].WellCurrentStateInfo.Terminal_ID.Trim()); Thread.Sleep(500); } } } wellInfoService.Empty_ReportNumInfo(); LogHelper.WriteQuartzLog("更新人井未上报次数。时间:" + dateTime); }