Jelajahi Sumber

朱老板的年报数据入湖BUG修复

DESKTOP-6LTVLN7\Liumouren 3 minggu lalu
induk
melakukan
2e82cf4e97

+ 2 - 2
pom.xml

@@ -43,12 +43,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
 <!--        本地运行要注释掉,打war包的时候要放开-->
-            <!--<exclusions>
+            <exclusions>
                 <exclusion>
                     <groupId>org.springframework.boot</groupId>
                     <artifactId>spring-boot-starter-tomcat</artifactId>
                 </exclusion>
-            </exclusions>-->
+            </exclusions>
         </dependency>
         <!-- MySQL 驱动依赖 -->
         <!--        <dependency>-->

+ 12 - 2
src/main/java/com/skyversation/poiaddr/service/impl/YyskAddressStandardizationServiceImpl.java

@@ -578,7 +578,7 @@ public class YyskAddressStandardizationServiceImpl {
                             DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss");
                             String output = dateTime.format(outputFormatter);
                             data.put(key, output);
-                        }else{
+                        } else {
                             data.put(key, ScheduledTasks.timestampToFormat(item.get(key).toString()));
                         }
                     } else if (key.equals("anchedate")) {
@@ -600,6 +600,16 @@ public class YyskAddressStandardizationServiceImpl {
                     datas.clear();
                 }
             }
+            if (datas.size() > 0) {
+                dataList.put("data", datas);
+                try {
+                    System.out.println(AddressQueryEngine.getInstance().putDataToSJ_Big_Data3(dataList));
+                    System.out.println("补录数据条数:" + datas.size());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                datas.clear();
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -734,7 +744,7 @@ public class YyskAddressStandardizationServiceImpl {
         }
         if (startFileIndex + sort != endFileIndex) {
             startFileIndex += sort;
-            readFileToPg(fileRootPath, startFileIndex, endFileIndex, sort, pageSize);
+            readFileToKafka(fileRootPath, startFileIndex, endFileIndex, sort, pageSize);
         } else {
             System.out.println("<<<<<<<<------任务处理完成!");
         }

+ 6 - 5
src/main/resources/application.properties

@@ -9,12 +9,13 @@ spring.servlet.multipart.max-request-size=300MB
 #spring.datasource.password=root
 #spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 # \u6570\u636E\u5E93\u914D\u7F6E\uFF08\u672C\u5730\u8C03\u8BD5\u73AF\u5883\uFF09
-spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/postgres?stringtype=unspecified&u003fuseUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=PRC&useSSL=false&tinyInt1isBit=false
-spring.datasource.username=postgres
-spring.datasource.password=WE176852439@lmx
-#spring.datasource.url=jdbc:postgresql://121.43.55.7:5433/postgres?stringtype=unspecified&u003fuseUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=PRC&useSSL=false&tinyInt1isBit=false
+#spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/postgres?stringtype=unspecified&u003fuseUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=PRC&useSSL=false&tinyInt1isBit=false
 #spring.datasource.username=postgres
-#spring.datasource.password=SKYversation@0816
+#spring.datasource.password=WE176852439@lmx
+# \u90E8\u7F72\u914D\u7F6E
+spring.datasource.url=jdbc:postgresql://121.43.55.7:5433/postgres?stringtype=unspecified&u003fuseUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&serverTimezone=PRC&useSSL=false&tinyInt1isBit=false
+spring.datasource.username=postgres
+spring.datasource.password=SKYversation@0816
 spring.datasource.driver-class-name=org.postgresql.Driver
 # JPA\u914D\u7F6E
 spring.jpa.hibernate.ddl-auto=update