28 lines
876 B
Python
28 lines
876 B
Python
"""页面送审入口。不连 Oracle、不写 actionCode=2、不推口 4。验收只看 ACCEPT.txt。"""
|
||
from __future__ import annotations
|
||
|
||
import os
|
||
|
||
from apa_browser_adapter import ApaBrowserAdapter
|
||
from db import load_runtime_env
|
||
from rebate_finder import context_from_env
|
||
from rebate_flow_steps import run_submit_flow
|
||
|
||
|
||
def main() -> int:
|
||
load_runtime_env()
|
||
contract_no = (os.getenv("REBATE_ACCEPT_CONTRACT_NO") or "").strip()
|
||
if not contract_no:
|
||
print("缺少 REBATE_ACCEPT_CONTRACT_NO,送审需要已搜到的合同号", flush=True)
|
||
return 1
|
||
ctx = context_from_env()
|
||
browser = ApaBrowserAdapter(url=ctx.rebate_url, flow="REBATE_SUBMIT")
|
||
result = run_submit_flow(browser, ctx, contract_no)
|
||
if result.submitted and result.agreement_id:
|
||
return 0
|
||
return 1
|
||
|
||
|
||
if __name__ == "__main__":
|
||
raise SystemExit(main())
|