From a6039dd43de890a85d3586c044a23378b12cca02 Mon Sep 17 00:00:00 2001 From: huanghongfa <18228131219@163.com> Date: 星期三, 27 一月 2021 13:49:59 +0800 Subject: [PATCH] 随手拍 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java | 146 +++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 136 insertions(+), 10 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 db1d137..7fac868 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,13 @@ 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.vos.R; import com.panzhihua.common.model.vos.SystemmanagementConfigVO; import com.panzhihua.common.model.vos.community.*; @@ -183,6 +185,16 @@ } /** + * 社区后台分页查询社区活动 + * @param comActActivityVO 查询参数 + * @return 返回结果 + */ + @PostMapping("pageactivitycommunityback") + public R pageActivityCommunityBack(@RequestBody ComActActivityVO comActActivityVO){ + return comActActivityService.pageActivityCommunityBack(comActActivityVO); + } + + /** * 发布活动 * * @param comActActivityVO 主键id 发布时间 @@ -230,13 +242,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); @@ -615,7 +642,22 @@ */ @PostMapping("batchhouse") public R batchHouse(@RequestBody BatchhouseVO batchhouseVO) { - return comMngStructHouseService.batchHouse(batchhouseVO); + R r = comMngStructHouseService.batchHouse(batchhouseVO); + if (R.isOk(r)) { + String areaCode = batchhouseVO.getAreaCode(); + String ruleDoor = batchhouseVO.getRuleDoor(); + String ruleConnector = batchhouseVO.getRuleConnector(); + String ruleFloor = batchhouseVO.getRuleFloor(); + ComMngStructAreaVO comMngStructAreaVO=new ComMngStructAreaVO(); + comMngStructAreaVO.setRoleDoor(ruleDoor); + comMngStructAreaVO.setRoleFloor(ruleFloor); + comMngStructAreaVO.setRoleConnector(ruleConnector); + comMngStructAreaVO.setAreaCode(areaCode); + comMngStructAreaVO.setCommunityId(null); + comMngStructAreaVO.setIsAccumulation(null); + comMngStructAreaService.putArea(comMngStructAreaVO); + } + return r; } /** @@ -640,7 +682,19 @@ R r=comMngStructAreaService.selectAreaByAreaCode(batchhouseVO.getAreaCode()); if (R.isOk(r)) { ComMngStructAreaDO comMngStructAreaDO = (ComMngStructAreaDO)r.getData(); - return comMngStructHouseService.addHouse(batchhouseVO,comMngStructAreaDO); + try { + R r1 = comMngStructHouseService.addHouse(batchhouseVO, comMngStructAreaDO); + return r1; + } catch (Exception e) { + if (e.getMessage().contains("unique_house_name")) { + return R.fail("房屋地址重复"); + }else { + log.error("添加同级地址失败【{}】",e.getMessage()); + return R.fail("添加房屋失败"); + } + } + + } return r; } @@ -1013,5 +1067,77 @@ return comActActivityService.timedTaskActActivityAll(); } + /** + * 其他建筑详情 + * @param id 主键id + * @return 建筑内容 + */ + @PostMapping("detailotherbuild") + public R detailOtherbuild(@RequestParam("id")Long id){ + return comMngStructOtherBuildService.detailOtherbuild(id); + } + + /** + * 编辑其他建筑 + * @param comMngStructOtherBuildVO 编辑内容 + * @return 编辑结果 + */ + @PostMapping("putotherbuild") + public R putOtherbuild(@RequestBody ComMngStructOtherBuildVO comMngStructOtherBuildVO){ + return comMngStructOtherBuildService.putOtherbuild(comMngStructOtherBuildVO); + } + + /** + * 删除其他建筑 + * @param id 主键 + * @return 删除结果 + */ + @PostMapping("deleteotherbuild") + public R deleteOtherbuild(@RequestParam("id")Long id){ + 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