From 963bcbf75e28d723cb5939ecb0bae3bcfc9e6aa8 Mon Sep 17 00:00:00 2001 From: jhseo Date: Thu, 11 Jan 2024 11:53:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=EC=98=A4=EB=9D=BC=ED=81=B4=20=EC=A0=91?= =?UTF-8?q?=EC=86=8D=EC=A0=95=EB=B3=B4(=EC=84=9C=EB=B9=84=EC=8A=A4ID)=20?= =?UTF-8?q?=EB=B0=8F=20=EC=BB=AC=EB=9F=BC=20=EB=B3=80=EA=B2=BD=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20-=20OtherMerge=20=EC=BB=A8=ED=8A=B8=EB=A1=A4?= =?UTF-8?q?=EB=9F=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/config/application-prod.yml | 2 +- .../mapper/other/other-oracle-mapper.xml | 8 +++-- .../batch/ens/web/BatchJobWebController.java | 33 +++++++++++++++---- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/mens-api/src/main/resources/config/application-prod.yml b/mens-api/src/main/resources/config/application-prod.yml index 6522d2e..3b30367 100644 --- a/mens-api/src/main/resources/config/application-prod.yml +++ b/mens-api/src/main/resources/config/application-prod.yml @@ -17,7 +17,7 @@ spring: secondary: database: oracle driver-class-name: oracle.jdbc.OracleDriver - jdbc-url: jdbc:oracle:thin:@150.50.48.31:1521:ETISDDB + jdbc-url: jdbc:oracle:thin:@150.50.48.31:1521/ETISDDB username: MOBELNOTI password: wjswkrhwl12!@ read-only: false diff --git a/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml index b12e1f2..19ff702 100644 --- a/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml +++ b/mens-api/src/main/resources/egovframework/mapper/other/other-oracle-mapper.xml @@ -71,6 +71,8 @@ UPDATE SET b.readdt = #{readdt} , b.resultcode = #{resultcode} + , b.upduser = #{upduser} + , b.upddate = sysdate WHERE b.resultcode != #{resultcode} WHEN NOT MATCHED THEN INSERT (b.unitysndngmastrid @@ -90,7 +92,7 @@ ) VALUES (#{unitysndngmastrid} , #{unitysndngdetailid} - , #{sndngdt} + , TO_DATE(#{sndngdt},'YYYYMMDDHH24MISS') , #{tmplatid} , #{gojidepth} , #{taxnum1} @@ -99,8 +101,8 @@ , #{taxnum4} , #{worker} , #{serialno} - , #{recvdt} - , #{readdt} + , TO_DATE(#{recvdt},'YYYYMMDDHH24MISS') + , TO_DATE(#{readdt},'YYYYMMDDHH24MISS') , #{resultcode} ) diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/web/BatchJobWebController.java b/mens-batch/src/main/java/kr/xit/batch/ens/web/BatchJobWebController.java index 6ffc161..569bad0 100644 --- a/mens-batch/src/main/java/kr/xit/batch/ens/web/BatchJobWebController.java +++ b/mens-batch/src/main/java/kr/xit/batch/ens/web/BatchJobWebController.java @@ -5,13 +5,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; import java.util.Date; import java.util.HashMap; import java.util.Map; -import kr.xit.batch.ens.job.PniCctvAcceptJobConfg; -import kr.xit.batch.ens.job.PniCctvFileJobConfg; -import kr.xit.batch.ens.job.SndngAcceptJobConfig; -import kr.xit.batch.ens.job.SndngCloseJobConfig; -import kr.xit.batch.ens.job.SndngMakeJobConfig; -import kr.xit.batch.ens.job.SndngSnedBulksJobConfig; -import kr.xit.batch.ens.job.SndngStatusBulksJobConfig; + +import kr.xit.batch.ens.job.*; import kr.xit.biz.common.ApiConstants; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.core.model.ApiResponseDTO; @@ -67,6 +62,7 @@ public class BatchJobWebController { private final SndngCloseJobConfig closeJobConfig; private final PniCctvFileJobConfg pniCctvFileJobConfg; private final PniCctvAcceptJobConfg pniCctvAcceptJobConfg; + private final OtherMergeJobConfig otherMergeJobConfig; @Operation(summary = "accept", description = "accept") @PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE) @@ -228,6 +224,29 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } + @Operation(summary = "otherMerge", description = "시설 오라클 DB로 Data Merge") + @PostMapping(value = "/otherMerge", produces = MediaType.APPLICATION_JSON_VALUE) + public IApiResponse otherMerge(@RequestBody final CmmEnsRequestDTO reqDTO) { + + try { + JobExecution jobExecution = jobLauncher.run( + otherMergeJobConfig.otherMergeJob(), + getJobParameters(reqDTO, null) + ); + + while(jobExecution.isRunning()){ + log.info("..."); + } + printLog(jobExecution); + + } catch (JobExecutionAlreadyRunningException | JobInstanceAlreadyCompleteException + | JobParametersInvalidException | org.springframework.batch.core.repository.JobRestartException e) { + + log.error(e.getMessage()); + } + return ApiResponseDTO.success(HttpStatus.OK); + } + private JobParameters getJobParameters(final CmmEnsRequestDTO reqDTO, final String processStatus){ Map confMap = new HashMap<>();