请假推送公司、职务等相关信息

This commit is contained in:
runny committed 2026-05-19 16:34:16 +08:00
1 parent fed57cc3cf
commit 51b466d4ab
4 files changed
+116 -24

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
"""Check qjsc field details in OA template"""
import sys, os
sys.path.insert(0, os.path.dirname(__file__))
from app import create_app
app = create_app('development')
with app.app_context():
from app.services.oa_leave_workflow import OALeaveWorkflowService, NS
import xml.etree.ElementTree as ET
filler = OALeaveWorkflowService._resolve_runtime_oa_user('26030025', '梁春艳', role_label='filler')
template = OALeaveWorkflowService._get_template_request_info(
OALeaveWorkflowService.WORKFLOW_ID, filler['user_id']
)
for field in template.findall('.//wf:WorkflowRequestTableField', NS):
fname = field.findtext('wf:fieldName', default='', namespaces=NS)
if fname == 'qjsc':
print('=== qjsc (duration) field ===')
for child in field:
tag = child.tag.split('}')[1] if '}' in child.tag else child.tag
print(f' {tag}: {child.text!r}')
break
else:
print('qjsc field NOT FOUND in template')
# Also check after setting
from copy import deepcopy
modified = deepcopy(template)
OALeaveWorkflowService._set_field(modified, 'qjsc', value='9', show_value='9')
for field in modified.findall('.//wf:WorkflowRequestTableField', NS):
fname = field.findtext('wf:fieldName', default='', namespaces=NS)
if fname == 'qjsc':
print('\n=== qjsc AFTER _set_field ===')
for child in field:
tag = child.tag.split('}')[1] if '}' in child.tag else child.tag
print(f' {tag}: {child.text!r}')
break