no
DESKTOP-71BH0QO\L、ming
2021-04-29 7ba749e70dc87fb57efd58cc439e31c93fd7076f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
package com.panzhihua.service_community.service.impl;
 
import java.util.Date;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.dtos.neighbor.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.neighbor.*;
import com.panzhihua.common.model.vos.neighbor.*;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.dao.ComActNeighborCircleCommentDAO;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
import com.panzhihua.service_community.dao.ComActNeighborCircleCommentReplyDAO;
import com.panzhihua.service_community.dao.ComActNeighborCircleDAO;
import com.panzhihua.service_community.dao.ComActNeighborCircleFabulousDAO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentDO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleCommentReplyDO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO;
import com.panzhihua.service_community.model.dos.ComActNeighborCircleFabulousDO;
import com.panzhihua.service_community.service.ComActNeighborCircleBrowseService;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.model.dos.*;
import com.panzhihua.service_community.service.ComActNeighborCircleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
 
import javax.annotation.Resource;
 
import java.util.List;
 
/**
 * @auther lyq
 * @create 2021-04-28 09:20:49
 * @describe 邻里圈表服务实现类
 */
@Slf4j
@Service
public class ComActNeighborCircleServiceImpl extends ServiceImpl<ComActNeighborCircleDAO, ComActNeighborCircleDO> implements ComActNeighborCircleService {
 
    @Resource
    private ComActNeighborCircleBrowseService comActNeighborCircleBrowseService;
 
    @Resource
    ComActNeighborCircleFabulousDAO neighborCircleFabulousDAO;
 
    @Resource
    ComActNeighborCircleBrowseDAO neighborCircleBrowseDAO;
 
    @Resource
    ComActNeighborCircleCommentDAO neighborCircleCommentDAO;
 
    @Resource
    ComActNeighborCircleCommentReplyDAO neighborCircleCommentReplyDAO;
 
