feat(adopt): 决策273 单价行 Total 采纳逻辑迁回 API 侧并调整 x_side 读取
This commit is contained in:
@@ -4143,16 +4143,16 @@ def api_bill_adopt(sc, hc, body):
|
||||
_a = _rec.get("attrs") or {}
|
||||
_m[(_a.get("Name") or "").strip()] = _a.get("Total")
|
||||
_ext_by_norm[_n2["id"]] = _m
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as _e:
|
||||
print("273 ext err:", _e, flush=True)
|
||||
_tmpl_side = None
|
||||
try:
|
||||
_pt = sc.execute("SELECT x_ptag FROM s_bills WHERE id=?", (bid,)).fetchone()
|
||||
_ptag = ((_pt["x_ptag"] if _pt else None) or "")
|
||||
_t = sc.execute("""SELECT n.x_side FROM s_norms n JOIN s_bills b ON b.id=n.bill_id
|
||||
WHERE b.session_id=? AND COALESCE(n.x_adopt,0)=0 AND n.x_side IS NOT NULL
|
||||
AND b.id<>? AND COALESCE(b.x_ptag,'')=?
|
||||
ORDER BY n.id LIMIT 1""", (sid, bid, _ptag)).fetchone()
|
||||
AND COALESCE(b.x_ptag,'')=?
|
||||
ORDER BY n.id LIMIT 1""", (sid, _ptag)).fetchone()
|
||||
if _t and _t["x_side"]:
|
||||
_tmpl_side = _t["x_side"]
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user