| | |
| | | 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.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.service_community.model.dos.ComActActPrizeDO; |
| | | import com.panzhihua.service_community.model.dos.ComActDynDO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; |
| | | import com.panzhihua.service_community.service.*; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private ComMngStructOtherBuildService comMngStructOtherBuildService; |
| | | @Resource |
| | | private ComMngVolunteerMngService comMngVolunteerMngService; |
| | | @Resource |
| | | private ComMngStructAreaDistrictService comMngStructAreaDistrictService; |
| | | @Resource |
| | | private ComActMessageService comActMessageService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | }); |
| | | } |
| | | comActActivityVO1.setComActActPrizeVOList(comActActPrizeVOList); |
| | | Integer participantMax = comActActivityVO1.getParticipantMax(); |
| | | if (participantMax.intValue()==0) { |
| | | comActActivityVO1.setType(1); |
| | | }else{ |
| | | comActActivityVO1.setType(2); |
| | | } |
| | | }); |
| | | page.setRecords(content); |
| | | } |
| | | |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 社区后台分页查询社区活动 |
| | | * @param comActActivityVO 查询参数 |
| | | * @return 返回结果 |
| | | */ |
| | | @PostMapping("pageactivitycommunityback") |
| | | public R pageActivityCommunityBack(@RequestBody ComActActivityVO comActActivityVO){ |
| | | return comActActivityService.pageActivityCommunityBack(comActActivityVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | 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); |
| | |
| | | @PostMapping("putdynamic") |
| | | public R putDynamic(@RequestBody ComActDynVO comActDynVO) { |
| | | ComActDynDO comActDynDO = new ComActDynDO(); |
| | | Long id = comActDynVO.getId(); |
| | | BeanUtils.copyProperties(comActDynVO, comActDynDO); |
| | | Integer isTopping = comActDynVO.getIsTopping(); |
| | | boolean b = isTopping.intValue() == 1; |
| | | if(b){ |
| | | ComActDynDO comActDynDO1 = comActDynService.getById(id); |
| | | Integer status = comActDynDO1.getStatus(); |
| | | if (status.intValue()==0) { |
| | | return R.fail("该动态还未发布"); |
| | | } |
| | | } |
| | | boolean update = comActDynService.updateById(comActDynDO); |
| | | if (update) { |
| | | // 最多只能设置三条置顶状态,后边设置会取消先前设置的置顶 |
| | | Integer isTopping = comActDynVO.getIsTopping(); |
| | | boolean b = isTopping.intValue() == 1; |
| | | if (b) { |
| | | List<ComActDynDO> list = comActDynService.list(new QueryWrapper<ComActDynDO>().lambda().eq(ComActDynDO::getIsTopping, 1).eq(ComActDynDO::getCommunityId, comActDynVO.getCommunityId())); |
| | | if (!ObjectUtils.isEmpty(list)) { |
| | |
| | | * @param comActVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("putCommunity") |
| | | @PostMapping("putCommunity") |
| | | public R putCommunity(@RequestBody ComActVO comActVO) { |
| | | return comActService.putCommunity(comActVO); |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | List<TodoEventsVO> todoEventsVOS1=comActEasyPhotoService.selectNeedToDo(communityId,userId); |
| | | List<TodoEventsVO> todoEventsVOS2=comActMicroWishService.selectNeedToDo(communityId,userId); |
| | | List<TodoEventsVO> todoEventsVOS3=comMngVolunteerMngService.selectNeedToDo(communityId,userId); |
| | | if (!ObjectUtils.isEmpty(todoEventsVOS1)) { |
| | | todoEventsVOS.addAll(todoEventsVOS1); |
| | | } |
| | | if (!ObjectUtils.isEmpty(todoEventsVOS2)) { |
| | | todoEventsVOS.addAll(todoEventsVOS2); |
| | | } |
| | | if (!ObjectUtils.isEmpty(todoEventsVOS3)) { |
| | | todoEventsVOS.addAll(todoEventsVOS3); |
| | | } |
| | | |
| | | TodoEventsVO todoEventsVO=new TodoEventsVO(); |
| | | todoEventsVO.setType(1); |
| | | todoEventsVO.setNum(todoEventsVOS1.size()); |
| | | TodoEventsVO todoEventsVO1=new TodoEventsVO(); |
| | | todoEventsVO1.setType(2); |
| | | todoEventsVO1.setNum(todoEventsVOS2.size()); |
| | | TodoEventsVO todoEventsVO2=new TodoEventsVO(); |
| | | todoEventsVO2.setType(4); |
| | | todoEventsVO2.setNum(todoEventsVOS3.size()); |
| | | todoEventsVOS.add(todoEventsVO); |
| | | todoEventsVOS.add(todoEventsVO1); |
| | | todoEventsVOS.add(todoEventsVO2); |
| | | return R.ok(todoEventsVOS); |
| | | } |
| | | |
| | |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 查询城市下属所有地区列表 |
| | | * @param cityAdcode 城市地址编码 |
| | | * @return 地区列表 |
| | | */ |
| | | @PostMapping("listareadistrict") |
| | | public R listAreaDistrict(@RequestParam("cityAdcode") Long cityAdcode){ |
| | | return comMngStructAreaDistrictService.listAreaDistrict(cityAdcode); |
| | | } |
| | | |
| | | /** |
| | | * 首页图表数据汇总 |
| | | * @param communityId 社区id |
| | | * @return 图表数据 IndexDataVO |
| | | */ |
| | | @PostMapping("indexdatacommunitybackstageechart") |
| | | public R indexDataCommunityBackstageEchart(@RequestParam("communityId")Long communityId){ |
| | | return comActActivityService.indexDataCommunityBackstageEchart(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 选择导入的小区 |
| | | * @param param 小区名字 模糊查询 |
| | | * @param communityId 社区id |
| | | * @return 小区集合 ComMngStructAreaVO |
| | | */ |
| | | @PostMapping("listareas") |
| | | public R listAreas(@RequestParam("param")String param, @RequestParam("communityId")Long communityId){ |
| | | return comMngStructAreaService.listAreas(param,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 检查小区是否已经批量设置过房屋并且返回小区房屋门号规则 |
| | | * @param id 小区id |
| | | * @return ComMngStructAreaVO |
| | | */ |
| | | @PostMapping("checkAreaHouse") |
| | | public R checkAreaHouse(@RequestParam("id")Long id){ |
| | | return comMngStructAreaService.checkAreaHouse(id); |
| | | } |
| | | /** |
| | | * 新增留言 |
| | | * @param comActMessageVO 新增留言信息 |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("addmessage") |
| | | public R addMessage(@RequestBody ComActMessageVO comActMessageVO){ |
| | | // 微信内容审核 |
| | | return comActMessageService.addMessage(comActMessageVO); |
| | | } |
| | | /** |
| | | * 我发的留言 |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemymessage") |
| | | public R pageMyMessage (@RequestBody ComActMessageVO comActMessageVO){ |
| | | return comActMessageService.pageMyMessageApplets(comActMessageVO); |
| | | } |
| | | /** |
| | | * 发给我的留言 |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagesendtomemessage") |
| | | public R pageSendToMessage (@RequestBody ComActMessageVO comActMessageVO){ |
| | | return comActMessageService.pageSendToMessageApplets(comActMessageVO); |
| | | } |
| | | /** |
| | | * 根据id查询留言集合 |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemessagebyuser") |
| | | public R pageMessageByUser (@RequestBody ComActMessageVO comActMessageVO){ |
| | | return comActMessageService.pageMessageByUserApplets(comActMessageVO); |
| | | } |
| | | /** |
| | | * 社区留言 |
| | | * @return 结果集合 |
| | | */ |
| | | @PostMapping("pagemycommunitymessage") |
| | | public R pageMyCommunityMessage (@RequestBody ComActMessageVO comActMessageVO){ |
| | | return comActMessageService.pageMyCommunityMessageApplets(comActMessageVO); |
| | | } |
| | | /** |
| | | * 新增留言回复 |
| | | * @param comActMessageVO 新增留言回复信息 |
| | | * @return 发布结果 |
| | | */ |
| | | @PostMapping("addmessageback") |
| | | public R addMessageBack(@RequestBody ComActMessageBackVO comActMessageBackVO){ |
| | | // 微信内容审核 |
| | | return comActMessageService.addMessageBack(comActMessageBackVO); |
| | | } |
| | | @PostMapping("deletemessage") |
| | | public R deleteMessage(@RequestBody ComActMessageVO comActMessageVO) { |
| | | return comActMessageService.deleteMessage(comActMessageVO); |
| | | } |
| | | |
| | | @PostMapping("resetmessagepublic") |
| | | public R resetMessagePublic(@RequestBody ResetComActMessageVO resetComActMessageVO) { |
| | | return comActMessageService.resetMessagePublic(resetComActMessageVO); |
| | | } |
| | | |
| | | /** |
| | | * 留言详情 |
| | | * |
| | | * @param id 主键 |
| | | * @return 详情内容 |
| | | */ |
| | | @PostMapping("detailmessage") |
| | | public R detailMessage(@RequestParam("id") Long id) { |
| | | return comActMessageService.detailMessage(id); |
| | | } |
| | | |
| | | /** |
| | | * 导出房屋信息 |
| | | * @param areaId |
| | | * @return |
| | | */ |
| | | @PostMapping("house/export") |
| | | public R houseExport(@RequestParam("areaId") Long areaId) { |
| | | return comMngStructHouseService.houseExport(areaId); |
| | | } |
| | | } |