From 32d3e175d20afe7e98825eec99b5a9e3fa4f0a34 Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期四, 21 一月 2021 18:46:01 +0800 Subject: [PATCH] 新需求 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java | 87 +++++++++++++++++++++++++++++++++++++++---- 1 files changed, 79 insertions(+), 8 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java index 541f5f4..a2914c9 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java @@ -1,11 +1,15 @@ package com.panzhihua.service_community.api; +import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.exceptions.ServiceException; -import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; +import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentDTO; +import com.panzhihua.common.model.dtos.community.PageComActEasyPhotoCommentDTO; +import com.panzhihua.common.model.dtos.community.ComActEasyPhotoCommentUserDTO; import com.panzhihua.common.model.dtos.community.PageComActDTO; -import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; +import com.panzhihua.common.model.dtos.partybuilding.ComPbServiceTeamDTO; +import com.panzhihua.common.model.dtos.partybuilding.PageComPbServiceTeamDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.SystemmanagementConfigVO; import com.panzhihua.common.model.vos.community.*; @@ -183,6 +187,16 @@ } /** + * 社区后台分页查询社区活动 + * @param comActActivityVO 查询参数 + * @return 返回结果 + */ + @PostMapping("pageactivitycommunityback") + public R pageActivityCommunityBack(@RequestBody ComActActivityVO comActActivityVO){ + return comActActivityService.pageActivityCommunityBack(comActActivityVO); + } + + /** * 发布活动 * * @param comActActivityVO 主键id 发布时间 @@ -230,13 +244,28 @@ activitySignVO.setActivityId(id); R r = comActActivityService.listActivitySign(activitySignVO); if (R.isOk(r)) { - List<ActivitySignVO> activitySignVOS = (List<ActivitySignVO>) r.getData(); - int size = activitySignVOS.size(); - if (size>=6) { - comActActivityVO.setActivitySignVOList(activitySignVOS.subList(0,6)); - } else { - comActActivityVO.setActivitySignVOList(activitySignVOS); + List<ActivitySignVO> activitySignVOS = JSONArray.parseArray(JSONArray.toJSONString( r.getData()),ActivitySignVO.class); + if (!ObjectUtils.isEmpty(activitySignVOS)) { + List<ActivitySignVO> collect = activitySignVOS.stream().filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 1).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(collect)) { + int size = collect.size(); + if (size>=6) { + comActActivityVO.setActivityVolunteerList(collect.subList(0,6)); + } else { + comActActivityVO.setActivityVolunteerList(collect); + } + } + List<ActivitySignVO> collect1 = activitySignVOS.stream().filter(activitySignVO1 -> activitySignVO1.getIsVolunteer() == 0).collect(Collectors.toList()); + if (!ObjectUtils.isEmpty(collect1)) { + int size = collect1.size(); + if (size>=6) { + comActActivityVO.setActivitySignVOList(collect1.subList(0,6)); + } else { + comActActivityVO.setActivitySignVOList(collect1); + } + } } + } comActActivityVO.setIntegral(0); return R.ok(comActActivityVO); @@ -1070,5 +1099,47 @@ return comMngStructOtherBuildService.deleteOtherbuild(id); } + /** + * 小程序分页查询随手拍 + * @param comActEasyPhotoVO 查询参数 + * @return 返回结果 + */ + @PostMapping("pageeasyphotoapplets") + public R pageEasyPhotoApplets(@RequestBody ComActEasyPhotoVO comActEasyPhotoVO){ + return comActEasyPhotoService.pageEasyPhotoApplets(comActEasyPhotoVO); + } + + /** + * 随手拍评论分页查询 + * @param pageComActEasyPhotoCommentDTO 查询参数 + * @return 查询结果 + */ + @PostMapping("pagecomacteasyphotocomment") + public R pageComActEasyPhotoComment(@RequestBody PageComActEasyPhotoCommentDTO pageComActEasyPhotoCommentDTO){ + return comActEasyPhotoService.pageComActEasyPhotoComment(pageComActEasyPhotoCommentDTO); + } + + /** + * 评论点赞/取消点赞 + * @param comActEasyPhotoCommentUserDTO 操作 + * @return 操作结果 + */ + @PostMapping("commentsign") + public R commentSign(@RequestBody ComActEasyPhotoCommentUserDTO comActEasyPhotoCommentUserDTO){ + return comActEasyPhotoService.commentSign(comActEasyPhotoCommentUserDTO); + } + + /** + * 随手拍--评论--新增评论 + * @param comActEasyPhotoCommentDTO 新增内容 + * @return 新增结果 + */ + @PostMapping("addcomacteasyphotocomment") + public R addComActEasyPhotoComment(@RequestBody ComActEasyPhotoCommentDTO comActEasyPhotoCommentDTO){ + return comActEasyPhotoService.addComActEasyPhotoComment(comActEasyPhotoCommentDTO); + } + + + } -- Gitblit v1.7.1