diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy index dbc8722a3..5542b2c16 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/district/DistrictHouseBatch.groovy @@ -87,8 +87,12 @@ class DistrictHouseBatch extends BaseBatch { long rentCount = 0 for(def name : names){ String key = name.toString().trim() + "_" + district.get("region") + "_" + district.get("city") - sellCount = sellCount + (sellCountMap.get(key) ? sellCountMap.get(key) : 0) - rentCount = rentCount + (rentCountMap.get(key) ? rentCountMap.get(key) : 0) + if(!sellCount){ + sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0 + } + if(!rentCount){ + rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0 + } } saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn) }