lijian 3 年之前
父節點
當前提交
e6ef3b208d

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

@@ -73,4 +73,5 @@ public class ZDJG_WELL {
73 73
     private double xsd;
74 74
     private double jljcyl;
75 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 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 92
         URL restURL = new URL(url);
93 93
         /*
94 94
          * 此处的urlConnection对象实际上是根据URL的请求协议(此处是http)生成的URLConnection类 的子类HttpURLConnection
@@ -159,7 +159,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
159 159
         SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
160 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 164
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
165 165
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -268,7 +268,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
268 268
             //全部执行完成的大概时间在30-40分钟
269 269
             @Override
270 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 272
                         .routeId("insert-OrgAndWellSource")
273 273
                         .setHeader("date", constant(getDate()))
274 274
                         .process(exchange -> {
@@ -764,7 +764,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
764 764
 
765 765
                 from("timer:mytimer11?period=3600000")
766 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 768
                         .to("jdbc:centralbase")
769 769
                         .split(body())
770 770
                         .doTry()
@@ -783,7 +783,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
783 783
                         })
784 784
                         .doCatch(Exception.class)
785 785
                         .log("${header.date}"+" rocketMQ send data faild")
786
-                        .end();*/
786
+                        .end();
787 787
 
788 788
                 //稀稠油信息
789 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 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 72
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
73 73
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -124,7 +124,7 @@ public class CamelRestConfiguration extends RouteBuilder {
124 124
     public ZDJG_WELL loadGtData(String param, String well_id, String sysDate) throws Exception {
125 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 129
         //此处的urlConnection对象实际上是根据URL的请求协议(此处是http) 生成的URLConnection类 的子类HttpURLConnection
130 130
         HttpURLConnection conn = (HttpURLConnection) restURL.openConnection();
@@ -223,14 +223,14 @@ public class CamelRestConfiguration extends RouteBuilder {
223 223
     @Override
224 224
     public synchronized void configure() throws Exception {
225 225
 
226
-        JSONObject body = new JSONObject();
226
+      /*  JSONObject body = new JSONObject();
227 227
 
228 228
           restConfiguration()
229 229
                 .component("servlet")
230 230
                 .host("11.72.128.71");
231 231
         from("timer:mytimer?period=3600000")
232 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 234
                 .unmarshal().json(JsonLibrary.Jackson)
235 235
                 .split(body()).process(
236 236
                 exchange -> {
@@ -272,7 +272,7 @@ public class CamelRestConfiguration extends RouteBuilder {
272 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 273
                 .to("jdbc:centralbase")
274 274
                 .doCatch(Exception.class)
275
-                .end();
275
+                .end();*/
276 276
 
277 277
       /* JSONArray jsonArray = new JSONArray();
278 278
         JSONObject search = new JSONObject();

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

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