fix:增加projectID匹配,避免因为二创导致查询到多条记录

This commit is contained in:
litianxiang
2025-09-17 15:19:19 +08:00
parent 8f53902d18
commit d568129843

View File

@@ -1738,7 +1738,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
private void processParentId(PoseTransformationVO vo, PoseTransformation poseTransformation) {
if (poseTransformation != null) {
ToProductImageResult productResult = getProductResultByPath(poseTransformation.getProductImage());
ToProductImageResult productResult = getProductResultByPath(poseTransformation);
if (productResult != null) {
Long parentId = collectionSortService.getParentIdByElementIdAndElementType(
productResult.getId(), CollectionType.TO_PRODUCT_IMAGE.getValue());
@@ -1770,9 +1770,11 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
}
}
private ToProductImageResult getProductResultByPath(String minioPath) {
private ToProductImageResult getProductResultByPath(PoseTransformation poseTransformation) {
QueryWrapper<ToProductImageResult> qw = new QueryWrapper<>();
qw.lambda().eq(ToProductImageResult::getUrl, minioPath);
//增加projectID匹配避免因为二创导致查询到多条记录
qw.lambda().eq(ToProductImageResult::getProjectId, poseTransformation.getProjectId());
qw.lambda().eq(ToProductImageResult::getUrl, poseTransformation.getUniqueId());
return toProductImageResultMapper.selectOne(qw);
}