From 3c487b12495eae103d050cd09820927390eeae5c Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Tue, 5 Mar 2024 15:10:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E6=9C=AC=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/district/DistrictHouseBatch.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 fa3d57a71..a66decde6 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 @@ -3,6 +3,7 @@ package com.fangjia.script.district import com.fangjia.script.util.MongoUtils import com.mongodb.DBCursor +import org.apache.commons.lang3.StringUtils import java.util.List @@ -55,6 +56,15 @@ class DistrictHouseBatch extends BaseBatch { String key = district.get("name").toString().trim() + "_" + district.get("region") + "_" + district.get("city") long sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0 long rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0 + if(district.alias != null){ + for(String alia: district.alias){ + if(StringUtils.isNotBlank(alia)){ + key = alia.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) + } + } + } saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn) } @@ -109,6 +119,7 @@ class DistrictHouseBatch extends BaseBatch { fields.put("city", 1) fields.put("region", 1) fields.put("name", 1) + fields.put("alias", 1) def ret = []