Files
37duAutomation/app/service/hrbp/oa/work_overtime/validator.py
T
puddy 7d5028c49a feat(oa): 搭建OA审批流程框架,实现请假/加班通用审批引擎
本次提交完成了OA人事审批系统的基础架构搭建:
1. 新增项目依赖包DrissionPage、python-dotenv
2. 初始化项目目录结构,创建通用工具包、日志模块、重试工具
3. 搭建HRBP OA系统模块,拆分公共配置、登录、会话管理、SSO解析、API接口
4. 实现请假、加班审批的通用流程引擎,抽离公共逻辑
5. 完善两个业务审批模块的校验入参文档,优化代码结构
6. 新增cookies持久化功能,支持复用登录态避免重复登录
7. 替换原有print日志为统一彩色日志系统
2026-08-06 00:09:55 +08:00

34 lines
1.0 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.work_overtime.validator
@FileName: validator.py
@Author: 小布丁
@CreateTime: 2026-08-05 21:35
@Description: 加班流程校验模块(审批规则:驳回/人工复核/通过)
@Version: 1.0.0
"""
from typing import Any, Dict
def validate_doc(doc: Dict[str, Any]) -> Dict[str, Any]:
"""
校验单张加班单据,返回审批决策。
TODO: 加班审批规则在此实现(与请假规则不同,依据加班时长、时段等判定通过/驳回/人工复核)。
Args:
doc: 单据信息,含基本信息(title/creator/time/detail_url)
和审批引擎已获取的 taskId/businessKey/formId/formData(表单详情)
Returns:
校验结果,包含审批决策
"""
return {
"title": doc.get("title", ""),
"creator": doc.get("creator", ""),
"time": doc.get("time", ""),
"decision": "pending", # pending: 规则未实现,默认待处理
"note": "加班校验规则待补充",
}