Compare commits
1 Commits
ff9482780d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2f31b3bfe |
@@ -866,7 +866,7 @@ async def get_vehicle_base_test_by_type(type_num: int) -> dict | None:
|
|||||||
# ─── tb_pending_detector ───────────────────────────────────────────
|
# ─── tb_pending_detector ───────────────────────────────────────────
|
||||||
|
|
||||||
async def get_pending_detector_serial(dnt_id: int) -> str:
|
async def get_pending_detector_serial(dnt_id: int) -> str:
|
||||||
"""获取并清除待插入的车检器序列号(一次性消费)"""
|
"""获取待插入的车检器序列号"""
|
||||||
pool = await get_pool()
|
pool = await get_pool()
|
||||||
async with pool.acquire() as conn:
|
async with pool.acquire() as conn:
|
||||||
async with conn.cursor(aiomysql.DictCursor) as cur:
|
async with conn.cursor(aiomysql.DictCursor) as cur:
|
||||||
@@ -876,10 +876,5 @@ async def get_pending_detector_serial(dnt_id: int) -> str:
|
|||||||
)
|
)
|
||||||
row = await cur.fetchone()
|
row = await cur.fetchone()
|
||||||
if row:
|
if row:
|
||||||
# 清除已消费的记录
|
|
||||||
await cur.execute(
|
|
||||||
"DELETE FROM tb_pending_detector WHERE dnt_id=%s",
|
|
||||||
(dnt_id,),
|
|
||||||
)
|
|
||||||
return row["detector_serial"] or ""
|
return row["detector_serial"] or ""
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
Reference in New Issue
Block a user