|
@@ -223,7 +223,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
223
|
223
|
//全部执行完成的大概时间在30-40分钟
|
224
|
224
|
@Override
|
225
|
225
|
public void configure() throws Exception {
|
226
|
|
- /* RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
|
|
226
|
+ RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
|
227
|
227
|
.routeId("insert-OrgAndWellSource")
|
228
|
228
|
.setHeader("date", constant(getDate()))
|
229
|
229
|
.process(exchange -> {
|
|
@@ -404,8 +404,9 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
404
|
404
|
.setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
|
405
|
405
|
.to("jdbc:centralbase")
|
406
|
406
|
.split(body())
|
407
|
|
- .setBody(simple("select v.WELL_COMMON_NAME jh,v.PROD_DATE rq,v.OIL_PRODUCTION_METHOD cyfs,v.PUMP_DIAMETER yz,v.BACK_PRES hysx,v.MAX_TUBING_PRES yysx,v.MAX_CASING_PRES tysx,v.PUMP_DEPTH bs from V_PC_PRO_COM_DAILY_CYYC_A2 v where v.PROD_DATE = to_date('${header.date}','yyyy-MM-dd') and v.WELL_COMMON_NAME = '${body[wellid]}' "))
|
408
|
|
- .to("jdbc:oracle")
|
|
407
|
+// .setBody(simple("select v.WELL_COMMON_NAME jh,v.PROD_DATE rq,v.OIL_PRODUCTION_METHOD cyfs,v.PUMP_DIAMETER yz,v.BACK_PRES hysx,v.MAX_TUBING_PRES yysx,v.MAX_CASING_PRES tysx,v.PUMP_DEPTH bs from V_PC_PRO_COM_DAILY_CYYC_A2 v where v.PROD_DATE = to_date('${header.date}','yyyy-MM-dd') and v.WELL_COMMON_NAME = '${body[wellid]}' "))
|
|
408
|
+ .setBody(simple("select v.WELL_COMMON_NAME jh,v.PROD_DATE rq,v.OIL_PRODUCTION_METHOD cyfs,v.PUMP_DIAMETER yz,v.BACK_PRES hysx,v.MAX_TUBING_PRES yysx,v.MAX_CASING_PRES tysx,v.PUMP_DEPTH bs from V_PC_PRO_COM_DAILY_CYYC v where v.PROD_DATE = to_date('${header.date}','yyyy-MM-dd') and v.WELL_COMMON_NAME = '${body[wellid]}' "))
|
|
409
|
+ .to("jdbc:oracle_A2")
|
409
|
410
|
.split(body()).process(exchange -> {
|
410
|
411
|
Message in = exchange.getIn();
|
411
|
412
|
HashMap<String, Object> aRow = in.getBody(HashMap.class);
|
|
@@ -441,8 +442,9 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
441
|
442
|
.setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
|
442
|
443
|
.to("jdbc:centralbase")
|
443
|
444
|
.split(body())
|
444
|
|
- .setBody(simple("select WELL_COMMON_NAME jh, PROD_DATE rq,PROD_TIME scsj, LIQ_PROD_DAILY rcyl1,OIL_PROD_DAILY rcyl,GAS_PROD_DAILY rcql,WATER_CUT hs,REMARKS bz from V_PC_PRO_COM_DAILY_CYYC_A2 where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}'"))
|
445
|
|
- .to("jdbc:oracle")
|
|
445
|
+// .setBody(simple("select WELL_COMMON_NAME jh, PROD_DATE rq,PROD_TIME scsj, LIQ_PROD_DAILY rcyl1,OIL_PROD_DAILY rcyl,GAS_PROD_DAILY rcql,WATER_CUT hs,REMARKS bz from V_PC_PRO_COM_DAILY_CYYC_A2 where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}'"))
|
|
446
|
+ .setBody(simple("select WELL_COMMON_NAME jh, PROD_DATE rq,PROD_TIME scsj, LIQ_PROD_DAILY rcyl1,OIL_PROD_DAILY rcyl,GAS_PROD_DAILY rcql,WATER_CUT hs,REMARKS bz from V_PC_PRO_COM_DAILY_CYYC where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}'"))
|
|
447
|
+ .to("jdbc:oracle_A2")
|
446
|
448
|
.split(body()).process(exchange -> {
|
447
|
449
|
Message in = exchange.getIn();
|
448
|
450
|
HashMap<String, Object> aRow = in.getBody(HashMap.class);
|
|
@@ -521,8 +523,12 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
521
|
523
|
aRow.put("JH", aRow.get("jh").toString());
|
522
|
524
|
in.setHeader("JH",aRow.get("jh").toString());
|
523
|
525
|
})
|
524
|
|
- .setBody(simple("Select t.jh, t.prod_date rq,t.static_pressure jy,t.flow_pres ly,t.pump_diameter bj, t.pump_depth bs,t.pump_efficiency bx,t.rotate_frequency zs,t.stroke_length cc,t.stroke_frequency cs, t.pump_type blx,t.elec_frequency dl,t.dynamic_liq_level dym FROM V_TEMP_WELL_MECH_ALL t where jh = '${body[JH]}'"))
|
525
|
|
- .to("jdbc:oracle")
|
|
526
|
+// .setBody(simple("Select t.jh, t.prod_date rq,t.static_pressure jy,t.flow_pres ly,t.pump_diameter bj, t.pump_depth bs,t.pump_efficiency bx,t.rotate_frequency zs,
|
|
527
|
+// t.stroke_length cc,t.stroke_frequency cs, t.pump_type blx,t.elec_frequency dl,t.dynamic_liq_level dym FROM V_TEMP_WELL_MECH_ALL t where jh = '${body[JH]}'"))
|
|
528
|
+ .setBody(simple("select * from ( Select v.WELL_COMMON_NAME, t.prod_date rq,t.static_pressure jy,t.flow_pres ly,t.pump_diameter bj, t.pump_depth bs,t.pump_efficiency bx, t.rotate_frequency zs,t.stroke_length cc,t.stroke_frequency cs, t.pump_type blx,t.elec_frequency dl, t.dynamic_liq_level dym " +
|
|
529
|
+ " FROM V_TEMP_WELL_MECH_ALL t inner join V_CD_WELL_SOURCE_YC v on t.well_id = v.well_id and v.WELL_COMMON_NAME = '${body[JH]}' " +
|
|
530
|
+ " order by rq desc) where rownum = 1"))
|
|
531
|
+ .to("jdbc:oracle_A2")
|
526
|
532
|
.split(body()).process(exchange -> {
|
527
|
533
|
Message in = exchange.getIn();
|
528
|
534
|
HashMap<String, Object> aRow = in.getBody(HashMap.class);
|
|
@@ -567,7 +573,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
567
|
573
|
.end();
|
568
|
574
|
|
569
|
575
|
//计量间产液量
|
570
|
|
- from("timer:mytimer6?period=3600000")
|
|
576
|
+ from("timer:mytimer6?period=3600000")
|
571
|
577
|
.routeId("oracle-6")
|
572
|
578
|
.setBody(simple("select max(prod_date) from centralbase.cb_temp_well_mech_runtime "))
|
573
|
579
|
.to("jdbc:centralbase")
|
|
@@ -651,7 +657,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
651
|
657
|
.end();
|
652
|
658
|
|
653
|
659
|
//稀稠油信息
|
654
|
|
- from("timer:mytimer9?period=3600000")
|
|
660
|
+ /* from("timer:mytimer9?period=3600000")
|
655
|
661
|
.routeId("oracle-9")
|
656
|
662
|
.setBody(simple("select max(prod_date) from centralbase.cb_temp_well_mech_runtime "))
|
657
|
663
|
.to("jdbc:centralbase")
|
|
@@ -679,7 +685,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
679
|
685
|
.to("jdbc:centralbase")
|
680
|
686
|
.doCatch(Exception.class)
|
681
|
687
|
.log("${header.date}"+" routeId:oracle-9-> centralbase.cb_pc_pro_wellbore_status_daily update date faild")
|
682
|
|
- .end();
|
|
688
|
+ .end();*/
|
683
|
689
|
|
684
|
690
|
|
685
|
691
|
from("timer:mytimer10?period=3600000")
|
|
@@ -735,7 +741,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
|
735
|
741
|
})
|
736
|
742
|
.doCatch(Exception.class)
|
737
|
743
|
.log("${header.date}"+" rocketMQ send data faild")
|
738
|
|
- .end();*/
|
|
744
|
+ .end();
|
739
|
745
|
|
740
|
746
|
|
741
|
747
|
//手动导入井信息
|