| | |
| | | |
| | | 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.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.service_community.model.dos.ComActActPrizeDO; |
| | |
| | | R r = comActActivityService.listActivitySign(activitySignVO); |
| | | if (R.isOk(r)) { |
| | | List<ActivitySignVO> activitySignVOS = (List<ActivitySignVO>) r.getData(); |
| | | comActActivityVO.setActivitySignVOList(activitySignVOS); |
| | | int size = activitySignVOS.size(); |
| | | if (size>=6) { |
| | | comActActivityVO.setActivitySignVOList(activitySignVOS.subList(0,6)); |
| | | } else { |
| | | comActActivityVO.setActivitySignVOList(activitySignVOS); |
| | | } |
| | | } |
| | | return R.ok(comActActivityVO); |
| | | } |
| | |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addarea") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | R addArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) { |
| | | R r = comMngStructAreaService.addArea(comMngStructAreaVO); |
| | | if (R.isOk(r)) { |
| | | String areaCode = (String) r.getData(); |
| | | String areaCode = String.valueOf(r.getData()) ; |
| | | comMngStructAreaVO.setAreaCode(areaCode); |
| | | R r1 = comMngStructHouseService.addHouseArea(comMngStructAreaVO); |
| | | if (!R.isOk(r1)) { |
| | | throw new RuntimeException("新增小区地址失败"); |
| | | } |
| | | return r1; |
| | | } |
| | | return r; |
| | | } |
| | |
| | | if (ObjectUtils.isEmpty(parentCode)) { |
| | | R r = comMngStructAreaService.selectAreaById(areaId); |
| | | if (R.isOk(r)) { |
| | | parentCode =(String) r.getData(); |
| | | parentCode =String.valueOf(r.getData()) ; |
| | | }else{ |
| | | return R.fail("用户没有绑定小区"); |
| | | } |
| | | } |
| | | return comMngStructHouseService.putVolunteerPhone(parentCode); |
| | |
| | | */ |
| | | @PostMapping("addhouses") |
| | | public R addHouses(@RequestBody ComMngStructHouseVO comMngStructHouseVO){ |
| | | R r = comMngStructAreaService.selectAreaById(comMngStructHouseVO.getAreaId()); |
| | | if (!R.isOk(r)) { |
| | | return R.fail("用户没有绑定小区"); |
| | | } |
| | | String data = String.valueOf(r.getData()); |
| | | comMngStructHouseVO.setAreaCode(data); |
| | | return comMngStructHouseService.addHouses(comMngStructHouseVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询小区 |
| | | * @param communityId 社区id |
| | | * @return 小区集合 |
| | | */ |
| | | @PostMapping("listarea") |
| | | public R listArea(@RequestParam("communityId")Long communityId){ |
| | | return comMngStructAreaService.listArea(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 用户参加的所有社区活动 |
| | | * @param userId 用户id |
| | | * @return 活动列表 |
| | | */ |
| | | @PostMapping("listactivity") |
| | | public R listActivity(@RequestParam("userId")Long userId ){ |
| | | return comActActivityService.listActivity(userId); |
| | | } |
| | | |
| | | /** |
| | | * 用户确认心愿 |
| | | * @param comActMicroWishVO 用户评价 |
| | | * @return 确认结果 |
| | | */ |
| | | @PostMapping("putmicrowishconfirm") |
| | | R putMicroWishConfirm(@RequestBody ComActMicroWishVO comActMicroWishVO){ |
| | | return comActMicroWishService.putMicroWishConfirm(comActMicroWishVO); |
| | | } |
| | | |
| | | /** |
| | | * 建筑类型 |
| | | * @param communityId 社区id |
| | | * @return 建筑集合 |
| | | */ |
| | | @PostMapping("listcommngstructbuildtype") |
| | | public R listComMngStructBuildType(@RequestParam("communityId") Long communityId){ |
| | | return comMngStructOtherBuildService.listComMngStructBuildType(communityId); |
| | | } |
| | | |
| | | /** |
| | | * 增加删除建筑类型 |
| | | * @param systemmanagementConfigVO 操作内容 |
| | | * @return 操作结果 |
| | | */ |
| | | @PostMapping("putcommngstructbuildtype") |
| | | public R putComMngStructBuildType(@RequestBody SystemmanagementConfigVO systemmanagementConfigVO){ |
| | | try { |
| | | R r=comMngStructOtherBuildService.putComMngStructBuildType(systemmanagementConfigVO); |
| | | } catch (ServiceException e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |