空值判断

This commit is contained in:
2025-02-22 11:18:04 +08:00
parent b519a64b9c
commit b5efda084a
@@ -36,7 +36,7 @@ class TownStandardBatch extends BaseBatch{
def fullCityMap = CommonDatautils.queryFullNameCity() def fullCityMap = CommonDatautils.queryFullNameCity()
def regionMap = com.fangjia.script.commData.CommonDatautils.queryAllRegionNameByCity() def regionMap = com.fangjia.script.commData.CommonDatautils.queryAllRegionNameByCity()
def regionFullNameMap = com.fangjia.script.commData.CommonDatautils.queryAllRegionFullNameByCity() def regionFullNameMap = com.fangjia.script.commData.CommonDatautils.queryAllRegionFullNameByCity()
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(5)
def updateList = [] def updateList = []
def addAliasList = [] def addAliasList = []
@@ -380,7 +380,12 @@ class TownStandardBatch extends BaseBatch{
o.put("district", arrs[4]) o.put("district", arrs[4])
o.put("lng", arrs[5]) o.put("lng", arrs[5])
o.put("lat", arrs[6]) o.put("lat", arrs[6])
o.put("data_source", arrs[7]) if(arrs[7]){
o.put("data_source", arrs[7])
}else{
o.put("data_source", "")
}
rets << o rets << o
}catch(Exception e){ }catch(Exception e){
println arrs println arrs
@@ -459,7 +464,7 @@ class TownStandardBatch extends BaseBatch{
totalCount.addAndGet(1) totalCount.addAndGet(1)
def rMap = regionFullNameMap.get(r.city) def rMap = regionFullNameMap.get(r.city)
if (rMap) { if (rMap) {
def townMap = null//CommonDatautils.queryTownByCity(r.city, ["city", "district", "mzb_district_name", "street", "alias", "shape"]) // def townMap = CommonDatautils.queryTownByCity(r.city, ["city", "district", "mzb_district_name", "street", "alias", "shape"])
def set = rMap.keySet() def set = rMap.keySet()
println totalCount.get() +" "+r.city + " " + set.size() println totalCount.get() +" "+r.city + " " + set.size()
// if (set.size() >= 1) { // if (set.size() >= 1) {