lijian 3 years ago
parent
commit
ca82305bea

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

@@ -223,7 +223,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
223
             //全部执行完成的大概时间在30-40分钟
223
             //全部执行完成的大概时间在30-40分钟
224
             @Override
224
             @Override
225
             public void configure() throws Exception {
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
                         .routeId("insert-OrgAndWellSource")
227
                         .routeId("insert-OrgAndWellSource")
228
                         .setHeader("date", constant(getDate()))
228
                         .setHeader("date", constant(getDate()))
229
                         .process(exchange -> {
229
                         .process(exchange -> {
@@ -735,7 +735,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
735
                         })
735
                         })
736
                         .doCatch(Exception.class)
736
                         .doCatch(Exception.class)
737
                         .log("${header.date}"+" rocketMQ send data faild")
737
                         .log("${header.date}"+" rocketMQ send data faild")
738
-                        .end();
738
+                        .end();*/
739
 
739
 
740
 
740
 
741
                 //手动导入井信息
741
                 //手动导入井信息

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

@@ -142,9 +142,12 @@ public class CamelRestConfiguration extends RouteBuilder {
142
                     Date yunpingtai = fomat2.parse(mydate);
142
                     Date yunpingtai = fomat2.parse(mydate);
143
                     long time1 = timeRtu.getTime();
143
                     long time1 = timeRtu.getTime();
144
                     long time2 = yunpingtai.getTime();
144
                     long time2 = yunpingtai.getTime();
145
+                    Date date = new Date();
146
+                    long time3 = date.getTime();
147
+                    int hours1 = (int) ((time3 - time2) / (1000 * 60 * 60));
145
                     int hours = (int) ((time2 - time1) / (1000 * 60 * 60));
148
                     int hours = (int) ((time2 - time1) / (1000 * 60 * 60));
146
                     //云平台和采集时间相差要小于4小时
149
                     //云平台和采集时间相差要小于4小时
147
-                    if (hours <4 && !"".equals(gtsj) ){
150
+                    if (hours <4 && !"".equals(gtsj) && hours1< 4 ){
148
                         z.setZd_init_sgt(gtsj);//位移载荷点
151
                         z.setZd_init_sgt(gtsj);//位移载荷点
149
 //                        z.setProd_date(mydate);
152
 //                        z.setProd_date(mydate);
150
 //                        z.setSys_date(sysDate);
153
 //                        z.setSys_date(sysDate);
@@ -174,12 +177,12 @@ public class CamelRestConfiguration extends RouteBuilder {
174
 
177
 
175
         JSONObject body = new JSONObject();
178
         JSONObject body = new JSONObject();
176
 
179
 
177
-          /*restConfiguration()
180
+          restConfiguration()
178
                 .component("servlet")
181
                 .component("servlet")
179
                 .host("11.72.128.71");
182
                 .host("11.72.128.71");
180
         from("timer:mytimer?period=3600000")
183
         from("timer:mytimer?period=3600000")
181
                 .setBody(simple(body.toJSONString()))
184
                 .setBody(simple(body.toJSONString()))
182
-                .to("rest:post:/api-service/device/query?appKey=SR5vY4bED7&type=simple&pageSize=5000&page=1")
185
+                .to("rest:post:/api-service/device/query?appKey=SR5vY4bED7&type=simple&pageSize=8000&page=1")
183
                 .unmarshal().json(JsonLibrary.Jackson)
186
                 .unmarshal().json(JsonLibrary.Jackson)
184
                 .split(body()).process(
187
                 .split(body()).process(
185
                 exchange -> {
188
                 exchange -> {
@@ -216,7 +219,7 @@ public class CamelRestConfiguration extends RouteBuilder {
216
 //                        "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${in.header.date}' )"))
219
 //                        "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and  prod_date = '${in.header.date}' )"))
217
                 .to("jdbc:centralbase")
220
                 .to("jdbc:centralbase")
218
                 .doCatch(Exception.class)
221
                 .doCatch(Exception.class)
219
-                .end();*/
222
+                .end();
220
 
223
 
221
       /* JSONArray jsonArray = new JSONArray();
224
       /* JSONArray jsonArray = new JSONArray();
222
         JSONObject search = new JSONObject();
225
         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: 12121
167
 
167
 
168
 
168
 
169
 rocketmq:
169
 rocketmq: