feat: DB管线补全 + 新增orchestrator_db/program_schema/to_sql + 清理临时脚本
This commit is contained in:
+12
-7
@@ -83,11 +83,16 @@ def parse_single_condition(text, fields=None):
|
||||
# Resolve 88-level condition names
|
||||
if fields:
|
||||
for f in fields:
|
||||
if f.get('is_88') and f['name'] == text.upper():
|
||||
return (f.get('parent', ''), '=', f.get('value', ''))
|
||||
# NOT 88-level → invert operator
|
||||
if f.get('is_88') and text.upper().startswith('NOT ') and f['name'] == text[4:].strip().upper():
|
||||
return (f.get('parent', ''), '<>', f.get('value', ''))
|
||||
if isinstance(f, dict):
|
||||
if f.get('is_88') and f['name'] == text.upper():
|
||||
return (f.get('parent', ''), '=', f.get('value', ''))
|
||||
if f.get('is_88') and text.upper().startswith('NOT ') and f['name'] == text[4:].strip().upper():
|
||||
return (f.get('parent', ''), '<>', f.get('value', ''))
|
||||
else:
|
||||
if f.is_88 and f.name == text.upper():
|
||||
return (f.parent or '', '=', f.value or '')
|
||||
if f.is_88 and text.upper().startswith('NOT ') and f.name == text[4:].strip().upper():
|
||||
return (f.parent or '', '<>', f.value or '')
|
||||
|
||||
# Strip OF qualifier: "STD-KEY OF MASTER-REC" → "STD-KEY"
|
||||
if ' OF ' in text.upper():
|
||||
@@ -268,10 +273,10 @@ def evaluate_tree(tree, assignment):
|
||||
|
||||
|
||||
def is_field(name, fields):
|
||||
# Strip subscript: WS-ITEM-STATUS(WS-INDEX-VAR) -> WS-ITEM-STATUS
|
||||
bare = re.sub(r'\s*\(.*?\)\s*$', '', name).strip()
|
||||
for f in fields:
|
||||
if f['name'] == bare.upper():
|
||||
fname = f['name'] if isinstance(f, dict) else f.name
|
||||
if fname == bare.upper():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user