更新Company页面的UI为FUI风格
This commit is contained in:
15
app.py
15
app.py
@@ -8734,6 +8734,9 @@ def get_stock_quote_detail(stock_code):
|
||||
|
||||
if trade_result:
|
||||
row = row_to_dict(trade_result)
|
||||
# 调试日志:打印所有字段
|
||||
app.logger.info(f"[quote-detail] stock={base_code}, row keys={list(row.keys())}")
|
||||
app.logger.info(f"[quote-detail] total_shares={row.get('total_shares')}, float_shares={row.get('float_shares')}, pe_ratio={row.get('pe_ratio')}")
|
||||
result_data['name'] = row.get('SECNAME') or ''
|
||||
result_data['current_price'] = float(row.get('close_price') or 0)
|
||||
result_data['change_percent'] = float(row.get('change_pct') or 0)
|
||||
@@ -8741,17 +8744,19 @@ def get_stock_quote_detail(stock_code):
|
||||
result_data['yesterday_close'] = float(row.get('pre_close') or 0)
|
||||
result_data['today_high'] = float(row.get('high') or 0)
|
||||
result_data['today_low'] = float(row.get('low') or 0)
|
||||
result_data['pe'] = float(row.get('pe_ratio') or 0) if row.get('pe_ratio') else None
|
||||
pe_value = row.get('pe_ratio') or row.get('F026N')
|
||||
result_data['pe'] = float(pe_value) if pe_value else None
|
||||
result_data['turnover_rate'] = float(row.get('turnover_rate') or 0)
|
||||
result_data['sw_industry_l1'] = row.get('sw_industry_l1') or ''
|
||||
result_data['sw_industry_l2'] = row.get('sw_industry_l2') or ''
|
||||
result_data['industry_l1'] = row.get('industry_l1') or ''
|
||||
result_data['industry'] = row.get('sw_industry_l2') or row.get('sw_industry_l1') or ''
|
||||
|
||||
# 计算股本和市值
|
||||
total_shares = float(row.get('total_shares') or 0)
|
||||
float_shares = float(row.get('float_shares') or 0)
|
||||
close_price = float(row.get('close_price') or 0)
|
||||
# 计算股本和市值(兼容别名和原始字段名)
|
||||
total_shares = float(row.get('total_shares') or row.get('F020N') or 0)
|
||||
float_shares = float(row.get('float_shares') or row.get('F021N') or 0)
|
||||
close_price = float(row.get('close_price') or row.get('F007N') or 0)
|
||||
app.logger.info(f"[quote-detail] calculated: total_shares={total_shares}, float_shares={float_shares}")
|
||||
|
||||
# 发行总股本(亿股)
|
||||
if total_shares > 0:
|
||||
|
||||
Reference in New Issue
Block a user