缺陷保存报错

This commit is contained in:
cuizhibin 2025-07-23 14:45:33 +08:00
parent fc8d3ae26b
commit a0fd37a74e
1 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
}
image.setImageType(ImageTypeEnum.DEFECT.getCode());
imageService.save(image);
imageService.updateById(image);
DefectEntity defectEntity = Converts.INSTANCE.toDefectEntity(req);
defectEntity.setImageId(imageId);
defectEntity.setLabelInfo(JSONUtil.toJsonStr(req.getMarkInfo()));
@ -197,7 +197,7 @@ public class DefectServiceImpl extends ServiceImpl<DefectMapper, DefectEntity> i
throw new ServiceException(Message.IMAGE_ID_IS_NOT_EXIST);
}
image.setImageType(ImageTypeEnum.DEFECT.getCode());
imageService.save(image);
imageService.updateById(image);
FilePathEnum pathEnum = image.getImagePath().contains("temp") ? FilePathEnum.IMAGE_TEMP : FilePathEnum.IMAGE;
String inputPath = pathEnum.getFileAbsolutePath(image.getImagePath());
// 写入attach同层级文件夹下