Merge branch 'script_gj' into 'master'
Script gj See merge request !875
This commit is contained in:
+2
-2
@@ -3,6 +3,7 @@ package com.fangjia.script.ana
|
|||||||
import com.fangjia.script.BaseBatch
|
import com.fangjia.script.BaseBatch
|
||||||
import com.fangjia.script.BatchOwner
|
import com.fangjia.script.BatchOwner
|
||||||
import com.fangjia.script.Watcher
|
import com.fangjia.script.Watcher
|
||||||
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.util.CommonUtils
|
import com.fangjia.script.util.CommonUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.mongodb.BasicDBObject
|
import com.mongodb.BasicDBObject
|
||||||
@@ -24,7 +25,7 @@ class FindStageDistrictBatch extends BaseBatch {
|
|||||||
@Override
|
@Override
|
||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
CommonUtils.findAllCity().each { def city ->
|
CommonUtils.findAllCity().each { def city ->
|
||||||
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery(city), new BasicDBObject("region", 1).append("name", 1).append("master_district_name", 1).append("city", 1)).each { BasicDBObject dbo ->
|
CommonDatautils.SEAWEED_COLL.find(DbUtils.buildSeaweedQuery2(city), new BasicDBObject("region", 1).append("name", 1).append("master_district_name", 1).append("city", 1)).each { BasicDBObject dbo ->
|
||||||
if (dbo.name =~ STAGE_PATTERN && StringUtils.isBlank(dbo.master_district_name)) {
|
if (dbo.name =~ STAGE_PATTERN && StringUtils.isBlank(dbo.master_district_name)) {
|
||||||
def mainName = dbo.name.toString().replaceAll("([一二三四五六七八九十百千\\d]+)期\$", "")
|
def mainName = dbo.name.toString().replaceAll("([一二三四五六七八九十百千\\d]+)期\$", "")
|
||||||
def query = DbUtils.buildSeaweedQuery(city, dbo.region, mainName)
|
def query = DbUtils.buildSeaweedQuery(city, dbo.region, mainName)
|
||||||
@@ -40,7 +41,6 @@ class FindStageDistrictBatch extends BaseBatch {
|
|||||||
println(dbo)
|
println(dbo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,6 +186,26 @@ public class DbUtils{
|
|||||||
return query
|
return query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BasicDBObject buildSeaweedQuery2(def city = null, def region = null, def name = null, def cat = "district", def status = 0){
|
||||||
|
BasicDBObject query = new BasicDBObject()
|
||||||
|
if(city){
|
||||||
|
query.append("city", city)
|
||||||
|
}
|
||||||
|
if(region){
|
||||||
|
query.append("region", region)
|
||||||
|
}
|
||||||
|
if(name){
|
||||||
|
query.append("name", name)
|
||||||
|
}
|
||||||
|
if(cat != null){
|
||||||
|
query.append("cat", cat)
|
||||||
|
}
|
||||||
|
if(status != null){
|
||||||
|
query.append("status", status)
|
||||||
|
}
|
||||||
|
return query
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 把小区修改成删除状态
|
* 把小区修改成删除状态
|
||||||
* @param id
|
* @param id
|
||||||
|
|||||||
Reference in New Issue
Block a user