| | |
| | | * @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); |
| | | } |
| | | |
| | | } |