|  |  |  | 
|---|
|  |  |  | package com.panzhihua.service_community.api; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.R; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngCarExcelVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngVillageVO; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.ComMngVillageService; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.annotation.Resource; | 
|---|
|  |  |  | import javax.validation.Valid; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.panzhihua.service_community.dao.ComMngBuildingDAO; | 
|---|
|  |  |  | import com.panzhihua.service_community.model.dos.ComMngBuildingDO; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.community.PageComMngVillageDTO; | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.grid.*; | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.grid.admin.ComMngVillageListExportAdminDTO; | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationDTO; | 
|---|
|  |  |  | import com.panzhihua.common.model.dtos.grid.admin.PageComMngVillagePopulationHouseDTO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.R; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; | 
|---|
|  |  |  | import com.panzhihua.common.model.vos.community.ComMngVillageVO; | 
|---|
|  |  |  | import com.panzhihua.service_community.model.dos.ComMngVillageDO; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.ComMngPopulationHouseService; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.ComMngPopulationService; | 
|---|
|  |  |  | import com.panzhihua.service_community.service.ComMngVillageService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @Author: llming | 
|---|
|  |  |  | 
|---|
|  |  |  | public class ComMngVillageApi { | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngVillageService comMngVillageService; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngPopulationHouseService comMngPopulationHouseService; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngPopulationHouseUserService comMngPopulationHouseUserService; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngPopulationService comMngPopulationService; | 
|---|
|  |  |  | @Resource | 
|---|
|  |  |  | private ComMngBuildingDAO comMngBuildingDAO; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 新增实有房屋 | 
|---|
|  |  |  | * @param comMngVillageVO 新增信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param comMngVillageVO | 
|---|
|  |  |  | *            新增信息 | 
|---|
|  |  |  | * @return 新增结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("addvillage") | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | public R addVillage(@Valid  @RequestBody ComMngVillageVO comMngVillageVO) { | 
|---|
|  |  |  | public R addVillage(@Valid @RequestBody ComMngVillageVO comMngVillageVO) { | 
|---|
|  |  |  | R r = comMngVillageService.addComActVillage(comMngVillageVO); | 
|---|
|  |  |  | return R.ok(r); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 分页查询实有房屋 | 
|---|
|  |  |  | * @param pageComMngVillageDTO 查询条件 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param pageComMngVillageDTO | 
|---|
|  |  |  | *            查询条件 | 
|---|
|  |  |  | * @return 新增结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("pagevillage") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询实有房屋 | 
|---|
|  |  |  | * @param comMngVillageVO 查询条件 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param comMngVillageVO | 
|---|
|  |  |  | *            查询条件 | 
|---|
|  |  |  | * @return 新增结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("listvillage") | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据房屋id查询实有房屋 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param villageId | 
|---|
|  |  |  | *            查询条件 | 
|---|
|  |  |  | * @return 查询结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("getVillageById") | 
|---|
|  |  |  | public R getVillageById(@RequestParam(value = "villageId") Long villageId) { | 
|---|
|  |  |  | ComMngVillageDO comMngVillageDO = comMngVillageService.getVillageById(villageId); | 
|---|
|  |  |  | if (comMngVillageDO != null) { | 
|---|
|  |  |  | return R.ok(comMngVillageDO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.fail(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 删除实有房屋 | 
|---|
|  |  |  | * @param Ids 动态id | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param Ids | 
|---|
|  |  |  | *            动态id | 
|---|
|  |  |  | * @return 删除结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("deletevillage") | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 社区后台导入实有房屋 | 
|---|
|  |  |  | * @param list 车辆列表 | 
|---|
|  |  |  | * @param communityId 社区编号 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param list | 
|---|
|  |  |  | *            数据 | 
|---|
|  |  |  | * @param communityId | 
|---|
|  |  |  | *            社区编号 | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/import") | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | public R listSaveMngCarExcelVO(@RequestBody List<ComMngVillageServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){ | 
|---|
|  |  |  | return comMngVillageService.listSaveVillage(list,communityId); | 
|---|
|  |  |  | public R listSaveMngCarExcelVO(@RequestBody List<ComMngVillageServeExcelVO> list, | 
|---|
|  |  |  | @RequestParam(value = "communityId") Long communityId) { | 
|---|
|  |  |  | return comMngVillageService.listSaveVillage(list, communityId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 编辑实有房屋 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param villageId | 
|---|
|  |  |  | *            动态id | 
|---|
|  |  |  | * @return 删除结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("editvillage/{villageId}") | 
|---|
|  |  |  | @Transactional(rollbackFor = Exception.class) | 
|---|
|  |  |  | public R editvillage(@PathVariable("villageId") Long villageId, | 
|---|
|  |  |  | @Valid @RequestBody ComMngVillageVO comMngVillageVO) { | 
|---|
|  |  |  | return comMngVillageService.editVillage(villageId, comMngVillageVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 小区详情 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param villageId | 
|---|
|  |  |  | *            小区id | 
|---|
|  |  |  | * @return 小区详情 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/getVillage") | 
|---|
|  |  |  | public R getVillage(@RequestParam("villageId") Long villageId) { | 
|---|
|  |  |  | return comMngVillageService.getVillage(villageId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 综治app-小区列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param villageListAppDTO | 
|---|
|  |  |  | *            请求参数 | 
|---|
|  |  |  | * @return 小区列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/list") | 
|---|
|  |  |  | public R getGridPopulationAdminList(@RequestBody ComMngVillageListAppDTO villageListAppDTO) { | 
|---|
|  |  |  | return comMngVillageService.getGridVillageList(villageListAppDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/village/grid/list/app") | 
|---|
|  |  |  | public R getGridPopulationAdminListApp(@RequestBody ComMngVillageListAppDTO villageListAppDTO) { | 
|---|
|  |  |  | return comMngVillageService.getGridVillageList(villageListAppDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 综治app-根据小区id查询小区下楼栋列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param villageId | 
|---|
|  |  |  | *            小区id | 
|---|
|  |  |  | * @return 楼栋列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/list") | 
|---|
|  |  |  | public R getGridVillageBuildingList(@RequestParam("villageId") Long villageId) { | 
|---|
|  |  |  | return comMngVillageService.getGridVillageBuildingList(villageId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 小区楼栋下房屋列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param buildHouseAppDTO | 
|---|
|  |  |  | *            请求参数 | 
|---|
|  |  |  | * @return 房屋列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/house/list") | 
|---|
|  |  |  | public R getGridVillageBuildingHouseList(@RequestBody PageComMngVillageBuildHouseAppDTO buildHouseAppDTO) { | 
|---|
|  |  |  | return comMngPopulationHouseService.getGridVillageBuildingHouseList(buildHouseAppDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 小区楼栋下房屋信息 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param houseId | 
|---|
|  |  |  | *            房屋id | 
|---|
|  |  |  | * @return 房屋信息 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/house/detail") | 
|---|
|  |  |  | public R getGridVillageBuildingHouseDetail(@RequestParam("houseId") Long houseId) { | 
|---|
|  |  |  | return comMngPopulationHouseService.getGridVillageBuildingHouseDetail(houseId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 查询平台人口列表 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param populationDTO | 
|---|
|  |  |  | *            请求参数 | 
|---|
|  |  |  | * @return 人口列表 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/house/population/list") | 
|---|
|  |  |  | public R getBuildingHousePopulationList(@RequestBody PageComMngPopulationDTO populationDTO) { | 
|---|
|  |  |  | return comMngPopulationService.getBuildingHousePopulationList(populationDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 批量向房屋新增人员 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param housePopulationDTO | 
|---|
|  |  |  | *            请求参数 | 
|---|
|  |  |  | * @return 添加结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/house/add/population") | 
|---|
|  |  |  | public R addBuildingHousePopulation(@RequestBody AddComMngHousePopulationDTO housePopulationDTO) { | 
|---|
|  |  |  | return comMngPopulationHouseUserService.addBuildingHousePopulation(housePopulationDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 批量删除房屋内人员 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param housePopulationDTO | 
|---|
|  |  |  | *            请求参数 | 
|---|
|  |  |  | * @return 删除结果 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/village/grid/building/house/del/population") | 
|---|
|  |  |  | public R delBuildingHousePopulation(@RequestBody DelComMngHousePopulationDTO housePopulationDTO) { | 
|---|
|  |  |  | return comMngPopulationHouseUserService.delBuildingHousePopulation(housePopulationDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/village/admin/del") | 
|---|
|  |  |  | public R delGridVillage(@RequestBody List<Long> villageIds) { | 
|---|
|  |  |  | return comMngVillageService.delGridVillage(villageIds); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/village/admin/population/list") | 
|---|
|  |  |  | public R getVillagePopulationAdmin(@RequestBody PageComMngVillagePopulationDTO villagePopulationDTO) { | 
|---|
|  |  |  | return comMngPopulationService.getVillagePopulationAdmin(villagePopulationDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/village/admin/population/house/list") | 
|---|
|  |  |  | public R | 
|---|
|  |  |  | getVillagePopulationHouseAdmin(@RequestBody PageComMngVillagePopulationHouseDTO villagePopulationHouseDTO) { | 
|---|
|  |  |  | return comMngPopulationHouseUserService.getVillagePopulationHouseAdmin(villagePopulationHouseDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/village/admin/statistics") | 
|---|
|  |  |  | public R getGridVillageStatistics() { | 
|---|
|  |  |  | return comMngVillageService.getGridVillageStatistics(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/village/admin/export") | 
|---|
|  |  |  | public R getGridPopulationAdminListExport(@RequestBody ComMngVillageListExportAdminDTO villageListAppDTO) { | 
|---|
|  |  |  | return comMngVillageService.getGridVillageListExport(villageListAppDTO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @GetMapping("/building/query") | 
|---|
|  |  |  | public R queryBuilding(@RequestParam("communityId")Long communityId){ | 
|---|
|  |  |  | return R.ok(comMngBuildingDAO.select(communityId)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|