+19
-5
@@ -3,6 +3,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.gj.ccb.FileUtils
|
||||
import com.fangjia.script.looplineinfo.InsidePolygon
|
||||
import com.fangjia.script.looplineinfo.Point
|
||||
import com.fangjia.script.util.CosineSimilarAlgorithm
|
||||
@@ -43,10 +44,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()
|
||||
|
||||
}
|
||||
|
||||
@@ -382,13 +383,26 @@ class OfficeProcess {
|
||||
def updateFlagToDB(filePath){
|
||||
def datas = ExcelUtils.read(filePath,0,1)
|
||||
def total = datas.size()
|
||||
println total
|
||||
def index = 0
|
||||
def rets = []
|
||||
for(def d : datas){
|
||||
def sql = "alter table office update option='${d['L']}', format_name='${d['K']}' where city='${d['B']}' and region='${d['C']}' and name='${d['D']}';"
|
||||
index++
|
||||
sqlInstance.executeUpdate(sql)
|
||||
println index+"/"+ total
|
||||
rets << sql
|
||||
//sqlInstance.executeUpdate(sql)
|
||||
//println index+"/"+ total
|
||||
println sql
|
||||
}
|
||||
|
||||
|
||||
def filePath1 = "d:\\Data1.txt"
|
||||
File file = new File(filePath1)
|
||||
def s = new StringBuffer()
|
||||
for(def r : rets){
|
||||
s.append(r+"\n")
|
||||
}
|
||||
file.write(s.toString())
|
||||
}
|
||||
|
||||
|
||||
@@ -457,7 +471,7 @@ class OfficeProcess {
|
||||
pstmt.setString(5, d['D'])
|
||||
println count+" "+d['L']+" "+d['K']+" "+d['B']+" "+d['C']+" "+d['D']
|
||||
pstmt.addBatch()
|
||||
if(count % 10 ==0) {
|
||||
if(count % 100 ==0) {
|
||||
pstmt.executeBatch()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user