BUGFIX:aida;

This commit is contained in:
shahaibo
2024-07-08 16:17:13 +08:00
parent 9ca0cd7c43
commit 42f1d47f82
7 changed files with 37 additions and 29 deletions

View File

@@ -126,7 +126,11 @@ public class SavedCollectionController {
userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size());
if (userLikeGroupVO.getOriginal() == 0) {
userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName());
userLikeGroupVO.setOriginalPortfolioName(portfolioService.getById(userLikeGroupVO.getOriginalPortfolioId()).getPortfolioName());
Portfolio byId = portfolioService.getByIdAll(userLikeGroupVO.getOriginalPortfolioId());
if (Objects.nonNull(byId)) {
String portfolioName = byId.getPortfolioName();
userLikeGroupVO.setOriginalPortfolioName(portfolioName);
}
}
return userLikeGroupVO;
}

View File

@@ -4,4 +4,5 @@ import com.ai.da.common.config.mybatis.plus.CommonMapper;
import com.ai.da.mapper.primary.entity.Portfolio;
public interface PortfolioMapper extends CommonMapper<Portfolio> {
Portfolio getByIdAll(Long originalPortfolioId);
}

View File

@@ -26,4 +26,6 @@ public class PortfolioVO extends Portfolio {
private Integer isMine;
private Integer selected;
private Integer jumpable;
}

View File

@@ -39,4 +39,6 @@ public interface PortfolioService extends IService<Portfolio> {
Boolean commentDelete(CommentDTO commentDTO);
Boolean delete(Long id);
Portfolio getByIdAll(Long originalPortfolioId);
}

View File

@@ -492,7 +492,16 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
vo.setUserName(accountMapper.selectById(vo.getAccountId()).getUserName());
if (vo.getOriginal() == 0) {
vo.setOriginalUserName(accountMapper.selectById(vo.getOriginalAccountId()).getUserName());
vo.setOriginalPortfolioName(portfolioMapper.selectById(vo.getOriginalPortfolioId()).getPortfolioName());
Portfolio byId = portfolioMapper.getByIdAll(vo.getOriginalPortfolioId());
if (Objects.nonNull(byId)) {
String portfolioName = byId.getPortfolioName();
vo.setOriginalPortfolioName(portfolioName);
if (byId.getIsDeleted() == 0) {
vo.setJumpable(1);
}else {
vo.setJumpable(0);
}
}
}
if (userHolder == null) {
vo.setIsMine(0);
@@ -882,6 +891,11 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
return Boolean.TRUE;
}
@Override
public Portfolio getByIdAll(Long originalPortfolioId) {
return portfolioMapper.getByIdAll(originalPortfolioId);
}
private List<CommentVO> getChildCommentVOList(Long id) {
QueryWrapper<Comment> qw = new QueryWrapper<>();
qw.lambda().eq(Comment::getParentLevel1Id, id);

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.da.mapper.primary.PortfolioMapper">
<select id="getByIdAll" resultType="com.ai.da.mapper.primary.entity.Portfolio">
select
*
from portfolio
where id = #{originalPortfolioId}
</select>
</mapper>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ai.da.mapper.AccountMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.ai.da.mapper.entity.Account">
<id column="id" property="id" />
<result column="user_email" property="userEmail" />
<result column="user_name" property="userName" />
<result column="user_password" property="userPassword" />
<result column="create_date" property="createDate" />
</resultMap>
<select id="findByPhoneList" resultType="com.ai.da.mapper.entity.Account">
select id , user_email AS userEmail, user_Name AS userName,
user_password AS userPassword from t_account
where user_Name in
<foreach collection="phoneList" item="phone" open="(" separator="," close=")">
#{phone}
</foreach>
</select>
<select id="findById" resultType="com.ai.da.mapper.entity.Account">
select id ,user_email AS userEmail, user_phone AS userPhone,
user_password AS userPassword from t_account
where id = #{id}
</select>
</mapper>