fix:兼容二创设置旧数据没有性别问题

This commit is contained in:
litianxiang
2025-10-15 15:58:08 +08:00
parent 1c32aaa46c
commit 9959a03ccc

View File

@@ -553,7 +553,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
}
vo.setCollectionElementList(collectionElementList);
List<UserLikeSnapshot> userLikeList = projectSnapshot.getUserLikeList();
if (userLikeList != null && !userLikeList.isEmpty()){
if (userLikeList != null && !userLikeList.isEmpty()) {
List<TDesignPythonOutfit> list = new ArrayList<>();
for (UserLikeSnapshot userLikeSnapshot : userLikeList) {
TDesignPythonOutfit designPythonOutfit = userLikeSnapshot.getDesignPythonOutfit();
@@ -682,6 +682,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
element.setUpdateDate(null);
element.setAccountId(accountId);
element.setProjectId(projectIdNew);
if (element.getLevel3Type() == null) {
element.setLevel3Type(workspaceOld.getSex());
}
collectionElementMapper.insert(element);
Long collectionElementNewID = element.getId();
if (collectionElementRelModelCopy != null) {
@@ -690,6 +693,17 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
collectionElementRelModelMapper.insert(collectionElementRelModelCopy);
}
;
} else if (element.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())) {
// element.setCollectionId(collectionIdNew);
if (element.getLevel3Type() == null) {
element.setLevel3Type(workspaceOld.getSex());
}
element.setId(null);
element.setCreateDate(new Date());
element.setUpdateDate(null);
element.setAccountId(accountId);
element.setProjectId(projectIdNew);
collectionElementMapper.insert(element);
} else {
// element.setCollectionId(collectionIdNew);
element.setId(null);
@@ -751,9 +765,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
List<CollectionElement> modelTypeElements = collectionElementListOld.stream()
.filter(element -> element.getLevel1Type().equals(CollectionLevel1TypeEnum.MODEL.getRealName()))
.collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(modelTypeElements)){
if (CollectionUtil.isNotEmpty(modelTypeElements)) {
design.setSingleOverall("overall");
}else {
} else {
design.setSingleOverall("single");
}