From 6be19aefa215b5237cab1b3cc804a18ea47bea2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=B9=B2?= Date: Mon, 2 Apr 2018 16:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20Pr?= =?UTF-8?q?iceSystem/fangjia/=5F=5Finit=5F=5F.py=20=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20PriceSystem/sell=5Fprice/zhuge0118A.py?= =?UTF-8?q?=20=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20PriceSystem/tes?= =?UTF-8?q?t.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/fangjia/__init__.py | 6 +-- PriceSystem/sell_price/zhuge0118A.py | 71 +++++++++++++++++++++++----- PriceSystem/test.py | 6 +-- 3 files changed, 64 insertions(+), 19 deletions(-) diff --git a/PriceSystem/fangjia/__init__.py b/PriceSystem/fangjia/__init__.py index b4350b4..cff9cc1 100644 --- a/PriceSystem/fangjia/__init__.py +++ b/PriceSystem/fangjia/__init__.py @@ -273,11 +273,11 @@ def dis_feature(query, fields=None): # db1 = client1.fangjia # dsf = db1.average_statistics # s = time.time() -<<<<<<< HEAD + seawater105 = get_collection("fangjia_stat", "district_feature",config.get_mongodb_host(), 27017) -======= + seawater105 = get_collection("fangjia_stat", "district_feature", config.get_mongodb_host(), config.get_mongodb_port()) ->>>>>>> 09017dda8ec82bf1b4eea67648f8c33417df32f7 + for err_count in range(0, 10): try: diff --git a/PriceSystem/sell_price/zhuge0118A.py b/PriceSystem/sell_price/zhuge0118A.py index ba9e156..6ff3909 100644 --- a/PriceSystem/sell_price/zhuge0118A.py +++ b/PriceSystem/sell_price/zhuge0118A.py @@ -1363,10 +1363,10 @@ def out_put_price(ct, rl, lk, weekend): #print('make_up',make_up,'*'*20) #print('credic',mm[1]) - - try: - - + + + def stat_save(ct,rl,p,weekend,mm,c_date,m_date,make_up,estate_type): + stat.replace_one( {"city": ct, "region": rl, "district_name": p[0], "weekend": weekend}, @@ -1376,8 +1376,55 @@ def out_put_price(ct, rl, lk, weekend): "m_date": m_date, 'value_type': int(mm[2]), 'weekend_markup': make_up, 'changed_markup': make_up, 'markup': make_up, 'sample_size': mm[3], 'estate_type': estate_type}, True - ) + ) + + + def pt_up(ct,rl,p,weekend,c_date,cmd_estate_type): + + pt.replace_one( + {"city": ct, "region": rl, "name": p[0], "calc_date": weekend}, + + {"city": ct, "region": rl, "name": p[0], "c_date": c_date, 'status': int(102), + 'remark': 'week', 'category': 'sell', "calc_date": weekend, 'priority': int(0), + 'estate_type': cmd_estate_type, 'problem': None, "calc_type": int(0) + }, True + ) + + def pt_down(ct,rl,p,weekend,c_date,cmd_estate_type,mm): + pt.replace_one( + + {"city": ct, "region": rl, "name": p[0], "calc_date": weekend}, + + {"city": ct, "region": rl, "name": p[0], "c_date": c_date, 'status': int(3), + 'remark': 'week', 'category': 'sell', "calc_date": weekend, 'priority': int(0), + 'problem': mm[0], 'estate_type': cmd_estate_type, "calc_type": int(0) + }, True + ) + + + + + + try: + + stat_save(ct,rl,p,weekend,mm,c_date,m_date,make_up,estate_type) + pt_up(ct,rl,p,weekend,c_date,cmd_estate_type) + + ''' + stat.replace_one( + + {"city": ct, "region": rl, "district_name": p[0], "weekend": weekend}, + + {"city": ct, "region": rl, "district_name": p[0], 'credit': mm[1], + "calc_value": int(mm[0]), "weekend": weekend, "c_date": c_date, 'avg_price': int(mm[0]), + "m_date": m_date, 'value_type': int(mm[2]), 'weekend_markup': make_up, + 'changed_markup': make_up, 'markup': make_up, 'sample_size': mm[3], + 'estate_type': estate_type}, True + ) + + + pt.replace_one( {"city": ct, "region": rl, "name": p[0], "calc_date": weekend}, @@ -1387,22 +1434,19 @@ def out_put_price(ct, rl, lk, weekend): 'estate_type': cmd_estate_type, 'problem': None, "calc_type": int(0) }, True ) + ''' except: + stat_save(ct,rl,p,weekend,mm,c_date,m_date,make_up,estate_type) - stat.replace_one( - {"city": ct, "region": rl, "district_name": p[0], "weekend": weekend}, - {"city": ct, "region": rl, "district_name": p[0], 'credit': mm[1], - "calc_value": int(mm[0]), "weekend": weekend, "c_date": c_date, 'avg_price': int(mm[0]), - "m_date": m_date, 'value_type': int(mm[2]), 'weekend_markup': make_up, - 'changed_markup': make_up, 'markup': make_up, 'sample_size': mm[3], - 'estate_type': estate_type}, True - ) else: + + pt_down(ct,rl,p,weekend,c_date,cmd_estate_type,mm) + ''' pt.replace_one( {"city": ct, "region": rl, "name": p[0], "calc_date": weekend}, @@ -1412,3 +1456,4 @@ def out_put_price(ct, rl, lk, weekend): 'problem': mm[0], 'estate_type': cmd_estate_type, "calc_type": int(0) }, True ) + ''' diff --git a/PriceSystem/test.py b/PriceSystem/test.py index 890f666..4342a2f 100644 --- a/PriceSystem/test.py +++ b/PriceSystem/test.py @@ -34,15 +34,15 @@ rl = '海珠' lk = '会展世界城三期' ''' #成都- 都江堰- 溪岭雪#上海徐汇 灞桥沁水新城百汇园西 安 未央 兴乐园 弘和美邻馆 雁塔鸿景花园上海 奉贤 万隆花苑# -<<<<<<< HEAD +""" ct='洛阳' rl='涧西' lk='奥阳康城' -======= +""" ct='北海' rl='银海' lk='汇景公寓' ->>>>>>> 09017dda8ec82bf1b4eea67648f8c33417df32f7 + #成都双流长滩一号 上海 奉贤 朝阳新村##上海 奉贤 棕榈滩别墅深圳龙岗丽皇阁 #洛阳涧西奥阳康城