| | |
| | | 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.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.*; |
| | |
| | | boolean ok = R.isOk(r); |
| | | if (ok) { |
| | | Integer hasPrize = comActActivityVO.getHasPrize(); |
| | | Long actActivityVOId = comActActivityVO.getId(); |
| | | if (!ObjectUtils.isEmpty(comActActPrizeVOList) && hasPrize.intValue() == 1) { |
| | | Long actActivityVOId = comActActivityVO.getId(); |
| | | comActActPrizeService.remove(new QueryWrapper<ComActActPrizeDO>().lambda().eq(ComActActPrizeDO::getActivityId, actActivityVOId)); |
| | | if (!ObjectUtils.isEmpty(comActActPrizeVOList)) { |
| | | List<ComActActPrizeDO> comActActPrizeDOS = new ArrayList<>(); |
| | |
| | | return R.fail("保存奖品失败"); |
| | | } |
| | | } |
| | | }else if(hasPrize.intValue() == 0){ |
| | | boolean remove = comActActPrizeService.remove(new QueryWrapper<ComActActPrizeDO>().lambda().eq(ComActActPrizeDO::getActivityId, actActivityVOId)); |
| | | log.info("删除社区活动奖品结果【{}】,社区活动id【{}】",remove,actActivityVOId); |
| | | } |
| | | } |
| | | return r; |
| | |
| | | return comActService.pageCommunity(pageComActDTO); |
| | | } |
| | | |
| | | /** |
| | | * 志愿者详情 |
| | | * @param id 主键 |
| | | * @return 志愿者 |
| | | */ |
| | | @PostMapping("detailvolunteer") |
| | | public R detailVolunteer(@RequestParam("id") Long id){ |
| | | R r = comMngVolunteerMngService.detailVolunteer(id); |
| | | if (R.isOk(r)) { |
| | | ComMngVolunteerMngAppletsVO comMngVolunteerMngAppletsVO =(ComMngVolunteerMngAppletsVO) r.getData(); |
| | | String phone = comMngVolunteerMngAppletsVO.getPhone(); |
| | | List<ComActActivityVO> comActActivityVOS= comActActivityService.listActivityByPhone(phone); |
| | | comMngVolunteerMngAppletsVO.setComActActivityVOList(comActActivityVOS); |
| | | r.setData(comMngVolunteerMngAppletsVO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 查询平台所有的社区 |
| | | * @return 社区集合 按照创建顺序倒序排列 |
| | | */ |
| | | @PostMapping("listcommunityall") |
| | | public R listCommunityAll(){ |
| | | return comActService.listCommunityAll(); |
| | | } |
| | | |
| | | /** |
| | | * 社区管理后台数据看板 代办事件 |
| | | * @param communityId 社区id |
| | | * @param userId 登录用户信息 |
| | | * @return 代办事件列表 |
| | | */ |
| | | @PostMapping("indexdatacommunitybackstage") |
| | | public R indexDataCommunityBackstage(@RequestParam("communityId") Long communityId, @RequestParam("userId")Long userId){ |
| | | List<TodoEventsVO> todoEventsVOS=new ArrayList<>(); |
| | | 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); |
| | | } |
| | | return R.ok(todoEventsVOS); |
| | | } |
| | | |
| | | /** |
| | | * 删除社区 |
| | | * @param communityId 社区id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("delectcommunity") |
| | | public R delectCommunity(@RequestParam("communityId") Long communityId){ |
| | | return comActService.delectCommunity(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新社区动态置顶状态 |
| | | * @return 刷新结果 |
| | | */ |
| | | @PostMapping("timedtaskdynistopping") |
| | | public R timedTaskDynIstopping(){ |
| | | return comActDynService.timedTaskDynIstopping(); |
| | | } |
| | | /** |
| | | * 定时任务刷新社区动态发布状态 |
| | | * @return |
| | | */ |
| | | @PostMapping("timedtaskdynstatus") |
| | | public R timedTaskDynStatus(){ |
| | | return comActDynService.timedTaskDynStatus(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务查询所有要取消的社区活动 |
| | | * @return 社区活动集合 |
| | | */ |
| | | @PostMapping("timedtaskactactivity") |
| | | public R timedTaskActActivity(){ |
| | | return comActActivityService.timedTaskActActivity(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新社区活动的各个状态 除取消外 |
| | | * @return 更新结果 |
| | | */ |
| | | @PostMapping("timedtaskactactivityall") |
| | | R timedTaskActActivityAll(){ |
| | | return comActActivityService.timedTaskActActivityAll(); |
| | | } |
| | | |
| | | |
| | | } |