| | |
| | | WriteSheet writeSheet = EasyExcel.writerSheet( "导出").build(); |
| | | excelWriter.write(excelVOS, writeSheet); |
| | | excelWriter.finish(); |
| | | |
| | | FileUtil.compressToZip(sourceFile,zipFile,"防疫登记信息.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String zipName = "防疫登记信息_"+ currentDateString+".zip"; |
| | | inputStream=new FileInputStream(zipFile+"防疫登记信息.zip"); |
| | | sftp.uploadMore(ftpUrl, zipName , inputStream); |
| | | sftp.logout(); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | FileUtil.compressToZip(sourceFile,zipFile,"防疫登记信息.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String zipName = "防疫登记信息_"+ currentDateString+".zip"; |
| | | InputStream input=new FileInputStream(zipFile+"防疫登记信息.zip"); |
| | | sftp.uploadMore(ftpUrl, zipName , input); |
| | | sftp.logout(); |
| | | input.close(); |
| | | return R.ok(excelUrl + zipName); |
| | | |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | |
| | | WriteSheet writeSheet = EasyExcel.writerSheet( "导出").build(); |
| | | excelWriter.write(excelVOS, writeSheet); |
| | | excelWriter.finish(); |
| | | |
| | | FileUtil.compressToZip(sourceFile,zipFile,"防疫登记信息.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String zipName = "防疫登记信息_"+ currentDateString+".zip"; |
| | | inputStream=new FileInputStream(zipFile+"防疫登记信息.zip"); |
| | | sftp.uploadMore(ftpUrl, zipName , inputStream); |
| | | sftp.logout(); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | FileUtil.compressToZip(sourceFile,zipFile,"防疫登记信息.zip"); |
| | | String currentDateString = String.valueOf(System.currentTimeMillis()); |
| | | String zipName = "防疫登记信息_"+ currentDateString+".zip"; |
| | | InputStream input=new FileInputStream(zipFile+"防疫登记信息.zip"); |
| | | sftp.uploadMore(ftpUrl, zipName , input); |
| | | sftp.logout(); |
| | | input.close(); |
| | | return R.ok(excelUrl + zipName); |
| | | |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |