From 46b6bf7268f758ea8cf182ec397f436850446b73 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Fri, 8 Mar 2024 10:41:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E6=BA=90=E7=BB=9F=E8=AE=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fangjia/script/district/DistrictHouseBatch.groovy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) }