BUGFIX:分页查询所有项目历史记录,根据更新时间排序,解决项目记录没有更新时间导致空指针问题

This commit is contained in:
2025-08-04 13:29:12 +08:00
parent 4ad2cd027c
commit 878f556a0b
2 changed files with 6 additions and 1 deletions

View File

@@ -684,8 +684,10 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
designPythonOutfit.setDesignId(null);
designPythonOutfit.setDesignItemId(-1L);
designPythonOutfit.setCollectionId(null);
designPythonOutfit.setCreateDate(LocalDateTime.now());
designPythonOutfit.setId(null);
// 这里插入的accountId是原作者的二创是否需要修改
designPythonOutfitMapper.insert(designPythonOutfit);
Long designOutfitIdNew = designPythonOutfit.getId();
userLike.setDesignOutfitId(designOutfitIdNew);
@@ -698,6 +700,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
tDesignPythonOutfitDetail.setId(null);
tDesignPythonOutfitDetail.setDesignId(null);
tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew);
tDesignPythonOutfitDetail.setCreateDate(LocalDateTime.now());
designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail);
}
}

View File

@@ -1775,7 +1775,9 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
IPage<ProjectVO> convert = page.convert((Function<Project, ProjectVO>) project -> {
if (project != null) {
ProjectVO projectVO = CopyUtil.copyObject(project, ProjectVO.class);
projectVO.setUpdateDate(project.getUpdateTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
// 用于排序的时间
LocalDateTime orderTime = Objects.isNull(project.getUpdateTime()) ? project.getCreateTime() : project.getUpdateTime();
projectVO.setUpdateDate(orderTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
QueryWrapper<UserLikeGroup> userLikeGroupQueryWrapper1 = new QueryWrapper<>();
userLikeGroupQueryWrapper1.lambda().eq(UserLikeGroup::getProjectId, projectVO.getId());