Bläddra i källkod

修改冲程冲次为A2的

gxt 1 år sedan
förälder
incheckning
07408867e0

+ 1 - 1
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelInsertA2Configuration.java

@@ -50,7 +50,7 @@ public class CamelInsertA2Configuration {
50 50
                         .split(body()).process(exchange -> {
51 51
                             Message in = exchange.getIn();
52 52
                             HashMap<String, Object> aRow = in.getBody(HashMap.class);
53
-                            aRow.putIfAbsent("liq_prod_daily", "0.0");
53
+                            //aRow.putIfAbsent("liq_prod_daily", null);
54 54
                             Timestamp timestamp = (Timestamp) aRow.get("prod_date");
55 55
                             Instant instant = Instant.ofEpochMilli(timestamp.getTime());
56 56
                             LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());

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

@@ -158,8 +158,8 @@ public class CamelJDBCCofRealTimeConfiguration  {
158 158
                             in.setHeader("well_id",wellId);
159 159
                             sendDataToRocketMQ(wellName,wellId,prodDate,strokeLength,strokeFrequency,sgt);
160 160
                         })
161
-                        .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) " +
162
-                                "select '${body[well_name]}','${body[dyna_create_time]}','${body[stroke]}','${body[frequency]}','${body[susp_max_load]}','${body[susp_min_load]}','${body[sgt]}' " +
161
+                        .setBody(simple("insert into centralbase.cb_temp_well_mech_runtime(well_id,prod_date,susp_max_load,susp_min_load,sgt) " +
162
+                                "select '${body[well_name]}','${body[dyna_create_time]}','${body[susp_max_load]}','${body[susp_min_load]}','${body[sgt]}' " +
163 163
                                 "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${body[dyna_create_time]}' )"))
164 164
                         .to("jdbc:centralbase")
165 165
                         .setBody(simple("update centralbase.sys_access_well_control set sgt_last_time = '${header.sgt_last_time}' where well_id ='${header.well_id}' "))

+ 19 - 0
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelJDBCConfiguration.java

@@ -389,6 +389,25 @@ public class CamelJDBCConfiguration {
389 389
                         .doCatch(Exception.class)
390 390
                         .log("${header.date}"+" routeId:update-volDaily-liq_prod_daily ->  centralbase.cb_pc_pro_wellbore_vol_daily update data failed")
391 391
                         .end();
392
+
393
+                RouteDefinition runTime = from("timer:mytimer-update-runTime-strokeAndFrequency?period=10800000")
394
+                        .routeId("update-runTime-strokeAndFrequency")
395
+                        .process(exchange -> {
396
+                            Message in = exchange.getIn();
397
+                            in.setHeader("date",getDate());
398
+                        });
399
+                        setMyBody(runTime)
400
+                        .setBody(simple("select distinct  jh,rq,cc,cs from DBA01 where rq  = to_date('${header.date}','yyyy-MM-dd')and jh ='${header.well_id}' and qyrq is not null "))
401
+                        .to("jdbc:oracle")
402
+                        .split(body())
403
+                        .setBody(simple("insert into centralbase.cb_temp_well_mech_runtime(well_id,prod_date,stroke_length,stroke_frequency)" +
404
+                                "select '${body[JH]}','${body[RQ]}','${body[CC]}','${body[CS]}'" +
405
+                                "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[JH]}' and  prod_date = '${body[RQ]}' )"))
406
+                        .doTry()
407
+                        .to("jdbc:centralbase")
408
+                        .doCatch(Exception.class)
409
+                        .log("${header.date}"+" routeId:update-runTime-strokeAndFrequency ->  centralbase.cb_temp_well_mech_runtime update data failed")
410
+                        .end();
392 411
             };
393 412
         };
394 413