From 18217e5952a5356fc630129d28068f74765b1f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Sun, 8 Feb 2026 21:31:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B7=E6=9C=AC=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sync/Seawater2SeabirdSyncBatch.groovy | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/Seawater2SeabirdSyncBatch.groovy diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/Seawater2SeabirdSyncBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/Seawater2SeabirdSyncBatch.groovy new file mode 100644 index 000000000..449f3ab03 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/sync/Seawater2SeabirdSyncBatch.groovy @@ -0,0 +1,51 @@ +package com.fangjia.script.sync + +import com.fangjia.core.util.DateUtil +import com.fangjia.script.BaseBatch +import com.fangjia.script.BatchOwner +import com.fangjia.script.Watcher +import com.fangjia.script.util.CommonUtils +import com.fangjia.script.util.DbUtils +import com.fangjia.script.util.ElasticUtils +import com.mongodb.BasicDBObject + +/** + * ¹¦ÄÜ˵Ã÷: + */ +@BatchOwner(Watcher.WangWenYan) +class Seawater2SeabirdSyncBatchBatch extends BaseBatch { + + + static void main(String[] args) { + runBatch(new Seawater2SeabirdSyncBatchBatch(), args) + } + + @Override + void process(Object args) { + + CommonUtils.findAllCity().each { city -> + ElasticUtils.executeSqlQuery("select * from latest_seawater where city = '${city}' and cat = 'sell' and p_date > 20250601",{Map house-> + def seabird = new BasicDBObject() + seabird.put("city", city) + seabird.put("cat", house.cat) + seabird.put("region", house.region) + seabird.put("name", house.name) + seabird.put("address", house.address) + seabird.put("district_name", house.district_name) + seabird.put("total_price", house.total_price) + seabird.put("area", house.area) + seabird.put("height", house.height) + seabird.put("fitment", house.fitment) + seabird.put("hall", house.hall) + seabird.put("room", house.room) + seabird.put("toilet", house.toilet) + seabird.put("floor", house.floor) + seabird.put("url", house.url) + seabird.put("direction", house.direction) + seabird.put("status", 0) + seabird.put("publish_date", DateUtil.parseDate(house.p_date.toString(), "yyyyMMdd")) + DbUtils.seabird.save(seabird) + }) + } + } +}