fix: handle large dataset queries and type conversion

- Add batch processing to production order query to handle SQL Server's 2100 parameter limit
- Fix material name column index from Q to R column
- Add string type conversion to prevent TypeError in material matching

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-02-05 11:28:33 +08:00
parent c6b97443e5
commit c9e68a2bf0
2 changed files with 24 additions and 14 deletions

View File

@@ -43,8 +43,10 @@ class MaterialStatusValidator:
List[str]: 去重后的材料名称列表
"""
df = pd.read_excel(excel_file)
# Q列索引为16Python从0开始
material_names = df.iloc[:, 16].dropna().unique().tolist()
# R列索引为17Python从0开始
material_names = df.iloc[:, 17].dropna().unique().tolist()
# 确保所有元素都是字符串类型
material_names = [str(name) for name in material_names]
return material_names
def match_materials(self, material_names: List[str],