mitao
2025-02-24 879ce4e66b36daf44f79b17eb02d3578148e4545
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
package com.panzhihua.applets.api;
 
import cn.hutool.core.util.StrUtil;
import com.panzhihua.applets.weixin.CheckService;
import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.CommonDTO;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.common.EditComActEasyPhotoHandlerDto;
import com.panzhihua.common.model.dtos.common.EvaluateEasyDto;
import com.panzhihua.common.model.dtos.common.PageComActEasyPhotoHandlerDto;
import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO;
import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO;
import com.panzhihua.common.model.dtos.community.NoticeReadDTO;
import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.advertisement.ComOpsAdvVO;
import com.panzhihua.common.model.vos.common.ComActEasyPhotoHandlerVo;
import com.panzhihua.common.model.vos.community.*;
import com.panzhihua.common.model.vos.community.easyPhoto.BannerVO;
import com.panzhihua.common.model.vos.community.easyPhoto.ComActEasyPhotoClassifyVO;
import com.panzhihua.common.model.vos.user.NoticeUnReadVO;
import com.panzhihua.common.model.vos.user.SysUserAgreementVO;
import com.panzhihua.common.model.vos.user.SysUserNoticeVO;
import com.panzhihua.common.service.community.ComActEasyPhotoEvaluateFeign;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PageGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
 * @description: 首页
 * @author: huang.hongfa weixin hhf9596 qq 959656820
 * @create: 2020-12-10 14:39
 **/
@RestController
@RequestMapping("/index/")
@Api(tags = {"首页"})
public class IndexApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @Resource
    private UserService userService;
    @Resource
    private CheckService checkService;
    @Resource
    private ComActEasyPhotoEvaluateFeign easyPhotoEvaluateFeign;
 
    @ApiOperation(value = "分页展示社区随手拍", response = ComActEasyPhotoVO.class)
    @PostMapping("pageeasyphoto")
    public R pageEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
//            comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
            comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
            comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember());
        }
        return communityService.pageEasyPhotoApplets(comActEasyPhotoVO);
    }
 
    @ApiOperation(value = "分页展示社区随手拍-脱敏", response = ComActEasyPhotoVO.class)
    @PostMapping("pageEasyPhotoDesensitize")
    public R pageEasyPhotoDesensitize(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActEasyPhotoVO.setCommunityId(loginUserInfo.getCommunityId());
            comActEasyPhotoVO.setLogInUserId(loginUserInfo.getUserId());
            comActEasyPhotoVO.setIsDpcMember(loginUserInfo.getIsDpcMember());
        }
        return communityService.pageEasyPhotoAppletsDesensitize(comActEasyPhotoVO);
    }
 
    @ApiOperation("上传随手拍")
    @PostMapping("easyphoto")
    public R addEasyPhoto(@RequestBody @Validated(AddGroup.class) ComActEasyPhotoVO comActEasyPhotoVO) {
        // 微信内容审核
        String openid = this.getLoginUserInfo().getOpenid();
        String appId = this.getAppId();
        // 微信内容审核
        String detail = comActEasyPhotoVO.getDetail();
        if (StrUtil.isNotBlank(detail)) {
            String result = checkService.checkMessageBy(detail, openid, appId);
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
 
        //微信图片审核
        String photoPathList = comActEasyPhotoVO.getPhotoPathList();
        if (StrUtil.isNotBlank(photoPathList)) {
            if (!checkService.checkImageBy(photoPathList, appId)) {
                return R.fail(501, "上传图片存在违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        Long userId = loginUserInfo.getUserId();
        comActEasyPhotoVO.setCommunityId(communityId);
        comActEasyPhotoVO.setSponsorId(userId);
        comActEasyPhotoVO.setStatus(1);
        return communityService.addEasyPhoto(comActEasyPhotoVO);
    }
 
    /**
     * description  queryByPage  分页查询
     *
     * @param comActEasyPhotoHandler 请求参数
     * @return 分页查询返回参数
     * @author lyq
     * @date 2022-03-01 13:45:10
     */
    @ApiOperation(value = "查询处理列表", response = ComActEasyPhotoHandlerVo.class)
    @PostMapping("/handleList")
    public R handleList(@RequestBody PageComActEasyPhotoHandlerDto comActEasyPhotoHandler) {
        comActEasyPhotoHandler.setUserId(this.getUserId());
        return this.communityService.queryEasyPhotoHandler(comActEasyPhotoHandler);
    }
 
    /**
     * description  edit  编辑数据
     *
     * @param comActEasyPhotoHandler 请求参数
     * @return 编辑结果
     * @author lyq
     * @date 2022-03-01 13:45:10
     */
    @ApiOperation(value = "提交反馈")
    @PostMapping("/editEasyPhotoHandler")
    public R editEasyPhotoHandler(@RequestBody EditComActEasyPhotoHandlerDto comActEasyPhotoHandler) {
        return this.communityService.editEasyPhotoHandler(comActEasyPhotoHandler);
    }
 
    @ApiOperation(value = "查询处理详情", response = ComActEasyPhotoHandlerVo.class)
    @ApiImplicitParam(name = "id", value = "处理id", required = true)
    @GetMapping("/easyPhotoHandler")
    public R detailEasyPhotoHandler(@RequestParam("id") Long id) {
        return this.communityService.detailEasyPhotoHandler(id);
    }
 
    @ApiOperation(value = "查询随手拍是否有活动", response = ComActEasyPhotoActivityVO.class)
    @PostMapping("getEasyPhotoActivity")
    public R getEasyPhotoActivity(@RequestBody CommonDTO commonDTO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        Long communityId = commonDTO.getCommunityId();
        if (loginUserInfo != null) {
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getEasyPhotoActivity(communityId);
    }
 
    @ApiOperation(value = "随手拍详情", response = ComActEasyPhotoVO.class)
    @GetMapping("detaileasyphoto")
    @ApiImplicitParam(name = "id", value = "随手拍主键")
    public R detailEasyPhoto(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailEasyPhoto(id, userId);
    }
 
 
    /**
     * 随手拍删除
     *
     * @param id
     *            随手拍主键
     *            登录用户id
     * @return 详情内容
     */
    @ApiOperation(value = "删除随手拍", response = ComActEasyPhotoVO.class)
    @DeleteMapping("easyphoto/{id}")
    public R deleteEasyPhoto(@PathVariable("id") Long id) {
        Long userId = this.getUserId();
        return communityService.deleteEasyPhoto(id, userId);
    }
 
 
 
    @ApiOperation(value = "随手拍详情-脱敏", response = ComActEasyPhotoVO.class)
    @GetMapping("detailEasyPhotoDesensitize")
    @ApiImplicitParam(name = "id", value = "随手拍主键")
    public R detailEasyPhotoDesensitize(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailEasyPhotoDesensitize(id, userId);
    }
 
    @ApiOperation(value = "随手拍--评论--分页查询", response = ComActEasyPhotoCommentVO.class)
    @PostMapping("pagecomacteasyphotocomment")
    public R pageComActEasyPhotoComment(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        pageComActEasyPhotoCommentDTO.setUserId(userId);
        return communityService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO);
    }
 
    @ApiOperation(value = "随手拍--评论--分页查询-脱敏", response = ComActEasyPhotoCommentVO.class)
    @PostMapping("pageComActEasyPhotoCommentDesensitize")
    public R pageComActEasyPhotoCommentDesensitize(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        pageComActEasyPhotoCommentDTO.setUserId(userId);
        return communityService.pageComActEasyPhotoCommentDesensitize(pageComActEasyPhotoCommentDTO);
    }
 
    @ApiOperation(value = "随手拍--评论--新增评论")
    @PostMapping("comacteasyphotocomment")
    public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO) {
        // 微信内容审核
        String openid = this.getLoginUserInfo().getOpenid();
        String appId = this.getAppId();
        // 微信内容审核
        String comment = comActEasyPhotoCommentDTO.getComment();
        if (StrUtil.isNotBlank(comment)) {
            String result = checkService.checkMessageBy(comment, openid, appId);
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        comActEasyPhotoCommentDTO.setUserId(this.getUserId());
        return communityService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO);
    }
 
    @ApiOperation(value = "随手拍--评论--点赞/取消点赞")
    @PostMapping("commentsign")
    public R commentSign(@RequestBody ComActEasyPhotoCommentUserDTO comActEasyPhotoCommentUserDTO) {
        comActEasyPhotoCommentUserDTO.setUserId(this.getUserId());
        return communityService.commentSign(comActEasyPhotoCommentUserDTO);
    }
 
    @ApiOperation("点赞/取消点赞随手拍")
    @PutMapping("easyphoto")
    public R putEasyPhoto(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO) {
        Long id = comActEasyPhotoVO.getId();
        if (null == id || id == 0) {
            return R.fail("随手拍主键不能为空");
        }
        Integer haveGiveThumbsUp = comActEasyPhotoVO.getHaveGiveThumbsUp();
        if (null == haveGiveThumbsUp) {
            return R.fail("操作类型不能为空");
        }
        Long userId = this.getUserId();
        comActEasyPhotoVO.setSponsorId(userId);
        return communityService.putEasyPhoto(comActEasyPhotoVO);
    }
 
    @ApiOperation(value = "分页展示社区微心愿", response = ComActMicroWishVO.class)
    @PostMapping("pagemicrowish")
    public R pageMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO)
    {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
            comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id
        }
 
        if(!StringUtils.isEmpty(comActMicroWishVO.getHandleId()))
        {
            comActMicroWishVO.setCommunityId(null);
        }
        comActMicroWishVO.setIsApplets(1);
        comActMicroWishVO.setIsPageMyWish(null);
        return communityService.pageMicroWishApplets(comActMicroWishVO);
    }
 
    @ApiOperation(value = "分页展示社区微心愿-脱敏", response = ComActMicroWishVO.class)
    @PostMapping("pageMicroWishDesensitize")
    public R pageMicroWishDesensitize(@RequestBody ComActMicroWishVO comActMicroWishVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            comActMicroWishVO.setCommunityId(loginUserInfo.getCommunityId());
            comActMicroWishVO.setResponsibleId(loginUserInfo.getUserId());// 责任人暂时放登录用户id
        }
        comActMicroWishVO.setIsApplets(1);
        comActMicroWishVO.setIsPageMyWish(null);
        return communityService.pageMicroWishAppletsDesensitize(comActMicroWishVO);
    }
 
    @ApiOperation("发布微心愿")
    @PostMapping("microwish")
    public R addMicroWish(@RequestBody @Validated(AddGroup.class) ComActMicroWishVO comActMicroWishVO) {
        // 微信内容审核
        String msg = comActMicroWishVO.getDetail();
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        Long userId = loginUserInfo.getUserId();
        String phone = loginUserInfo.getPhone();
        if (ObjectUtils.isEmpty(phone)) {
            // return R.fail("用户绑定手机号后才能发布微心愿");
            phone = "18228784579";
        }
        comActMicroWishVO.setSponsorPhone(phone);
        comActMicroWishVO.setCommunityId(communityId);
        comActMicroWishVO.setSponsorId(userId);
        return communityService.addMicroWish(comActMicroWishVO);
    }
 
    @ApiOperation(value = "心愿详情", response = ComActMicroWishVO.class)
    @GetMapping("microwish")
    @ApiImplicitParam(name = "id", value = "微心愿主键")
    public R detailMicroWish(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailMicroWish(id, userId);
    }
 
 
    @ApiOperation(value = "删除心愿")
    @PostMapping("deletemicrowish")
    public R deleteMicrowish(@RequestParam("id") Long id) {
        return communityService.deletemicrowish(id);
    }
 
 
    @ApiOperation(value = "心愿详情-脱敏", response = ComActMicroWishVO.class)
    @GetMapping("microwishDesensitize")
    @ApiImplicitParam(name = "id", value = "微心愿主键")
    public R detailMicroWishDesensitize(@RequestParam("id") Long id) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
        }
        return communityService.detailMicroWishDesensitize(id, userId);
    }
 
    @ApiOperation("点赞/取消点赞微心愿")
    @PutMapping("microwish")
    public R putMicroWish(@RequestBody ComActMicroWishVO comActMicroWishVO) {
        Long id = comActMicroWishVO.getId();
        if (null == id || id == 0) {
            return R.fail("微心愿主键不能为空");
        }
        Long userId = this.getUserId();
        comActMicroWishVO.setSponsorId(userId);// 发起人字段暂时存放userId
        return communityService.putMicroWish(comActMicroWishVO);
    }
 
    @ApiOperation(value = "首页广告banner", response = ComOpsAdvVO.class)
    @GetMapping("listadvertisement/noToken")
    public R listAdvertisement(@RequestParam(value = "type",required = false,defaultValue = "1") Integer type) {
        return communityService.listAdvertisement(type);
    }
 
    @ApiOperation(value = "分页通知列表", response = SysUserNoticeVO.class)
    @PostMapping("pagenotice")
    public R pageNotice(@RequestBody @Validated(PageGroup.class) PageDTO pageDTO) {
        Long userId = this.getUserId();
        pageDTO.setUserId(userId);
        return userService.pageNotice(pageDTO);
    }
 
    @ApiOperation(value = "通知已读")
    @PutMapping("notice")
    public R putNotice(@RequestBody NoticeReadDTO noticeReadDTO) {
        Long userId = this.getUserId();
        noticeReadDTO.setUserId(userId);
        return userService.putNotice(noticeReadDTO);
    }
 
    @ApiOperation(value = "未读消息汇总", response = NoticeUnReadVO.class)
    @GetMapping("noticeunreadnum")
    public R noticeUnreadNum() {
        Long userId = this.getUserId();
        return userService.noticeUnreadNum(userId);
    }
 
    @ApiOperation(value = "获取各种协议", response = SysUserAgreementVO.class)
    @GetMapping("agreement")
    @ApiImplicitParam(name = "type", value = "1居民端app协议 2网格员端app协议 3商家端app协议 4隐私政策")
    public R agreement(@RequestParam("type") Integer type) {
        return userService.agreement(type, this.getAppId());
    }
 
    @ApiOperation("发布留言")
    @PostMapping("addmessage")
    public R addMessage(@RequestBody @Validated(AddGroup.class) ComActMessageVO comActMessageVO) {
        // 微信内容审核
        String msg = comActMessageVO.getMsgContent();
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        Integer type = loginUserInfo.getType();
        if (null == type || (type != 1 && type != 2)) {
            return R.fail("留言对象类型错误!");
        }
        Long userId = loginUserInfo.getUserId();
        comActMessageVO.setCommunityId(communityId);
        comActMessageVO.setUserId(userId);
        comActMessageVO.setUserName(loginUserInfo.getName());
        comActMessageVO.setUserAccount(loginUserInfo.getAccount());
        comActMessageVO.setIspublic(1);
        comActMessageVO.setStatus(1);
        return communityService.addMessage(comActMessageVO);
    }
 
    @ApiOperation("发布留言回复")
    @PostMapping("addmessageback")
    public R addMessageBack(@RequestBody @Validated(AddGroup.class) ComActMessageBackVO comActMessageBackVO) {
        // 微信内容审核
        String msg = comActMessageBackVO.getMsgContent();
        if (StrUtil.isNotBlank(msg)) {
            String result = checkService.checkMessageBy(msg, this.getLoginUserInfo().getOpenid(),this.getAppId());
            if (StrUtil.isNotBlank(result)) {
                return R.fail(501, "填写内容存在 " + result + " 违规信息");
            }
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        Integer type = loginUserInfo.getType();
        if (null == type || (type != 1 && type != 2)) {
            return R.fail("留言对象类型错误!");
        }
        Long userId = loginUserInfo.getUserId();
        comActMessageBackVO.setCommunityId(communityId);
        comActMessageBackVO.setUserId(userId);
        comActMessageBackVO.setUserName(loginUserInfo.getName());
        comActMessageBackVO.setUserAccount(loginUserInfo.getAccount());
        comActMessageBackVO.setIspublic(1);
        comActMessageBackVO.setStatus(1);
        return communityService.addMessageBack(comActMessageBackVO);
    }
 
    @ApiOperation(value = "分页显示我的留言", response = ComActMessageVO.class)
    @PostMapping("pagemymessage")
    public R pageMyMessage(@RequestBody ComActMessageVO comActMessageVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        comActMessageVO.setCommunityId(communityId);
        comActMessageVO.setUserId(loginUserInfo.getUserId());
        return communityService.pageMyMessageApplets(comActMessageVO);
    }
 
    @ApiOperation(value = "分页显示居民给我的留言", response = ComActMessageVO.class)
    @PostMapping("pagesendtomemessage")
    public R pageSendToMessage(@RequestBody ComActMessageVO comActMessageVO) {
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long communityId = loginUserInfo.getCommunityId();
        if (null == communityId || 0 == communityId) {
            return R.fail("用户未绑定社区");
        }
        comActMessageVO.setCommunityId(communityId);
        comActMessageVO.setUserId(loginUserInfo.getUserId());
        comActMessageVO.setPhone(loginUserInfo.getPhone());
        return communityService.pageSendToMessageApplets(comActMessageVO);
    }
 
    @ApiOperation(value = "分页显示指定用户的留言", response = ComActMessageVO.class)
    @PostMapping("pagemessagebyuser")
    public R pageMessageByUser(@RequestBody ComActMessageVO comActMessageVO) {
        return communityService.pageMessageByUser(comActMessageVO);
    }
 
    @ApiOperation(value = "留言详情", response = ComActMessageVO.class)
    @GetMapping("detailmessage")
    @ApiImplicitParam(name = "id", value = "随手拍主键")
    public R detailMessage(@RequestParam("id") Long id) {
        return communityService.detailMessage(id);
    }
 
    @ApiOperation(value = "首页商城开关接口")
    @GetMapping("isShop")
    public R isShop() {
        return R.ok(Constants.IS_SHOP_OPEN);
    }
 
    @ApiOperation(value = "获取最新活动和用户最新收益", response = BannerVO.class)
    @GetMapping("getUserReward")
    public R getUserReward(@RequestParam("communityId") Long communityId) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
            if (loginUserInfo.getCommunityId() != null) {
                communityId = loginUserInfo.getCommunityId();
            }
        }
        return communityService.getUserReward(userId, communityId);
    }
 
    @ApiOperation(value = "获取首页弹窗接口", response = ComActEasyPhotoRewardVO.class)
    @GetMapping("getUserRewards")
    public R getUserRewards(@RequestParam("communityId") Long communityId) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getUserRewards(userId, communityId);
    }
 
    @ApiOperation(value = "获取普达首页弹窗接口", response = ComActEasyPhotoRewardVO.class)
    @GetMapping("getUserRewardsNew")
    public R getUserRewardsNew(@RequestParam("communityId") Long communityId) {
        Long userId = 0L;
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfoSureNoLogin();
        if (loginUserInfo != null) {
            userId = loginUserInfo.getUserId();
            communityId = loginUserInfo.getCommunityId();
        }
        return communityService.getUserRewardsNew(userId, communityId);
    }
 
    @ApiOperation(value = "读取用户随手拍奖励")
    @PostMapping("readUserReward")
    public R readUserReward() {
        return communityService.readUserReward(this.getUserId(), this.getCommunityId());
    }
 
    @ApiOperation(value = "随手拍分类列表", response = ComActEasyPhotoClassifyVO.class)
    @GetMapping("easyphoto/classify/list")
    public R easyPhotoClassifyList() {
        return communityService.listPhotoClassify(this.getAreaCode());
    }
 
    @ApiOperation(value = "随手拍评价")
    @PostMapping("easyphoto/whistle/evaluate")
    public R evaluateEasyPhotoWhistle(@RequestBody EvaluateEasyDto whistleDto) {
        whistleDto.setUserId(this.getUserId());
        return easyPhotoEvaluateFeign.evaluateEasyApplets(whistleDto);
    }
 
 
 
    /*****************************************************************************************************************
     *
     *                                         社区宣传
     *
     ******************************************************************************************************************/
    @ApiOperation(value = "获取社区宣传", response = CommunityPublicityVO.class)
    @GetMapping("/getCommunityPublicityData")
    public R getCommunityPublicityData(@RequestParam("communityId") String communityId)
    {
        return communityService.getCommunityPublicityData(communityId);
    }
 
 
//    @ApiOperation(value = "添加社区宣传")
//    @PostMapping("/addCommunityPublicityDate")
//    public R addCommunityPublicityDate(@RequestBody CommunityPublicityVO item)
//    {
//        return communityService.addCommunityPublicityDate(item);
//    }
//
//    @ApiOperation(value = "编辑社区宣传")
//    @PostMapping("/editCommunityPublicityDate")
//    public R editCommunityPublicityDate(@RequestBody CommunityPublicityVO item)
//    {
//        return communityService.editCommunityPublicityDate(item);
//    }
//
//    @ApiOperation(value = "删除社区宣传")
//    @DeleteMapping("/deleteCommunityPublicityData")
//    public R deleteCommunityPublicityData(@RequestParam("communityId") String communityId)
//    {
//        return communityService.deleteCommunityPublicityData(communityId);
//    }
//
//
 
}