|
|
@ -137,14 +137,21 @@ public class IotMonitoringDataJob { |
|
|
// 上次启动时间 |
|
|
// 上次启动时间 |
|
|
Long lastBootTime = lastDeviceState.getLastBootTime(); |
|
|
Long lastBootTime = lastDeviceState.getLastBootTime(); |
|
|
Long lastTheDayDuration = lastDeviceState.getTheDayDuration(); |
|
|
Long lastTheDayDuration = lastDeviceState.getTheDayDuration(); |
|
|
|
|
|
lastTheDayDuration = lastTheDayDuration == null ? 0L : lastTheDayDuration; |
|
|
Long lastTheDayJobDuration = lastDeviceState.getTheDayJobDuration(); |
|
|
Long lastTheDayJobDuration = lastDeviceState.getTheDayJobDuration(); |
|
|
|
|
|
lastTheDayJobDuration = lastTheDayJobDuration == null ? 0L : lastTheDayJobDuration; |
|
|
Long lastJobDurationTotal = lastDeviceState.getJobDurationTotal(); |
|
|
Long lastJobDurationTotal = lastDeviceState.getJobDurationTotal(); |
|
|
|
|
|
lastJobDurationTotal = lastJobDurationTotal == null ? 0L : lastJobDurationTotal; |
|
|
Long lastTheDayJobCount = lastDeviceState.getTheDayJobCount(); |
|
|
Long lastTheDayJobCount = lastDeviceState.getTheDayJobCount(); |
|
|
|
|
|
lastTheDayJobCount = lastTheDayJobCount == null ? 0L : lastTheDayJobCount; |
|
|
Long lastJobTotal = lastDeviceState.getJobTotal(); |
|
|
Long lastJobTotal = lastDeviceState.getJobTotal(); |
|
|
|
|
|
lastJobTotal = lastJobTotal == null ? 0L : lastJobTotal; |
|
|
Integer machinePwrStat = command.getMachinePwrStat(); |
|
|
Integer machinePwrStat = command.getMachinePwrStat(); |
|
|
Integer machineWorkingStat = command.getMachineWorkingStat(); |
|
|
Integer machineWorkingStat = command.getMachineWorkingStat(); |
|
|
Long currJobDuration = command.getCurrJobDuration(); |
|
|
Long currJobDuration = command.getCurrJobDuration(); |
|
|
|
|
|
currJobDuration = currJobDuration == null ? 0L : currJobDuration; |
|
|
Long currJobCount = command.getCurrJobCount(); |
|
|
Long currJobCount = command.getCurrJobCount(); |
|
|
|
|
|
currJobCount = currJobCount == null ? 0L : currJobCount; |
|
|
// 当前数据 |
|
|
// 当前数据 |
|
|
DeviceTotalData nowDeviceState = new DeviceTotalData(); |
|
|
DeviceTotalData nowDeviceState = new DeviceTotalData(); |
|
|
nowDeviceState.setMachinePwrStat(machinePwrStat); |
|
|
nowDeviceState.setMachinePwrStat(machinePwrStat); |
|
|
@ -299,9 +306,17 @@ public class IotMonitoringDataJob { |
|
|
if (iotMac.equals(machineIotMac)) { |
|
|
if (iotMac.equals(machineIotMac)) { |
|
|
deviceTotalData = new DeviceTotalData(); |
|
|
deviceTotalData = new DeviceTotalData(); |
|
|
Object productionTotal = JSONUtil.getByPath(JSONUtil.parse(o), "productionTotal"); |
|
|
Object productionTotal = JSONUtil.getByPath(JSONUtil.parse(o), "productionTotal"); |
|
|
deviceTotalData.setJobTotal(Integer.toUnsignedLong(Integer.parseInt(String.valueOf(productionTotal)))); |
|
|
|
|
|
|
|
|
if(productionTotal == null) { |
|
|
|
|
|
deviceTotalData.setJobTotal(0L); |
|
|
|
|
|
}else { |
|
|
|
|
|
deviceTotalData.setJobTotal(Integer.toUnsignedLong(Integer.parseInt(String.valueOf(productionTotal)))); |
|
|
|
|
|
} |
|
|
Object workTotalTotal = JSONUtil.getByPath(JSONUtil.parse(o), "workTotalTotal"); |
|
|
Object workTotalTotal = JSONUtil.getByPath(JSONUtil.parse(o), "workTotalTotal"); |
|
|
deviceTotalData.setJobDurationTotal(Integer.toUnsignedLong(Integer.parseInt(String.valueOf(workTotalTotal))) * 3600); |
|
|
|
|
|
|
|
|
if(workTotalTotal == null) { |
|
|
|
|
|
deviceTotalData.setJobDurationTotal(0L); |
|
|
|
|
|
}else { |
|
|
|
|
|
deviceTotalData.setJobDurationTotal(Integer.toUnsignedLong(Integer.parseInt(String.valueOf(workTotalTotal))) * 3600); |
|
|
|
|
|
} |
|
|
Object startingUpTime = JSONUtil.getByPath(JSONUtil.parse(o), "startingUpTime"); |
|
|
Object startingUpTime = JSONUtil.getByPath(JSONUtil.parse(o), "startingUpTime"); |
|
|
LocalDateTime lastBootTime = LocalDateTime |
|
|
LocalDateTime lastBootTime = LocalDateTime |
|
|
.parse((String) startingUpTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
|
|
.parse((String) startingUpTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
|
|
|