+27
@@ -97,6 +97,7 @@ class CommonDatautils {
|
|||||||
public static final DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL)
|
public static final DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL)
|
||||||
public static final DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL)
|
public static final DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL)
|
||||||
|
|
||||||
|
public static final DBCollection SEAWEED_MONGO_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com")
|
||||||
|
|
||||||
static def DIRECTIONS = ["东北", "西北", "东南", "西南", "南北", "东西", "东", "南", "西", "北"]
|
static def DIRECTIONS = ["东北", "西北", "东南", "西南", "南北", "东西", "东", "南", "西", "北"]
|
||||||
private static final HashMap<String, List<String>> FITMENTS_TYPES_MAPS = new HashMap<String, List<String>>()
|
private static final HashMap<String, List<String>> FITMENTS_TYPES_MAPS = new HashMap<String, List<String>>()
|
||||||
@@ -4311,5 +4312,31 @@ class CommonDatautils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static def findAllDistrictByCity(def city, def cat, def fields){
|
||||||
|
|
||||||
|
DBObject q = new BasicDBObject();
|
||||||
|
q.put("status",0)
|
||||||
|
q.put("cat", cat);
|
||||||
|
q.put("city", city);
|
||||||
|
|
||||||
|
DBObject keys = new BasicDBObject();
|
||||||
|
if(fields){
|
||||||
|
for(def field : fields){
|
||||||
|
keys.put(field, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
def dbsour = SEAWEED_MONGO_COLL.find(q,keys).batchSize(2000)
|
||||||
|
def rets = []
|
||||||
|
|
||||||
|
def ids = []
|
||||||
|
for(def d : dbsour){
|
||||||
|
rets << d
|
||||||
|
}
|
||||||
|
println "[${city}] 小区量:"+rets.size()
|
||||||
|
return rets;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -32,6 +32,8 @@ class DistrictSellStatBatch extends BaseBatch {
|
|||||||
|
|
||||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
|
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
|
||||||
|
|
||||||
|
public static final DBCollection SEAWEED_MONGO_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com")
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
runBatch(new DistrictSellStatBatch(), args);
|
runBatch(new DistrictSellStatBatch(), args);
|
||||||
@@ -90,10 +92,10 @@ class DistrictSellStatBatch extends BaseBatch {
|
|||||||
def q = new BasicDBObject("city", city).append("cat", "district").append("status", 0)
|
def q = new BasicDBObject("city", city).append("cat", "district").append("status", 0)
|
||||||
// q.put("name", "翠园楼")
|
// q.put("name", "翠园楼")
|
||||||
if(day == 2){
|
if(day == 2){
|
||||||
districts = DbUtils.seaweed.find(q, keys).batchSize(2000)
|
districts = SEAWEED_MONGO_COLL.find(q, keys).batchSize(2000)
|
||||||
}else{
|
}else{
|
||||||
q.put("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate))
|
q.put("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate))
|
||||||
districts = DbUtils.seaweed.find(q, keys).batchSize(2000)
|
districts = SEAWEED_MONGO_COLL.find(q, keys).batchSize(2000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -58,14 +58,14 @@ class SeaweedDataSynch extends BaseBatch{
|
|||||||
public void process(Object args) {
|
public void process(Object args) {
|
||||||
|
|
||||||
|
|
||||||
// run()
|
run()
|
||||||
// println "全国district, shop, office同步完成"
|
// println "全国district, shop, office同步完成"
|
||||||
//民政部编码上传
|
//民政部编码上传
|
||||||
//codeRun()
|
//codeRun()
|
||||||
//println "民政部省,市,区同步完成"
|
//println "民政部省,市,区同步完成"
|
||||||
//println new ObjectId("622c433afb459ab08fdab460").getDate()
|
//println new ObjectId("622c433afb459ab08fdab460").getDate()
|
||||||
|
|
||||||
addTest()
|
// addTest()
|
||||||
}
|
}
|
||||||
|
|
||||||
def addTest(){
|
def addTest(){
|
||||||
|
|||||||
Reference in New Issue
Block a user