|
|
|
@ -126,7 +126,7 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
).name("machineIotDataReceivedEvent kafka Sink"); |
|
|
|
|
|
|
|
// 发送到OSS存储 |
|
|
|
String outputPath = ApolloConfig.get(ConfigConstant.SINK_OSS_PATH); |
|
|
|
/*String outputPath = ApolloConfig.get(ConfigConstant.SINK_OSS_PATH); |
|
|
|
|
|
|
|
StreamingFileSink<String> sink = StreamingFileSink.forRowFormat( |
|
|
|
new Path(outputPath), |
|
|
|
@ -173,7 +173,7 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
public String map(MachineIotDataReceivedEvent value) { |
|
|
|
return JSONUtil.toJsonStr(value); |
|
|
|
} |
|
|
|
}).addSink(sink); |
|
|
|
}).addSink(sink);*/ |
|
|
|
|
|
|
|
env.execute("gizwits iot data formatter job"); |
|
|
|
} |
|
|
|
@ -196,8 +196,8 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
machineIotDataReceivedEvent.setMachinePwrStat(0); |
|
|
|
machineIotDataReceivedEvent.setMachineWorkingStat(0); |
|
|
|
machineIotDataReceivedEvent.setAccJobCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrDuration(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrJobCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrJobDuration(0L); |
|
|
|
machineIotDataReceivedEvent.setJobDurationOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setJobCountOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setDurationOfThePeriod(0L); |
|
|
|
@ -229,8 +229,8 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
machineIotDataReceivedEvent.setMachinePwrStat(1); |
|
|
|
machineIotDataReceivedEvent.setMachineWorkingStat(2); |
|
|
|
machineIotDataReceivedEvent.setAccJobCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrDuration(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrJobCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrJobDuration(0L); |
|
|
|
machineIotDataReceivedEvent.setJobDurationOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setJobCountOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setDurationOfThePeriod(0L); |
|
|
|
@ -264,7 +264,7 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
machineIotDataReceivedEvent.setMachinePwrStat(1); |
|
|
|
machineIotDataReceivedEvent.setMachineWorkingStat(1); |
|
|
|
machineIotDataReceivedEvent.setAccJobCount(0L); |
|
|
|
machineIotDataReceivedEvent.setCurrDuration(deviceStatus.getDuration()); |
|
|
|
machineIotDataReceivedEvent.setCurrJobDuration(deviceStatus.getDuration()); |
|
|
|
machineIotDataReceivedEvent.setJobDurationOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setJobCountOfTheDay(0L); |
|
|
|
machineIotDataReceivedEvent.setDurationOfThePeriod(0L); |
|
|
|
@ -273,7 +273,7 @@ public class GizWitsIotDataFormatterJob { |
|
|
|
machineIotDataReceivedEvent.setCurrStoppingDuration(0L); |
|
|
|
machineIotDataReceivedEvent.setIgStat(null); |
|
|
|
Long count = deviceStatus.getCount(); |
|
|
|
machineIotDataReceivedEvent.setCurrCount(count); |
|
|
|
machineIotDataReceivedEvent.setCurrJobCount(count); |
|
|
|
machineIotDataReceivedEvent.setReceivedTime(System.currentTimeMillis()); |
|
|
|
Date timestamp = deviceStatus.getTimestamp(); |
|
|
|
if(timestamp != null) { |
|
|
|
|