build(desktop): 升级 electron-shell 版本至 1.6.3 并调整插件执行超时配置

- 插件执行超时默认延长至 6 小时,支持插件单独配置超时时间
- 新增插件根目录迁移逻辑,解决旧版权限问题
- 新增多个服务端实体、DTO、配置模块等基础代码
- 新增插件 UI 模板及相关静态资源
This commit is contained in:
2026-10-15 11:38:45 +08:00
parent 3dcedf95fd
commit f27639777f
717 changed files with 88647 additions and 17543 deletions
@@ -42,7 +42,8 @@ from step2_sign_new_contract import ( # noqa: E402
_aitable_request, _build_query_params, _encode_common_query,
_build_like_condition, _request_retry)
from step2_transfer_initiate import _hr_session # noqa: E402
from step3_transfer_todo import _log # noqa: E402
from step3_transfer_todo import ( # noqa: E402
WORKFORM_FORM_ID, _log, get_business_data)
from step4_transfer_esign import query_sign_status # noqa: E402
from step5_transfer_aitable import _ms_day, RECORDS_LIST_URL # noqa: E402
@@ -58,6 +59,10 @@ FIELD_LEAVE_DONE = "是否完成离职签署"
FIELD_NEW_DONE = "是否完成新合同签署"
SIGN_DONE = "2" # 电子签状态编码:1=签署中 2=已完成
# WeProcess 分页遍历(流程反查不再受单页条数截断)
WF_PAGE_SIZE = 100
MAX_WF_PAGES = 50
# 试算开关:True=试算(只打印,不回填);False=实跑回填
DRY_RUN = False
@@ -121,22 +126,40 @@ def _triple_done(triple):
return all(t == SIGN_DONE for t in triple)
def find_running_flow(session, name, code):
"""运行中「改签离职电子签」流程按姓名(标题含)+ 工号兜底匹配 -> businessKey。"""
params = {
"version": "", "PACKAGE_ID": "cq37du", "process_type": "",
"defProcessType": "", "struId": "", "rootId": "cq37du", "taskIds": "",
"title": "改签离职电子签", "state": "", "startTime": "", "endTime": "",
"sortType": "desc", "sortName": "CREATE_TIME",
"commonQuery": "[]", "start": "0", "pageNo": "1", "pageSize": "100",
}
resp = _request_retry(
"POST", f"{HR_BASE_URL}/RedseaPlatform/WeProcess.mc?method=getProcessAndData",
session, data=params)
for r in resp.json().get("datas") or []:
title = str(r.get("title") or "")
if name in title:
def find_running_flow(session, code, name):
"""运行中「改签离职电子签」流程按表单工号精确匹配 -> businessKey。
分页遍历运行中流程(每页 WF_PAGE_SIZE=100,上限 MAX_WF_PAGES 页),先用标题
「{姓名}-改签离职电子签」粗筛(低开销),再读流程表单业务数据按 base_code
精确确认(防重名误伤:重名同事的流程不会误判成本人的流程)。
表单读取失败无法排除时按本人流程处理(返回该 businessKey),避免误入
「流程已办结」分支造成提前回填。
"""
key = f"{(name or '').strip()}-改签离职电子签"
for page in range(MAX_WF_PAGES):
params = {
"version": "", "PACKAGE_ID": "cq37du", "process_type": "",
"defProcessType": "", "struId": "", "rootId": "cq37du", "taskIds": "",
"title": "改签离职电子签", "state": "", "startTime": "", "endTime": "",
"sortType": "desc", "sortName": "CREATE_TIME",
"commonQuery": "[]",
"start": str(page * WF_PAGE_SIZE), "pageNo": str(page + 1),
"pageSize": str(WF_PAGE_SIZE),
}
resp = _request_retry(
"POST", f"{HR_BASE_URL}/RedseaPlatform/WeProcess.mc?method=getProcessAndData",
session, data=params)
rows = resp.json().get("datas") or []
for r in rows:
if key not in str(r.get("title") or ""):
continue
biz = get_business_data(session, str(r.get("businessKey") or ""), WORKFORM_FORM_ID)
biz_code = str(biz.get("base_code") or "").strip()
if biz and biz_code and biz_code != str(code).strip():
continue # 标题含重名但工号不符:重名同事的流程,跳过
return str(r.get("businessKey") or "")
if len(rows) < WF_PAGE_SIZE:
break
return ""
@@ -170,7 +193,7 @@ def check_one(session, row):
# 旧合同仍在生效中(改签未生效)-> 流程反查签署三状态
notes.append("生效中Tab为旧合同(起始{})".format(
old_rows[0].get("hr_staff_contract.contract_start_date")))
biz = find_running_flow(session, name, code)
biz = find_running_flow(session, code, name)
if biz:
st = query_sign_status(session, biz)
triple = (str(st.get("is_initiate_sign") or ""),
@@ -185,7 +208,7 @@ def check_one(session, row):
else:
# 生效中既无旧也无新:查待生效 tab(新合同签署中/签完未生效)
notes.append("生效中Tab无合同行")
biz = find_running_flow(session, name, code)
biz = find_running_flow(session, code, name)
if biz:
st = query_sign_status(session, biz)
triple = (str(st.get("is_initiate_sign") or ""),