|
|
@@ -393,6 +393,8 @@ async def update_gray_image_json(
|
|
|
|
|
|
# 丢弃前端展示用的辅助字段,防止传给算分服务导致报错
|
|
|
for d in gray_defects:
|
|
|
+ if d.get("label") == "slight_scratch":
|
|
|
+ d["label"] = "scratch"
|
|
|
d.pop("defectImgUrl", None)
|
|
|
d.pop("defectImgUrls", None)
|
|
|
|
|
|
@@ -459,11 +461,6 @@ async def update_gray_image_json(
|
|
|
is_fusion = gray_image_type in (ImageType.front_fusion.value, ImageType.back_fusion.value)
|
|
|
key_to_check = "fusion_id" if is_fusion else "gray_id"
|
|
|
|
|
|
- # 把前端传来的 slight_scratch 强制转换成 scratch
|
|
|
- # 这是因为算分服务可能不支持 slight_scratch 这种新标签
|
|
|
- if new_defect.get("label") == "slight_scratch":
|
|
|
- new_defect["label"] = "scratch"
|
|
|
-
|
|
|
identifier = new_defect.get(key_to_check)
|
|
|
|
|
|
# 只有带有对应标识的才进行特殊合并处理
|