|
@@ -339,33 +339,33 @@ public class PatientStatistics extends LifeCenterController {
|
|
|
String tempPath = "../excel-temp/testExcel.xlsx";
|
|
|
String downName = LifeCenterFunction.getNow() + " 환자입퇴소통계.xlsx";
|
|
|
File xlsFile = new File(tempPath);
|
|
|
- FileOutputStream fileOut = new FileOutputStream(tempPath);
|
|
|
- workbook.write(fileOut);
|
|
|
-// fileOut.close();
|
|
|
-
|
|
|
-// ByteArrayOutputStream fileOut = new ByteArrayOutputStream();
|
|
|
-// FileOutputStream fos = new FileOutputStream(tempPath);
|
|
|
+// FileOutputStream fileOut = new FileOutputStream(tempPath);
|
|
|
// workbook.write(fileOut);
|
|
|
-//
|
|
|
-// InputStream filein = new ByteArrayInputStream(fileOut.toByteArray());
|
|
|
-// OPCPackage opc = OPCPackage.open(filein);
|
|
|
-//
|
|
|
-// POIFSFileSystem fileSystem = new POIFSFileSystem();
|
|
|
-//
|
|
|
-// EncryptionInfo encryptionInfo = new EncryptionInfo(EncryptionMode.agile);
|
|
|
-// Encryptor encryptor = encryptionInfo.getEncryptor();
|
|
|
-// encryptor.confirmPassword(password);
|
|
|
-//
|
|
|
-// opc.save(encryptor.getDataStream(fileSystem));
|
|
|
-// opc.flush();
|
|
|
-//
|
|
|
-// fileSystem.writeFilesystem(fos);
|
|
|
-//
|
|
|
// fileOut.close();
|
|
|
-// opc.close();
|
|
|
-//
|
|
|
-// filein.close();
|
|
|
-// fileSystem.close();
|
|
|
+
|
|
|
+ ByteArrayOutputStream fileOut = new ByteArrayOutputStream();
|
|
|
+ FileOutputStream fos = new FileOutputStream(tempPath);
|
|
|
+ workbook.write(fileOut);
|
|
|
+
|
|
|
+ InputStream filein = new ByteArrayInputStream(fileOut.toByteArray());
|
|
|
+ OPCPackage opc = OPCPackage.open(filein);
|
|
|
+
|
|
|
+ POIFSFileSystem fileSystem = new POIFSFileSystem();
|
|
|
+
|
|
|
+ EncryptionInfo encryptionInfo = new EncryptionInfo(EncryptionMode.agile);
|
|
|
+ Encryptor encryptor = encryptionInfo.getEncryptor();
|
|
|
+ encryptor.confirmPassword(password);
|
|
|
+
|
|
|
+ opc.save(encryptor.getDataStream(fileSystem));
|
|
|
+ opc.flush();
|
|
|
+
|
|
|
+ fileSystem.writeFilesystem(fos);
|
|
|
+
|
|
|
+ fileOut.close();
|
|
|
+ opc.close();
|
|
|
+
|
|
|
+ filein.close();
|
|
|
+ fileSystem.close();
|
|
|
|
|
|
LifeCenterFileDownload.download(request, response, tempPath, downName);
|
|
|
|
|
@@ -375,12 +375,12 @@ public class PatientStatistics extends LifeCenterController {
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
-// catch (InvalidFormatException e) {
|
|
|
-// // TODO Auto-generated catch block
|
|
|
-// e.printStackTrace();
|
|
|
-// } catch (GeneralSecurityException e) {
|
|
|
-// // TODO Auto-generated catch block
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
+ catch (InvalidFormatException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (GeneralSecurityException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
}
|