29 lines
981 B
Python
29 lines
981 B
Python
# 页面查号入口。不连 Oracle、不录协议。验收只看 ACCEPT.txt。
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
from pathlib import Path
|
|
|
|
from apa_browser_adapter import ApaBrowserAdapter
|
|
from rpa_oracle import load_job_env
|
|
from rebate_finder import context_from_env
|
|
from rebate_flow_steps import SENTINEL_CONTRACT_NO, run_find_flow
|
|
|
|
|
|
# 只跑查号页。没配合同号时用哨兵号验收「搜不到」。不写表。
|
|
def main() -> int:
|
|
load_job_env(Path(__file__).resolve().parent)
|
|
contract_no = (os.getenv("REBATE_ACCEPT_CONTRACT_NO") or SENTINEL_CONTRACT_NO).strip()
|
|
expect_found = None if contract_no != SENTINEL_CONTRACT_NO else False
|
|
ctx = context_from_env()
|
|
browser = ApaBrowserAdapter(url=ctx.rebate_url, flow="REBATE_FIND")
|
|
found = run_find_flow(browser, ctx, contract_no, expect_found=expect_found)
|
|
if expect_found is False and found:
|
|
return 1
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|