BUGFIX:色块重复

This commit is contained in:
shahaibo
2024-05-23 16:38:40 +08:00
parent 031d71bf99
commit 02b3a407a9
5 changed files with 17 additions and 6 deletions

View File

@@ -187,11 +187,11 @@ public class CollectionElementServiceImpl extends ServiceImpl<CollectionElementM
if (CollectionUtils.isEmpty(ids)) {
return;
}
QueryWrapper<CollectionElement> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id", ids);
CollectionElement collectionElement = new CollectionElement();
collectionElement.setCollectionId(0L);
collectionElementMapper.update(collectionElement, queryWrapper);
// QueryWrapper<CollectionElement> queryWrapper = new QueryWrapper<>();
// queryWrapper.in("id", ids);
// CollectionElement collectionElement = new CollectionElement();
// collectionElement.setCollectionId(0L);
collectionElementMapper.deleteBatchIds(ids);
}
@Override

View File

@@ -1,5 +1,6 @@
package com.ai.da.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.ai.da.common.config.exception.BusinessException;
import com.ai.da.common.enums.CollectionLevel1TypeEnum;
import com.ai.da.common.enums.DesignTypeEnum;
@@ -129,6 +130,12 @@ public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, Collect
default:
}
});
if (CollectionUtil.isNotEmpty(response.getColorBoards())) {
List<CollectionColorVO> collect = response.getColorBoards().stream()
.distinct()
.collect(Collectors.toList());
response.setColorBoards(collect);
}
return response;
}