From 7cfcc209ece8d9ca5146733514c24b322ac58974 Mon Sep 17 00:00:00 2001 From: gaojuan1 Date: Tue, 8 Oct 2024 18:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9C=B0=E5=9D=80=E5=8C=B9?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data_handle/ThirdPriceMappingBatch.groovy | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy index 2d7515aa7..0fbf352f7 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/data_handle/ThirdPriceMappingBatch.groovy @@ -7,6 +7,7 @@ import com.fangjia.script.commData.CommonDatautils import com.fangjia.script.common.DataHandleUtils import com.fangjia.script.gj.district.FangjiaClientUtils import com.fangjia.script.util.CommonUtils +import com.fangjia.script.util.DataUtil import com.fangjia.script.util.DateUtils import com.fangjia.script.util.MongoUtils import com.mongodb.BasicDBObject @@ -34,7 +35,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ final DBCollection dataProcessColl = MongoUtils.getCollectionByName("fangjia_craw", "data_process", "192.168.0.235", 27018) - def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM")); + def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM")); static main(args) { runBatch(new ThirdPriceMappingBatch(), args); @@ -76,7 +77,17 @@ class ThirdPriceMappingBatch extends BaseBatch{ address = address + nmd.district } address = address + nmd.name - def jsonObject = FangjiaClientUtils.newMatch(nmd.city, address, "property", true) + def jsonObject = FangjiaClientUtils.newMatch(nmd.city, address, "property", false) + if(!jsonObject){ + if(DataUtil.isPreciseAddress(nmd.address)){ + address = nmd.city + if(nmd.district){ + address = address + nmd.district + } + address = address + nmd.address + jsonObject = FangjiaClientUtils.newMatch(nmd.city, address, "property", false) + } + } if(jsonObject) { def udata = new BasicDBObject() udata.put("match_id",jsonObject.get("id")) @@ -161,7 +172,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ } def addOldMatchResult(){ - def citys = ["上海"]//CommonUtils.findAllCity() + def citys = CommonUtils.findAllCity() def keys = new BasicDBObject() keys.put("_id", 1) @@ -199,7 +210,7 @@ class ThirdPriceMappingBatch extends BaseBatch{ println addCount.get()+"/"+total +" [旧匹配找到] " }else{ - println addCount.get()+"/"+total +" [旧匹配没找到] " + println addCount.get()+"/"+total +" [旧匹配没找到] "+d._id.toString() } } catch (Exception e) { e.printStackTrace()