Browse Source

更新

feature_hph_新增rabbitmq_sink
1049970895@qniao.cn 3 years ago
parent
commit
4da067bc33
1 changed files with 12 additions and 4 deletions
  1. 16
      src/main/java/com/qniao/iot/IotMonitoringDataJob.java

16
src/main/java/com/qniao/iot/IotMonitoringDataJob.java

@ -242,22 +242,29 @@ public class IotMonitoringDataJob {
// 树根今日当前数 + 这次信息点距离上次信息点生产的数量 // 树根今日当前数 + 这次信息点距离上次信息点生产的数量
nowDeviceState.setTheDayJobCount(onData.getTheDayJobCount() + receivedEvent.getCurrJobCount()); nowDeviceState.setTheDayJobCount(onData.getTheDayJobCount() + receivedEvent.getCurrJobCount());
nowDeviceState.setJobTotal(onData.getJobTotal() + receivedEvent.getCurrJobCount()); nowDeviceState.setJobTotal(onData.getJobTotal() + receivedEvent.getCurrJobCount());
nowDeviceState.setTheDayJobDuration(lastedDeviceState.getTheDayJobDuration() + workingDuration);
nowDeviceState.setJobDurationTotal(lastedDeviceState.getJobDurationTotal() + workingDuration);
} else { } else {
// 机智云 // 机智云
nowDeviceState.setTheDayJobCount(lastedDeviceState.getTheDayJobCount() + receivedEvent.getCurrJobCount()); nowDeviceState.setTheDayJobCount(lastedDeviceState.getTheDayJobCount() + receivedEvent.getCurrJobCount());
nowDeviceState.setJobTotal(lastedDeviceState.getJobTotal() + receivedEvent.getCurrJobCount()); nowDeviceState.setJobTotal(lastedDeviceState.getJobTotal() + receivedEvent.getCurrJobCount());
nowDeviceState.setTheDayJobDuration(lastedDeviceState.getTheDayJobDuration() + receivedEvent.getCurrJobDuration());
nowDeviceState.setJobDurationTotal(lastedDeviceState.getJobDurationTotal() + receivedEvent.getCurrJobDuration());
} }
nowDeviceState.setCurrLocalDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); nowDeviceState.setCurrLocalDate(localDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
nowDeviceState.setLastBootTime(onData.getReportTime()); nowDeviceState.setLastBootTime(onData.getReportTime());
nowDeviceState.setTheDayJobDuration(lastedDeviceState.getTheDayJobDuration() + workingDuration);
nowDeviceState.setJobDurationTotal(lastedDeviceState.getJobDurationTotal() + workingDuration);
/*nowDeviceState.setTheDayJobDuration(lastedDeviceState.getTheDayJobDuration() + workingDuration);
nowDeviceState.setJobDurationTotal(lastedDeviceState.getJobDurationTotal() + workingDuration);*/
nowDeviceState.setReportTime(reportTime); nowDeviceState.setReportTime(reportTime);
} else { } else {
// 待机或开机 // 待机或开机
nowDeviceState = lastedDeviceState; nowDeviceState = lastedDeviceState;
} }
deviceTotalDataStat.update(nowDeviceState);
nowDeviceState.setTheDayDuration(lastedDeviceState.getTheDayDuration() + workingDuration);
if (dataSource == 1) {
nowDeviceState.setTheDayDuration(lastedDeviceState.getTheDayDuration() + workingDuration);
}else {
nowDeviceState.setTheDayDuration(lastedDeviceState.getTheDayDuration() + receivedEvent.getCurrJobDuration());
}
if (lastPwStat == 0) { if (lastPwStat == 0) {
// 如果上次是关机消息那么这次就是开机消息 // 如果上次是关机消息那么这次就是开机消息
// 记录本次开机作为上次开机时间 // 记录本次开机作为上次开机时间
@ -266,6 +273,7 @@ public class IotMonitoringDataJob {
onDataState.update(nowDeviceState); onDataState.update(nowDeviceState);
onData = nowDeviceState; onData = nowDeviceState;
} }
deviceTotalDataStat.update(nowDeviceState);
} }
// 如果上次是待机并且这次也是待机那么就不需要发送了 // 如果上次是待机并且这次也是待机那么就不需要发送了
if (((!(lastWorkingStat == 2 && machineWorkingStat == 2)) if (((!(lastWorkingStat == 2 && machineWorkingStat == 2))

Loading…
Cancel
Save