From cca33540aced57e2ba429f9ed16bfa721d1c7ffd Mon Sep 17 00:00:00 2001 From: minuk926 Date: Mon, 28 Nov 2022 15:51:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Transaction=20=EA=B4=80=EB=A6=AC=20fix?= =?UTF-8?q?=20-=20=EB=8B=A4=EC=A4=91=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=EC=8B=9C=20rollback=20=EB=B6=88=EA=B0=80(req?= =?UTF-8?q?uired=20=EC=86=8D=EC=84=B1=20=EB=AF=B8=EC=A0=81=EC=9A=A9=3F=3F?= =?UTF-8?q?=3F)=20=20=20=20=20=20annotation=20=EB=B0=A9=EC=8B=9D=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ec/service/EcNatlNewspaperService.java | 4 ++- .../biz/ec/web/EcNatlNewspaperController.java | 15 ++++----- .../biz/cmm/service/CmmFileService.java | 3 +- src/main/resources/logback-dev.xml | 4 ++- src/main/resources/logback-local.xml | 31 ++++++++++++++++--- .../resources/xitProps/globals.properties | 6 ++-- 6 files changed, 46 insertions(+), 17 deletions(-) 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 1d96d8bb..ab2940c7 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 @@ -8,6 +8,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.crypto.codec.Base64; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import kr.xit.fims.biz.cmm.FimsConst; @@ -55,6 +56,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService { */ @SuppressWarnings("ConfusingArgumentToVarargsMethod") @Override + @Transactional public void saveEsbRvcParse(final EcNatlNewspaperRcvReqDTO dto) { String filePath = dto.getFilePath(); @@ -111,7 +113,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService { fileMstDTO.setFileDirPath(FimsConst.FileDirDepth.DAY.getCode()); cmmFileService.saveFiles(fileMstDTO, mfList); } - log.debug(appendFileDto.toString()); + //log.debug(appendFileDto.toString()); }); } diff --git a/src/main/java/kr/xit/fims/biz/ec/web/EcNatlNewspaperController.java b/src/main/java/kr/xit/fims/biz/ec/web/EcNatlNewspaperController.java index d581cb28..e4d141a9 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/EcNatlNewspaperController.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/EcNatlNewspaperController.java @@ -1,10 +1,8 @@ package kr.xit.fims.biz.ec.web; -import java.util.Arrays; -import java.util.List; -import java.util.Map; import java.util.stream.Collectors; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -13,16 +11,13 @@ import org.springframework.web.servlet.ModelAndView; import kr.xit.fims.biz.cmm.FimsConst; import kr.xit.fims.biz.ec.model.EcNatlNewspaperRcvReqDTO; -import kr.xit.fims.biz.ec.model.NatlNewspaperDTO; import kr.xit.fims.biz.ec.service.IEcNatlNewspaperService; -import kr.xit.fims.biz.ec.model.NatlNewspaperRcvXmlDTO; import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.model.ResultResponse; import kr.xit.framework.core.utils.fileExplorer.XitFileExplorerUtil; import kr.xit.framework.core.utils.fileExplorer.function.DirectorySearch; import kr.xit.framework.support.util.AjaxMessageMapRenderer; import kr.xit.framework.support.util.constants.MessageKey; -import kr.xit.framework.support.util.xml.XmlParseUtils; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -31,6 +26,12 @@ import lombok.extern.slf4j.Slf4j; @Controller @RequestMapping(value = "/fims/biz/ec") public class EcNatlNewspaperController { + @Value("#{prop['file.rcv.root']}") + private String fileRcvRoot; + + @Value("#{prop['file.rcv.natl-newspaper.path']}") + private String rcvNatlNewspaperPath; + private final IEcNatlNewspaperService service; @@ -41,7 +42,7 @@ public class EcNatlNewspaperController { @RequestMapping(value = "/ecNatlNewspaperFileSelPopup") public ModelAndView ecNatlNewspaperFileSelPopup(){ ModelAndView mav = new ModelAndView(FimsConst.FIMS_JSP_BASE_PATH +"ec/ecNatlNewspaperFileSelPopup.popup"); - mav.addObject("dirPath", "/Users/minuk/project_data/fims/01. 연계/01. 국민신문고/rcv"); + mav.addObject("dirPath", fileRcvRoot + rcvNatlNewspaperPath); return mav; } diff --git a/src/main/java/kr/xit/framework/biz/cmm/service/CmmFileService.java b/src/main/java/kr/xit/framework/biz/cmm/service/CmmFileService.java index 25b289f2..e6b8e66c 100644 --- a/src/main/java/kr/xit/framework/biz/cmm/service/CmmFileService.java +++ b/src/main/java/kr/xit/framework/biz/cmm/service/CmmFileService.java @@ -45,6 +45,7 @@ public class CmmFileService implements ICmmFileService { private final ICmmFileMapper mapper; @Override + @Transactional(readOnly = true) public CmmFileMstDTO findFiles(String fileMstId) { Assert.notNull(fileMstId, "대상 파일[fileMstId]을 선택해 주세요."); @@ -66,7 +67,7 @@ public class CmmFileService implements ICmmFileService { * @return CmmFileMst */ @Override - @Transactional + @Transactional//(propagation = Propagation.REQUIRES_NEW) public CmmFileMstDTO saveFiles(final CmmFileMstDTO fileMstDTO, final MultipartFile[] files) { Assert.notNull(fileMstDTO, "파일 정보가 존재하지 않습니다."); Assert.notNull(fileMstDTO.getJobSeCode(), "파일 구분 코드[fileCtgCd] 정보가 존재하지 않습니다."); diff --git a/src/main/resources/logback-dev.xml b/src/main/resources/logback-dev.xml index b5da1d64..46c437f6 100644 --- a/src/main/resources/logback-dev.xml +++ b/src/main/resources/logback-dev.xml @@ -106,10 +106,12 @@ + + + - diff --git a/src/main/resources/logback-local.xml b/src/main/resources/logback-local.xml index e6ac61a0..85f69aba 100644 --- a/src/main/resources/logback-local.xml +++ b/src/main/resources/logback-local.xml @@ -103,10 +103,27 @@ - + + + + + + + + + + + + + + + + + + + - @@ -126,6 +143,10 @@ + + + + @@ -173,9 +194,9 @@ - - - + + + diff --git a/src/main/resources/xitProps/globals.properties b/src/main/resources/xitProps/globals.properties index efd73604..bad417fe 100644 --- a/src/main/resources/xitProps/globals.properties +++ b/src/main/resources/xitProps/globals.properties @@ -124,10 +124,12 @@ exception.log.trace=true # k byte file.upload.allow.max-size: 2048 file.upload.allow.ext= -file.upload.root=/Users/minuk/data/fims/upload +#file.upload.root=/Users/minuk/data/fims/upload +file.upload.root=D:/data/fims/upload file.upload.natl-newspaper.path=/natl-newspaper #file.rcv.root=/Users/minuk/data/fims/rcv #file.rcv.natl-newspaper.path=/natl-newspaper/rcv -file.rcv.root=/Users/minuk/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0 +#file.rcv.root=/Users/minuk/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0 +file.rcv.root=D:/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0 file.rcv.natl-newspaper.path=/rcv