chore: 清理废弃插件与冗余文档,重构项目目录结构

1.  删除旧版xq0031_xq0032插件的冗余UI源码与配置文件
2.  迁移并标准化XQ0001-0100系列需求的插件、文档与工作流目录
3.  清理过期的需求列表、评分文档与流程底稿
4.  更新.gitignore匹配规则,适配新的目录结构
This commit is contained in:
2026-09-21 16:59:05 +08:00
parent b1ae4e5111
commit d1af551eac
192 changed files with 5335 additions and 2694 deletions
@@ -0,0 +1,653 @@
# -*- coding: utf-8 -*-
"""
@FileName: purchase_order_list_export.py
@Description: 需求32 - 金蝶 K3Cloud ERP「采购订单列表」自动导出。
全局搜索「采购订单列表」→ 选中编号 CGDDLB 项 → 点快捷方案「默认方案(个人)」→
等查询完成 → 选项 → 引出 → 按列表引出数据 → 下载保存到桌面(与需求31同目录)。
调用关系:复用 share/erp_login.py 登录 ERP(新旧系统通用)。
运行方式:直接运行本文件(参数全部在代码内定义,无需命令行传参)。
业务配置说明(改下面配置块即可):
ERP 'new' 新版 / 'old' 旧版 / 完整登录页 URL
登录账号密码 统一放项目根目录 .env(erp_login_username / erp_login_password),
erp_login 自动读取,代码中不存明文
REPORT_KEYWORD 全局搜索关键字(采购订单列表)
REPORT_NUMBER 搜索结果编号(CGDDLB,选中该项进入列表)
SCHEME_NAME 要选中的快捷方案名(精确匹配:默认方案(个人))
SAVE_DIR 保存目录,None 时与需求31同目录:桌面/采购计划报表_YYYY-MM-DD
FOLDER_NAME 文件夹命名(采购计划报表+日期,与需求31一致)
FILE_PREFIX 导出文件命名前缀(采购订单列表_日期.xlsx)
"""
import os
import re
import sys
import time
import shutil
from datetime import datetime
from pathlib import Path
try: # 浏览器断连等致命异常需上抛,避免被通用容错吞掉空转
from DrissionPage.errors import PageDisconnectedError
except Exception:
PageDisconnectedError = None
# ================== 业务配置(直接在此修改) ==================
ERP = 'new' # 新版 criterion.erp.37du.co
# 登录账号密码统一放根目录 .env:erp_login_username / erp_login_password
REPORT_KEYWORD = '采购订单列表' # 全局搜索关键字
REPORT_NUMBER = 'CGDDLB' # 搜索结果编号(列表项唯一标识)
SCHEME_NAME = '默认方案(个人)' # 快捷方案条要选中的方案(精确匹配,避免命中「采购订单宽表默认方案」)
SAVE_DIR = None # None → 与需求31同目录:桌面/采购计划报表_日期
FOLDER_NAME = '采购计划报表' # 文件夹命名前缀(与需求31一致)
FILE_PREFIX = '采购订单列表' # 导出文件命名前缀(采购订单列表_日期.xlsx)
# ================== 运行参数 ==================
RETRY_MAX = 3 # 单次导出最大重试次数(项目规范)
TIMEOUT = 15 # 元素查找超时(秒)
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'share'))
from erp_login import erp_login # noqa: E402
# ================== 工具函数 ==================
def _get_desktop():
"""获取真实桌面路径,适配 OneDrive 等重定向的不同电脑。"""
try:
import ctypes
from ctypes import wintypes
guid = wintypes.GUID(
data1=0xB4BFCC3A, data2=0xDB2C, data3=0x424C,
data4=(0xB0, 0x29, 0x7F, 0xE9, 0x9A, 0x87, 0xC6, 0x41))
func = ctypes.windll.shell32.SHGetKnownFolderPath
func.argtypes = [wintypes.GUID, wintypes.DWORD, wintypes.HANDLE,
ctypes.POINTER(ctypes.c_wchar_p)]
ptr = ctypes.c_wchar_p()
func(ctypes.byref(guid), 0, None, ctypes.byref(ptr))
return ptr.value
except Exception:
return str(Path.home() / 'Desktop')
def _is_in_viewport(el, page):
"""元素是否真实显示在视口内。K3 残留窗口会被移到屏幕外,此时 is_displayed
仍为 True,但其内元素点击无效——必须同时校验位置在视口内。"""
try:
if not el.states.is_displayed:
return False
w, h = el.rect.size
if w <= 0 or h <= 0:
return False
x, y = el.rect.location
vw, vh = page.run_js(
'return [window.innerWidth || document.documentElement.clientWidth,'
' window.innerHeight || document.documentElement.clientHeight];')
return 0 <= x < vw and 0 <= y < vh
except Exception:
return False
def _click_visible(page, css, timeout=TIMEOUT, by_js=False):
"""点击第一个在视口内可见的匹配元素,成功返回 True。浏览器断连等致命异常直接上抛。
by_js=True 用于 K3 工具栏/菜单项:物理点击只会选中文字,不触发菜单。"""
end = time.time() + timeout
while time.time() < end:
try:
for el in page.eles(css):
if _is_in_viewport(el, page):
el.click(by_js=True) if by_js else el.click()
return True
except Exception as e:
if PageDisconnectedError is not None and isinstance(e, PageDisconnectedError):
raise
time.sleep(0.5)
return False
def _ele_visible(page, css, timeout=1):
"""元素存在、且在视口内可见才算命中(K3 过滤窗口关闭后 DOM 里仍残留隐藏/屏幕外节点)。"""
end = time.time() + timeout
while time.time() < end:
try:
for el in page.eles(css):
if _is_in_viewport(el, page):
return True
except Exception:
pass
time.sleep(0.3)
return False
def _close_window_by_title(page, title, timeout=3):
"""物理点击关闭标题包含关键字的 k-window 弹窗(K3 下载窗口等残留,关闭按钮 by_js 不触发)。
用包含匹配:实际标题可能是「文件下载」或「文档下载」,避免因标题差异关不掉。"""
end = time.time() + timeout
while time.time() < end:
for w in page.eles('css:.k-window'):
try:
if not w.states.is_displayed:
continue
t = w.ele('css:.k-window-title', timeout=0.3)
if t is None or title not in (t.text or ''):
continue
btn = w.ele('css:.k-window-actions .k-i-close', timeout=0.5)
if btn is None:
return False
try:
btn.click()
except Exception:
btn.click(by_js=True)
time.sleep(0.3)
return True
except Exception:
pass
time.sleep(0.5)
return False
# ================== 列表操作 ==================
def _diag_search(page):
"""探针:搜索失败时打印当前页面/下拉状态,定位是下拉没出来还是选择器不匹配。"""
try:
print(f'[采购订单列表] [探针] 当前 URL: {(page.url or "")[:120]}')
except Exception as e:
print(f'[采购订单列表] [探针] 读 URL 异常: {e}')
try:
items = page.eles('css:.kd-fullsearch-selectable li.kd-fullsearch-item-container',
timeout=2)
print(f'[采购订单列表] [探针] 下拉结果项数量: {len(items)}')
for i, li in enumerate(items[:10]):
try:
num = li.ele('css:span[searchitem="number"]', timeout=0.3)
txt = li.ele('css:span[searchitem="text"]', timeout=0.3)
print(f'[采购订单列表] [探针] 第{i + 1}项: '
f'number={num.text if num else "?"} '
f'text={txt.text if txt else "?"} '
f'displayed={li.states.is_displayed}')
except Exception:
pass
except Exception as e:
print(f'[采购订单列表] [探针] 枚举下拉异常: {e}')
filter_visible = _ele_visible(
page, 'css:[id*="BILLMENU_TOOLBAR-tbFilter"]', timeout=1)
print(f'[采购订单列表] [探针] 过滤按钮可见: {filter_visible}')
def _open_report(page):
"""点击全局搜索 → 输入「采购订单列表」→ 等联想下拉出现 → 点选编号 CGDDLB 项。
注意:不能按回车——K3 全局搜索回车会默认直接进入第一个结果,下拉随即关闭,
无法精确选中 CGDDLB 项。输入后等待联想下拉,再点对应项。"""
if not _click_visible(page, 'css:.kd-fullsearch-searchicon', timeout=10):
print('[采购订单列表] 找不到全局搜索图标')
return False
time.sleep(1)
sbox = page.ele('css:.kd-appplat-searchinput', timeout=5)
if not sbox:
print('[采购订单列表] 找不到搜索输入框')
return False
sbox.clear()
sbox.input(REPORT_KEYWORD)
time.sleep(0.8) # 输入即出联想下拉;不按回车(回车=直接进第一个结果)
# 结果下拉列表中找编号为 CGDDLB 的「采购订单列表」项
end = time.time() + 20
while time.time() < end:
for li in page.eles('css:.kd-fullsearch-selectable li.kd-fullsearch-item-container',
timeout=2):
try:
if not li.states.is_displayed:
continue
num = li.ele('css:span[searchitem="number"]', timeout=0.5)
if num is None:
continue
num_text = (num.attr('title') or num.text or '').strip().upper()
if num_text == REPORT_NUMBER.upper():
li.click()
time.sleep(2)
if _ele_visible(page, 'css:[id*="BILLMENU_TOOLBAR-tbFilter"]', timeout=2):
print('[采购订单列表] 已打开列表(CGDDLB)')
return True
except Exception:
pass
time.sleep(0.5)
print(f'[采购订单列表] 未找到编号 {REPORT_NUMBER} 的搜索结果项')
_diag_search(page) # 探针:输出诊断信息
return False
def _open_filter(page):
"""确保过滤窗口打开:已开则复用,未开则点「过滤」按钮(by_js 触发菜单项)。"""
if _ele_visible(page, 'css:.k-window [id*="_Filter-FSCHEMELIST"]', timeout=2):
return True
if _click_visible(page, 'css:[id*="BILLMENU_TOOLBAR-tbFilter"]', by_js=True):
time.sleep(1.5)
return _ele_visible(page, 'css:[id*="_Filter-FSCHEMELIST"]', timeout=5)
return False
def _select_scheme(page, scheme):
"""在过滤窗口方案树中选中目标方案(默认「默认方案(个人)」)。
方案树节点结构:li.k-item > .k-in.kd-treenode-textcnt > .kd-treenode-text。
注意:K3 树节点用 by_js click 不触发选中事件(现场验证),必须真实鼠标点击
.k-in.kd-treenode-textcnt 节点;选中成功后界面出现 SelectedSchemeItemControlTemplate。"""
ac = page.actions
end = time.time() + TIMEOUT
while time.time() < end:
for li in page.eles('css:.k-window li.k-item', timeout=2):
try:
if not li.states.is_displayed:
continue
t = li.ele('css:.kd-treenode-text', timeout=0.5)
if t is None or scheme not in (t.text or ''):
continue
# 已选中:选中模板(SelectedSchemeItemControlTemplate)的文本须是目标方案,
# 否则可能是上次选的其它方案,误判会导出错误数据
cur = page.ele('css:.SelectedSchemeItemControlTemplate', timeout=1)
if cur is not None and scheme in (cur.text or ''):
print(f'[采购订单列表] 方案已是: {t.text.strip()}')
return True
# 真实鼠标点击节点外层 .k-in.kd-treenode-textcnt(by_js 不触发选中)
node = t.parent() # .k-in.kd-treenode-textcnt
if node is None or not node.states.is_displayed:
node = t
try:
ac.move_to(node)
time.sleep(0.3)
ac.click()
except Exception:
try:
node.click(by_js=True)
except Exception:
pass
time.sleep(0.8)
# 确认选中:出现 SelectedSchemeItemControlTemplate 才算点击成功
if _ele_visible(page, 'css:.SelectedSchemeItemControlTemplate', timeout=2):
print(f'[采购订单列表] 已选择方案: {t.text.strip()}')
return True
# 未生效:可能点到文本被全选,改为点 li 下的 .kd-treenode-textcnt 外层再试一次
try:
cnt = li.ele('css:.kd-treenode-textcnt', timeout=1)
if cnt is not None and cnt.states.is_displayed:
ac.move_to(cnt)
time.sleep(0.3)
ac.click()
time.sleep(0.8)
if _ele_visible(page, 'css:.SelectedSchemeItemControlTemplate',
timeout=2):
print(f'[采购订单列表] 已选择方案: {t.text.strip()}')
return True
except Exception:
pass
except Exception:
pass
time.sleep(0.5)
print(f'[采购订单列表] 过滤窗口方案树中未找到: {scheme}')
return False
def _submit_filter(page):
"""点过滤窗口「确定」触发查询。注意:[id*="_Filter-FBTNOK_c"] 也会命中仓库等其它
过滤面板的同 id 按钮,用 :not + .k-window 限定,防止误点。"""
if not _click_visible(page, 'css:.k-window [id*="_Filter-FBTNOK_c"]:not([id*="FBeginStockId"])'):
print('[采购订单列表] 找不到过滤窗口确定按钮')
return False
print('[采购订单列表] 已提交过滤查询')
return True
def _read_rowcount(page):
"""读分页栏行数统计(span[data-kdid="rowcount_pagerlist2"],文本形如「共519行」)。
返回 (文本, 条数);未找到/未显示返回 (None, -1)。"""
try:
for el in page.eles('css:span[data-kdid="rowcount_pagerlist2"]', timeout=1):
try:
if not el.states.is_displayed:
continue
txt = (el.text or '').strip()
m = re.search(r'共\s*(\d+)\s*行', txt)
return txt, (int(m.group(1)) if m else -1)
except Exception:
pass
except Exception:
pass
return None, -1
def _wait_progress(page, timeout=300):
"""等待查询完成:进入页面时分页栏已带旧条数,查询时会先变 0(或消失)再变新条数。
故记录初始条数,等行数经历「变 0/消失」或「发生变化」后,再出现非 0 条数才算完成。"""
_, init_cnt = _read_rowcount(page)
print(f'[采购订单列表] 当前条数: {init_cnt if init_cnt >= 0 else "无"},等待查询刷新...')
saw_reset = init_cnt < 0 # 初始无条数视为已重置
end = time.time() + timeout
while time.time() < end:
txt, cnt = _read_rowcount(page)
if cnt == 0:
saw_reset = True # 先变 0:查询已触发,正在刷新
elif cnt > 0:
if saw_reset or cnt != init_cnt:
print(f'[采购订单列表] 查询完成: {txt}')
return True
time.sleep(1)
print('[采购订单列表] 等待查询完成超时(行数未刷新)')
return False
def _export_all_pages(page):
"""选项 → 引出(真实鼠标悬浮展开子菜单)→ 按列表引出数据。
结论(现场症状):物理点击内容 span 只会『全选文字』不触发菜单;JS click 又触发不了
K3 的悬浮式嵌套子菜单。故全程用 page.actions 的真实鼠标 move_to(悬浮,不点击文字),
让子菜单展开后用 move_to+click 点中「按列表引出数据」;不点 span 文本,避免全选。
注意:必须复用同一个 ac=page.actions,保证光标位置连续(悬浮链不中断子菜单不收起)。
本列表页与需求31不同:选项=tbOptionLists,引出=tbInputOutput,目标=按列表引出数据(tbOutput)。"""
ac = page.actions
def _clickable(span):
"""内容 span 的父级可点击元素(a/li),避免点到文本被『全选文字』。"""
try:
a = span.closest('css:a')
if a is not None and a.tag.lower() == 'a' and a.states.is_displayed:
return a
except Exception:
pass
try:
li = span.closest('css:li')
if li is not None and li.states.is_displayed:
return li
except Exception:
pass
return span
# 1. 点「选项」打开配置菜单(点其 a/li,避开文本)
opt = page.ele('css:span[id*="BILLMENU_TOOLBAR-tbOptionLists"]', timeout=5)
if opt is None or not opt.states.is_displayed:
opt = page.ele('css:[id*="BILLMENU_TOOLBAR-tbOptionLists"]', timeout=5)
if opt is None or not opt.states.is_displayed:
print('[采购订单列表] 找不到选项按钮')
return False
try:
ac.move_to(_clickable(opt)).click()
except Exception:
try:
opt.click(by_js=True)
except Exception:
print('[采购订单列表] 点选项失败')
return False
time.sleep(1.2)
# 2. 定位「引出」(splitbutton)
split = page.ele('css:span[id*="BILLMENU_TOOLBAR-tbInputOutput"]', timeout=5)
if split is None or not split.states.is_displayed:
split = page.ele('css:[id*="BILLMENU_TOOLBAR-tbInputOutput"]', timeout=5)
if split is None or not split.states.is_displayed:
print('[采购订单列表] 找不到导出(引出)按钮')
return False
def _trigger():
"""悬浮目标:优先右箭头(悬浮开子菜单),无箭头则悬浮整体。"""
try:
ar = split.parent().ele('css:span.k-icon', timeout=1)
if ar is not None and ar.states.is_displayed:
return ar
except Exception:
pass
return _clickable(split)
trigger = _trigger()
# 3. 悬浮展开「按列表引出数据」子菜单
target = None
for _ in range(4):
try:
ac.move_to(trigger) # 真实鼠标悬浮到右箭头,子菜单展开
except Exception:
pass
time.sleep(1.0)
t = page.ele('css:span[id$="BILLMENU_TOOLBAR-tbOutput"]', timeout=2)
if t is not None and t.states.is_displayed:
target = t
break
if target is None or not target.states.is_displayed:
for _ in range(3):
try:
trigger.click()
except Exception:
pass
time.sleep(1)
t = page.ele('css:span[id$="BILLMENU_TOOLBAR-tbOutput"]', timeout=2)
if t is not None and t.states.is_displayed:
target = t
break
if target is None or not target.states.is_displayed:
print('[采购订单列表] 找不到按列表引出数据')
return False
# 4. 光标从「引出」连续移入「按列表引出数据」再点击(悬浮链不断,菜单不收起)
try:
ac.move_to(_clickable(target))
time.sleep(0.5)
ac.click()
except Exception:
try:
target.click(by_js=True)
except Exception:
print('[采购订单列表] 点击按列表引出数据失败')
return False
print('[采购订单列表] 已触发按列表引出数据')
return True
def _download_file(page, save_dir, new_name):
"""点「下载」按钮 → 等文件落盘到保存目录。
做法:把浏览器默认下载目录直接指到 save_dir,再点「下载」按钮(target=_blank 也会下载到该目录),
然后盯着文件夹等新文件出现且大小稳定(下载完成),不依赖 DrissionPage 的任务捕获,避免静默卡住。"""
try:
save_dir.mkdir(parents=True, exist_ok=True)
page.set.download_path(str(save_dir))
page.set.when_download_file_exists('overwrite')
except Exception as e:
print(f'[采购订单列表] 设置下载目录异常: {e}')
before = set(save_dir.glob('*')) if save_dir.exists() else set()
before_names = {b.name for b in before} # 一次性算好,避免每秒循环重复生成
# 找可见的「下载」按钮
dl = None
end = time.time() + TIMEOUT
while time.time() < end:
for el in page.eles('css:[id*="FDOWNLOAD_c"]'):
try:
if el.states.is_displayed:
dl = el
break
except Exception:
pass
if dl:
break
time.sleep(0.5)
if not dl:
print('[采购订单列表] 找不到下载按钮')
return False
print('[采购订单列表] 点击下载按钮...')
try:
dl.click()
except Exception:
dl.click(by_js=True)
# 等新文件出现且大小连续两次不变(下载完成)
print('[采购订单列表] 等待文件下载完成...')
last_size, last_name = -1, None
end = time.time() + 300
while time.time() < end:
new_files = [f for f in save_dir.glob('*')
if f.is_file() and f.name not in before_names]
if new_files:
f = max(new_files, key=lambda x: x.stat().st_mtime)
try:
s = f.stat().st_size
except Exception:
s = 0
if (f.suffix not in ('.crdownload', '.tmp', '.part')
and s > 0 and s == last_size and f.name == last_name):
dst = save_dir / new_name
if f != dst:
if dst.exists():
dst.unlink()
try:
shutil.move(str(f), str(dst))
except Exception:
dst = f
print(f'[采购订单列表] 已保存: {dst}')
_close_window_by_title(page, '文件下载') # 只关下载窗口,其余残留不主动关
return True
last_size, last_name = s, f.name
time.sleep(1)
# 兜底:超时但确有新文件也尝试落名
new_files = [f for f in save_dir.glob('*')
if f.is_file() and f.name not in before_names
and f.suffix not in ('.crdownload', '.tmp', '.part')]
for f in new_files:
dst = save_dir / new_name
if dst != f:
if dst.exists():
dst.unlink()
try:
shutil.move(str(f), str(dst))
except Exception:
dst = f
print(f'[采购订单列表] 已保存: {dst}')
_close_window_by_title(page, '文件下载') # 只关下载窗口,其余残留不主动关
return True
print('[采购订单列表] 下载失败/超时')
return False
# ================== 单次导出 ==================
def _reset_filter_state(page):
"""重试前清理脏界面状态:按 ESC 关闭残留的弹层/过滤窗口,兜底点各面板「取消」按钮。"""
for _ in range(2):
try:
page.actions.key_down('ESC')
page.actions.key_up('ESC')
except Exception:
pass
time.sleep(0.5)
_click_visible(page, 'css:[id*="FBTNCANCEL_c"]', timeout=1)
time.sleep(0.5)
def _click_quick_scheme(page, scheme):
"""直接点击列表页顶部快捷方案条中的目标方案,无需打开过滤窗口。
结构:div[filter-role="filterschemecontent"] > div.SchemeItemControlTemplate(含方案名,
选中的为 SelectedSchemeItemControlTemplate)。
注意:K3 控件用 by_js click 可能不触发,优先真实鼠标点击。"""
ac = page.actions
end = time.time() + TIMEOUT
while time.time() < end:
for item in page.eles(
'css:div[filter-role="filterschemecontent"] '
'div[class*="SchemeItemControlTemplate"]', timeout=2):
try:
if not item.states.is_displayed:
continue
txt = (item.text or '').strip()
if txt != scheme: # 精确匹配:避免「默认方案」误命中「采购订单宽表默认方案」
continue
cls = item.attr('class') or ''
if 'Selected' in cls:
print(f'[采购订单列表] 快捷方案已是: {txt}')
return True
try:
ac.move_to(item)
time.sleep(0.3)
ac.click()
except Exception:
try:
item.click(by_js=True)
except Exception:
pass
time.sleep(1)
# 确认选中:快捷条中 Selected 方案变为目标方案
cur = page.ele(
'css:div[filter-role="filterschemecontent"] '
'div.SelectedSchemeItemControlTemplate', timeout=2)
if cur is not None and scheme in (cur.text or ''):
print(f'[采购订单列表] 已点选快捷方案: {txt}')
return True
# 未确认选中:返回 False 走过滤窗口回退,防止把旧数据当本次结果
print(f'[采购订单列表] 点击快捷方案未确认选中: {txt}')
return False
except Exception:
pass
time.sleep(0.5)
print(f'[采购订单列表] 快捷方案条中未找到: {scheme}')
return False
def _run_once(page):
"""直接点快捷方案「默认方案(个人)」→ 等查询 → 引出所有页 → 下载。
快捷方案条不存在时回退到过滤窗口选方案。"""
if _click_quick_scheme(page, SCHEME_NAME):
if not _wait_progress(page):
return False
else:
# 回退:过滤窗口选方案
if not _open_filter(page):
return False
if not _select_scheme(page, SCHEME_NAME):
return False
if not _submit_filter(page):
return False
if not _wait_progress(page):
return False
if not _export_all_pages(page):
return False
return True
# ================== 入口 ==================
def main():
save_dir = Path(SAVE_DIR) if SAVE_DIR else (
Path(_get_desktop()) / f'{FOLDER_NAME}_{datetime.now():%Y-%m-%d}')
save_dir.mkdir(parents=True, exist_ok=True)
new_name = f'{FILE_PREFIX}_{datetime.now():%Y-%m-%d}.xlsx'
print(f'[采购订单列表] 保存目录: {save_dir}')
print(f'[采购订单列表] 导出文件: {new_name}')
ok, page = erp_login(ERP)
if not ok:
print('[采购订单列表] ERP 登录失败,终止')
return 1
try:
try:
page.set.window.max()
except Exception:
pass
time.sleep(1)
if not _open_report(page):
print('[采购订单列表] 打开列表失败,终止')
return 1
success = False
for attempt in range(1, RETRY_MAX + 1):
print(f'[采购订单列表] 第 {attempt}/{RETRY_MAX} 次导出')
if _run_once(page):
success = _download_file(page, save_dir, new_name)
if success:
break
_reset_filter_state(page) # 清掉失败留下的弹层/半填条件再重试
time.sleep(2)
if not success:
print(f'[采购订单列表] 重试 {RETRY_MAX} 次均失败')
return 1
finally:
try:
page.quit()
except Exception:
pass
print('[采购订单列表] 导出完成')
return 0
if __name__ == '__main__':
main()