清理(前三步归商机产线): - 删邮箱采集: bid_mail.py/bid_mail_accounts表与页面/首页按钮 - 删招标审批状态机: TD_*/HT_TENDER_APPROVAL/摘要审批工具族 - bid_tenders瘦身为解析抽取的商务要素(去邮件字段) QC契合度审核: - 新表bid_qc_reviews(qc_type/round/fit_score/pass_score/passed/improvement) - bid_qc_capability: start_qc/finish_qc/list_qc/qc_report, 四类产出逐类审核 - 判定: 10分制打分, >9.5放行(参数bid_qc_pass_score); 不通过给改进意见 +清空产出+对账器重派解析任务带意见重做; 超轮次抛qc_escalation人工 - bid_flow对账器A2门禁阶段: 幂等/在办去重/轮次守卫/重做不计首跑上限 - 驾驶舱: qc_report工具+解析QC审核菜单; 参数读appbase表+默认兜底
74 lines
2.2 KiB
Python
74 lines
2.2 KiB
Python
#!/usr/bin/env python3
|
||
"""RBAC path registration for pipeline-bidding module.
|
||
|
||
与平台惯例一致:静态资源 → any(免登录),页面/CRUD/API → logined。
|
||
在宿主应用根目录执行(set_role_perm.py 位于宿主根):
|
||
cd <APP_ROOT> && py3/bin/python pkgs/pipeline-bidding/scripts/load_path.py
|
||
"""
|
||
import os
|
||
import subprocess
|
||
import sys
|
||
|
||
MOD = "pipeline-bidding"
|
||
# set_role_perm.py 在宿主应用根目录(本脚本位于 <APP_ROOT>/pkgs/pipeline-bidding/scripts/)
|
||
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
|
||
|
||
TABLES = [
|
||
"bid_tenders", "bid_members", "bid_tender_files",
|
||
"bid_scoring_items", "bid_qualifications", "bid_doc_requirements",
|
||
"bid_qc_reviews",
|
||
"bid_chapters", "bid_reviews", "bid_scores", "bid_kb_docs", "bid_documents",
|
||
]
|
||
|
||
PATHS_ANY = [
|
||
"/imgs/node-expand.svg",
|
||
"/imgs/node-collapse.svg",
|
||
"/imgs/open-folder.svg",
|
||
"/imgs/close-folder.svg",
|
||
]
|
||
|
||
PATHS_LOGINED = [
|
||
"/%s" % MOD,
|
||
"/%s/index.ui" % MOD,
|
||
# 多 session 会话入口(agent 目录 + 页面,菜单 open_tab 指向 /pipeline-bidding/agent)
|
||
"/%s/agent" % MOD,
|
||
"/%s/agent/index.ui" % MOD,
|
||
]
|
||
for t in TABLES:
|
||
PATHS_LOGINED += [
|
||
"/%s/%s/index.ui" % (MOD, t),
|
||
"/%s/%s/get_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/add_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/update_%s.dspy" % (MOD, t, t),
|
||
"/%s/%s/delete_%s.dspy" % (MOD, t, t),
|
||
]
|
||
# 产线业务 API
|
||
PATHS_LOGINED += [
|
||
"/%s/api/" % MOD,
|
||
"/%s/api/bid_probe.dspy" % MOD,
|
||
]
|
||
|
||
|
||
def _run(role, path):
|
||
r = subprocess.run([sys.executable, os.path.join(APP_ROOT, "set_role_perm.py"), role, path],
|
||
capture_output=True, text=True, cwd=APP_ROOT)
|
||
if r.returncode != 0:
|
||
print(" FAIL [%s] %s: %s" % (role, path, (r.stderr or "").strip()[:120]))
|
||
return r.returncode == 0
|
||
|
||
|
||
def main():
|
||
print("=== %s RBAC registration ===" % MOD)
|
||
n = 0
|
||
for p in PATHS_ANY:
|
||
n += _run("any", p)
|
||
print(" any: %s" % p)
|
||
for p in PATHS_LOGINED:
|
||
n += _run("logined", p)
|
||
print(" logined: %s" % p)
|
||
print("Done. %d/%d paths registered" % (n, len(PATHS_ANY) + len(PATHS_LOGINED)))
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|