fix:오라클 접속정보(서비스ID) 및 컬럼 변경 적용

- OtherMerge 컨트롤러 추가
main
jhseo 10 months ago
parent 46c60ef19b
commit 963bcbf75e

@ -17,7 +17,7 @@ spring:
secondary: secondary:
database: oracle database: oracle
driver-class-name: oracle.jdbc.OracleDriver 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 username: MOBELNOTI
password: wjswkrhwl12!@ password: wjswkrhwl12!@
read-only: false read-only: false

@ -71,6 +71,8 @@
UPDATE UPDATE
SET b.readdt = #{readdt} SET b.readdt = #{readdt}
, b.resultcode = #{resultcode} , b.resultcode = #{resultcode}
, b.upduser = #{upduser}
, b.upddate = sysdate
WHERE b.resultcode != #{resultcode} WHERE b.resultcode != #{resultcode}
WHEN NOT MATCHED THEN WHEN NOT MATCHED THEN
INSERT (b.unitysndngmastrid INSERT (b.unitysndngmastrid
@ -90,7 +92,7 @@
) )
VALUES (#{unitysndngmastrid} VALUES (#{unitysndngmastrid}
, #{unitysndngdetailid} , #{unitysndngdetailid}
, #{sndngdt} , TO_DATE(#{sndngdt},'YYYYMMDDHH24MISS')
, #{tmplatid} , #{tmplatid}
, #{gojidepth} , #{gojidepth}
, #{taxnum1} , #{taxnum1}
@ -99,8 +101,8 @@
, #{taxnum4} , #{taxnum4}
, #{worker} , #{worker}
, #{serialno} , #{serialno}
, #{recvdt} , TO_DATE(#{recvdt},'YYYYMMDDHH24MISS')
, #{readdt} , TO_DATE(#{readdt},'YYYYMMDDHH24MISS')
, #{resultcode} , #{resultcode}
) )
</insert> </insert>

@ -5,13 +5,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import kr.xit.batch.ens.job.PniCctvAcceptJobConfg;
import kr.xit.batch.ens.job.PniCctvFileJobConfg; import kr.xit.batch.ens.job.*;
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.biz.common.ApiConstants; import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.core.model.ApiResponseDTO; import kr.xit.core.model.ApiResponseDTO;
@ -67,6 +62,7 @@ public class BatchJobWebController {
private final SndngCloseJobConfig closeJobConfig; private final SndngCloseJobConfig closeJobConfig;
private final PniCctvFileJobConfg pniCctvFileJobConfg; private final PniCctvFileJobConfg pniCctvFileJobConfg;
private final PniCctvAcceptJobConfg pniCctvAcceptJobConfg; private final PniCctvAcceptJobConfg pniCctvAcceptJobConfg;
private final OtherMergeJobConfig otherMergeJobConfig;
@Operation(summary = "accept", description = "accept") @Operation(summary = "accept", description = "accept")
@PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE)
@ -228,6 +224,29 @@ public class BatchJobWebController {
return ApiResponseDTO.success(HttpStatus.OK); 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){ private JobParameters getJobParameters(final CmmEnsRequestDTO reqDTO, final String processStatus){
Map<String, JobParameter> confMap = new HashMap<>(); Map<String, JobParameter> confMap = new HashMap<>();

Loading…
Cancel
Save