feat: 新增改签离职电子签OA待办对账销办脚本
新增步骤7脚本,实现OA待办对账销办逻辑: 1. 解析OA待办链路由fdId获取HR任务ID 2. 核对任务/流程状态,仅销办COMPLETED状态的待办 3. 校验账号权限,仅处理当前人资账号待办 4. 支持试算模式,避免误操作 同时更新XQ0035转正流程规则,将分支1回填条件从"到期能否考核通过=能"调整为"人员处理意见=直接离职/无需处理",并更新XQ0037合同模板逻辑,为超龄人员配置专用合同模板组合
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
2. 匹配「已发起名单」sheet 拿现单位/现四级部门/现职位序列/现岗位
|
||||
3. 计算合同期限(超龄用工不分类型统一 12 个月;未达龄按序列 12/36 月)、起止日期、
|
||||
签署单位(金色湖畔事业部特殊判断;后浪新天地LIFE+主题会馆按现岗位细分
|
||||
(餐饮)/(非餐饮),2026-10-16 拍板)、新合同模板(按序列选劳动合同档 + 廉政协议 + 放弃社保申明)
|
||||
(餐饮)/(非餐饮),2026-10-16 拍板)、新合同模板(未达龄按序列选劳动合同档 + 廉政协议
|
||||
+ 放弃社保申明;已达龄按员工取超龄人员用工协议 + 超龄专用保密/廉政/食品安全承诺)
|
||||
4. 未达龄但按期限签会超退休日时:实际开始日到退休日 > 3 个月 -> 直接签至退休日;
|
||||
<= 3 个月才写「改签异常名单.xlsx」并跳过(2026-10-21 调整);
|
||||
签署单位字典未命中的写入「改签异常名单.xlsx」并跳过;已达法定退休年龄的不算异常,正常走流程(统一签 12 个月)
|
||||
@@ -34,9 +35,9 @@ for _p in (_XQ35, _SHARE, HERE):
|
||||
sys.path.insert(0, _p)
|
||||
|
||||
from step2_sign_new_contract import ( # noqa: E402
|
||||
HR_BASE_URL, SEQUENCE_1YEAR_KEYWORDS, _defer_months, _request_retry,
|
||||
_retire_date, _unit_set_detail, _unit_set_id_by_name, houlang_unit_name,
|
||||
query_process_tasks)
|
||||
HR_BASE_URL, SEQUENCE_1YEAR_KEYWORDS, TREATY_TYPE_OVERAGE, _defer_months,
|
||||
_new_contract_template_ids, _request_retry, _retire_date, _unit_set_detail,
|
||||
_unit_set_id_by_name, houlang_unit_name, query_process_tasks)
|
||||
from step2_transfer_initiate import ( # noqa: E402
|
||||
TARGET_SHEET, _hr_session, load_pending_list, remove_pending)
|
||||
|
||||
@@ -58,6 +59,13 @@ TPL_LABOR_SERV = "95d5c603-a9e3-4ae4-b48c-927aeeed6128" # 1.1 劳动合同(
|
||||
TPL_LABOR_TECH = "8c38d933-e967-4eb7-8541-ad2d78374d8c" # 1.2 劳动合同(中国技师)
|
||||
TPL_INTEGRITY = "b269d6d6-51ff-4da9-bb0a-8a615890385d" # 4.1 廉政协议+知悉确认
|
||||
TPL_SOCIAL = "3cd64878-0261-4ebc-ae03-e2d68bfca8cc" # 6.0 自愿放弃社会保险申明
|
||||
# 已达法定退休年龄(超龄/退休返聘):超龄人员用工协议 + 超龄专用附件
|
||||
# 优先按员工实时查(rf_hr_contract_template_select_sp_cq37du,与页面默认一致),
|
||||
# 以下为查询失败时的兜底组合
|
||||
TPL_OVERAGE_AGREEMENT = "09657eb9-2855-4d6c-ae4a-4f83045845ab" # 2.0 超龄人员用工协议
|
||||
TPL_OVERAGE_SECRECY = "bfd69e52-d2db-4a17-a8b3-03e56df4b700" # 3.1 保密协议(超龄人员专用)
|
||||
TPL_INTEGRITY_OVERAGE = "b61153a1-af58-4e51-a7a8-25b0ca8267d0" # 5.0 廉政协议(超龄人员专用)
|
||||
TPL_FOOD_OVERAGE = "f53dca01-8bd9-4ea3-b3b2-adbdd0bcfdce" # 7.3 食品安全生产承诺书(超龄人员专用)
|
||||
UNIT_GOLDEN_LAKESIDE = "金色湖畔事业部" # 特殊签署单位判断的现单位
|
||||
UNIT_SHIQIAOPU = "石桥铺会馆"
|
||||
UNIT_LAKESIDE_COMPANY = "金色湖畔企业管理公司"
|
||||
@@ -288,11 +296,18 @@ def calc_plan(session, biz, roster_row):
|
||||
|
||||
# 期限:超龄用工(已达法定退休年龄)不分类型统一签 12 个月(2026-10-13 拍板);
|
||||
# 未达龄按序列:服务/技师序列 12 个月,其他 36 个月(与 XQ0035 一致)
|
||||
# 合同类型/模板:达龄必须走超龄人员用工协议(ext_8),不能沿用流程预填的劳动合同
|
||||
if overage:
|
||||
months = 12
|
||||
_log(f"[超龄] 已达法定退休年龄({retire:%Y-%m-%d}),不分类型统一签 12 个月")
|
||||
treaty_type = TREATY_TYPE_OVERAGE
|
||||
templates = (_new_contract_template_ids(session, str(biz.get("staff_id") or ""))
|
||||
or ",".join([TPL_OVERAGE_AGREEMENT, TPL_OVERAGE_SECRECY,
|
||||
TPL_INTEGRITY_OVERAGE, TPL_FOOD_OVERAGE]))
|
||||
_log(f"[超龄] 已达法定退休年龄({retire:%Y-%m-%d}),签超龄人员用工协议 12 个月")
|
||||
else:
|
||||
months = 12 if any(k in seq_name for k in SEQUENCE_1YEAR_KEYWORDS) else 36
|
||||
treaty_type = biz.get("treaty_type") or "1"
|
||||
templates = ",".join([_labor_template_id(seq_name), TPL_INTEGRITY, TPL_SOCIAL])
|
||||
|
||||
# 日期:起始=实际离职日期次日;终止=起始+N个月-1天(前端 calculate 同款)
|
||||
lo = str(biz.get("leaveoffice_time") or "")[:10]
|
||||
@@ -333,13 +348,14 @@ def calc_plan(session, biz, roster_row):
|
||||
|
||||
plan = {
|
||||
"months": months,
|
||||
"treaty_type": treaty_type,
|
||||
"start": f"{start:%Y-%m-%d}",
|
||||
"end_time": f"{end_time:%Y-%m-%d}",
|
||||
"end": f"{end:%Y-%m-%d}",
|
||||
"unit_name": unit_name,
|
||||
"si_area": si_area,
|
||||
"license_name": license_name,
|
||||
"templates": ",".join([_labor_template_id(seq_name), TPL_INTEGRITY, TPL_SOCIAL]),
|
||||
"templates": templates,
|
||||
"push_time": f"{today:%Y-%m-%d}",
|
||||
}
|
||||
return plan, None
|
||||
@@ -370,7 +386,7 @@ def submit_task(session, task, biz, plan):
|
||||
payload.update({
|
||||
"is_new_sign": biz.get("is_new_sign") or "1",
|
||||
"trigger_type": biz.get("trigger_type") or "1",
|
||||
"treaty_type": biz.get("treaty_type") or "1",
|
||||
"treaty_type": plan.get("treaty_type") or biz.get("treaty_type") or "1",
|
||||
"contract_type": biz.get("contract_type") or "0",
|
||||
"contract_deadline": str(plan["months"]),
|
||||
"contract_start_date": plan["start"],
|
||||
|
||||
Reference in New Issue
Block a user