瀏覽代碼

修复一些依赖问题 尝试解决黑油山数据导入

xusirui 3 月之前
父節點
當前提交
72045a370d

+ 14 - 4
pom.xml

@@ -21,6 +21,16 @@
21
         <lombok.version>1.16.18</lombok.version>
21
         <lombok.version>1.16.18</lombok.version>
22
         <lombok-maven-plugin.version>1.16.6.1</lombok-maven-plugin.version>
22
         <lombok-maven-plugin.version>1.16.6.1</lombok-maven-plugin.version>
23
     </properties>
23
     </properties>
24
+    <repositories>
25
+        <repository>
26
+            <id>central</id>
27
+            <url>https://repo1.maven.org/maven2</url>
28
+        </repository>
29
+        <repository>
30
+            <id>ojdbc</id>
31
+            <url>https://maven.aliyun.com/repository/central</url>
32
+        </repository>
33
+    </repositories>
24
     <dependencyManagement>
34
     <dependencyManagement>
25
         <dependencies>
35
         <dependencies>
26
             <dependency>
36
             <dependency>
@@ -47,9 +57,9 @@
47
             <version>2.0-SNAPSHOT</version>
57
             <version>2.0-SNAPSHOT</version>
48
         </dependency>
58
         </dependency>
49
         <dependency>
59
         <dependency>
50
-            <groupId>com.oracle</groupId>
60
+            <groupId>com.oracle.database.jdbc</groupId>
51
             <artifactId>ojdbc6</artifactId>
61
             <artifactId>ojdbc6</artifactId>
52
-            <version>11.2.0.4.0-atlassian-hosted</version>
62
+            <version>11.2.0.4</version>
53
         </dependency>
63
         </dependency>
54
         <dependency>
64
         <dependency>
55
             <groupId>org.springframework.boot</groupId>
65
             <groupId>org.springframework.boot</groupId>
@@ -62,12 +72,12 @@
62
         <dependency>
72
         <dependency>
63
             <groupId>io.springfox</groupId>
73
             <groupId>io.springfox</groupId>
64
             <artifactId>springfox-swagger2</artifactId>
74
             <artifactId>springfox-swagger2</artifactId>
65
-            <version>2.9.0</version>
75
+            <version>2.10.0</version>
66
         </dependency>
76
         </dependency>
67
         <dependency>
77
         <dependency>
68
             <groupId>io.springfox</groupId>
78
             <groupId>io.springfox</groupId>
69
             <artifactId>springfox-swagger-ui</artifactId>
79
             <artifactId>springfox-swagger-ui</artifactId>
70
-            <version>2.9.0</version>
80
+            <version>2.10.0</version>
71
         </dependency>
81
         </dependency>
72
         <dependency>
82
         <dependency>
73
             <groupId>org.springframework.boot</groupId>
83
             <groupId>org.springframework.boot</groupId>

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

@@ -3,10 +3,10 @@ package com.gct.tools.etlcamelhuge;
3
 import org.springframework.boot.SpringApplication;
3
 import org.springframework.boot.SpringApplication;
4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5
 import org.springframework.scheduling.annotation.EnableAsync;
5
 import org.springframework.scheduling.annotation.EnableAsync;
6
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
6
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
7
 
7
 
8
 @SpringBootApplication
8
 @SpringBootApplication
9
-@EnableSwagger2
9
+@EnableSwagger2WebMvc
10
 @EnableAsync
10
 @EnableAsync
11
 public class EtlCamelHugeApplication {
11
 public class EtlCamelHugeApplication {
12
     public static void main(String[] args) {
12
     public static void main(String[] args) {

+ 11 - 16
src/main/java/com/gct/tools/etlcamelhuge/routeconfig/CamelJDBCConfiguration.java

@@ -240,12 +240,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
240
     public String getDate() {
240
     public String getDate() {
241
         return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
241
         return LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
242
     }
242
     }
243
-//    public static String getDate()
244
-//    {
245
-//        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
246
-//        String date = df.format(new java.util.Date());// new Date()为获取当前系统时间
247
-//        return date;
248
-//    }
243
+
249
 
244
 
250
     @Resource(name = "diagnoseMessageProducer")
245
     @Resource(name = "diagnoseMessageProducer")
251
     private MessageProducer producer;
246
     private MessageProducer producer;
@@ -271,7 +266,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
271
             //全部执行完成的大概时间在30-40分钟
266
             //全部执行完成的大概时间在30-40分钟
272
             @Override
267
             @Override
273
             public void configure() throws Exception {
268
             public void configure() throws Exception {
274
-               /* RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
269
+                RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
275
                         .routeId("insert-OrgAndWellSource")
270
                         .routeId("insert-OrgAndWellSource")
276
                         .setHeader("date", constant(getDate()))
271
                         .setHeader("date", constant(getDate()))
277
                         .process(exchange -> {
272
                         .process(exchange -> {
@@ -295,7 +290,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
295
                         }).end();
290
                         }).end();
296
                 setMyBody(OrgAndWellSource)
291
                 setMyBody(OrgAndWellSource)
297
 
292
 
298
-                        .setBody(simple("select distinct a.well_common_name jh, a.org_name_cj zyq, a.GROUP_UNIT_NAME cw, a.station_name zd, a.project_name qk from V_CD_WELL_SOURCE_YC a where a.well_common_name ='${header.well_id}' "))
293
+                        .setBody(simple("select distinct a.well_common_name jh, a.org_name_cj zyq, a.GROUP_UNIT_NAME cw, a.station_name zd, a.project_name qk from V_CD_WELL_SOURCE_YC_HJ a where a.well_common_name ='${header.well_id}' "))
299
 //                        .setBody(simple("select  distinct jh,cydmc,zyq,zk,qyrq,sccw,qk,bz from DBA01 where jh ='${header.well_id}' "))
294
 //                        .setBody(simple("select  distinct jh,cydmc,zyq,zk,qyrq,sccw,qk,bz from DBA01 where jh ='${header.well_id}' "))
300
                         .to("jdbc:oracle_A2")
295
                         .to("jdbc:oracle_A2")
301
                         .transform()
296
                         .transform()
@@ -452,8 +447,8 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
452
                         .setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
447
                         .setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
453
                         .to("jdbc:centralbase")
448
                         .to("jdbc:centralbase")
454
                         .split(body())
449
                         .split(body())
455
-//                        .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]}' "))
456
-                       .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]}' "))
450
+//                        .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_HYS_CYYC_A2 v  where  v.PROD_DATE = to_date('${header.date}','yyyy-MM-dd')  and  v.WELL_COMMON_NAME = '${body[wellid]}' "))
451
+                       .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_HYS_CYYC v  where  v.PROD_DATE = to_date('${header.date}','yyyy-MM-dd')  and  v.WELL_COMMON_NAME = '${body[wellid]}' "))
457
                         .to("jdbc:oracle_A2")
452
                         .to("jdbc:oracle_A2")
458
                         .split(body()).process(exchange -> {
453
                         .split(body()).process(exchange -> {
459
                     Message in = exchange.getIn();
454
                     Message in = exchange.getIn();
@@ -490,14 +485,14 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
490
                         .setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
485
                         .setBody(simple("SELECT well_id wellid FROM centralbase.sys_access_well_control where access_status = '1' and error_id = '1' "))
491
                         .to("jdbc:centralbase")
486
                         .to("jdbc:centralbase")
492
                         .split(body())
487
                         .split(body())
493
-//                        .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]}'"))
494
-//                        .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]}' and LIQ_PROD_DAILY >0 "))
488
+//                        .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_HYS_CYYC_A2 where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}'"))
489
+//                        .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_HYS_CYYC where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}' and LIQ_PROD_DAILY >0 "))
495
                         .setBody(simple("select  WELL_COMMON_NAME jh,\n" +
490
                         .setBody(simple("select  WELL_COMMON_NAME jh,\n" +
496
                                 "                       PROD_DATE rq,\n" +
491
                                 "                       PROD_DATE rq,\n" +
497
                                 "                       PROD_TIME scsj,\n" +
492
                                 "                       PROD_TIME scsj,\n" +
498
-                                "                       (select  sum(LIQ_PROD_DAILY) from V_PC_PRO_COM_DAILY_CYYC where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}') rcyl1,\n" +
493
+                                "                       (select  sum(LIQ_PROD_DAILY) from V_PC_PRO_COM_DAILY_HYS_CYYC where prod_date = to_date('${header.date}','yyyy-MM-dd') and WELL_COMMON_NAME = '${body[wellid]}') rcyl1,\n" +
499
                                 "                       OIL_PROD_DAILY rcyl,GAS_PROD_DAILY rcql,WATER_CUT hs,REMARKS bz\n" +
494
                                 "                       OIL_PROD_DAILY rcyl,GAS_PROD_DAILY rcql,WATER_CUT hs,REMARKS bz\n" +
500
-                            "                       from   V_PC_PRO_COM_DAILY_CYYC\n" +
495
+                            "                       from   V_PC_PRO_COM_DAILY_HYS_CYYC\n" +
501
                             "                       where prod_date = to_date('${header.date}','yyyy-MM-dd')\n" +
496
                             "                       where prod_date = to_date('${header.date}','yyyy-MM-dd')\n" +
502
                             "                       and WELL_COMMON_NAME = '${body[wellid]}'  "))
497
                             "                       and WELL_COMMON_NAME = '${body[wellid]}'  "))
503
                         .to("jdbc:oracle_A2")
498
                         .to("jdbc:oracle_A2")
@@ -580,7 +575,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
580
                         in.setHeader("JH",aRow.get("jh").toString());
575
                         in.setHeader("JH",aRow.get("jh").toString());
581
                 })
576
                 })
582
 //                    .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,
577
 //                    .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,
583
-// 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]}'"))
578
+// t.stroke_length cc,t.stroke_frequency cs, t.pump_type blx,t.elec_frequency dl,t.dynamic_liq_level dym   FROM V_PC_PRO_COM_DAILY_HYS t where jh = '${body[JH]}'"))
584
                     .setBody(simple("select  * from ( Select  v.WELL_COMMON_NAME 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  " +
579
                     .setBody(simple("select  * from ( Select  v.WELL_COMMON_NAME 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  " +
585
                             " 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]}' and t.dynamic_liq_level > 0 " +
580
                             " 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]}' and t.dynamic_liq_level > 0 " +
586
                             " order by rq desc) where rownum = 1"))
581
                             " order by rq desc) where rownum = 1"))
@@ -773,7 +768,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder*/ {
773
                         })
768
                         })
774
                         .doCatch(Exception.class)
769
                         .doCatch(Exception.class)
775
                         .log("${header.date}"+" rocketMQ send data faild")
770
                         .log("${header.date}"+" rocketMQ send data faild")
776
-                        .end();*/
771
+                        .end();
777
 
772
 
778
 
773
 
779
                /* from("timer:mytimer12?period=604800000")
774
                /* from("timer:mytimer12?period=604800000")

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

@@ -25,7 +25,7 @@ import java.util.*;
25
 import java.util.concurrent.atomic.AtomicInteger;
25
 import java.util.concurrent.atomic.AtomicInteger;
26
 
26
 
27
 
27
 
28
-@Configuration
28
+//@Configuration
29
 public class CamelRestConfiguration extends RouteBuilder {
29
 public class CamelRestConfiguration extends RouteBuilder {
30
 
30
 
31
 
31
 
@@ -62,7 +62,7 @@ public class CamelRestConfiguration extends RouteBuilder {
62
         return string;
62
         return string;
63
     }
63
     }
64
 
64
 
65
-    public Expression getDate() {
65
+    public String getDate() {
66
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
66
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
67
         String date = df.format(new java.util.Date());// new Date()为获取当前系统时间
67
         String date = df.format(new java.util.Date());// new Date()为获取当前系统时间
68
         return date;
68
         return date;