| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | 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 lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | private ComActMicroWishService comActMicroWishService; |
| | | @Resource |
| | | private ComActEasyPhotoService comActEasyPhotoService; |
| | | @Resource |
| | | private ComActService comActService; |
| | | @Resource |
| | | private ComMngStructHouseService comMngStructHouseService; |
| | | @Resource |
| | | private ComMngStructAreaService comMngStructAreaService; |
| | | @Resource |
| | | private ComMngStructOtherBuildService comMngStructOtherBuildService; |
| | | @Resource |
| | | private ComMngVolunteerMngService comMngVolunteerMngService; |
| | | |
| | | /** |
| | | * 新增社区活动 |
| | |
| | | |
| | | /** |
| | | * 发布活动 |
| | | * |
| | | * @param comActActivityVO 主键id 发布时间 |
| | | * @return 发布结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 取消活动 |
| | | * |
| | | * @param comActActivityVO 取消原因 |
| | | * @return 取消结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 活动详情 |
| | | * |
| | | * @param id 活动id |
| | | * @return 详情 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 活动报名名单 |
| | | * |
| | | * @param activitySignVO 查询参数 |
| | | * @return 报名人员集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增社区动态 |
| | | * |
| | | * @param comActDynVO 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 编辑社区动态 |
| | | * |
| | | * @param comActDynVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除社区动态 |
| | | * |
| | | * @param comActDynVO 动态id |
| | | * @return 删除结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询社区动态 |
| | | * |
| | | * @param comActDynVO 查询参数 |
| | | * @return 动态集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 社区动态详情 |
| | | * |
| | | * @param id 动态id |
| | | * @return 详情 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页查询随手拍 |
| | | * |
| | | * @param comActEasyPhotoVO 查询参数 |
| | | * @return 心愿列表 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 随手拍详情 |
| | | * |
| | | * @param id 随手拍主键 |
| | | * @param userId 登录用户 |
| | | * @return 详情内容 |
| | |
| | | |
| | | /** |
| | | * 分页查询微心愿 |
| | | * |
| | | * @param comActMicroWishVO 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 心愿详情 |
| | | * |
| | | * @param id 查询主键 |
| | | * @param userId 登录用户id |
| | | * @return 心愿内容 |
| | |
| | | |
| | | /** |
| | | * 审核、分配、反馈心愿 |
| | | * |
| | | * @param comActMicroWishVO 具体操作 |
| | | * @return 操作结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 分页展示我的所有活动 时间倒序排列 |
| | | * |
| | | * @param comActActivityVO 分页参数 |
| | | * @return 分页集合 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 报名/取消报名社区活动 |
| | | * |
| | | * @param signactivityVO 报名参数 |
| | | * @return 报名 取消报名 结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 上传随手拍 |
| | | * |
| | | * @param comActEasyPhotoVO 上传数据 |
| | | * @return 上传结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 发布微心愿 |
| | | * |
| | | * @param comActMicroWishVO 发布内容 |
| | | * @return 发布结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 点赞/取消点赞随手拍 |
| | | * |
| | | * @param comActEasyPhotoVO 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 点赞/取消点赞微心愿 |
| | | * |
| | | * @param comActMicroWishVO 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增社区动态浏览记录 |
| | | * |
| | | * @param id 动态主键 |
| | | * @param userId 登录用户id |
| | | * @return 新增结果 |
| | |
| | | |
| | | /** |
| | | * 审核反馈随手拍 |
| | | * |
| | | * @param comActEasyPhotoVO 操作参数 |
| | | * @return 操作结果 |
| | | */ |
| | |
| | | return comActEasyPhotoService.putEasypHotoStatus(comActEasyPhotoVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增社区 |
| | | * |
| | | * @param comActVO 社区信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addcommunity") |
| | | R addCommunity(@RequestBody ComActVO comActVO) { |
| | | return comActService.addCommunity(comActVO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑社区 |
| | | * |
| | | * @param comActVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("putCommunity") |
| | | public R putCommunity(@RequestBody ComActVO comActVO) { |
| | | return comActService.putCommunity(comActVO); |
| | | } |
| | | |
| | | /** |
| | | * 房屋信息 |
| | | * |
| | | * @param userId 用户id |
| | | * @return 房屋信息 |
| | | */ |
| | | @PostMapping("detailhouse") |
| | | public R detailHouse(@RequestParam("userId") Long userId) { |
| | | return comMngStructHouseService.detailHouse(userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增小区 |
| | | * |
| | | * @param comMngStructAreaVO 小区信息 |
| | | * @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(); |
| | | comMngStructAreaVO.setAreaCode(areaCode); |
| | | R r1 = comMngStructHouseService.addHouseArea(comMngStructAreaVO); |
| | | if (!R.isOk(r1)) { |
| | | throw new RuntimeException("新增小区地址失败"); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询小区 |
| | | * |
| | | * @param comMngStructAreaVO 查询参数 |
| | | * @return 分页结果 |
| | | */ |
| | | @PostMapping("pagearea") |
| | | public R pageArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) { |
| | | return comMngStructAreaService.pageArea(comMngStructAreaVO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑小区 |
| | | * |
| | | * @param comMngStructAreaVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("putarea") |
| | | public R putArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) { |
| | | return comMngStructAreaService.putArea(comMngStructAreaVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除小区 |
| | | * |
| | | * @param comMngStructAreaVO 地址编码 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletearea") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R deleteArea(@RequestBody ComMngStructAreaVO comMngStructAreaVO) { |
| | | // 先删除小区小面所有房屋、删除用户和小区房屋的绑定关系 |
| | | R r = comMngStructHouseService.batchDeleteHouse(comMngStructAreaVO); |
| | | if (R.isOk(r)) { |
| | | R r1 = comMngStructAreaService.deleteArea(comMngStructAreaVO); |
| | | if (!R.isOk(r1)) { |
| | | throw new RuntimeException("删除小区失败"); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 小区批量建房 |
| | | * |
| | | * @param batchhouseVO 建房参数 |
| | | * @return 建房结果 |
| | | */ |
| | | @PostMapping("batchhouse") |
| | | public R batchHouse(@RequestBody BatchhouseVO batchhouseVO) { |
| | | return comMngStructHouseService.batchHouse(batchhouseVO); |
| | | } |
| | | |
| | | /** |
| | | * 展示下级建筑 |
| | | * |
| | | * @param houseCode 房屋编号 |
| | | * @return 下级建筑列表 |
| | | */ |
| | | @PostMapping("listsubordinatebuilding") |
| | | public R listSubordinatebuilding(@RequestParam("houseCode") String houseCode) { |
| | | return comMngStructHouseService.listSubordinatebuilding(houseCode); |
| | | } |
| | | |
| | | /** |
| | | * 添加同级地址 |
| | | * |
| | | * @param batchhouseVO 添加地址 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("addhouse") |
| | | public R addHouse(@RequestBody BatchhouseVO batchhouseVO) { |
| | | R r=comMngStructAreaService.selectAreaByAreaCode(batchhouseVO.getAreaCode()); |
| | | if (R.isOk(r)) { |
| | | ComMngStructAreaDO comMngStructAreaDO = (ComMngStructAreaDO)r.getData(); |
| | | return comMngStructHouseService.addHouse(batchhouseVO,comMngStructAreaDO); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 编辑地址 |
| | | * |
| | | * @param comMngStructHouseVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping("puthouse") |
| | | public R putHouse(@RequestBody ComMngStructHouseVO comMngStructHouseVO) { |
| | | return comMngStructHouseService.putHouse(comMngStructHouseVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除地址 |
| | | * |
| | | * @param comMngStructHouseVO 删除指定地址和所有下级 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletehouse") |
| | | public R deleteHouse(@RequestBody ComMngStructHouseVO comMngStructHouseVO) { |
| | | return comMngStructHouseService.deleteHouse(comMngStructHouseVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增其他建筑 |
| | | * |
| | | * @param comMngStructOtherBuildVO 建筑参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addotherbuild") |
| | | public R addOtherbuild(@RequestBody ComMngStructOtherBuildVO comMngStructOtherBuildVO) { |
| | | return comMngStructOtherBuildService.addOtherbuild(comMngStructOtherBuildVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有建筑类型 |
| | | * @return 类型列表 |
| | | */ |
| | | @PostMapping("listbuildtype") |
| | | public R listBuildType(){ |
| | | return comMngStructOtherBuildService.listBuildType(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 其他建筑 |
| | | * @param comMngStructOtherBuildVO 分页查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pageotherbuild") |
| | | public R pageOtherBuild(@RequestBody ComMngStructOtherBuildVO comMngStructOtherBuildVO){ |
| | | return comMngStructOtherBuildService.pageOtherBuild(comMngStructOtherBuildVO); |
| | | } |
| | | |
| | | /** |
| | | * 增加志愿者 |
| | | * @param comMngVolunteerMngVO 志愿者信息 |
| | | * @return 增加结果 |
| | | */ |
| | | @PostMapping("addvolunteer") |
| | | R addVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除志愿者 |
| | | * @param comMngVolunteerMngVO 手机号 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletevolunteer") |
| | | public R deleteVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.deleteVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑志愿者 |
| | | * @param comMngVolunteerMngVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("putvolunteer") |
| | | R putVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.putVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 分页展示志愿者 |
| | | * @param comMngVolunteerMngVO 查询参数 |
| | | * @return 分页集合返回 |
| | | */ |
| | | @PostMapping("pagevolunteer") |
| | | public R pageVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.pageVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 分页展示志愿者审核 |
| | | * @param comMngVolunteerMngVO 查询参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pagevolunteerexamine") |
| | | public R pageVolunteerExamine(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.pageVolunteerExamine(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 志愿者审核详情 |
| | | * @param id 主键 |
| | | * @return 详情 |
| | | */ |
| | | @PostMapping("detailvolunteerexamine") |
| | | public R detailVolunteerExamine(@RequestParam("id") Long id){ |
| | | return comMngVolunteerMngService.detailVolunteerExamine(id); |
| | | } |
| | | |
| | | /** |
| | | * 志愿者审核 |
| | | * @param comMngVolunteerMngVO 审核操作 |
| | | * @return 审核结果 |
| | | */ |
| | | @PostMapping("putvolunteerexamine") |
| | | public R putVolunteerExamine(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.putVolunteerExamine(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除志愿者审核 |
| | | * @param comMngVolunteerMngVO 主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletevolunteerexamine") |
| | | public R deleteVolunteerExamine(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | return comMngVolunteerMngService.deleteVolunteerExamine(comMngVolunteerMngVO); |
| | | } |
| | | |
| | | /** |
| | | * 查询区域 |
| | | * @param comActVO 登录人的经纬度、或者指定区域的社区 |
| | | * @return 社区集合 |
| | | */ |
| | | @PostMapping("listcommunity") |
| | | public R listCommunity(@RequestBody ComActVO comActVO){ |
| | | return comActService.listCommunity(comActVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户修改手机号对应的志愿者手机号也要修改 |
| | | * @param userPhoneVO 新旧手机号 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("putvolunteerphone") |
| | | public R putVolunteerPhone(UserPhoneVO userPhoneVO){ |
| | | return comMngVolunteerMngService.putVolunteerPhone(userPhoneVO); |
| | | } |
| | | |
| | | /** |
| | | * 房屋地址下拉列表 |
| | | * @param parentCode 父级编码 |
| | | * @param areaId 小区id |
| | | * @return 下级列表 |
| | | */ |
| | | @PostMapping("listhouses") |
| | | public R listHouses(@RequestParam("parentCode")String parentCode, @RequestParam("areaId")Long areaId){ |
| | | if (ObjectUtils.isEmpty(parentCode)) { |
| | | R r = comMngStructAreaService.selectAreaById(areaId); |
| | | if (R.isOk(r)) { |
| | | parentCode =(String) r.getData(); |
| | | } |
| | | } |
| | | return comMngStructHouseService.putVolunteerPhone(parentCode); |
| | | } |
| | | |
| | | /** |
| | | * 新增房屋 |
| | | * @param comMngStructHouseVO 房屋信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addhouses") |
| | | public R addHouses(@RequestBody ComMngStructHouseVO comMngStructHouseVO){ |
| | | return comMngStructHouseService.addHouses(comMngStructHouseVO); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |