BOM发料对比
This commit is contained in:
@@ -388,6 +388,25 @@ def import_issue_receipt_details(conn):
|
||||
if not wo_number or not line_no or not mat_code:
|
||||
continue
|
||||
|
||||
remark = item.get("明细备注") or ""
|
||||
p_remark = item.get("生产订单备注") or ""
|
||||
inferred_sfc = ""
|
||||
|
||||
# 尝试从备注中提取 SFC 编号
|
||||
if '【' in remark and '】' in remark:
|
||||
start = remark.find('【') + 1
|
||||
end = remark.find('】')
|
||||
sfc_candidate = remark[start:end].strip()
|
||||
if sfc_candidate.startswith('SFC'):
|
||||
inferred_sfc = sfc_candidate
|
||||
|
||||
if '【' in p_remark and '】' in p_remark:
|
||||
start = p_remark.find('【') + 1
|
||||
end = p_remark.find('】')
|
||||
sfc_candidate = p_remark[start:end].strip()
|
||||
if sfc_candidate.startswith('SFC'):
|
||||
inferred_sfc = sfc_candidate
|
||||
|
||||
try:
|
||||
cursor.execute('''
|
||||
INSERT INTO issue_receipt_details (
|
||||
|
||||
Reference in New Issue
Block a user