Merge branch 'script_gj' into 'master'
同步第三方去除深圳有政府指导价的那批小区 See merge request !607
This commit is contained in:
+13
-2
@@ -146,7 +146,9 @@ class CcbCommonUtils {
|
|||||||
public static def findGuidePrice(city, startDate, endDate){
|
public static def findGuidePrice(city, startDate, endDate){
|
||||||
def q = new BasicDBObject()
|
def q = new BasicDBObject()
|
||||||
q.put("city", city)
|
q.put("city", city)
|
||||||
q.put('c_date', new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)).append('$lt', DateUtils.parseFromTightYYYYMMDD(endDate)));
|
if(startDate && endDate){
|
||||||
|
q.put('c_date', new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)).append('$lt', DateUtils.parseFromTightYYYYMMDD(endDate)));
|
||||||
|
}
|
||||||
def dbcursor = DISTRICT_GUIDE_PRICE_COLL.find(q)
|
def dbcursor = DISTRICT_GUIDE_PRICE_COLL.find(q)
|
||||||
def rets = []
|
def rets = []
|
||||||
for(def d : dbcursor){
|
for(def d : dbcursor){
|
||||||
@@ -428,7 +430,7 @@ class CcbCommonUtils {
|
|||||||
q.put("visible",0)
|
q.put("visible",0)
|
||||||
q.put("cat", cat);
|
q.put("cat", cat);
|
||||||
q.put("city", city);
|
q.put("city", city);
|
||||||
// q.put("name","鸣翠蓝湾")
|
// q.put("name","锦南浦三小区")
|
||||||
// q.put("name_cat", 0);
|
// q.put("name_cat", 0);
|
||||||
// q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"]))
|
// q.put("estate_type2", new BasicDBObject('$in', ["普通住宅","商住"]))
|
||||||
|
|
||||||
@@ -660,4 +662,13 @@ class CcbCommonUtils {
|
|||||||
pgsqlInstance.executeUpdate(sql2)
|
pgsqlInstance.executeUpdate(sql2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static def findDistGovPrice(def city){
|
||||||
|
def ids = []
|
||||||
|
pgsqlInstance.eachRow("SELECT gujia_bds_id from base.t0831_community_guide_price_gj_h where urbn_nm='${city}'",{it->
|
||||||
|
ids << it.gujia_bds_id
|
||||||
|
});
|
||||||
|
return ids;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-3
@@ -46,6 +46,15 @@ class ThirdPartyPriceBatch extends BaseBatch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(Object args) {
|
public void process(Object args) {
|
||||||
|
|
||||||
|
// def gocPrices = CcbCommonUtils.findDistGovPrice("深圳")
|
||||||
|
// def sql = "delete from base.t0831_bigdata_third_party_price_gj_h where gujiabds_avprc_dt_val=202303 and gujia_bds_id=?"
|
||||||
|
// pgsqlInstance.withBatch(500, sql){ ps->
|
||||||
|
// for(def id : gocPrices){
|
||||||
|
// ps.addBatch(id)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
def citys = CcbCommonUtils.getRunningCitys(args)
|
def citys = CcbCommonUtils.getRunningCitys(args)
|
||||||
def rows = []
|
def rows = []
|
||||||
def index = 0
|
def index = 0
|
||||||
@@ -53,13 +62,20 @@ class ThirdPartyPriceBatch extends BaseBatch {
|
|||||||
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
||||||
for(def city : citys){
|
for(def city : citys){
|
||||||
index++
|
index++
|
||||||
|
|
||||||
|
def gocIdsPrices = []
|
||||||
|
if(city == "深圳"){
|
||||||
|
gocIdsPrices = CcbCommonUtils.findDistGovPrice(city)
|
||||||
|
}
|
||||||
|
|
||||||
def statMap = getDistrictStatByCity(city, weekend)
|
def statMap = getDistrictStatByCity(city, weekend)
|
||||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||||
|
|
||||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name","name_cat", "estate_type2","lng"])
|
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city", "region", "name","name_cat", "estate_type2","lng"])
|
||||||
def thirdPriceMap = findThirdPartyPrice(city, statMap)
|
def thirdPriceMap = findThirdPartyPrice(city, statMap)
|
||||||
//def rets = createCityDatas(cityCodeDatas, distCodeMap, dists, thirdPriceMap)//老第三方均价表(现不用)
|
//def rets = createCityDatas(cityCodeDatas, distCodeMap, dists, thirdPriceMap)//老第三方均价表(现不用)
|
||||||
def rets = createCityDatas1(cityCodeDatas, distCodeMap, dists, thirdPriceMap)
|
|
||||||
|
def rets = createCityDatas1(cityCodeDatas, distCodeMap, dists, thirdPriceMap, gocIdsPrices)
|
||||||
// def rets = createData3(cityCodeDatas.get(city))//新第三方均价表,要做2步,麻烦
|
// def rets = createData3(cityCodeDatas.get(city))//新第三方均价表,要做2步,麻烦
|
||||||
rows.addAll(rets)
|
rows.addAll(rets)
|
||||||
println index+" "+city+" "+rets.size() +" "+rows.size()
|
println index+" "+city+" "+rets.size() +" "+rows.size()
|
||||||
@@ -187,10 +203,12 @@ class ThirdPartyPriceBatch extends BaseBatch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def createCityDatas1(cityCodeDatas, distCodeMap, dists, thirdPriceMap){
|
def createCityDatas1(cityCodeDatas, distCodeMap, dists, thirdPriceMap, gocPrices){
|
||||||
def allRows = []
|
def allRows = []
|
||||||
for(def d : dists){
|
for(def d : dists){
|
||||||
|
if(gocPrices && gocPrices.contains(d._id.toString())){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
def third = thirdPriceMap.get(d.region+"##"+d.name)
|
def third = thirdPriceMap.get(d.region+"##"+d.name)
|
||||||
if(third){
|
if(third){
|
||||||
def data = distCodeMap.get(d.region)
|
def data = distCodeMap.get(d.region)
|
||||||
|
|||||||
Reference in New Issue
Block a user