新增楼盘评级POI重抓
This commit is contained in:
+24
-19
@@ -10,6 +10,7 @@ import com.fangjia.script.temp.shenjian.util.HttpUtils
|
||||
import com.fangjia.script.temp.shenjian.util.SeaweedUtils
|
||||
import com.fangjia.script.util.DbUtils
|
||||
import com.fangjia.script.util.MongoUtils
|
||||
import com.mongodb.BasicDBList
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection
|
||||
import com.mongodb.DBObject
|
||||
@@ -27,7 +28,7 @@ import java.util.concurrent.Executors
|
||||
@BatchOwner(Watcher.ShenJian)
|
||||
class SeaweedAroundPoi extends BaseBatch {
|
||||
|
||||
static DBCollection conn136 = MongoUtils.getCollectionByName("fangjia", "seaweed_poi_sync", "192.168.0.136", 27017)
|
||||
static DBCollection conn136 = MongoUtils.getCollectionByName("fangjia", "seaweed_poi_sync", "192.168.0.235", 27018)
|
||||
static final def URL = "http://192.168.0.100:38080/FangJiaDataService/saveAmapPoi"
|
||||
//static ExecutorService executorService = Executors.newFixedThreadPool(2)
|
||||
|
||||
@@ -71,18 +72,20 @@ class SeaweedAroundPoi extends BaseBatch {
|
||||
// @Override
|
||||
// void run() {
|
||||
def city = obj.city
|
||||
def lng = obj.lng
|
||||
def lat = obj.lat
|
||||
List<AmapPoi> pois = GaoDeUtils.searchNearDtoByPoi(city, types, lng, lat, 1000, "")
|
||||
if (CollectionUtils.isNotEmpty(pois)) {
|
||||
String jsonStr = JSONObject.toJSONString(pois)
|
||||
HttpUtils.postForJson(URL, jsonStr)
|
||||
conn136.update(new BasicDBObject("_id", obj._id), new BasicDBObject('$set', new BasicDBObject("status", 0).append("flag", "已获取周边POI")))
|
||||
} else {
|
||||
conn136.update(new BasicDBObject("_id", obj._id), new BasicDBObject('$set', new BasicDBObject("status", 2).append("flag", "周边POI为空")))
|
||||
if (obj.lng) {
|
||||
def lng = SeaweedUtils.formatLatLng(obj.lng)
|
||||
def lat = SeaweedUtils.formatLatLng(obj.lat)
|
||||
List<AmapPoi> pois = GaoDeUtils.searchNearDtoByPoi(city, types, lng, lat, 1000, "")
|
||||
if (CollectionUtils.isNotEmpty(pois)) {
|
||||
String jsonStr = JSONObject.toJSONString(pois)
|
||||
HttpUtils.postForJson(URL, jsonStr)
|
||||
conn136.update(new BasicDBObject("_id", obj._id), new BasicDBObject('$set', new BasicDBObject("status", 0).append("flag", "已获取周边POI")))
|
||||
} else {
|
||||
conn136.update(new BasicDBObject("_id", obj._id), new BasicDBObject('$set', new BasicDBObject("status", 2).append("flag", "周边POI为空")))
|
||||
}
|
||||
Thread.sleep(500)
|
||||
println("已处理小区:" + obj)
|
||||
}
|
||||
Thread.sleep(500)
|
||||
println("已处理小区:" + obj)
|
||||
}
|
||||
// })
|
||||
// }
|
||||
@@ -92,6 +95,8 @@ class SeaweedAroundPoi extends BaseBatch {
|
||||
DBObject query = new BasicDBObject()
|
||||
query.put("cat", "district")
|
||||
query.put("visible", 0)
|
||||
//query.put("city", new BasicDBObject('$in', ["连云港", "南通", "苏州", "无锡", "盐城", "扬州"]))
|
||||
//query.put("city", "连云港")
|
||||
//query.put("_id", new ObjectId("50c96f82e4b0e15299cb018a"))
|
||||
|
||||
DBObject filter = new BasicDBObject()
|
||||
@@ -164,15 +169,15 @@ class SeaweedAroundPoi extends BaseBatch {
|
||||
|
||||
public static final Map<String, String> KEYWORDS_MAP = new HashMap<String, String>() {
|
||||
{
|
||||
//put("餐饮", "05");
|
||||
// put("地铁", "150500");
|
||||
// put("公交", "1507");
|
||||
// put("医院", "090100|090101|090200|090202|090203|090204|090205|090206|090207|090208|090209|090210|090211");
|
||||
put("餐饮", "05");
|
||||
put("地铁", "150500");
|
||||
put("公交", "1507");
|
||||
put("医院", "090100|090101|090200|090202|090203|090204|090205|090206|090207|090208|090209|090210|090211");
|
||||
// put("写字楼", "120201");
|
||||
// put("学校", "141200|141201|141202|141203|141204");
|
||||
put("学校", "141200|141201|141202|141203|141204");
|
||||
// put("银行", "1601|1603");
|
||||
// put("大型超市", "0604");
|
||||
// put("商场", "0601");
|
||||
put("大型超市", "0604");
|
||||
put("商场", "0601");
|
||||
// put("餐饮", "0501|0502|0503|0504");
|
||||
// put("旅游景点", "110000");
|
||||
put("公园广场", "110100|110101|110102|110103|110104|110105")
|
||||
|
||||
Reference in New Issue
Block a user