| | |
| | | return R.ok(tAppUserVo); |
| | | } |
| | | |
| | | @ApiOperation(value = "小程序用户金币导入模板下载") |
| | | @GetMapping("/import-template_gold") |
| | | public void importTemplateGold() { |
| | | List<AppUserGoldImport> imports = new ArrayList<>(); |
| | | AppUserGoldImport goldImport = new AppUserGoldImport(); |
| | | imports.add(goldImport); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), AppUserGoldImport.class, imports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("金币导入模板.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setHeader("content-Type", "application/vnd.ms-excel"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | System.out.println("金币导入模板下载失败!"); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @Log(title = "小程序用户-金币导入", businessType = BusinessType.IMPORT) |
| | | @ApiOperation(value = "小程序用户-金币导入") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "小程序用户导入模板下载") |
| | | @GetMapping("/import-template_user") |
| | | public void importTemplate() { |
| | | List<AppUserImport> imports = new ArrayList<>(); |
| | | AppUserImport appUserImport = new AppUserImport(); |
| | | imports.add(appUserImport); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), AppUserImport.class, imports); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("小程序用户导入模板.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setHeader("content-Type", "application/vnd.ms-excel"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | System.out.println("小程序用户导入模板下载失败!"); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Log(title = "小程序用户-用户导入", businessType = BusinessType.IMPORT) |
| | | @ApiOperation(value = "小程序用户-用户导入") |
| | | @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) |