'commit'
This commit is contained in:
@@ -199,6 +199,52 @@ class AiTeJiYiChongService:
|
||||
})
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
# Fallback: 如果不是列表(可能是字符串)
|
||||
piles_str = str(piles_data) if piles_data else "0/0"
|
||||
|
||||
nums = re.findall(r"\d+", piles_str)
|
||||
if len(nums) >= 2:
|
||||
# 假设最后两个数字是 free 和 total
|
||||
v1 = int(nums[-2])
|
||||
v2 = int(nums[-1])
|
||||
if v2 >= v1:
|
||||
free = v1
|
||||
total = v2
|
||||
else:
|
||||
free = v2
|
||||
total = v1
|
||||
|
||||
# 构造一条记录用于 Excel 展示
|
||||
standardized_piles.append({
|
||||
"pile_no": "-",
|
||||
"type": "未知",
|
||||
"status_text": piles_str,
|
||||
"remark": "原始识别文本"
|
||||
})
|
||||
else:
|
||||
# Fallback: 如果不是列表(可能是字符串)
|
||||
piles_str = str(piles_data) if piles_data else "0/0"
|
||||
|
||||
nums = re.findall(r"\d+", piles_str)
|
||||
if len(nums) >= 2:
|
||||
# 假设最后两个数字是 free 和 total
|
||||
v1 = int(nums[-2])
|
||||
v2 = int(nums[-1])
|
||||
if v2 >= v1:
|
||||
free = v1
|
||||
total = v2
|
||||
else:
|
||||
free = v2
|
||||
total = v1
|
||||
|
||||
# 构造一条记录用于 Excel 展示
|
||||
standardized_piles.append({
|
||||
"pile_no": "-",
|
||||
"type": "未知",
|
||||
"status_text": piles_str,
|
||||
"remark": "原始识别文本"
|
||||
})
|
||||
|
||||
await self.station_status_model.save(
|
||||
session=session,
|
||||
|
||||
Reference in New Issue
Block a user