From 052eb970abec976f3394fb3f56a417222681961f Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 2 Jan 2023 12:48:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=99=B8=EB=B6=80=EC=97=B0=EA=B3=84?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=83=80=20=EC=B2=98=EB=A6=AC=ED=9B=84=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=B0=B1=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ec/service/EcCctvCrackdownService.java | 10 +++++-- .../ec/service/EcNatlNewspaperService.java | 30 ++++++++++--------- .../layouts/tiles/biz/cmmn/BizIncludeBase.jsp | 21 +++++++++++++ 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java index af823231..f0908d6f 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java @@ -11,6 +11,7 @@ import java.util.Objects; import java.util.stream.Collectors; import org.apache.commons.collections4.ListUtils; +import org.apache.commons.io.FileExistsException; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.ibatis.session.RowBounds; @@ -194,7 +195,7 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService { cmmFileService.saveFiles(fileMstDTO, busOnlyDTO.getBusonlyImgList()); }); - // FIXME: src file backup + // FIXME: src file backup - rollback이 필요한 경우 BizException throw 필요 // rollback시 파일이 move 않되도록 모든 데이타 처리후 file move dto.getFileInfoList().forEach((fi) -> { try { @@ -203,7 +204,12 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService { , new File(rcvBackupRoot + uploadBusCctvPath + "/" + fi.getFileNm()) ); - } catch (IOException ie) { + } catch (NullPointerException npe){ + log.error("{}[{}]", "버스전용차로 데이타 parsing 에러::처리할 파일이 부정확 합니다.", fi.getFileNm()); + } catch (FileExistsException fee){ + log.error("{}[{}]", "버스전용차로 데이타 parsing 에러::처리된 데이타 입니다.", fi.getFileNm()); + } catch (IOException ie){ + log.error("버스전용차로 데이타 parsing 에러::{}", ie.getLocalizedMessage()); ie.printStackTrace(); } }); diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java index ec7d398b..68f5ea1b 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java @@ -15,6 +15,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import org.apache.commons.io.FileExistsException; import org.apache.commons.io.FileUtils; import org.apache.ibatis.session.RowBounds; import org.springframework.beans.factory.annotation.Value; @@ -160,10 +161,23 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService { }; }); - // FIXME: src file backup + // FIXME: src file backup - rollback이 필요한 경우 BizException throw 필요 // rollback시 파일이 move 않되도록 모든 데이타 처리후 file move dto.getFileInfoList().forEach((fi) -> { - processOrgFileBackup(filePath, fi); + try { + FileUtils.moveFile( + new File(filePath + "/" + fi.getFileNm()) + , new File(rcvBackupRoot + uploadNewsPaperPath + "/" + fi.getFileNm()) + ); + + } catch (NullPointerException npe){ + log.error("{}[{}]", "시민신고[국민신문고] 데이타 parsing 에러::처리할 파일이 부정확 합니다.", fi.getFileNm()); + } catch (FileExistsException fee){ + log.error("{}[{}]", "시민신고[국민신문고] 데이타 parsing 에러::처리된 데이타 입니다.", fi.getFileNm()); + } catch (IOException ie){ + log.error("시민신고[국민신문고] 데이타 parsing 에러::{}", ie.getLocalizedMessage()); + ie.printStackTrace(); + } }); } @@ -472,16 +486,4 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService { dateStr = dateStr.substring(0,4) + "/" + dateStr.substring(4); return "/" + dateStr; } - - private void processOrgFileBackup(String filePath, FolderReqDTO.FileInfo fi) { - try { - FileUtils.moveFile( - new File(filePath + "/" + fi.getFileNm()) - , new File(rcvBackupRoot + uploadNewsPaperPath + "/" + fi.getFileNm()) - ); - - } catch (IOException fee){ - fee.printStackTrace(); - } - } } diff --git a/src/main/webapp/WEB-INF/jsp/framework/layouts/tiles/biz/cmmn/BizIncludeBase.jsp b/src/main/webapp/WEB-INF/jsp/framework/layouts/tiles/biz/cmmn/BizIncludeBase.jsp index 9936f649..735c830f 100644 --- a/src/main/webapp/WEB-INF/jsp/framework/layouts/tiles/biz/cmmn/BizIncludeBase.jsp +++ b/src/main/webapp/WEB-INF/jsp/framework/layouts/tiles/biz/cmmn/BizIncludeBase.jsp @@ -64,6 +64,26 @@ + + + + <%--TODO: 보완 필요 : 공통 ajax 호출 모듈과 통합 필요 --%>