| | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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("操作成功"); |
| | | 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); |
| | | } |
| | | |
| | | /** |