Este commit está contenido en:
caixiang 2022-10-18 09:35:35 +08:00
padre 0dfff37b3d
commit 2cc12991b0
Se han modificado 2 ficheros con 24 adiciones y 7 borrados

Ver fichero

@ -76,12 +76,23 @@ public enum InfluxClient {
}
public void insert(Event event, String measurement){
Point point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId())
.addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue())
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
Point point = null;
if(event.getBatchNum()==null){
point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId())
.addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue())
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
}else {
point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId())
//.addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("batchNum", event.getBatchNum().toString())
.addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue())
.time(event.getTime().toEpochMilli(), WritePrecision.MS);
}
writeApi.writePoint(point);
}
@ -114,7 +125,7 @@ public enum InfluxClient {
}else {
point = Point.measurement(measurement)
.addTag("transationId", event.getTransationId())
.addTag("inspectionSheetId", event.getInspectionSheetId())
//.addTag("inspectionSheetId", event.getInspectionSheetId())
.addTag("batchNum", event.getBatchNum().toString())
.addTag("argName", event.getArgName())
.addField("argValue", event.getArgValue())

Ver fichero

@ -19,4 +19,10 @@ public class Event {
private String argName;
private String argValue;
private String BatchNum;
private String InspectionSheetId;
}