'commit'
This commit is contained in:
@@ -195,6 +195,41 @@ class YiLaiTeService:
|
||||
logger.info(f"成功保存驿来特场站数据: {station_name} | 距离: {distance} | 价格条数: {cnt}")
|
||||
return True
|
||||
|
||||
async def save_station_profile_and_status(self, station_name, address=None, total_piles=None, free_piles=None, piles_detail=None, parking_info=None, distance=None):
|
||||
"""
|
||||
一次性写入场站基础信息与状态,用于列表页兜底
|
||||
"""
|
||||
if not station_name:
|
||||
return False
|
||||
station_hash = self.get_hash(station_name)
|
||||
now = datetime.now()
|
||||
async with await self.db.get_session() as session:
|
||||
profile_id = self.generate_id()
|
||||
await self.station_profile_model.save(
|
||||
session=session,
|
||||
id=profile_id,
|
||||
station_hash=station_hash,
|
||||
operator=self.operator,
|
||||
station_name=station_name,
|
||||
address=address,
|
||||
valid_start_time=now,
|
||||
)
|
||||
status_id = self.generate_id()
|
||||
await self.station_status_model.save(
|
||||
session=session,
|
||||
id=status_id,
|
||||
station_hash=station_hash,
|
||||
total_piles=total_piles,
|
||||
free_piles=free_piles,
|
||||
piles_detail_json=piles_detail,
|
||||
parking_info=parking_info,
|
||||
distance=distance,
|
||||
current_price=None,
|
||||
valid_start_time=now,
|
||||
)
|
||||
await session.commit()
|
||||
logger.info(f"兜底写入驿来特场站基础信息与状态: {station_name} | 桩数: {free_piles}/{total_piles} | 距离: {distance}")
|
||||
return True
|
||||
async def process_station_list_vl(self, image_path, json_metadata, device_info=None, max_count=None) -> list:
|
||||
"""
|
||||
基于 VL 模式处理场站列表 (整页识别)
|
||||
|
||||
Reference in New Issue
Block a user