linhw 2024-06-17 10:40:04 +08:00
parent 63e9f8e54b
commit 297a16847b
3 changed files with 16 additions and 2 deletions

View File

@ -119,7 +119,6 @@ public class AppDynamicCommentController extends BaseController
@GetMapping("/treeList")
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
public AjaxResult treeList(AppDynamicComment appDynamicComment) {
startPage();
Map list = appDynamicCommentService.treeList(appDynamicComment);
return AjaxResult.success(list);
}

View File

@ -19,6 +19,8 @@ import com.ruoyi.app.mapper.AppDynamicCommentMapper;
import com.ruoyi.app.domain.AppDynamicComment;
import com.ruoyi.app.service.IAppDynamicCommentService;
import static com.ruoyi.common.core.utils.PageUtils.startPage;
/**
* Service
*
@ -126,10 +128,12 @@ public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService
if (appDynamicComment.getDynamicId() == null) {
return map;
}
List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment);
startPage();
List<AppDynamicCommentVo> appDynamicComments = appDynamicCommentMapper.selectCommentList(appDynamicComment);
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
map.put("countNum",appDynamicComments.size());
map.put("countNum",list.size());
map.put("list",buildList(parentList,srcList));
return map;
}

View File

@ -65,6 +65,9 @@ public class AppUserServiceImpl implements IAppUserService {
@Autowired
private AppRegisterMapper appRegisterMapper;
@Autowired
private AppDynamicCommentMapper appDynamicCommentMapper;
@Override
public AjaxResult statistics() {
StatisticsVo statisticsVo = new StatisticsVo();
@ -221,6 +224,14 @@ public class AppUserServiceImpl implements IAppUserService {
List<AppUserDynamic> list = appUserDynamicMapper.selectAppUserDynamicList(appUserDynamic);
if (list != null && list.size() > 0) {
for (AppUserDynamic userDynamic : list) {
AppDynamicComment appDynamicComment = new AppDynamicComment();
appDynamicComment.setDynamicId(userDynamic.getId());
List<AppDynamicComment> appDynamicComments = appDynamicCommentMapper.selectAppDynamicCommentList(appDynamicComment);
if (appDynamicComments != null && list.size() > 0) {
for (AppDynamicComment dynamicComment : appDynamicComments) {
appDynamicCommentMapper.deleteAppDynamicCommentById(dynamicComment.getId());
}
}
appUserDynamicMapper.deleteAppUserDynamicById(userDynamic.getId());
}
}