AI请假对接OA自动跳转待提交页面
This commit is contained in:
1 parent
059346f1ac
commit
c0dde055cd
3 files changed
+52
-10
No files matched your search
@@ -40,6 +40,10 @@ class HRLeaveSQLServerService:
|
||||
"明细",
|
||||
"查询",
|
||||
)
|
||||
_STRONG_BALANCE_PATTERNS = (
|
||||
r"(?:假期|年假|育儿假|休假).{0,6}(?:还剩|还有|剩余|可休|已休|未休|多少)",
|
||||
r"(?:还剩|还有|剩余|可休|已休|未休|多少).{0,6}(?:假期|年假|育儿假|休假)",
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def supports(query: str) -> bool:
|
||||
@@ -50,6 +54,8 @@ class HRLeaveSQLServerService:
|
||||
return False
|
||||
if any(keyword in text for keyword in HRLeaveSQLServerService._PROCESS_KEYWORDS):
|
||||
return False
|
||||
if any(re.search(pattern, text) for pattern in HRLeaveSQLServerService._STRONG_BALANCE_PATTERNS):
|
||||
return True
|
||||
if not any(keyword in text for keyword in HRLeaveSQLServerService._SELF_KEYWORDS):
|
||||
return False
|
||||
if any(keyword in text for keyword in HRLeaveSQLServerService._BALANCE_KEYWORDS):
|
||||
|
||||
Reference in new issue
Block a user