Merge branch 'master' of 192.168.0.27:dev0/PriceSystem

# Conflicts:
#	PriceSystem/test.py
This commit is contained in:
2018-04-02 16:09:28 +08:00
3 changed files with 62 additions and 15 deletions
+1
View File
@@ -274,6 +274,7 @@ def dis_feature(query, fields=None):
# dsf = db1.average_statistics # dsf = db1.average_statistics
# s = time.time() # s = time.time()
seawater105 = get_collection("fangjia_stat", "district_feature", config.get_mongodb_host(), config.get_mongodb_port()) seawater105 = get_collection("fangjia_stat", "district_feature", config.get_mongodb_host(), config.get_mongodb_port())
for err_count in range(0, 10): for err_count in range(0, 10):
try: try:
+49 -9
View File
@@ -1311,6 +1311,43 @@ def out_estate_type(estate_type):
else: else:
return '小区',"普通住宅" return '小区',"普通住宅"
@timer
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
)
@timer
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},
{"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
)
@timer
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
)
@timer @timer
def out_put_price(ct, rl, lk, weekend): def out_put_price(ct, rl, lk, weekend):
@@ -1363,7 +1400,10 @@ def out_put_price(ct, rl, lk, weekend):
try: 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( stat.replace_one(
{"city": ct, "region": rl, "district_name": p[0], "weekend": weekend}, {"city": ct, "region": rl, "district_name": p[0], "weekend": weekend},
@@ -1373,7 +1413,9 @@ def out_put_price(ct, rl, lk, weekend):
"m_date": m_date, 'value_type': int(mm[2]), 'weekend_markup': make_up, "m_date": m_date, 'value_type': int(mm[2]), 'weekend_markup': make_up,
'changed_markup': make_up, 'markup': make_up, 'sample_size': mm[3], 'changed_markup': make_up, 'markup': make_up, 'sample_size': mm[3],
'estate_type': estate_type}, True 'estate_type': estate_type}, True
) )
pt.replace_one( pt.replace_one(
@@ -1384,22 +1426,19 @@ def out_put_price(ct, rl, lk, weekend):
'estate_type': cmd_estate_type, 'problem': None, "calc_type": int(0) 'estate_type': cmd_estate_type, 'problem': None, "calc_type": int(0)
}, True }, True
) )
'''
except: 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: else:
pt_down(ct,rl,p,weekend,c_date,cmd_estate_type,mm)
'''
pt.replace_one( pt.replace_one(
{"city": ct, "region": rl, "name": p[0], "calc_date": weekend}, {"city": ct, "region": rl, "name": p[0], "calc_date": weekend},
@@ -1409,3 +1448,4 @@ def out_put_price(ct, rl, lk, weekend):
'problem': mm[0], 'estate_type': cmd_estate_type, "calc_type": int(0) 'problem': mm[0], 'estate_type': cmd_estate_type, "calc_type": int(0)
}, True }, True
) )
'''
+9 -3
View File
@@ -34,9 +34,15 @@ rl = '海珠'
lk = '会展世界城三期' lk = '会展世界城三期'
''' '''
#成都- 都江堰- 溪岭雪#上海徐汇 灞桥沁水新城百汇园西 安 未央 兴乐园 弘和美邻馆 雁塔鸿景花园上海 奉贤 万隆花苑# #成都- 都江堰- 溪岭雪#上海徐汇 灞桥沁水新城百汇园西 安 未央 兴乐园 弘和美邻馆 雁塔鸿景花园上海 奉贤 万隆花苑#
ct='辽源' """
rl='东丰' ct='洛阳'
lk='鑫华小区' rl='涧西'
lk='奥阳康城'
"""
ct='北海'
rl='银海'
lk='汇景公寓'
#成都双流长滩一号 上海 奉贤 朝阳新村##上海 奉贤 棕榈滩别墅深圳龙岗丽皇阁 #成都双流长滩一号 上海 奉贤 朝阳新村##上海 奉贤 棕榈滩别墅深圳龙岗丽皇阁
#洛阳涧西奥阳康城 #洛阳涧西奥阳康城