    /**
     * 分页查询邻里圈列表
     * @param neighborCircleAppDTO  请求参数
     * @return  邻里圈列表
     */
    @Override
    public R pageNeighborByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO){
        Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize());
        IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO);
        return R.ok(doPager);
    }
 
    /**
     * 用户发布邻里圈审核
     * @param addNeighborCircleAppDTO   邻里圈请求参数
     * @return  发布结果
     */
    @Override
    public R addNeighborByApp(AddComActNeighborCircleAppDTO addNeighborCircleAppDTO){
        //新增邻里圈审核
        ComActNeighborCircleDO neighborCircleDO = new ComActNeighborCircleDO();
        BeanUtils.copyProperties(addNeighborCircleAppDTO,neighborCircleDO);
        if(addNeighborCircleAppDTO.getUserId() != null){
            neighborCircleDO.setReleaseId(addNeighborCircleAppDTO.getUserId());
        }
        if(addNeighborCircleAppDTO.getCommunityId() != null){
            neighborCircleDO.setCommunityId(addNeighborCircleAppDTO.getCommunityId());
        }
        if(StringUtils.isNotEmpty(addNeighborCircleAppDTO.getPhone())){
            neighborCircleDO.setReleasePhone(addNeighborCircleAppDTO.getPhone());
        }
        if(this.baseMapper.insert(neighborCircleDO) > 0){
            return R.ok();
        }else{
            return R.fail("发布失败");
        }
    }
 
    /**
     * 查看邻里圈详情
     * @param neighborCircleAppDTO  请求参数
     * @return  邻里圈详情
     */
    @Override
    public R neighborDetailByApp(ComActNeighborCircleDetailAppDTO neighborCircleAppDTO){
        //添加邻里圈浏览记录
        comActNeighborCircleBrowseService.addBrowseRecord(neighborCircleAppDTO.getCircleId(),neighborCircleAppDTO.getUserId());
        //查询邻里圈详情
        ComActNeighborCircleDetailAppVO circleDetailAppVO = this.baseMapper.neighborDetailByApp(neighborCircleAppDTO.getCircleId());
        //查询邻里圈下评论列表
        IPage<ComActNeighborCircleCommentAppVO> circleCommentAppPage = neighborCircleCommentDAO.pageNeighborCommentByApp(
                new Page(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO);
        if(!circleCommentAppPage.getRecords().isEmpty()){
            for (ComActNeighborCircleCommentAppVO circleCommentVo:circleCommentAppPage.getRecords()) {
                //查询评论下评论回复
                List<ComActNeighborCircleCommentReplyAppVO> commentReplyAppVOS = neighborCircleCommentReplyDAO.getCircleCommentReplyList(circleCommentVo.getId());
                if(!commentReplyAppVOS.isEmpty()){
                    circleCommentVo.setCircleCommentReplyAppList(commentReplyAppVOS);
                }
            }
        }
        return R.ok(circleDetailAppVO);
    }
 
    @Override
    public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) {
        Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize());
        IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO);
        return R.ok(doPager);
    }
 
    @Override
    public R addNeighborByAdmin(AddNeighborCircleAdminVO addVO) {
        ComActNeighborCircleDO comActNeighborCircleDO = new ComActNeighborCircleDO();
        AdministratorsUserVO adminUser = this.baseMapper.selectUserByUserId(addVO.getUserId());
        if (adminUser == null) {
            return R.fail("请登录重试");
        }
        comActNeighborCircleDO.setReleaseId(addVO.getUserId());
        comActNeighborCircleDO.setReleasePhone(adminUser.getPhone());
        comActNeighborCircleDO.setCommunityId(adminUser.getCommunityId());
        comActNeighborCircleDO.setReleaseContent(addVO.getReleaseContent());
        comActNeighborCircleDO.setReleaseImages(addVO.getReleaseImages());
        comActNeighborCircleDO.setStatus(1);
        comActNeighborCircleDO.setCommentNum(0);
        comActNeighborCircleDO.setFabulousNum(0);
        comActNeighborCircleDO.setForwardNum(0);
        comActNeighborCircleDO.setViewsNum(0);
        comActNeighborCircleDO.setIsBoutique(2);
        comActNeighborCircleDO.setCreateAt(new Date());
        comActNeighborCircleDO.setLastCommentNum(0);
        comActNeighborCircleDO.setLastFabulousNum(0);
        comActNeighborCircleDO.setLastViewsNum(0);
        this.baseMapper.insert(comActNeighborCircleDO);
        return R.ok();
    }
 
    @Override
    public R changeStatusByAdmin(EditNeighborCircleAdminVO editVO) {
        ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(editVO.getId());
        if (neighborCircleDO == null) {
            return R.fail("id有误!");
        }
        neighborCircleDO.setStatus(editVO.getStatus());
        if(editVO.getRefuseReason()!=null){
            neighborCircleDO.setRefuseReason(editVO.getRefuseReason());
        }
        this.baseMapper.updateById(neighborCircleDO);
        return R.ok();
    }
 
    /**
     * 用户查询邻里圈列表
     * @param neighborCircleAppDTO  请求参数
     * @return  邻里圈列表
     */
    @Override
    public R neighborExamineByApp(ComActNeighborCircleAppDTO neighborCircleAppDTO){
        IPage<ComActNeighborCircleAppVO> neighborCircleIPage = this.baseMapper.neighborExamineByApp(
                new Page<>(neighborCircleAppDTO.getPageNum(),neighborCircleAppDTO.getPageSize()),neighborCircleAppDTO.getUserId());
        return R.ok(neighborCircleIPage);
    }
 
    /**
     * 邻里圈点赞
     * @param fabulousAppDTO    请求参数
     * @return  点赞结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R neighborFabulousByApp(ComActNeighborFabulousAppDTO fabulousAppDTO){
 
        ComActNeighborCircleFabulousDO circleFabulousDO = new ComActNeighborCircleFabulousDO();
        circleFabulousDO.setUserId(fabulousAppDTO.getUserId());
        circleFabulousDO.setType(fabulousAppDTO.getType());
        circleFabulousDO.setParentId(fabulousAppDTO.getServiceId());
        //判断点赞类型
        if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.llq)){
            //增加邻里圈点赞数量
            ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(fabulousAppDTO.getServiceId());
            if(neighborCircleDO != null){
                neighborCircleDO.setFabulousNum(neighborCircleDO.getFabulousNum() + 1);
                this.baseMapper.updateById(neighborCircleDO);
                circleFabulousDO.setCircleId(neighborCircleDO.getId());
            }
 
            //添加邻里圈浏览记录
            comActNeighborCircleBrowseService.addBrowseRecord(fabulousAppDTO.getServiceId(),fabulousAppDTO.getUserId());
        }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.pl)){
            //增加邻里圈评论点赞数量
            ComActNeighborCircleCommentDO circleCommentDO = neighborCircleCommentDAO.selectById(fabulousAppDTO.getServiceId());
            if(circleCommentDO != null){
                circleCommentDO.setFabulousNum(circleCommentDO.getFabulousNum() + 1);
                neighborCircleCommentDAO.updateById(circleCommentDO);
                circleFabulousDO.setCircleId(circleCommentDO.getCircleId());
            }
        }else if(fabulousAppDTO.getType().equals(ComActNeighborFabulousAppDTO.type.hf)){
            //增加邻里圈评论回复点赞数量
            ComActNeighborCircleCommentReplyDO circleCommentReplyDO = neighborCircleCommentReplyDAO.selectById(fabulousAppDTO.getServiceId());
            if(circleCommentReplyDO != null){
                circleCommentReplyDO.setFabulousNum(circleCommentReplyDO.getFabulousNum() + 1);
                neighborCircleCommentReplyDAO.updateById(circleCommentReplyDO);
                circleFabulousDO.setCircleId(circleCommentReplyDO.getCircleId());
            }
        }
        if(neighborCircleFabulousDAO.insert(circleFabulousDO) > 0){
            return R.ok();
        }else{
            return R.fail("点赞失败");
        }
    }
 
    /**
     * 邻里圈转发
     * @param forwardAppDTO 请求参数
     * @return  转发结果
     */
    @Override
    public R neighborForwardByApp(ComActNeighborForwardAppDTO forwardAppDTO){
 
        //添加邻里圈浏览记录
        comActNeighborCircleBrowseService.addBrowseRecord(forwardAppDTO.getCircleId(),forwardAppDTO.getUserId());
 
        ComActNeighborCircleDO circleDO = this.baseMapper.selectById(forwardAppDTO.getCircleId());
        if(circleDO == null){
            return R.fail("没有找到邻里圈");
        }
        circleDO.setForwardNum(circleDO.getForwardNum() + 1);
        if(this.baseMapper.updateById(circleDO) > 0){
            return R.ok();
        }else{
            return R.fail("转发失败");
        }
    }
 
    /**
     * 邻里圈评论
     * @param commentAppDTO 请求参数
     * @return  评论结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R neighborCommentByApp(ComActNeighborCommentAppDTO commentAppDTO){
 
        ComActNeighborCircleCommentDO circleCommentDO = new ComActNeighborCircleCommentDO();
        //查询邻里圈更新邻里圈评论数量
        ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(commentAppDTO.getCircleId());
        if(neighborCircleDO == null){
            return R.fail("没有找到邻里圈");
        }
        neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1);
        neighborCircleDO.setReplyAt(new Date());
        this.baseMapper.updateById(neighborCircleDO);
 
        circleCommentDO.setCircleId(commentAppDTO.getCircleId());
        circleCommentDO.setUserId(commentAppDTO.getUserId());
        circleCommentDO.setUserPhone(commentAppDTO.getPhone());
        circleCommentDO.setContent(commentAppDTO.getContent());
        if(neighborCircleDO.getReleaseId().equals(commentAppDTO.getUserId())){
            circleCommentDO.setIsRelease(ComActNeighborCircleCommentDO.isRelease.yes);
        }
 
        if(neighborCircleCommentDAO.insert(circleCommentDO) > 0){
            return R.ok();
        }else{
            return R.fail("评论失败");
        }
    }
 
    /**
     * 邻里圈回复
     * @param replyAppDTO   请求参数
     * @return  回复结果
     */
    @Override
    public R neighborReplyByApp(ComActNeighborReplyAppDTO replyAppDTO){
 
        ComActNeighborCircleCommentReplyDO circleCommentReplyDO = new ComActNeighborCircleCommentReplyDO();
        //查询邻里圈更新邻里圈评论数量
        ComActNeighborCircleDO neighborCircleDO = this.baseMapper.selectById(replyAppDTO.getCircleId());
        if(neighborCircleDO == null){
            return R.fail("没有找到邻里圈");
        }
        neighborCircleDO.setCommentNum(neighborCircleDO.getCommentNum() + 1);
        neighborCircleDO.setReplyAt(new Date());
        this.baseMapper.updateById(neighborCircleDO);
 
        circleCommentReplyDO.setCircleId(replyAppDTO.getCircleId());
        circleCommentReplyDO.setUserId(replyAppDTO.getUserId());
        circleCommentReplyDO.setReplyContent(replyAppDTO.getContent());
        if(neighborCircleDO.getReleaseId().equals(replyAppDTO.getUserId())){
            circleCommentReplyDO.setIsRelease(1);
        }
 
        //判断回复类型
        if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.pl)){
            //查询评论信息
            ComActNeighborCircleCommentDO circleCommentDO = neighborCircleCommentDAO.selectById(replyAppDTO.getServiceId());
            if(circleCommentDO != null){
                circleCommentReplyDO.setCommentId(replyAppDTO.getServiceId());
                circleCommentReplyDO.setParentId(0L);
                circleCommentReplyDO.setParentUserId(circleCommentDO.getUserId());
            }
        }else if(replyAppDTO.getType().equals(ComActNeighborReplyAppDTO.type.hf)){
            //查询上级回复信息
            ComActNeighborCircleCommentReplyDO parentCommentReplyDO = neighborCircleCommentReplyDAO.selectById(replyAppDTO.getServiceId());
            if(parentCommentReplyDO != null){
                circleCommentReplyDO.setCommentId(parentCommentReplyDO.getCommentId());
                circleCommentReplyDO.setParentId(parentCommentReplyDO.getId());
                circleCommentReplyDO.setParentUserId(parentCommentReplyDO.getUserId());
            }
        }
 
        if(neighborCircleCommentReplyDAO.insert(circleCommentReplyDO) > 0){
            return R.ok();
        }else{
            return R.fail("回复失败");
        }
    }
 
    @Override
    public R timeTaskCircleFlow(){
        Date oldDate = DateUtils.addDay(new Date(),-3);
        //查询所有状态正常的邻里圈
        List<ComActNeighborCircleDO> circleDOList = this.baseMapper.selectList(
                new QueryWrapper<ComActNeighborCircleDO>().lambda().eq(ComActNeighborCircleDO::getStatus,ComActNeighborCircleDO.status.xs));
        if(!circleDOList.isEmpty()){
            //遍历查询到的邻里圈,更新邻里圈内近3天的评论数,点赞数,浏览量
            for (ComActNeighborCircleDO neighborCircleDO:circleDOList) {
                //查询邻里圈近3天的评论数
                int commentCount = neighborCircleCommentDAO.selectCount(
                        new QueryWrapper<ComActNeighborCircleCommentDO>().lambda().eq(ComActNeighborCircleCommentDO::getCircleId,neighborCircleDO.getId()));
                //查询邻里圈近3天的评论回复数
                int commentReplyCount = neighborCircleCommentReplyDAO.selectCount(
                        new QueryWrapper<ComActNeighborCircleCommentReplyDO>().lambda()
                                .eq(ComActNeighborCircleCommentReplyDO::getCircleId,neighborCircleDO.getId()));
 
                //查询邻里圈近3天的点赞数
                int fabulousCount = neighborCircleFabulousDAO.selectCount(new QueryWrapper<ComActNeighborCircleFabulousDO>()
                        .lambda().eq(ComActNeighborCircleFabulousDO::getCircleId,neighborCircleDO.getId())
                        .eq(ComActNeighborCircleFabulousDO::getIsEffective,ComActNeighborCircleFabulousDO.isEffective.yes));
 
                //查询邻里圈近3天的浏览量
 
            }
        }
 
        return R.ok();
    }
 
    @Override
    public R deleteByAdmin(Long id) {
        ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id);
        if (comActNeighborCircleDO == null) {
            return R.fail();
        }
        if (comActNeighborCircleDO.getStatus() == 1) {
            return R.fail("待审核的邻里圈不能删除");
        }
        //邻里圈删除
        this.baseMapper.deleteById(id);
        //邻里圈评论删除
        neighborCircleCommentDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleCommentDO>()
                .eq(ComActNeighborCircleCommentDO::getCircleId, id));
        //邻里圈回复删除
        neighborCircleCommentReplyDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleCommentReplyDO>()
                .eq(ComActNeighborCircleCommentReplyDO::getCircleId, id));
        //邻里圈浏览器记录
        neighborCircleBrowseDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleBrowseDO>()
                .eq(ComActNeighborCircleBrowseDO::getNeighborId, id));
        //邻里圈点赞删除 需要一层一层删
