Browse Source

入湖服务器添加日志。

DESKTOP-6LTVLN7\Liumouren 3 weeks ago
parent
commit
af7d6e61ac

+ 1 - 0
src/main/java/com/skyversation/poiaddr/addquery/AddressQueryEngine.java

@@ -310,6 +310,7 @@ public class AddressQueryEngine {
         JSONArray dataList = new JSONArray();
         dataList.add(datas);
         params.put("dataList", dataList);
+        System.out.println("=====松江区规范化地名地址库,入湖=====:" + JSONObject.toJSONString(params));
         ResponseEntity response = AddressNetTools.getInstance().requestGetOrPost(HttpMethod.POST, Constant.SJ_BIGDATA_KAFKA_URL, params, initSigns(), 0);
         if (response != null && response.hasBody()) {
             return response.getBody() + "";

+ 10 - 4
src/main/java/com/skyversation/poiaddr/controller/CorporateLibraryController.java

@@ -191,14 +191,19 @@ public class CorporateLibraryController {
     @PostMapping(value = "/tyaToServer")
     public Object tyaToServer(@RequestParam(name = "startOidIndex") Integer startOidIndex, @RequestParam(name = "page") Integer page, @RequestParam(name = "pageSize") Integer pageSize) {
         long startTime = System.currentTimeMillis();
-        startOidIndex = startOidIndex + (page * pageSize);
-        yyskAddressStandardizationService.tyaToServer(startOidIndex, page, pageSize);
-        long endTime = System.currentTimeMillis();
         try {
-            ExcelReaderUtils.writeToExcel(ScheduledTasks.LogInfos, "C:\\Users\\Liumouren\\Desktop\\logInfos_" + startTime + ".xlsx");
+            startOidIndex = startOidIndex + (page * pageSize);
+            yyskAddressStandardizationService.tyaToServer(startOidIndex, page, pageSize);
         } catch (Exception e) {
             e.printStackTrace();
+        } finally {
+            try {
+                ExcelReaderUtils.writeToExcel(ScheduledTasks.LogInfos, "C:\\Users\\Liumouren\\Desktop\\logInfos_" + startTime + ".xlsx");
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
+        long endTime = System.currentTimeMillis();
         return "处理完成!用时" + (endTime - startTime) / 1000 + "秒!";
     }
 
@@ -242,6 +247,7 @@ public class CorporateLibraryController {
         long endTime = System.currentTimeMillis();
         return "处理完成!用时" + (endTime - startTime) / 1000 + "秒!";
     }
+
     /**
      * 先获取文件内容,然后根据address当做key,standardAddress和经纬度作为value
      * 读取结果文件,然后存成Map,接着获取经纬度

+ 3 - 4
src/main/java/com/skyversation/poiaddr/service/impl/YyskAddressStandardizationServiceImpl.java

@@ -645,7 +645,7 @@ public class YyskAddressStandardizationServiceImpl {
             dataItem.put("lat", tYyszAddress.getLocation().split(",")[1]);
             dataItem.put("x",tYyszAddress.getLon());
             dataItem.put("y",tYyszAddress.getLat());
-            dataItem.put("address_type", tYyszAddress.getType());*/
+            dataItem.put("data_type", tYyszAddress.getType());*/
 
 //            YyszAddressV3All表映射
             /*dataItem.put("sourceaddress", tYyszAddress.getSourceaddress());
@@ -658,7 +658,7 @@ public class YyskAddressStandardizationServiceImpl {
             dataItem.put("lat", tYyszAddress.getLat());
             dataItem.put("x",tYyszAddress.getX());
             dataItem.put("y",tYyszAddress.getY());
-            dataItem.put("address_type", tYyszAddress.getNo1());*/
+            dataItem.put("data_type", tYyszAddress.getNo1());*/
 
 //          zhili表映射
             dataItem.put("sourceaddress", tYyszAddress.getSourceaddress());
@@ -671,11 +671,10 @@ public class YyskAddressStandardizationServiceImpl {
             dataItem.put("lat", tYyszAddress.getLat());
             dataItem.put("x",tYyszAddress.getX());
             dataItem.put("y",tYyszAddress.getY());
-            dataItem.put("address_type", "zl_v3");
+            dataItem.put("data_type", "zl_v3");
 
             dataItem.put("createtime", getCurrentDateTime());
             dataItem.put("updatetime", getCurrentDateTime());
-//            dataItem.put("match_level", tYyszAddress.getMatchLevel());
             datas.add(dataItem);
         }
         dataList.put("data", datas);