Browse Source

bug xiugai

gxt 3 years ago
parent
commit
881f42292c

+ 1 - 5
pom.xml

@@ -101,7 +101,7 @@
101
         </dependency>
101
         </dependency>
102
         <dependency>
102
         <dependency>
103
             <groupId>org.springframework.boot</groupId>
103
             <groupId>org.springframework.boot</groupId>
104
-            <artifactId>spring-boot-starter-web</artifactId>
104
+            <artifactId>spring-boot-starter-actuator</artifactId>
105
         </dependency>
105
         </dependency>
106
 <!--        <dependency>-->
106
 <!--        <dependency>-->
107
 <!--            <groupId>org.springframework.boot</groupId>-->
107
 <!--            <groupId>org.springframework.boot</groupId>-->
@@ -117,10 +117,6 @@
117
         </dependency>
117
         </dependency>
118
         <dependency>
118
         <dependency>
119
             <groupId>org.apache.camel.springboot</groupId>
119
             <groupId>org.apache.camel.springboot</groupId>
120
-            <artifactId>camel-rest-starter</artifactId>
121
-        </dependency>
122
-        <dependency>
123
-            <groupId>org.apache.camel.springboot</groupId>
124
             <artifactId>camel-file-starter</artifactId>
120
             <artifactId>camel-file-starter</artifactId>
125
         </dependency>
121
         </dependency>
126
         <dependency>
122
         <dependency>

+ 3 - 3
src/main/java/com/gct/tools/etlcamelhuge/controller/GtController.java

@@ -55,14 +55,14 @@ public class GtController {
55
         jdbcTemplate = new JdbcTemplate(dataSource);
55
         jdbcTemplate = new JdbcTemplate(dataSource);
56
         long sumData = 0;
56
         long sumData = 0;
57
         try {
57
         try {
58
-                if (wellList.isEmpty() || wellList.size()==0 ){
58
+                if (wellList.isEmpty()){
59
                     String sql = String.format("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 " +
59
                     String sql = String.format("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 " +
60
                             " where ti.well_id = so.well_id  and ti.prod_date between '%s' and '%s' " ,startDate,endDate);
60
                             " where ti.well_id = so.well_id  and ti.prod_date between '%s' and '%s' " ,startDate,endDate);
61
                     sumData = sendDataToMQ(sql);
61
                     sumData = sendDataToMQ(sql);
62
                 }else {
62
                 }else {
63
-                    for (int i = 0; i < wellList.size(); i++) {
63
+                    for (String s : wellList) {
64
                         String sql = String.format("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 " +
64
                         String sql = String.format("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 " +
65
-                                " where ti.well_id = so.well_id and ti.well_id = '%s' and ti.prod_date between '%s' and '%s' ", wellList.get(i), startDate, endDate);
65
+                                " where ti.well_id = so.well_id and ti.well_id = '%s' and ti.prod_date between '%s' and '%s' ", s, startDate, endDate);
66
                         sumData = sendDataToMQ(sql);
66
                         sumData = sendDataToMQ(sql);
67
                     }
67
                     }
68
                 }
68
                 }

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

@@ -54,7 +54,7 @@ public class CamelInsertA2Configuration {
54
                             Timestamp timestamp = (Timestamp) aRow.get("prod_date");
54
                             Timestamp timestamp = (Timestamp) aRow.get("prod_date");
55
                             Instant instant = Instant.ofEpochMilli(timestamp.getTime());
55
                             Instant instant = Instant.ofEpochMilli(timestamp.getTime());
56
                             LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
56
                             LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
57
-                            aRow.put("prod_date",localDateTime.toLocalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
57
+                            aRow.put("prod_date",localDateTime.minusDays(1).toLocalDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
58
                         })
58
                         })
59
                         .setBody(simple(" insert into DMS_DBA01_RCYL (JH, RQ, RCYL) values('${body[well_id]}', to_date(to_char('${body[prod_date]}'),'yyyy-MM-dd'),'${body[liq_prod_daily]}') "))
59
                         .setBody(simple(" insert into DMS_DBA01_RCYL (JH, RQ, RCYL) values('${body[well_id]}', to_date(to_char('${body[prod_date]}'),'yyyy-MM-dd'),'${body[liq_prod_daily]}') "))
60
                         .to("jdbc:insertA2")
60
                         .to("jdbc:insertA2")
@@ -63,6 +63,6 @@ public class CamelInsertA2Configuration {
63
         };
63
         };
64
     }
64
     }
65
     private String getDate(){
65
     private String getDate(){
66
-        return  LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
66
+        return  LocalDateTime.now().minusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
67
     }
67
     }
68
 }
68
 }