/*        neighborCircleFabulousDAO.delete(new LambdaQueryWrapper<ComActNeighborCircleFabulousDO>()
                .eq(ComActNeighborCircleFabulousDO::get))*/
        return R.ok();
 
    }
 
    @Override
    public R detailNeighborByAdmin(Long id) {
        ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(id);
        AdministratorsUserVO user = this.baseMapper.selectUserByUserId(comActNeighborCircleDO.getReleaseId());
        if (comActNeighborCircleDO == null) {
            return R.fail("id有误");
        }
        DetailNeighborCircleAdminVO vo = new DetailNeighborCircleAdminVO();
        BeanUtils.copyProperties(comActNeighborCircleDO, vo);
        vo.setReleaseName(user.getName());
        return R.ok(vo);
    }
 
    @Override
    public R detailNeighborAllCommentByAdmin(DetailNeighborAllCommentByAdminDTO dto) {
        ComActNeighborCircleDO comActNeighborCircleDO = this.baseMapper.selectById(dto.getId());
        if (comActNeighborCircleDO == null) {
            return R.fail("id有误");
        }
        Page<ComActNeighborCircleCommentDO> page = new Page<>(dto.getPageNum(),dto.getPageSize());
        //1、先查询所有该邻里圈_的评论
        IPage<ComActNeighborCommentByAdminVO> commentDOIPage = neighborCircleCommentDAO.selectPageDetailNeighborComment(page,dto);
        return R.ok(commentDOIPage);
    }
 
    @Override
    public R changeCommentStatusByAdmin(ChangeCommentStatusByAdminVO dto) {
        ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(dto.getId());
        if(commentDO==null){
            return R.fail("id有误!");
        }
        commentDO.setStatus(dto.getStatus());
        neighborCircleCommentDAO.updateById(commentDO);
        return R.ok();
    }
 
    @Override
    public R detailNeighborCommentByAdmin(Long id) {
        ComActNeighborCircleCommentDO commentDO = neighborCircleCommentDAO.selectById(id);
        if(commentDO==null){
            return R.fail("id有误!");
        }
        AdministratorsUserVO user = this.baseMapper.selectUserByUserId(commentDO.getUserId());
        ComActNeighborCommentByAdminVO vo = new ComActNeighborCommentByAdminVO();
        BeanUtils.copyProperties(commentDO,vo);
        vo.setUserName(user.getName());
        return R.ok(vo);
    }
 
    @Override
    public R detailNeighborCommentAllReply(DetailNeighborCommentReplyByAdminDTO dto) {
        Page<ComActNeighborCircleCommentReplyDO> page = new Page<>(dto.getPageNum(),dto.getPageSize());
        Page<ComActNeighborCommentReplyByAdminVO> replyPage = neighborCircleCommentReplyDAO.selectListByComment(page, dto);
        replyPage.getRecords().forEach(reply->{
 
        });
        return R.ok(replyPage);
    }
 
    @Override
    public R detailNeighborCommentReply(Long id) {
        ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(id);
        if(replyDO==null){
            return R.fail("id有误!");
        }
        AdministratorsUserVO user = this.baseMapper.selectUserByUserId(replyDO.getUserId());
        ComActNeighborCommentReplyByAdminVO vo = new ComActNeighborCommentReplyByAdminVO();
        BeanUtils.copyProperties(replyDO,vo);
        vo.setUserName(user.getName());
        vo.setUserPhone(user.getPhone());
        return R.ok(vo);
    }
 
    @Override
    public R changeCommentReplyStatusByAdmin(ChangeCommentReplyStatusByAdminVO changeStatusReplyVO) {
        ComActNeighborCircleCommentReplyDO replyDO = neighborCircleCommentReplyDAO.selectById(changeStatusReplyVO.getId());
        if(replyDO==null){
            return R.fail("id有误!");
        }
        replyDO.setStatus(changeStatusReplyVO.getStatus());
        neighborCircleCommentReplyDAO.updateById(replyDO);
        return R.ok();
    }
}