|
@@ -13,8 +13,10 @@ import javax.annotation.Resource;
|
13
|
13
|
import java.math.BigDecimal;
|
14
|
14
|
import java.time.LocalDateTime;
|
15
|
15
|
import java.time.format.DateTimeFormatter;
|
|
16
|
+import java.util.ArrayList;
|
16
|
17
|
import java.util.Arrays;
|
17
|
18
|
import java.util.HashMap;
|
|
19
|
+import java.util.List;
|
18
|
20
|
|
19
|
21
|
/**
|
20
|
22
|
* class name: CamelJDBCCofRealTimeConfiguration.java
|
|
@@ -125,6 +127,25 @@ public class CamelJDBCCofRealTimeConfiguration {
|
125
|
127
|
aRow.put("susp_max_load",susp_max_load);
|
126
|
128
|
aRow.put("susp_min_load",susp_min_load);
|
127
|
129
|
}
|
|
130
|
+ //对于位移没有数据,所有数据都在载荷中的特殊数据做特别处理
|
|
131
|
+ if ((aRow.get("displacement") == null || aRow.get("displacement").equals("")) && (aRow.get("disp_load") != null && !aRow.get("disp_load").equals(""))){
|
|
132
|
+ String disp_load = aRow.get("disp_load").toString().replaceAll(";", ",");
|
|
133
|
+ Double[][] doubles = SGTUtil.encodeToDoubleArray(disp_load);
|
|
134
|
+ aRow.put("sgt", SGTUtil.encodeToString(doubles));
|
|
135
|
+ String[] split = disp_load.split(",");
|
|
136
|
+ List<String> list = new ArrayList<>();
|
|
137
|
+ for (int i = 0; i < split.length; i++) {
|
|
138
|
+ if (i%2 != 0){
|
|
139
|
+ BigDecimal bigDecimal = new BigDecimal(split[i]).divide(new BigDecimal("100.0"));
|
|
140
|
+ list.add(bigDecimal.toString());
|
|
141
|
+ }
|
|
142
|
+ }
|
|
143
|
+ String[] loads = list.toArray(new String[0]);
|
|
144
|
+ Double susp_max_load = max(loads);
|
|
145
|
+ Double susp_min_load = min(loads);
|
|
146
|
+ aRow.put("susp_max_load",susp_max_load);
|
|
147
|
+ aRow.put("susp_min_load",susp_min_load);
|
|
148
|
+ }
|
128
|
149
|
if (aRow.get("stroke") == null) aRow.put("stroke", "0.0");
|
129
|
150
|
if (aRow.get("frequency") == null) aRow.put("frequency", "0.0");
|
130
|
151
|
if (aRow.get("susp_max_load") == null) aRow.put("susp_max_load", "0.0");
|