TASK:作品更新接口,将通过projectId替换userLikeGroupId

This commit is contained in:
2025-07-17 17:21:14 +08:00
parent 0155154664
commit 20f7dc0ef9
2 changed files with 16 additions and 6 deletions

View File

@@ -147,9 +147,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
throw new BusinessException("The title of the published work has been used.");
}
// 判断用户是否参与#RCAworkshop_2024的活动
if (hasParticipatedRCAWorkshop(authPrincipalVo.getId(), portfolioDTO.getTagsDTO(), portfolioDTO.getId(), portfolioDTO.getUserLikeGroupId())){
throw new BusinessException("you.have.participated.in.the.event", ResultEnum.PROMPT.getCode());
}
// if (hasParticipatedRCAWorkshop(authPrincipalVo.getId(), portfolioDTO.getTagsDTO(), portfolioDTO.getId(), portfolioDTO.getUserLikeGroupId())){
// throw new BusinessException("you.have.participated.in.the.event", ResultEnum.PROMPT.getCode());
// }
if (file != null && file.getOriginalFilename() != null) {
Long portfolioId;
// 上传画布到minio
@@ -295,7 +295,12 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
throw new BusinessException("The title of the published work has been used.");
}
if (portfolioDTO.getPortfolioType().equals("History")) {
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
UserLikeGroup likeGroup = userLikeGroupMapper.selectOne(new QueryWrapper<UserLikeGroup>().eq("project_id", portfolioDTO.getProjectId()));
if (Objects.isNull(likeGroup)){
return null;
}
Long userLikeGroupId = likeGroup.getId();
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(userLikeGroupId);
UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null);
userLikeGroupNew.setAccountId(-1L);
Long collectionIdOld = userLikeGroup.getCollectionId();
@@ -316,7 +321,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
collectionElementRelationNew.setElementId(element.getId());
collectionElementRelationMapper.insert(collectionElementRelationNew);
}
Portfolio portfolio = getPortfolioByUserGroupIdSource(portfolioDTO.getUserLikeGroupId());
Portfolio portfolio = getPortfolioByUserGroupIdSource(userLikeGroupId);
Long coverIdOld = portfolioDTO.getCoverId();
portfolio.setPortfolioName(portfolioDTO.getPortfolioName());
// portfolio.setPortfolioType("History");
@@ -328,7 +333,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
portfolio.setIsDeleted(0);
portfolioMapper.updateById(portfolio);
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
List<UserLike> userLikeList = userLikeService.getUserLikeList(userLikeGroupId);
Long coverIdNew = null;
Boolean flag = false;