From 27d98406a8cc89c8656780245a259fbcc3812023 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Mon, 15 Apr 2024 15:35:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EB=82=98=ED=81=90=EB=B8=8C=20?= =?UTF-8?q?=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/base/file/pdf/PDFWriter.java | 4 ---- src/main/java/cokr/xit/fims/base/FileController.java | 2 +- src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java | 2 +- src/main/java/cokr/xit/fims/cmmn/ftp/FTPUtil.java | 3 +-- .../java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java | 5 ++++- .../java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java | 2 +- .../java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java | 2 +- src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java | 2 +- .../cokr/xit/fims/cmmn/pdf/extraction/ExtractText.java | 7 ++----- .../xit/fims/cmmn/pdf/extraction/PDFExtractionUtil.java | 2 +- .../java/cokr/xit/fims/cmmn/service/bean/ExtrStngBean.java | 1 - .../cokr/xit/fims/crdn/receive/eqpmnt/LayoutParser.java | 2 +- src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java | 3 +-- .../java/cokr/xit/fims/nxrp/support/AttachedTxtMaker.java | 4 +++- .../java/cokr/xit/fims/sndb/service/bean/SndngBean.java | 2 +- .../java/cokr/xit/fims/stat/service/bean/StatBean.java | 2 +- 16 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/main/java/cokr/xit/base/file/pdf/PDFWriter.java b/src/main/java/cokr/xit/base/file/pdf/PDFWriter.java index 5e6b2b3a..72e8eb5c 100644 --- a/src/main/java/cokr/xit/base/file/pdf/PDFWriter.java +++ b/src/main/java/cokr/xit/base/file/pdf/PDFWriter.java @@ -346,7 +346,6 @@ public class PDFWriter { result.put("file", new File(resultFilePath)); } catch (Exception e) { - e.printStackTrace(); throw new RuntimeException("출력오류."+e); } @@ -562,7 +561,6 @@ public class PDFWriter { contentStream.drawImage(image, xyAbsolute[0], xyAbsolute[1]-size[1], size[0], size[1]); } catch (IOException e) { - e.printStackTrace(); throw new RuntimeException("PDF 파일 출력 중 오류가 발생하였습니다."+e); } } @@ -737,7 +735,6 @@ public class PDFWriter { contentStream.stroke(); contentStream.setLineDashPattern(new float[]{}, 0); } catch (IOException e) { - e.printStackTrace(); throw new RuntimeException("PDF 파일 출력 중 오류가 발생하였습니다."+e); } } @@ -832,7 +829,6 @@ public class PDFWriter { ); return fontMap; } catch (IOException e) { - e.printStackTrace(); throw new RuntimeException("글꼴 로드 오류"+e); } } diff --git a/src/main/java/cokr/xit/fims/base/FileController.java b/src/main/java/cokr/xit/fims/base/FileController.java index 18bfde61..184c4f8e 100644 --- a/src/main/java/cokr/xit/fims/base/FileController.java +++ b/src/main/java/cokr/xit/fims/base/FileController.java @@ -426,7 +426,7 @@ public class FileController extends cokr.xit.base.file.web.FileController { uploadFile.transferTo(file); saved = true; } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("파일업로드 오류"+e); } mav.addObject("saved", saved); diff --git a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java index adb42a00..e7b1b2f5 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java @@ -209,7 +209,7 @@ public class CmmnUtil { fileList = pathStream.filter(Files::isRegularFile).toList(); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("파일 조회 오류."+e); } if(fileList != null && !fileList.isEmpty()) { diff --git a/src/main/java/cokr/xit/fims/cmmn/ftp/FTPUtil.java b/src/main/java/cokr/xit/fims/cmmn/ftp/FTPUtil.java index 9d6d51a2..87e85121 100644 --- a/src/main/java/cokr/xit/fims/cmmn/ftp/FTPUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/ftp/FTPUtil.java @@ -155,8 +155,7 @@ public class FTPUtil { } } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); + throw new RuntimeException("ftp오류."+e); } // 커서 이동에 실패하면 false를 리턴한다. diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java b/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java index 45643a64..b2608cbb 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/InsertingImageCell.java @@ -98,7 +98,10 @@ public class InsertingImageCell { InputStream ios = null; try { ios = new FileInputStream(file); - ios.read(buffer); + int count = ios.read(buffer); + if(count != file.length()) { + throw new RuntimeException("[F]파일 로드 오류"); + } } finally { try { if (ios != null) diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java index c6c24fee..56d1e7b1 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/CrdnConfirm.java @@ -98,7 +98,7 @@ public class CrdnConfirm extends HWPFormat { InsertingImageCell.IMPL_InsertPicture(baseFile, "오른쪽아래사진", dataObject.string("PHOTO4")); } } catch(Exception e) { - e.printStackTrace(); + throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); } diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java index 5762476b..9fd71f2d 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/ReportOnClaims.java @@ -98,7 +98,7 @@ public class ReportOnClaims extends HWPFormat { try { InsertingImageCell.IMPL_InsertPicture(baseFile, "직인", globalVariable.get("offcsFilePath")); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); } diff --git a/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java b/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java index eb644c0b..e06a9249 100644 --- a/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java +++ b/src/main/java/cokr/xit/fims/cmmn/hwp/format/SvbtcList.java @@ -68,7 +68,7 @@ public class SvbtcList extends HWPFormat { InsertingImageCell.IMPL_InsertPicture(baseFile, "직인", dataObjectList.get(0).string("OFFCS_FILE_PATH")); } } catch(Exception e) { - e.printStackTrace(); + throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); } } diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/ExtractText.java b/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/ExtractText.java index 301a88d8..61cd9738 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/ExtractText.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/ExtractText.java @@ -35,12 +35,9 @@ public class ExtractText { } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("자료추출 오류."+e); } - - - return ""; } @@ -56,7 +53,7 @@ public class ExtractText { try { summaryText = Tstripper.getText(pdDocument); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("자료추출 오류."+e); } String[] textArr = summaryText.split("\r?\n|\r"); diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/PDFExtractionUtil.java b/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/PDFExtractionUtil.java index 21247ceb..e0b42e7f 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/PDFExtractionUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/extraction/PDFExtractionUtil.java @@ -30,7 +30,7 @@ public class PDFExtractionUtil { try { pdDocument = Loader.loadPDF(file); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("자료추출 오류."+e); } diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/ExtrStngBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/ExtrStngBean.java index dd380474..f1c9d73a 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/ExtrStngBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/ExtrStngBean.java @@ -121,7 +121,6 @@ public class ExtrStngBean extends AbstractComponent { } } } catch (Exception e) { - e.printStackTrace(); throw new RuntimeException("[F]추출 설정 저장 중 오류가 발생하였습니다."); } diff --git a/src/main/java/cokr/xit/fims/crdn/receive/eqpmnt/LayoutParser.java b/src/main/java/cokr/xit/fims/crdn/receive/eqpmnt/LayoutParser.java index 41ad7113..500d19d5 100644 --- a/src/main/java/cokr/xit/fims/crdn/receive/eqpmnt/LayoutParser.java +++ b/src/main/java/cokr/xit/fims/crdn/receive/eqpmnt/LayoutParser.java @@ -240,7 +240,7 @@ abstract public class LayoutParser { } } catch (ParseException e) { - e.printStackTrace(); + throw new RuntimeException("파일명 분석 오류."+e); } } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index 862de966..e5a041b2 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -201,7 +201,6 @@ public class Crdn05Controller extends ApplicationController { return mav; } } catch (Exception e) { - e.printStackTrace(); saved = false; mav.addObject("saved", saved); return mav; @@ -301,7 +300,7 @@ public class Crdn05Controller extends ApplicationController { //폴더는 제외하고 파일만 필터링 fileList = Files.walk(Paths.get(workPath)).filter(Files::isRegularFile).toList(); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("파일 조회 오류."+e); } LayoutParser parser = null; diff --git a/src/main/java/cokr/xit/fims/nxrp/support/AttachedTxtMaker.java b/src/main/java/cokr/xit/fims/nxrp/support/AttachedTxtMaker.java index 28a7839f..b1aee667 100644 --- a/src/main/java/cokr/xit/fims/nxrp/support/AttachedTxtMaker.java +++ b/src/main/java/cokr/xit/fims/nxrp/support/AttachedTxtMaker.java @@ -63,7 +63,9 @@ public class AttachedTxtMaker extends LinkFileMaker { try { File txtFile = new File(workPath + "/" + this.textFileName); - txtFile.createNewFile(); + if(!txtFile.createNewFile()) { + throw new RuntimeException("[F]파일 생성 오류"); + } FileWriter fileWriter = new FileWriter(workPath + "/" + this.textFileName); diff --git a/src/main/java/cokr/xit/fims/sndb/service/bean/SndngBean.java b/src/main/java/cokr/xit/fims/sndb/service/bean/SndngBean.java index cedc352c..b7fe0d6a 100644 --- a/src/main/java/cokr/xit/fims/sndb/service/bean/SndngBean.java +++ b/src/main/java/cokr/xit/fims/sndb/service/bean/SndngBean.java @@ -1384,7 +1384,7 @@ public class SndngBean extends AbstractComponent { fInputStream.close(); fOutputStream.close(); } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException("우편통합 발송 작업중 전자우편 단속 사진 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback } diff --git a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java index 148f1cb5..e81c29f7 100644 --- a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java +++ b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java @@ -530,7 +530,7 @@ public class StatBean extends AbstractComponent { } else { int originalValue = statItem.getNumberValue()[i]; double ratioValue = (double) originalValue / (double) totValue; - double percent = ratioValue * Math.pow(10, 2+decimalPoint); + double percent = ratioValue * Math.pow(10, 2f+decimalPoint); statItem.getNumberValue()[i] = (int) Math.floor(percent); }