新poi九级拆分
This commit is contained in:
+54
@@ -0,0 +1,54 @@
|
||||
package com.fangjia.script.gj.data_handle
|
||||
|
||||
import com.fangjia.script.BaseBatch
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.Watcher
|
||||
import com.fangjia.script.commData.CommonDatautils
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
class PoiNineSplitBatch extends BaseBatch{
|
||||
|
||||
static main(args) {
|
||||
runBatch(new PoiNineSplitBatch(), args)
|
||||
}
|
||||
|
||||
@Override
|
||||
void process(Object args) {
|
||||
run()
|
||||
}
|
||||
def run(){
|
||||
def i = 0;
|
||||
while(i<360) {
|
||||
def fileName = "/home/goojia/gj/new_poi/new_poi_address_split_${i}.xlsx"
|
||||
if (CommonDatautils.isWindow()) {
|
||||
fileName = "D:\\数据\\new_poi\\new_poi_address_split_${i}.xlsx"
|
||||
}
|
||||
|
||||
File file = new File(fileName);
|
||||
if (file.exists()) {
|
||||
ExcelUtils.multiThreadingModify(fileName, { d ->
|
||||
if (d['C'] && !d['G']) {
|
||||
println d['C'] +" "+ d['E']
|
||||
def jsonObject = com.fangjia.script.gj.district.FangjiaClientUtils.formatNinelevel(d['C'], d['D'] + d['E'])
|
||||
if (jsonObject) {
|
||||
if (jsonObject.get("street") && jsonObject.get("street") != "null") {
|
||||
d['G'] = jsonObject.get("street")
|
||||
}
|
||||
if (jsonObject.get("streetNumber") && jsonObject.get("streetNumber") != "null") {
|
||||
d['H'] = jsonObject.get("streetNumber")
|
||||
}
|
||||
if (jsonObject.get("township") && jsonObject.get("township") != "null") {
|
||||
d['I'] = jsonObject.get("township")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
println fileName +" 九级拆分完成"
|
||||
}else{
|
||||
println fileName +" 文件不存在"
|
||||
}
|
||||
i++
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user