优化请假

This commit is contained in:
runny committed 2026-05-19 17:12:04 +08:00
1 parent 51b466d4ab
commit 5e21ce46d1
2 files changed
+5 -42

No files matched your search

+5 -3
View File
@@ -244,9 +244,11 @@ class OALeaveWorkflowService:
show_node = ET.SubElement(field, f'{{{WORKFLOW_NS}}}fieldShowValue')
show_node.text = str(show_value)
filed_html_node = field.find('wf:filedHtmlShow', NS)
if filed_html_node is not None:
filed_html_node.text = str(show_value)
field_html_type = (field.findtext('wf:fieldHtmlType', default='', namespaces=NS) or '').strip()
if field_html_type == '3':
filed_html_node = field.find('wf:filedHtmlShow', NS)
if filed_html_node is not None:
filed_html_node.text = str(show_value)
for tag in ['edit', 'view']:
node = field.find(f'wf:{tag}', NS)
-39
View File
@@ -1,39 +0,0 @@
"""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