From 832450a795e1d3717615ea80345fdd2e4fd4fb2f Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 21 Apr 2023 16:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script/gj/crawl/OfficeProcess.groovy | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy index ba3adf88d..e422b860f 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/crawl/OfficeProcess.groovy @@ -2,6 +2,7 @@ package com.fangjia.script.gj.crawl import com.fangjia.core.RegionData import com.fangjia.core.util.DataUtil +import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.looplineinfo.InsidePolygon import com.fangjia.script.looplineinfo.Point import com.fangjia.script.util.CosineSimilarAlgorithm @@ -26,7 +27,11 @@ class OfficeProcess { "goojia", "goojia123456", "ru.yandex.clickhouse.ClickHouseDriver") static main(args) { - def filePath = "D:\\数据\\写字楼\\6城未匹配上的写字楼.xlsx" + def filePath = "/home/goojia/gj/6城未匹配上的写字楼.xlsx" + + if(CommonDatautils.isWindow()){ + filePath = "D:\\数据\\写字楼\\6城未匹配上的写字楼.xlsx" + } def task = new OfficeProcess(); // task.run("D:\\数据\\写字楼\\6城合并写字楼.xlsx") @@ -38,10 +43,10 @@ class OfficeProcess { // task.nameFiter(filePath) // task.typeFiter(filePath) // task.nameFlag(filePath) -//// task.updateFlagToDB(filePath) + task.updateFlagToDB(filePath) // task.updateFlagToDB2(filePath) - task.checkRegion() +// task.checkRegion() } @@ -452,12 +457,8 @@ class OfficeProcess { pstmt.setString(5, d['D']) println count+" "+d['L']+" "+d['K']+" "+d['B']+" "+d['C']+" "+d['D'] pstmt.addBatch() - if(count % 100 ==0) { - try { - pstmt.executeBatch() - } catch (Exception e) { - - } + if(count % 10 ==0) { + pstmt.executeBatch() } } }