瀏覽代碼

导入功图时 添加字段最大上下行电流

xsr 8 月之前
父節點
當前提交
15d5da065e

+ 4 - 0
src/main/java/com/gct/tools/etlcamelhuge/entity/ZDJG_WELL.java

@@ -74,4 +74,8 @@ public class ZDJG_WELL {
74 74
     private double jljcyl;
75 75
     private String type;
76 76
     private double phd;
77
+
78
+    private double maxCurrent;
79
+
80
+    private double minCurrent;
77 81
 }

+ 12 - 2
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelRestConfiguration.java

@@ -10,6 +10,7 @@ import com.gct.tools.etlcamelhuge.util.TransUtil;
10 10
 import org.apache.camel.Message;
11 11
 import org.apache.camel.builder.RouteBuilder;
12 12
 import org.apache.camel.model.dataformat.JsonLibrary;
13
+import org.checkerframework.checker.units.qual.A;
13 14
 import org.springframework.context.annotation.Configuration;
14 15
 import org.springframework.jdbc.core.JdbcTemplate;
15 16
 
@@ -22,6 +23,7 @@ import java.net.URL;
22 23
 import java.net.URLEncoder;
23 24
 import java.text.SimpleDateFormat;
24 25
 import java.util.*;
26
+import java.util.concurrent.atomic.AtomicInteger;
25 27
 
26 28
 
27 29
 @Configuration
@@ -242,6 +244,8 @@ public class CamelRestConfiguration extends RouteBuilder {
242 244
         System.out.println(URLEncoder.encode("红004"));
243 245
     }
244 246
 
247
+    static AtomicInteger printCount = new AtomicInteger(1);
248
+
245 249
 
246 250
     public ZDJG_WELL loadGtDataNew(String param, String well_id, String sysDate) throws Exception {
247 251
 //        String date = getDate();
@@ -325,6 +329,8 @@ public class CamelRestConfiguration extends RouteBuilder {
325 329
                         z.setSxzh(Double.parseDouble(jsonObject.getString("maxLoad")));//最大载荷
326 330
                         z.setXxzh(Double.parseDouble(jsonObject.getString("minLoad")));//最小载荷
327 331
                         z.setWell_common_name(well_id);
332
+                        z.setMaxCurrent(jsonObject.getDoubleValue("maxCurrent"));
333
+                        z.setMinCurrent(jsonObject.getDoubleValue("minCurrent"));
328 334
                     }
329 335
 //                System.out.println("step 3 ===="+z);
330 336
 //                }
@@ -485,13 +491,17 @@ public class CamelRestConfiguration extends RouteBuilder {
485 491
                             aRow.put("frequency", zdjg_well.getFrequence());
486 492
                             aRow.put("dyna_create_time", zdjg_well.getProd_date());
487 493
                             aRow.put("well_name", zdjg_well.getStroke() == 0 || zdjg_well.getSxzh() == 0 ? "No01" : aRow.get("well_id"));
494
+                            aRow.put("max_current",zdjg_well.getMaxCurrent());
495
+                            aRow.put("min_current",zdjg_well.getMinCurrent());
488 496
                             aRow.put("phd",0);
489 497
                         })
490 498
 //                .log("${body[phd]}"+ "sql" + "${body[well_name]}")
491 499
 //                .filter(simple("${body[well_name]} != 'No01'"))
492 500
                 .doTry()
493
-                .setBody(simple("insert into centralbase.cb_temp_well_mech_runtime(well_id,prod_date,stroke_length,stroke_frequency,susp_max_load,susp_min_load,sgt,elec_pump_current_b) " +
494
-                        "values( '${body[well_name]}','${in.header.date}','${body[stroke]}','${body[frequency]}','${body[susp_max_load]}','${body[susp_min_load]}','${body[sgt]}','${body[phd]}')  "))
501
+                .setBody(simple("insert into centralbase.cb_temp_well_mech_runtime(well_id,prod_date,stroke_length,stroke_frequency" +
502
+                        ",susp_max_load,susp_min_load,sgt,elec_pump_current_b,max_current,min_current) " +
503
+                        "values( '${body[well_name]}','${in.header.date}','${body[stroke]}','${body[frequency]}','" +
504
+                        "${body[susp_max_load]}','${body[susp_min_load]}','${body[sgt]}','${body[phd]}','${body[max_current]}','${body[min_current]}')  "))
495 505
 //                        "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${in.header.date}' )"))
496 506
                 .to("jdbc:centralbase")
497 507
                 .doCatch(Exception.class)