change - 产量统计取消已完成筛选,修改bug

master
SoulStar 1 month ago
parent 5fcdd89323
commit 07c15adc14

@ -83,11 +83,12 @@ namespace HighWayIot.Repository.service
{ {
try try
{ {
DateTime useTime = DateTime.Now - TimeSpan.FromMinutes(60);
ZxDailyReportEntity entity = ZxDailyReportEntity entity =
_repository.AsQueryable() _repository.AsQueryable()
.OrderByDescending(x => x.StartTime) .OrderByDescending(x => x.StartTime)
//取最近一小时内未完成的数据,防止取到很久以前的数据 //取最近一小时内未完成的数据,防止取到很久以前的数据
.First(x => x.DeviceNo == rgvNo && x.IsDone == 0 && x.StartTime > (DateTime.Now - TimeSpan.FromMinutes(60))); .First(x => x.DeviceNo == rgvNo && x.IsDone == 0 && x.StartTime > useTime);
return entity; return entity;
} }
catch (Exception ex) catch (Exception ex)

@ -29,7 +29,7 @@ namespace HighWayIot.Winform.Business
public MonitorDataRefreshBusiness() public MonitorDataRefreshBusiness()
{ {
// 启动定时器每隔1秒刷新一次报表数据 // 启动定时器每隔1秒刷新一次报表数据
refreshTimer = new System.Threading.Timer(RefreshData, null, 0, 1600); refreshTimer = new Timer(RefreshData, null, 0, 1600);
} }
/// <summary> /// <summary>

@ -234,9 +234,9 @@ namespace HighWayIot.Winform.UserControlPages
MonitorDataGridView.DataSource = _monitorDataSources; MonitorDataGridView.DataSource = _monitorDataSources;
MonitorDataGridView.CellFormatting += MonitorDataGridView_CellFormatting; MonitorDataGridView.CellFormatting += MonitorDataGridView_CellFormatting;
int daycount = dailyEntity.Count(x => x.StartTime >= DayStartTime && x.StartTime <= DayEndTine && x.IsDone == 1); int daycount = dailyEntity.Count(x => x.StartTime >= DayStartTime && x.StartTime <= DayEndTine);
DayProductNumTextBox.Text = daycount.ToString(); DayProductNumTextBox.Text = daycount.ToString();
int nightcount = dailyEntity.Count(x => x.StartTime >= NightStartTime && x.StartTime <= NightEndTime && x.IsDone == 1); int nightcount = dailyEntity.Count(x => x.StartTime >= NightStartTime && x.StartTime <= NightEndTime);
NightProductNumTextBox.Text = nightcount.ToString(); NightProductNumTextBox.Text = nightcount.ToString();
NowDateProductNumTextBox.Text = dailyEntity.Count(x => x.StartTime >= LastDayStartTime && x.StartTime <= LastNightEndTime).ToString(); NowDateProductNumTextBox.Text = dailyEntity.Count(x => x.StartTime >= LastDayStartTime && x.StartTime <= LastNightEndTime).ToString();

Loading…
Cancel
Save