| | |
| | | private String companyUrl = "http://panzhihua.nhys.cdnhxx.com/web/%e5%ae%9e%e6%9c%89%e5%8d%95%e4%bd%8d%e5%af%bc%e5%85%a5%e6%a8%a1%e6%9d%bf.xlsx"; |
| | | @Value("${excel.assetsUrl}") |
| | | private String assetsUrl = "http://panzhihua.nhys.cdnhxx.com/web/%e5%ae%9e%e6%9c%89%e5%8d%95%e4%bd%8d%e5%af%bc%e5%85%a5%e6%a8%a1%e6%9d%bf.xlsx"; |
| | | private String excelPopulationUrl="http://panzhihua.nhys.cdnhxx.com/web/实有人口导入.xlsx"; |
| | | |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | |
| | | return communityService.pagePopulation(comMngPopulationVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载模板-实有人口") |
| | | @GetMapping(value = "/serve/download/population/template") |
| | | public R downloadPopulationTemplate(HttpServletResponse response) throws IOException, SftpException { |
| | | return R.ok(excelPopulationUrl); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel导入实有人口") |
| | | @PostMapping(value = "/serve/population/import", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R downloadPopulationTemplate(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | |
| | | return communityService.editTagPopulation(populationTagDTO); |
| | | } |
| | | |
| | | // @ApiOperation(value = "实有人口导入模板") |
| | | // @PostMapping("/population/export") |
| | | // public void exportPopulation(HttpServletRequest request, HttpServletResponse response) { |
| | | // //获取登陆用户 |
| | | // LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | // //获取登陆用户绑定社区id |
| | | // Long communityId = loginUserInfo.getCommunityId(); |
| | | // //创建Excel工具类对象 |
| | | // ExportExcelWrapper<ExcelExportDto> util = new ExportExcelWrapper<>(); |
| | | // //创建示范数据对象list |
| | | // List<ExcelExportDto> list = new ArrayList<>(); |
| | | // //创建表头数组集合 |
| | | // String[] columnNames = new String[50]; |
| | | // //加载默认表头数据 |
| | | // for (int i = 0; i < ExportExcelUtil.ExportField.length; i++) { |
| | | // columnNames[i] = ExportExcelUtil.ExportField[i]; |
| | | // } |
| | | // //查询当前社区标签列表 |
| | | // R tagsResult = userService.listTags(communityId); |
| | | // if(Constants.SUCCESS.equals(tagsResult.getCode())){ |
| | | // List<String> TagsList = (List<String>)tagsResult.getData(); |
| | | // //动态加载标签列表到表头 |
| | | // for (int i = 0; i < TagsList.size(); i++) { |
| | | // columnNames[ExportExcelUtil.ExportField.length + i] = TagsList.get(i) + "(是或否)"; |
| | | // } |
| | | // } |
| | | // //导出模板 |
| | | // util.exportExcel("实有人口导入模板", "实有人口导入模板", columnNames, list, response, ExportExcelUtil.EXCEl_FILE_2007); |
| | | // } |
| | | |
| | | @ApiOperation(value = "下载居民导入模板") |
| | | @ApiOperation(value = "实有人口-下载模板") |
| | | @GetMapping("/population/export") |
| | | public R exportPopulation() { |
| | | //获取登陆用户 |