| | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.log.annotation.ApiLog; |
| | | import org.springblade.core.log.logger.BladeLogger; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.jackson.JsonUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.house.excel.HouseAndHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseAndHoldImporter; |
| | | import org.springblade.modules.place.excel.*; |
| | | import org.springblade.modules.taskPlaceRectification.excel.TaskPlaceRectificationExcel; |
| | | import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationsVO; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class PlaceController extends BladeController{ |
| | | |
| | | private final IPlaceService placeService; |
| | | private final BladeLogger bladeLogger; |
| | | |
| | | /** |
| | | * 场所表 详情 |
| | |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入place") |
| | | @ApiOperation(value = "分页LIST", notes = "传入place") |
| | | public R<IPage<PlaceVO>> list(PlaceEntity place, Query query) { |
| | | IPage<PlaceEntity> pages = placeService.page(Condition.getPage(query), Condition.getQueryWrapper(place)); |
| | | return R.data(PlaceWrapper.build().pageVO(pages)); |
| | |
| | | /** |
| | | * 场所表 自定义分页 |
| | | */ |
| | | @ApiLog("场所列表查询") |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入place") |
| | | @ApiOperation(value = "分页page", notes = "传入place") |
| | | public R<IPage<PlaceVO>> page(PlaceVO place, Query query) { |
| | | bladeLogger.info("场所列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectPlacePage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | |
| | | /** |
| | | * 九小场所档案 |
| | | */ |
| | | @ApiLog("九小场所档案列表查询") |
| | | @GetMapping("/ninePage") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入place") |
| | | @ApiOperation(value = "九小场所档案", notes = "传入place") |
| | | public R<IPage<PlaceVO>> ninePage(PlaceVO place, Query query) { |
| | | bladeLogger.info("九小场所档案列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectNinePlacePage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 企业商超列表查询 |
| | | */ |
| | | @ApiLog("企业商超列表查询") |
| | | @GetMapping("/mallPage") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "企业商超列表查询", notes = "传入place") |
| | | public R<IPage<PlaceVO>> mallPage(PlaceVO place, Query query) { |
| | | bladeLogger.info("企业商超列表查询", JsonUtil.toJson(place)); |
| | | IPage<PlaceVO> pages = placeService.selectMallPage(Condition.getPage(query), place); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义新增/修改 |
| | | * 自定义新增 |
| | | * @param placeVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/add") |
| | | @ApiLog("场所自定义新增") |
| | | @ApiOperation(value = "自定义新增", notes = "传入place") |
| | | public R add(@RequestBody PlaceVO placeVO){ |
| | | bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO)); |
| | | return R.status(placeService.addOrUpdate(placeVO)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/addOrUpdate") |
| | | @ApiLog("场所自定义新增/修改") |
| | | @ApiOperation(value = "自定义新增/修改", notes = "传入place") |
| | | public R addOrUpdate(@RequestBody PlaceVO placeVO){ |
| | | bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO)); |
| | | return R.status(placeService.addOrUpdate(placeVO)); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/updatePlace") |
| | | @ApiOperation(value = "自定义修改", notes = "传入place") |
| | | public R updatePlace(@RequestBody PlaceVO placeVO){ |
| | | return R.status(placeService.updatePlace(placeVO)); |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiLog("场所数据删除") |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | bladeLogger.info("场所数据删除", JsonUtil.toJson(ids)); |
| | | List<Long> longs = Func.toLongList(ids); |
| | | // 返回 |
| | | return R.status(placeService.removePlace(longs)); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDetail") |
| | | @ApiLog("场所表 自定义详情查询") |
| | | @ApiOperation(value = "场所表 自定义详情查询", notes = "传入ids") |
| | | public R<PlaceVO> getDetail(PlaceVO place) { |
| | | bladeLogger.info("场所表详情查询", JsonUtil.toJson(place)); |
| | | return R.data(placeService.getDetail(place)); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/import-place") |
| | | public R importPlace(MultipartFile file, Integer isCovered) { |
| | | PlaceImporter placeImporter = new PlaceImporter(placeService, isCovered == 1); |
| | | ExcelUtil.save(file, placeImporter, PlaceExcel.class); |
| | | return R.success("操作成功"); |
| | | bladeLogger.info("场所信息批量导入", JsonUtil.toJson(isCovered)); |
| | | String data = placeService.importPlace(ExcelUtil.read(file, ImportPlaceExcel.class),isCovered==1); |
| | | return R.data(200,data,""); |
| | | } |
| | | |
| | | /** |
| | | * 导出场所信息 |
| | | */ |
| | | @GetMapping("export-place") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiLog("导出场所信息") |
| | | @ApiOperation(value = "导出场所信息", notes = "传入place") |
| | | public void exportPlace(PlaceVO place, HttpServletResponse response) { |
| | | List<ExportPlaceExcel> list = placeService.exportPlaceList(place); |
| | | ExcelUtil.export(response, "场所数据管理" + DateUtil.time(), "场所数据表", list, ExportPlaceExcel.class); |
| | | } |
| | | |
| | | /** |
| | | * 导出模板 |
| | | */ |
| | | @GetMapping("export-template") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiLog("导出九小统计") |
| | | @ApiOperation(value = "导出九小统计", notes = "传入place") |
| | | public void exportTemplate(HttpServletResponse response) { |
| | | List<ImportPlaceExcel> list = new ArrayList<>(); |
| | | ImportPlaceExcel importPlaceExcel = new ImportPlaceExcel(); |
| | | importPlaceExcel.setHouseCode("AdiEQ41254122****SXFDK44"); |
| | | importPlaceExcel.setLocation("江西上饶**********"); |
| | | importPlaceExcel.setLng("128.754451241"); |
| | | importPlaceExcel.setLat("28.4521122441"); |
| | | importPlaceExcel.setStreetName("西市街道"); |
| | | importPlaceExcel.setCommunityName("万达社区"); |
| | | importPlaceExcel.setGridName("第一网格"); |
| | | importPlaceExcel.setPlaceName("***场所"); |
| | | importPlaceExcel.setPrincipal("张三"); |
| | | importPlaceExcel.setPrincipalPhone("13112341234"); |
| | | importPlaceExcel.setPrincipalIdCard("360***********0001"); |
| | | importPlaceExcel.setLegalPerson("张三"); |
| | | importPlaceExcel.setLegalTel("13112341234"); |
| | | importPlaceExcel.setLegalIdCard("360***********0001"); |
| | | importPlaceExcel.setNineType("1"); |
| | | importPlaceExcel.setFrontType("1"); |
| | | importPlaceExcel.setThreeFireProtection("是"); |
| | | importPlaceExcel.setNoExplosionCategory("2"); |
| | | importPlaceExcel.setLabelCode("131120"); |
| | | importPlaceExcel.setRemark("测试****"); |
| | | |
| | | list.add(importPlaceExcel); |
| | | ExcelUtil.export(response, "场所数据" + DateUtil.time(), "场所数据表", list, ImportPlaceExcel.class); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 导出房屋 |
| | | * 导出九小统计 |
| | | */ |
| | | @GetMapping("exportNineType") |
| | | @ApiOperationSupport(order = 13) |
| | | @ApiOperation(value = "导出九小统计", notes = "传入user") |
| | | @ApiLog("导出九小统计") |
| | | @ApiOperation(value = "导出九小统计", notes = "传入place") |
| | | public void exportNineType(PlaceVO place, HttpServletResponse response) { |
| | | List<NinePlaceExcel> list = placeService.export(place); |
| | | ExcelUtil.export(response, "房屋数据" + DateUtil.time(), "房屋数据表", list, NinePlaceExcel.class); |
| | | ExcelUtil.export(response, "档案管理" + DateUtil.time(), "场所数据表", list, NinePlaceExcel.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 场所警务网格处理 |
| | | */ |
| | | @GetMapping("/placeJwGridCodeHandle") |
| | | public R placeJwGridCodeHandle() { |
| | | return R.data(placeService.placeJwGridCodeHandle()); |
| | | } |
| | | |
| | | /** |
| | | * 场所综治网格处理 |
| | | */ |
| | | @GetMapping("/placeGridCodeHandle") |
| | | public R placeGridCodeHandle() { |
| | | return R.data(placeService.placeGridCodeHandle()); |
| | | } |
| | | |
| | | /** |
| | | * 场所二维码绑定处理 |
| | | */ |
| | | @GetMapping("/placeDoorBindHandle") |
| | | public R placeDoorBindHandle() { |
| | | return R.data(placeService.placeDoorBindHandle()); |
| | | } |
| | | |
| | | |
| | | // 查询附近1公里的场所列表 |
| | | @GetMapping("/getNearbyPlaceList") |
| | | public R getNearbyPlaceList(@RequestParam("lat") String lat, @RequestParam("lng") String lng) { |
| | | return R.data(placeService.getNearbyPlaceList(lat, lng)); |
| | | } |
| | | |
| | | /** |
| | | * 更新场所的POI标签颜色 |
| | | * @param placeId |
| | | * @param color |
| | | * @return |
| | | */ |
| | | @GetMapping("/updatePoiLabelColor") |
| | | public R updatePoiLabelColor(@RequestParam("placeId") Long placeId, @RequestParam("color") String color) { |
| | | return R.data(placeService.updatePoiLabelColor(placeId, color)); |
| | | } |
| | | } |