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:
@@ -43,8 +43,10 @@ class MaterialStatusValidator:
|
||||
List[str]: 去重后的材料名称列表
|
||||
"""
|
||||
df = pd.read_excel(excel_file)
|
||||
# Q列索引为16(Python从0开始)
|
||||
material_names = df.iloc[:, 16].dropna().unique().tolist()
|
||||
# R列索引为17(Python从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],
|
||||
|
||||
Reference in New Issue
Block a user