Files
37duAutomation/app/service/hrbp/oa/leave/validator.py
T
puddy 249088614d feat(hrbp): 完成HRBP加班审批系统全链路开发
新增:
1.  新增依赖包chinese_calendar,完善.gitignore会话存储配置
2.  新增完整测试套件与项目初始化文件
3.  实现延时/休息日/法定假日加班审批规则(参考aa.md文档)
4.  新增排班、打卡、请假数据获取与解析工具
5.  完善会话管理与持久化存储逻辑
6.  实现格式化审批报告生成功能

修改:
1.  调整请假校验函数签名以传入会话对象
2.  更新审批流程调用逻辑适配新校验函数
3.  重构cookie存储路径与目录创建逻辑
4.  优化日志输出级别与调试信息
2026-08-06 21:03:20 +08:00

35 lines
1.1 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
"""
@Module: hrbp.oa.leave.validator
@FileName: validator.py
@Author: 小布丁
@CreateTime: 2026-08-05 17:11
@Description: 请假流程校验模块(审批规则:驳回/人工复核/通过)
@Version: 1.1.0
"""
from typing import Any, Dict
def validate_doc(doc: Dict[str, Any], session: Any) -> Dict[str, Any]:
"""
校验单张请假单据,返回审批决策。
TODO: 请假审批规则在此实现(依据排班、假期类型、请假时长等判定通过/驳回/人工复核)。
Args:
doc: 单据信息,含基本信息(title/creator/time/detail_url)
和审批引擎已获取的 taskId/businessKey/formId/formData(表单详情)
session: 已登录的 SessionPage 对象(用于调用排班接口)
Returns:
校验结果,包含审批决策
"""
return {
"title": doc.get("title", ""),
"creator": doc.get("creator", ""),
"time": doc.get("time", ""),
"decision": "pending", # pending: 规则未实现,默认待处理
"note": "请假校验规则待补充",
}