|
@@ -268,8 +268,13 @@ def generate_rating_report(
|
|
|
# 构造 Type 字符串: defect_type + label (大写)
|
|
# 构造 Type 字符串: defect_type + label (大写)
|
|
|
# 例如: defect_type="edge", label="wear" -> "EDGE WEAR"
|
|
# 例如: defect_type="edge", label="wear" -> "EDGE WEAR"
|
|
|
d_type_raw = defect.get("defect_type", "")
|
|
d_type_raw = defect.get("defect_type", "")
|
|
|
- d_label_raw = defect.get("label", "")
|
|
|
|
|
- type_str = f"{d_type_raw.upper()} {d_label_raw.upper()}".strip()
|
|
|
|
|
|
|
+ # d_label_raw = defect.get("label", "")
|
|
|
|
|
+
|
|
|
|
|
+ type_str = f"{d_type_raw.upper()}".strip()
|
|
|
|
|
+ type_str_map = {"CORNER": "CORNER",
|
|
|
|
|
+ "EDGE": "SIDE",
|
|
|
|
|
+ "FACE": "SURFACE"}
|
|
|
|
|
+ type_str = type_str_map.get(type_str)
|
|
|
|
|
|
|
|
final_defect_list.append({
|
|
final_defect_list.append({
|
|
|
"id": d_id,
|
|
"id": d_id,
|