lijian 3 anni fa
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 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 -> {
@@ -735,7 +735,7 @@ public class CamelJDBCConfiguration /*extends RouteBuilder */ {
735 735
                         })
736 736
                         .doCatch(Exception.class)
737 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 142
                     Date yunpingtai = fomat2.parse(mydate);
143 143
                     long time1 = timeRtu.getTime();
144 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 148
                     int hours = (int) ((time2 - time1) / (1000 * 60 * 60));
146 149
                     //云平台和采集时间相差要小于4小时
147
-                    if (hours <4 && !"".equals(gtsj) ){
150
+                    if (hours <4 && !"".equals(gtsj) && hours1< 4 ){
148 151
                         z.setZd_init_sgt(gtsj);//位移载荷点
149 152
 //                        z.setProd_date(mydate);
150 153
 //                        z.setSys_date(sysDate);
@@ -174,12 +177,12 @@ public class CamelRestConfiguration extends RouteBuilder {
174 177
 
175 178
         JSONObject body = new JSONObject();
176 179
 
177
-          /*restConfiguration()
180
+          restConfiguration()
178 181
                 .component("servlet")
179 182
                 .host("11.72.128.71");
180 183
         from("timer:mytimer?period=3600000")
181 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 186
                 .unmarshal().json(JsonLibrary.Jackson)
184 187
                 .split(body()).process(
185 188
                 exchange -> {
@@ -216,7 +219,7 @@ public class CamelRestConfiguration extends RouteBuilder {
216 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 220
                 .to("jdbc:centralbase")
218 221
                 .doCatch(Exception.class)
219
-                .end();*/
222
+                .end();
220 223
 
221 224
       /* JSONArray jsonArray = new JSONArray();
222 225
         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: 12121
167 167
 
168 168
 
169 169
 rocketmq: