lijian 3 years ago
parent
commit
e6ef3b208d

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

@@ -73,4 +73,5 @@ public class ZDJG_WELL {
73
     private double xsd;
73
     private double xsd;
74
     private double jljcyl;
74
     private double jljcyl;
75
     private String type;
75
     private String type;
76
+    private double phd;
76
 }
77
 }

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

@@ -88,7 +88,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
88
 
88
 
89
 
89
 
90
     public  ArrayList<ZDJG_WELL> loadKey() throws java.lang.Exception {
90
     public  ArrayList<ZDJG_WELL> loadKey() throws java.lang.Exception {
91
-        String url = "http://11.72.128.71/api-service/device/query?appKey=SR5vY4bED7";
91
+        String url = "http://11.72.128.71/api-service/device/query?appKey=MOsEWVl8S0";
92
         URL restURL = new URL(url);
92
         URL restURL = new URL(url);
93
         /*
93
         /*
94
          * 此处的urlConnection对象实际上是根据URL的请求协议(此处是http)生成的URLConnection类 的子类HttpURLConnection
94
          * 此处的urlConnection对象实际上是根据URL的请求协议(此处是http)生成的URLConnection类 的子类HttpURLConnection
@@ -159,7 +159,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
159
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
159
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
160
         String date1 =  sf.format(ca.getTime());
160
         String date1 =  sf.format(ca.getTime());
161
 
161
 
162
-        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getSeries?appKey=SR5vY4bED7");
162
+        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getSeries?appKey=MOsEWVl8S0");
163
 
163
 
164
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
164
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
165
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
165
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -268,7 +268,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
268
             //全部执行完成的大概时间在30-40分钟
268
             //全部执行完成的大概时间在30-40分钟
269
             @Override
269
             @Override
270
             public void configure() throws Exception {
270
             public void configure() throws Exception {
271
-             /*   RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
271
+                RouteDefinition OrgAndWellSource= (RouteDefinition) from("timer:insert-OrgAndWellSource?period=86400000")
272
                         .routeId("insert-OrgAndWellSource")
272
                         .routeId("insert-OrgAndWellSource")
273
                         .setHeader("date", constant(getDate()))
273
                         .setHeader("date", constant(getDate()))
274
                         .process(exchange -> {
274
                         .process(exchange -> {
@@ -764,7 +764,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
764
 
764
 
765
                 from("timer:mytimer11?period=3600000")
765
                 from("timer:mytimer11?period=3600000")
766
                         .routeId("centralbase-1")
766
                         .routeId("centralbase-1")
767
-                        .setBody(simple("select so.well_id,so.well_common_name,so.org_id,ti.prod_date,ti.stroke_frequency,ti.stroke_length,ti.sgt from centralbase.cb_temp_well_mech_runtime ti, centralbase.cb_cd_well_source so where ti.well_id = so.well_id and ti.prod_date =(select  prod_date  from centralbase.cb_temp_well_mech_runtime GROUP BY prod_date  ORDER BY prod_date desc LIMIT  1 OFFSET 1) and ti.stroke_length > 0 "))
767
+                        .setBody(simple("select so.well_id,so.well_common_name,so.org_id,ti.prod_date,ti.stroke_frequency,ti.stroke_length,ti.sgt from centralbase.cb_temp_well_mech_runtime ti, centralbase.cb_cd_well_source so where ti.well_id = so.well_id and ti.prod_date =(select  prod_date  from centralbase.cb_temp_well_mech_runtime GROUP BY prod_date  ORDER BY prod_date desc LIMIT  1 OFFSET 1) and ti.stroke_length > 0 and ti.sgt != '' "))
768
                         .to("jdbc:centralbase")
768
                         .to("jdbc:centralbase")
769
                         .split(body())
769
                         .split(body())
770
                         .doTry()
770
                         .doTry()
@@ -783,7 +783,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
783
                         })
783
                         })
784
                         .doCatch(Exception.class)
784
                         .doCatch(Exception.class)
785
                         .log("${header.date}"+" rocketMQ send data faild")
785
                         .log("${header.date}"+" rocketMQ send data faild")
786
-                        .end();*/
786
+                        .end();
787
 
787
 
788
                 //稀稠油信息
788
                 //稀稠油信息
789
                  /* from("timer:mytimer9?period=3600000")
789
                  /* from("timer:mytimer9?period=3600000")

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

@@ -67,7 +67,7 @@ public class CamelRestConfiguration extends RouteBuilder {
67
     }
67
     }
68
 
68
 
69
     public String loadPhdDate( String well_id) throws Exception {
69
     public String loadPhdDate( String well_id) throws Exception {
70
-        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getLast?appKey=SR5vY4bED7");
70
+        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getLast?appKey=MOsEWVl8S0");
71
 
71
 
72
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
72
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
73
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
73
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -124,7 +124,7 @@ public class CamelRestConfiguration extends RouteBuilder {
124
     public ZDJG_WELL loadGtData(String param, String well_id, String sysDate) throws Exception {
124
     public ZDJG_WELL loadGtData(String param, String well_id, String sysDate) throws Exception {
125
 //        String date = getDate();
125
 //        String date = getDate();
126
 
126
 
127
-        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getLast?appKey=SR5vY4bED7");
127
+        URL restURL = new URL("http://11.72.128.71/api-service/tsdb/getLast?appKey=MOsEWVl8S0");
128
 
128
 
129
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
129
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
130
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
130
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -223,14 +223,14 @@ public class CamelRestConfiguration extends RouteBuilder {
223
     @Override
223
     @Override
224
     public synchronized void configure() throws Exception {
224
     public synchronized void configure() throws Exception {
225
 
225
 
226
-        JSONObject body = new JSONObject();
226
+      /*  JSONObject body = new JSONObject();
227
 
227
 
228
           restConfiguration()
228
           restConfiguration()
229
                 .component("servlet")
229
                 .component("servlet")
230
                 .host("11.72.128.71");
230
                 .host("11.72.128.71");
231
         from("timer:mytimer?period=3600000")
231
         from("timer:mytimer?period=3600000")
232
                 .setBody(simple(body.toJSONString()))
232
                 .setBody(simple(body.toJSONString()))
233
-                .to("rest:post:/api-service/device/query?appKey=SR5vY4bED7&type=simple&pageSize=8000&page=1")
233
+                .to("rest:post:/api-service/device/query?appKey=MOsEWVl8S0&type=simple&pageSize=8000&page=1")
234
                 .unmarshal().json(JsonLibrary.Jackson)
234
                 .unmarshal().json(JsonLibrary.Jackson)
235
                 .split(body()).process(
235
                 .split(body()).process(
236
                 exchange -> {
236
                 exchange -> {
@@ -272,7 +272,7 @@ public class CamelRestConfiguration extends RouteBuilder {
272
 //                        "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${in.header.date}' )"))
272
 //                        "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${in.header.date}' )"))
273
                 .to("jdbc:centralbase")
273
                 .to("jdbc:centralbase")
274
                 .doCatch(Exception.class)
274
                 .doCatch(Exception.class)
275
-                .end();
275
+                .end();*/
276
 
276
 
277
       /* JSONArray jsonArray = new JSONArray();
277
       /* JSONArray jsonArray = new JSONArray();
278
         JSONObject search = new JSONObject();
278
         JSONObject search = new JSONObject();

+ 1 - 1
src/main/resources/application.yml

@@ -163,7 +163,7 @@ management:
163
       cors:
163
       cors:
164
         allow-credentials: off
164
         allow-credentials: off
165
 server:
165
 server:
166
-  port: 1010
166
+  port: 11101
167
 
167
 
168
 
168
 
169
 rocketmq:
169
 rocketmq: