|
@@ -48,11 +48,11 @@ public class IdeaCommentServiceImpl extends ServiceImpl<IdeaCommentMapper, IdeaC
|
|
|
idea.setIsEvaluated(1);
|
|
|
idea.setScoreId(scoreId);
|
|
|
ideaMapper.update(idea,new QueryWrapper<Idea>().eq("id",ideaComment.getIdeaId()));
|
|
|
- List<Idea> ideaList = ideaMapper.selectList(new QueryWrapper<Idea>().eq("score_id", scoreId));
|
|
|
- Score scoreEntiry = new Score();
|
|
|
- scoreEntiry.setScoreId(scoreId);
|
|
|
- scoreEntiry.setIdeaScore(ideaList.stream().mapToDouble(Idea::getScore).sum()+0);
|
|
|
- scoreMapper.update(scoreEntiry,new QueryWrapper<Score>().eq("score_id",scoreId));
|
|
|
+// List<Idea> ideaList = ideaMapper.selectList(new QueryWrapper<Idea>().eq("score_id", scoreId));
|
|
|
+// Score scoreEntiry = new Score();
|
|
|
+// scoreEntiry.setScoreId(scoreId);
|
|
|
+// scoreEntiry.setIdeaScore(ideaList.stream().mapToDouble(Idea::getScore).sum()+0);
|
|
|
+// scoreMapper.update(scoreEntiry,new QueryWrapper<Score>().eq("score_id",scoreId));
|
|
|
} else {
|
|
|
//修改评论
|
|
|
Idea idea = ideaMapper.selectOne(new QueryWrapper<Idea>().eq("id", ideaComment.getIdeaId()));
|
|
@@ -62,6 +62,11 @@ public class IdeaCommentServiceImpl extends ServiceImpl<IdeaCommentMapper, IdeaC
|
|
|
idea.setScore(score);
|
|
|
ideaMapper.updateById(idea);
|
|
|
}
|
|
|
+// List<Idea> ideaList = ideaMapper.selectList(new QueryWrapper<Idea>().eq("score_id", idea.getScoreId()));
|
|
|
+// Score scoreEntiry = new Score();
|
|
|
+// scoreEntiry.setScoreId(scoreId);
|
|
|
+// scoreEntiry.setIdeaScore(ideaList.stream().mapToDouble(Idea::getScore).sum()+0);
|
|
|
+// scoreMapper.update(scoreEntiry,new QueryWrapper<Score>().eq("score_id",scoreId));
|
|
|
} else {
|
|
|
msg.setError("该建议数据不存在。");
|
|
|
return msg;
|