|
@@ -64,13 +64,10 @@ public class IdeaCommentServiceImpl extends ServiceImpl<IdeaCommentMapper, IdeaC
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
IdeaComment oldIdeaComment = ideaCommentMapper.selectById(ideaComment.getId());
|
|
|
if (oldIdeaComment != null) {
|
|
|
- Idea idea = ideaMapper.selectOne(new QueryWrapper<Idea>().eq("id", ideaComment.getIdeaId()));
|
|
|
- if (idea != null && null == idea.getScore()) {
|
|
|
- ideaCommentMapper.deleteById(ideaComment.getId());
|
|
|
- } else {
|
|
|
- msg.setError("该回复对应的建议已被打分,不提供删除操作。");
|
|
|
- return msg;
|
|
|
- }
|
|
|
+ Idea idea = ideaMapper.selectOne(new QueryWrapper<Idea>().eq("id", oldIdeaComment.getIdeaId()));
|
|
|
+ idea.setScore(0.0);
|
|
|
+ ideaMapper.updateById(idea);
|
|
|
+ ideaCommentMapper.deleteById(ideaComment.getId());
|
|
|
}else{
|
|
|
msg.setError("想要删除的回复数据不存在。");
|
|
|
}
|