diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvAcceptJobConfg.java b/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvAcceptJobConfg.java deleted file mode 100644 index befc12f..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvAcceptJobConfg.java +++ /dev/null @@ -1,113 +0,0 @@ -package kr.xit.batch.ens.job; - -import kr.xit.batch.ens.task.EnsCctvAcceptTasklet; -import kr.xit.biz.ens.service.IEnsCctvFileService; -import kr.xit.core.biz.batch.CustomRunIdIncrementer; -import kr.xit.core.biz.batch.listener.CustomJobListener; -import kr.xit.core.biz.batch.listener.CustomStepListener; -import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener; -import kr.xit.core.biz.batch.service.IBatchCmmService; -import kr.xit.core.biz.batch.task.BatchEndTasklet; -import kr.xit.core.biz.batch.task.BatchFailEndTasklet; -import kr.xit.core.biz.batch.task.BatchStartTasklet; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.Step; -import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - *
- * description : 전자 고지 CCTV accept - * - * packageName : kr.xit.batch.ens.job - * fileName : EnsCctvAcceptJobConfg - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Configuration -public class EnsCctvAcceptJobConfg { - private static final String JOB_NAME = "EnsCctvAcceptJob"; - - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobBuilderFactory jobBuilderFactory; - private final StepBuilderFactory stepBuilderFactory; - - private final IBatchCmmService lockService; - private final IEnsCctvFileService service; - - @Bean(name = JOB_NAME) - public Job ensCctvAcceptJob() { - return jobBuilderFactory.get(JOB_NAME) - .incrementer(new CustomRunIdIncrementer()) - .listener(new CustomJobListener()) - .listener(new CustomStepListener()) - .listener(new NoWorkFoundStepListener()) - - // JOB 시작 - // start() 결과가 FAILED 인경우 종료 - .start(start()) - .on("FAILED") - .end() - - // start()의 결과로 부터 FAILED를 제외한 모든 경우 to() 실행 - //.from(start()) - .on("*") - .to(execution()) - .on("FAILED") - .to(fail()) - - .from(execution()) - // to() 실행 결과와 상관 없이 end() 실행 - .on("*") - .to(end()) - - // JOB 종료 - .end() - - .build(); - } - - @Bean(name = JOB_NAME + "_step") - public Step execution() { - return stepBuilderFactory.get(JOB_NAME + "_step") - .tasklet(new EnsCctvAcceptTasklet(service)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_start_step") - protected Step start() { - return stepBuilderFactory.get("Job_Locking") - .tasklet(new BatchStartTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_end_step") - protected Step end() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchEndTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_fail_step") - protected Step fail() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchFailEndTasklet(lockService)) - .build(); - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvFileJobConfg.java b/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvFileJobConfg.java deleted file mode 100644 index 5dea37b..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/job/EnsCctvFileJobConfg.java +++ /dev/null @@ -1,113 +0,0 @@ -package kr.xit.batch.ens.job; - -import kr.xit.batch.ens.task.EnsCctvFileTasklet; -import kr.xit.biz.ens.service.IEnsCctvFileService; -import kr.xit.core.biz.batch.CustomRunIdIncrementer; -import kr.xit.core.biz.batch.listener.CustomJobListener; -import kr.xit.core.biz.batch.listener.CustomStepListener; -import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener; -import kr.xit.core.biz.batch.service.IBatchCmmService; -import kr.xit.core.biz.batch.task.BatchEndTasklet; -import kr.xit.core.biz.batch.task.BatchFailEndTasklet; -import kr.xit.core.biz.batch.task.BatchStartTasklet; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.Step; -import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - *
- * description : 전자 고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.job - * fileName : EnsCctvFileJobConfg - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Configuration -public class EnsCctvFileJobConfg { - private static final String JOB_NAME = "EnsCctvFileJob"; - - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobBuilderFactory jobBuilderFactory; - private final StepBuilderFactory stepBuilderFactory; - - private final IBatchCmmService lockService; - private final IEnsCctvFileService service; - - @Bean(name = JOB_NAME) - public Job ensCctvFileJob() { - return jobBuilderFactory.get(JOB_NAME) - .incrementer(new CustomRunIdIncrementer()) - .listener(new CustomJobListener()) - .listener(new CustomStepListener()) - .listener(new NoWorkFoundStepListener()) - - // JOB 시작 - // start() 결과가 FAILED 인경우 종료 - .start(start()) - .on("FAILED") - .end() - - // start()의 결과로 부터 FAILED를 제외한 모든 경우 to() 실행 - //.from(start()) - .on("*") - .to(execution()) - .on("FAILED") - .to(fail()) - - .from(execution()) - // to() 실행 결과와 상관 없이 end() 실행 - .on("*") - .to(end()) - - // JOB 종료 - .end() - - .build(); - } - - @Bean(name = JOB_NAME + "_step") - public Step execution() { - return stepBuilderFactory.get(JOB_NAME + "_step") - .tasklet(new EnsCctvFileTasklet(service)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_start_step") - protected Step start() { - return stepBuilderFactory.get("Job_Locking") - .tasklet(new BatchStartTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_end_step") - protected Step end() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchEndTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_fail_step") - protected Step fail() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchFailEndTasklet(lockService)) - .build(); - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/job/OtherMergeJobConfig.java b/mens-batch/src/main/java/kr/xit/batch/ens/job/OtherMergeJobConfig.java deleted file mode 100644 index 25ae26b..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/job/OtherMergeJobConfig.java +++ /dev/null @@ -1,113 +0,0 @@ -package kr.xit.batch.ens.job; - -import kr.xit.batch.ens.task.OtherMergeTasklet; -import kr.xit.biz.ens.service.IEnsOtherMergeService; -import kr.xit.core.biz.batch.CustomRunIdIncrementer; -import kr.xit.core.biz.batch.listener.CustomJobListener; -import kr.xit.core.biz.batch.listener.CustomStepListener; -import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener; -import kr.xit.core.biz.batch.service.IBatchCmmService; -import kr.xit.core.biz.batch.task.BatchEndTasklet; -import kr.xit.core.biz.batch.task.BatchFailEndTasklet; -import kr.xit.core.biz.batch.task.BatchStartTasklet; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.Step; -import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - *
- * description : - * - * packageName : kr.xit.batch.ens.job - * fileName : OtherMergeJobConfig - * author : jhseo - * date : 2024-01-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2024-01-10 jhseo 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Configuration -public class OtherMergeJobConfig { - private static final String JOB_NAME = "OtherMergeJob"; - - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobBuilderFactory jobBuilderFactory; - private final StepBuilderFactory stepBuilderFactory; - - private final IBatchCmmService lockService; - private final IEnsOtherMergeService otherService; - - @Bean(name = JOB_NAME) - public Job otherMergeJob() { - return jobBuilderFactory.get(JOB_NAME) - .incrementer(new CustomRunIdIncrementer()) - .listener(new CustomJobListener()) - .listener(new CustomStepListener()) - .listener(new NoWorkFoundStepListener()) - - // JOB 시작 - // start() 결과가 FAILED 인경우 종료 - .start(start()) - .on("FAILED") - .end() - - // start()의 결과로 부터 FAILED를 제외한 모든 경우 to() 실행 - //.from(start()) - .on("*") - .to(execution()) - .on("FAILED") - .to(fail()) - - .from(execution()) - // to() 실행 결과와 상관 없이 end() 실행 - .on("*") - .to(end()) - - // JOB 종료 - .end() - - .build(); - } - - @Bean(name = JOB_NAME + "_step") - public Step execution() { - return stepBuilderFactory.get(JOB_NAME + "_step") - .tasklet(new OtherMergeTasklet(otherService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_start_step") - protected Step start() { - return stepBuilderFactory.get("Job_Locking") - .tasklet(new BatchStartTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_end_step") - protected Step end() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchEndTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_fail_step") - protected Step fail() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchFailEndTasklet(lockService)) - .build(); - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvAcceptJobConfg.java b/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvAcceptJobConfg.java deleted file mode 100644 index 98c3c26..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvAcceptJobConfg.java +++ /dev/null @@ -1,113 +0,0 @@ -package kr.xit.batch.ens.job; - -import kr.xit.batch.ens.task.PniCctvAcceptTasklet; -import kr.xit.biz.pni.service.IPniCctvFileService; -import kr.xit.core.biz.batch.CustomRunIdIncrementer; -import kr.xit.core.biz.batch.listener.CustomJobListener; -import kr.xit.core.biz.batch.listener.CustomStepListener; -import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener; -import kr.xit.core.biz.batch.service.IBatchCmmService; -import kr.xit.core.biz.batch.task.BatchEndTasklet; -import kr.xit.core.biz.batch.task.BatchFailEndTasklet; -import kr.xit.core.biz.batch.task.BatchStartTasklet; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.Step; -import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - *
- * description : 사전고지 CCTV accept - * - * packageName : kr.xit.batch.ens.job - * fileName : PniCctvAcceptJobConfg - * author : limju - * date : 2023-07-11 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-11 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Configuration -public class PniCctvAcceptJobConfg { - private static final String JOB_NAME = "PniCctvAcceptJob"; - - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobBuilderFactory jobBuilderFactory; - private final StepBuilderFactory stepBuilderFactory; - - private final IBatchCmmService lockService; - private final IPniCctvFileService service; - - @Bean(name = JOB_NAME) - public Job pniCctvAcceptJob() { - return jobBuilderFactory.get(JOB_NAME) - .incrementer(new CustomRunIdIncrementer()) - .listener(new CustomJobListener()) - .listener(new CustomStepListener()) - .listener(new NoWorkFoundStepListener()) - - // JOB 시작 - // start() 결과가 FAILED 인경우 종료 - .start(start()) - .on("FAILED") - .end() - - // start()의 결과로 부터 FAILED를 제외한 모든 경우 to() 실행 - //.from(start()) - .on("*") - .to(execution()) - .on("FAILED") - .to(fail()) - - .from(execution()) - // to() 실행 결과와 상관 없이 end() 실행 - .on("*") - .to(end()) - - // JOB 종료 - .end() - - .build(); - } - - @Bean(name = JOB_NAME + "_step") - public Step execution() { - return stepBuilderFactory.get(JOB_NAME + "_step") - .tasklet(new PniCctvAcceptTasklet(service)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_start_step") - protected Step start() { - return stepBuilderFactory.get("Job_Locking") - .tasklet(new BatchStartTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_end_step") - protected Step end() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchEndTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_fail_step") - protected Step fail() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchFailEndTasklet(lockService)) - .build(); - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvFileJobConfg.java b/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvFileJobConfg.java deleted file mode 100644 index 07296f6..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/job/PniCctvFileJobConfg.java +++ /dev/null @@ -1,113 +0,0 @@ -package kr.xit.batch.ens.job; - -import kr.xit.batch.ens.task.PniCctvFileTasklet; -import kr.xit.biz.pni.service.IPniCctvFileService; -import kr.xit.core.biz.batch.CustomRunIdIncrementer; -import kr.xit.core.biz.batch.listener.CustomJobListener; -import kr.xit.core.biz.batch.listener.CustomStepListener; -import kr.xit.core.biz.batch.listener.NoWorkFoundStepListener; -import kr.xit.core.biz.batch.service.IBatchCmmService; -import kr.xit.core.biz.batch.task.BatchEndTasklet; -import kr.xit.core.biz.batch.task.BatchFailEndTasklet; -import kr.xit.core.biz.batch.task.BatchStartTasklet; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.Job; -import org.springframework.batch.core.Step; -import org.springframework.batch.core.configuration.annotation.JobBuilderFactory; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.configuration.annotation.StepBuilderFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - *
- * description : 사전고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.job - * fileName : PniCctvFileJobConfg - * author : limju - * date : 2023-07-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-10 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Configuration -public class PniCctvFileJobConfg { - private static final String JOB_NAME = "PniCctvFileJob"; - - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobBuilderFactory jobBuilderFactory; - private final StepBuilderFactory stepBuilderFactory; - - private final IBatchCmmService lockService; - private final IPniCctvFileService service; - - @Bean(name = JOB_NAME) - public Job pniCctvFileJob() { - return jobBuilderFactory.get(JOB_NAME) - .incrementer(new CustomRunIdIncrementer()) - .listener(new CustomJobListener()) - .listener(new CustomStepListener()) - .listener(new NoWorkFoundStepListener()) - - // JOB 시작 - // start() 결과가 FAILED 인경우 종료 - .start(start()) - .on("FAILED") - .end() - - // start()의 결과로 부터 FAILED를 제외한 모든 경우 to() 실행 - //.from(start()) - .on("*") - .to(execution()) - .on("FAILED") - .to(fail()) - - .from(execution()) - // to() 실행 결과와 상관 없이 end() 실행 - .on("*") - .to(end()) - - // JOB 종료 - .end() - - .build(); - } - - @Bean(name = JOB_NAME + "_step") - public Step execution() { - return stepBuilderFactory.get(JOB_NAME + "_step") - .tasklet(new PniCctvFileTasklet(service)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_start_step") - protected Step start() { - return stepBuilderFactory.get("Job_Locking") - .tasklet(new BatchStartTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_end_step") - protected Step end() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchEndTasklet(lockService)) - .build(); - } - - @JobScope - @Bean(name = JOB_NAME + "_fail_step") - protected Step fail() { - return stepBuilderFactory.get("Lock_Release") - .tasklet(new BatchFailEndTasklet(lockService)) - .build(); - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/scheduler/EnsCctvAcceptJobScheduler.java b/mens-batch/src/main/java/kr/xit/batch/ens/scheduler/EnsCctvAcceptJobScheduler.java deleted file mode 100644 index b72c86f..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/scheduler/EnsCctvAcceptJobScheduler.java +++ /dev/null @@ -1,66 +0,0 @@ -package kr.xit.batch.ens.scheduler; - -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import kr.xit.batch.ens.job.EnsCctvAcceptJobConfg; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.batch.core.JobParameter; -import org.springframework.batch.core.JobParameters; -import org.springframework.batch.core.JobParametersInvalidException; -import org.springframework.batch.core.launch.JobLauncher; -import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException; -import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -/** - *
- * description : 전자 고지 CCTV accept - * - * packageName : kr.xit.batch.ens.scheduler - * fileName : EnsCctvAcceptJobScheduler - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Component -public class EnsCctvAcceptJobScheduler { - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobLauncher jobLauncher; - private final EnsCctvAcceptJobConfg jobConfiguration; - @Value("${app.slack-webhook.enabled:false}") - private String isSlackEnabled; - - //FIXME : 전자 고지 CCTV 파일 처리(서광) 실행 간격 정의 - private final static int RUN_EXEC_MIS = 10000; - - //@Scheduled(initialDelay = RUN_EXEC_MIS, fixedDelay = RUN_EXEC_MIS) - public void runJob() { - - Map
- * description : 전자 고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.scheduler - * fileName : EnsCctvFileJobScheduler - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Component -public class EnsCctvFileJobScheduler { - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobLauncher jobLauncher; - private final EnsCctvFileJobConfg jobConfiguration; - @Value("${app.slack-webhook.enabled:false}") - private String isSlackEnabled; - - //FIXME : 전자 고지 CCTV 파일 처리(서광) 실행 간격 정의 - private final static int RUN_EXEC_MIS = 10000; - - //@Scheduled(initialDelay = RUN_EXEC_MIS, fixedDelay = RUN_EXEC_MIS) - public void runJob() { - - Map
- * description : Oracle Merge - * 대상 : Maria DB (tb_cntc_sndng_mastr, tb_cntc_sndng_detail, tb_cntc_sndng_result) - * -> 시설 결과 마스터(elecnoticemst) - * 시설 결과 상세(elecnoticedtl) - * packageName : kr.xit.batch.ens.scheduler - * fileName : OtherMergeJobScheduler - * author : jhseo - * date : 2024-01-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2024-01-10 jhseo 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Component -public class OtherMergeJobScheduler { - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobLauncher jobLauncher; - private final OtherMergeJobConfig jobConfiguration; - @Value("${app.slack-webhook.enabled:false}") - private String isSlackEnabled; - - @Scheduled(cron = "${app.batch.cron.other.merge}") - public void runJob() { - - Map
- * description : 사전고지 CCTV accept - * - * packageName : kr.xit.batch.ens.scheduler - * fileName : PniCctvAcceptJobScheduler - * author : limju - * date : 2023-07-11 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-11 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Component -public class PniCctvAcceptJobScheduler { - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobLauncher jobLauncher; - private final PniCctvAcceptJobConfg jobConfiguration; - @Value("${app.slack-webhook.enabled:false}") - private String isSlackEnabled; - - //FIXME : 사전고지 CCTV 파일 처리(서광) 실행 간격 정의 - private final static int RUN_EXEC_MIS = 10000; - - //@Scheduled(initialDelay = RUN_EXEC_MIS, fixedDelay = RUN_EXEC_MIS) - public void runJob() { - - Map
- * description : 사전고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.scheduler - * fileName : PniCctvFileJobScheduler - * author : limju - * date : 2023-07-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-10 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Component -public class PniCctvFileJobScheduler { - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - private final JobLauncher jobLauncher; - private final PniCctvFileJobConfg jobConfiguration; - @Value("${app.slack-webhook.enabled:false}") - private String isSlackEnabled; - - //FIXME : 사전고지 CCTV 파일 처리(서광) 실행 간격 정의 - private final static int RUN_EXEC_MIS = 10000; - - //@Scheduled(initialDelay = RUN_EXEC_MIS, fixedDelay = RUN_EXEC_MIS) - public void runJob() { - - Map
- * description : 전자 고지 CCTV accept - * - * packageName : kr.xit.batch.ens.task - * fileName : EnsCctvAcceptTasklet - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -public class EnsCctvAcceptTasklet implements Tasklet { - private final IEnsCctvFileService service; - @Override - @JobScope - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - final String isSlackEnabled = contribution.getStepExecution().getJobParameters().getString("isSlackEnabled"); - - try { - MDC.put("service_error_msg", ""); - - service.acceptEnsNtnccntcSndng(); - }catch(Exception e){ - String errMsg = ErrorParse.extractError(e).getMessage(); - log.error("EnsCctvAcceptTasklet error :: {}", e.getMessage()); - MDC.put("service_error_msg", errMsg); - - TaskCmmUtils.taskBatchErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - TaskCmmUtils.taskEnsBatchServiceUpdateErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - contribution.setExitStatus(ExitStatus.FAILED); - return RepeatStatus.FINISHED; - } - contribution.setExitStatus(ExitStatus.COMPLETED); - return RepeatStatus.FINISHED; - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/task/EnsCctvFileTasklet.java b/mens-batch/src/main/java/kr/xit/batch/ens/task/EnsCctvFileTasklet.java deleted file mode 100644 index a4c9f45..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/task/EnsCctvFileTasklet.java +++ /dev/null @@ -1,61 +0,0 @@ -package kr.xit.batch.ens.task; - -import kr.xit.batch.ens.task.cmm.TaskCmmUtils; -import kr.xit.biz.ens.service.IEnsCctvFileService; -import kr.xit.core.exception.ErrorParse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; -import org.springframework.batch.core.ExitStatus; -import org.springframework.batch.core.StepContribution; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; -import org.springframework.batch.repeat.RepeatStatus; - -/** - *
- * description : 전자 고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.task - * fileName : EnsCctvFileTasklet - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -public class EnsCctvFileTasklet implements Tasklet { - private final IEnsCctvFileService service; - @Override - @JobScope - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - final String isSlackEnabled = contribution.getStepExecution().getJobParameters().getString("isSlackEnabled"); - - try { - MDC.put("service_error_msg", ""); - - service.createCctvFileOfSg(); - }catch(Exception e){ - String errMsg = ErrorParse.extractError(e).getMessage(); - log.error("EnsCctvFileTasklet error :: {}", e.getMessage()); - MDC.put("service_error_msg", errMsg); - - TaskCmmUtils.taskBatchErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - contribution.setExitStatus(ExitStatus.FAILED); - return RepeatStatus.FINISHED; - } - contribution.setExitStatus(ExitStatus.COMPLETED); - return RepeatStatus.FINISHED; - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/task/OtherMergeTasklet.java b/mens-batch/src/main/java/kr/xit/batch/ens/task/OtherMergeTasklet.java deleted file mode 100644 index 6990dea..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/task/OtherMergeTasklet.java +++ /dev/null @@ -1,60 +0,0 @@ -package kr.xit.batch.ens.task; - -import kr.xit.batch.ens.task.cmm.TaskCmmUtils; -import kr.xit.biz.ens.service.IEnsOtherMergeService; -import kr.xit.core.exception.ErrorParse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; -import org.springframework.batch.core.ExitStatus; -import org.springframework.batch.core.StepContribution; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; -import org.springframework.batch.repeat.RepeatStatus; - -/** - *
- * description : - * - * packageName : kr.xit.batch.ens.task - * fileName : OtherMergeTasklet - * author : jhseo - * date : 2024-01-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2024-01-10 jhseo 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -public class OtherMergeTasklet implements Tasklet { - private final IEnsOtherMergeService service; - - @Override - @JobScope - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - final String isSlackEnabled = contribution.getStepExecution().getJobParameters().getString("isSlackEnabled"); - - try { - MDC.put("service_error_msg", ""); - - service.mergeData(); - }catch(Exception e){ - String errMsg = ErrorParse.extractError(e).getMessage(); - log.error("OtherMergeTasklet error :: {}", e.getMessage()); - MDC.put("service_error_msg", errMsg); - TaskCmmUtils.taskBatchErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - contribution.setExitStatus(ExitStatus.FAILED); - return RepeatStatus.FINISHED; - } - contribution.setExitStatus(ExitStatus.COMPLETED); - return RepeatStatus.FINISHED; - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvAcceptTasklet.java b/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvAcceptTasklet.java deleted file mode 100644 index 513d955..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvAcceptTasklet.java +++ /dev/null @@ -1,67 +0,0 @@ -package kr.xit.batch.ens.task; - -import kr.xit.batch.ens.task.cmm.TaskCmmUtils; -import kr.xit.biz.pni.service.IPniCctvFileService; -import kr.xit.core.exception.ErrorParse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; -import org.springframework.batch.core.ExitStatus; -import org.springframework.batch.core.StepContribution; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; -import org.springframework.batch.repeat.RepeatStatus; - -/** - *
- * description : 사전고지 CCTV accept - * - * packageName : kr.xit.batch.ens.task - * fileName : PniCctvAcceptTasklet - * author : limju - * date : 2023-07-11 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-11 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -public class PniCctvAcceptTasklet implements Tasklet { - private final IPniCctvFileService service; - @Override - @JobScope - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - final String isSlackEnabled = contribution.getStepExecution().getJobParameters().getString("isSlackEnabled"); - - try { - MDC.put("service_error_msg", ""); - - service.acceptPniNtnccntcSndng(); - }catch(Exception e){ - String errMsg = ErrorParse.extractError(e).getMessage(); - log.error("PniCctvAcceptTasklet error :: {}", e.getMessage()); - MDC.put("service_error_msg", errMsg); - - TaskCmmUtils.taskBatchErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - TaskCmmUtils.taskEnsBatchServiceUpdateErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - contribution.setExitStatus(ExitStatus.FAILED); - return RepeatStatus.FINISHED; - } - contribution.setExitStatus(ExitStatus.COMPLETED); - return RepeatStatus.FINISHED; - } -} diff --git a/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvFileTasklet.java b/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvFileTasklet.java deleted file mode 100644 index eaa3be1..0000000 --- a/mens-batch/src/main/java/kr/xit/batch/ens/task/PniCctvFileTasklet.java +++ /dev/null @@ -1,61 +0,0 @@ -package kr.xit.batch.ens.task; - -import kr.xit.batch.ens.task.cmm.TaskCmmUtils; -import kr.xit.biz.pni.service.IPniCctvFileService; -import kr.xit.core.exception.ErrorParse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; -import org.springframework.batch.core.ExitStatus; -import org.springframework.batch.core.StepContribution; -import org.springframework.batch.core.configuration.annotation.JobScope; -import org.springframework.batch.core.scope.context.ChunkContext; -import org.springframework.batch.core.step.tasklet.Tasklet; -import org.springframework.batch.repeat.RepeatStatus; - -/** - *
- * description : 사전고지 CCTV 파일 처리(서광) - * - * packageName : kr.xit.batch.ens.task - * fileName : PniCctvFileTasklet - * author : limju - * date : 2023-07-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-10 limju 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -public class PniCctvFileTasklet implements Tasklet { - private final IPniCctvFileService service; - @Override - @JobScope - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { - final String isSlackEnabled = contribution.getStepExecution().getJobParameters().getString("isSlackEnabled"); - - try { - MDC.put("service_error_msg", ""); - - service.createCctvFileOfSg(); - }catch(Exception e){ - String errMsg = ErrorParse.extractError(e).getMessage(); - log.error("PniCctvFileTasklet error :: {}", e.getMessage()); - MDC.put("service_error_msg", errMsg); - - TaskCmmUtils.taskBatchErrorLog( - contribution.getStepExecution().getJobExecution().getJobInstance().getJobName(), - errMsg, - isSlackEnabled - ); - - contribution.setExitStatus(ExitStatus.FAILED); - return RepeatStatus.FINISHED; - } - contribution.setExitStatus(ExitStatus.COMPLETED); - return RepeatStatus.FINISHED; - } -} 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 569bad0..a88fc4b 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 @@ -1,19 +1,9 @@ package kr.xit.batch.ens.web; -import io.swagger.v3.oas.annotations.Operation; -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.*; -import kr.xit.biz.common.ApiConstants; -import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; -import kr.xit.core.model.ApiResponseDTO; -import kr.xit.core.model.IApiResponse; -import kr.xit.core.support.utils.Checks; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameters; @@ -29,6 +19,21 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +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.ens.model.cmm.CmmEnsRequestDTO; +import kr.xit.core.model.ApiResponseDTO; +import kr.xit.core.model.IApiResponse; +import kr.xit.core.support.utils.Checks; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + /** *
* description : 카카오페이 전자문서 발송요청 배치 컨트롤러 @@ -60,9 +65,6 @@ public class BatchJobWebController { private final SndngSnedBulksJobConfig sendBulksJobConfig; private final SndngStatusBulksJobConfig statusJobConfig; 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) @@ -178,74 +180,6 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } - @Operation(summary = "pniCctvFileService", description = "CCTV 사전알림(서광)") - @PostMapping(value = "/pniCctvFileService", produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse pniCctvFileService(@RequestBody final CmmEnsRequestDTO reqDTO) { - - try { - JobExecution jobExecution = jobLauncher.run( - pniCctvFileJobConfg.pniCctvFileJob(), - 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); - } - - @Operation(summary = "pniCctvAccept", description = "CCTV 단속 사전알림 accept") - @PostMapping(value = "/pniCctvAccept", produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse pniCctvAccept(@RequestBody final CmmEnsRequestDTO reqDTO) { - - try { - JobExecution jobExecution = jobLauncher.run( - pniCctvAcceptJobConfg.pniCctvAcceptJob(), - 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); - } - - @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){ MapconfMap = new HashMap<>(); diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java index 0ed8245..aa29bef 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java @@ -152,26 +152,6 @@ public interface IEnsBatchMapper { */ int insertKtMobilePageManage(final T t); - /** - * - * 문자발송 데이터 생성 - * - tb_ens_sms_sndng - * @param t T - * @return int - *- */ -int insertSmsSndng(final T t); - - /** - * - * 우편발송 데이터 생성 - * - tb_ens_post_sndng - * @param t T - * @return int - *- */ -int insertPostSndng(final T t); - /** * * Kt 공인알림문자 마스타 데이터 생성 @@ -192,17 +172,6 @@ public interface IEnsBatchMapper { */int insertKtBcDetail(final T t); - /** - * - * Post plus 데이터 생성 - * - tb_ens_post_plus - * @param t T - * @return int - *- */ -int insertPplus(final T t); - - /** * * 통합발송마스터 상태 변경 @@ -269,27 +238,6 @@ public interface IEnsBatchMapper { */List selectKakaoSendTgts(final T t); - /** - * - * E-GREEN 우편발송 대상 목록 조회 - * - tb_ens_sndng_mastr, tb_ens_post_sndng - * @param t status - * @return List- */ -- * List selectPostTgts(final T t); - - /** - * - * SMS 발송 대상 목록 조회 - * - tb_ens_sndng_mastr, tb_ens_sms_sndng - * @param t status - * @return List- */ -- * List selectSmsSendTgts(final T t); - - /** * * 발송상태 조회 : 발송후 발송 연계 마스터의 발송상태 변경값 조회 @@ -388,13 +336,6 @@ public interface IEnsBatchMapper { * @return int */ int updateCntcSndngResultByKkoMyDoc(final CntcDTO.SndngResult dto); - - /** - * Post plus 상태조회 결과 반영 대상 조회 - * @param unitySndngMstId String - * @return Listdiff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsCctvFileService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsCctvFileService.java deleted file mode 100644 index e15a3d6..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsCctvFileService.java +++ /dev/null @@ -1,311 +0,0 @@ -package kr.xit.biz.ens.service; - -import static egovframework.com.cmm.util.EgovDateUtil.formatDate; -import static egovframework.com.cmm.util.EgovDateUtil.formatTime; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import kr.xit.biz.ens.mapper.IEnsCctvFileMapper; -import kr.xit.biz.ens.model.EnsDTO; -import kr.xit.biz.ens.model.EnsDTO.EnsNtncCntcSndngTgt; -import kr.xit.core.service.AbstractService; -import kr.xit.core.support.utils.Checks; -import kr.xit.core.support.utils.DateUtils; -import kr.xit.core.support.utils.SFTPUtils; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.MDC; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -/** - *- */ - List selectPplusResultTgtsByUnitySndngMstId(final String unitySndngMstId); //---------------------------------------------------------------------- // result //---------------------------------------------------------------------- diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsCctvFileMapper.java b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsCctvFileMapper.java deleted file mode 100644 index eadc742..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsCctvFileMapper.java +++ /dev/null @@ -1,33 +0,0 @@ -package kr.xit.biz.ens.mapper; - -import kr.xit.biz.ens.model.EnsDTO; -import kr.xit.biz.ens.model.EnsDTO.EnsNtncCntcSndngTgt; -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import java.util.List; - -/** - * - * description : - * - * packageName : kr.xit.biz.ens.mapper - * fileName : IEnsCctvFileMapper - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Mapper -public interface IEnsCctvFileMapper { - int selectLicense(String jobSeCode); - int insertNtcnCntcData(EnsDTO.NtcnCntcData dto); - - ListselectEnsNtncCntcSndngs(); - int insertCntcSndngMst(EnsNtncCntcSndngTgt dto); - int insertCntcSndngDtl(EnsNtncCntcSndngTgt dto); - int updateEnsNtcnCntcData(EnsNtncCntcSndngTgt dto); -} diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java index fb1eb78..32b66b9 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java @@ -175,16 +175,10 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak * - 최초(전송 없슴), 1차 전송, 2차 전송 데이타 대상 * KAKAO - {@link IEnsBatchMapper#insertKakaoMyDocs(Object) insertKakaoMyDocs} * - tb_ens_kakao_my_doc - * E_GREEN - {@link IEnsBatchMapper#insertPostSndng(Object) insertPostSndng} - * - tb_ens_post_sndng - * SMS - {@link IEnsBatchMapper#insertSmsSndng(Object) insertSmsSndng} - * - tb_ens_sms_sndng * KT_BC - {@link IEnsBatchMapper#insertKtBcMastr(Object) insertKtBcMastr} * - tb_ens_kt_bc_mastr FIXME::운영 전환 시 처리 필요 * - {@link IEnsBatchMapper#insertKtBcDetail(Object) insertKtBcDetail} * - tb_ens_kt_bc_detail FIXME::운영 전환 시 처리 필요 - * PPLUS - {@link IEnsBatchMapper#insertPplus(Object) insertPplus} - * - tb_ens_ FIXME::처리 필요 * @param dto SndngMssageParam * @return int * - * description : 전자 고지 CCTV 파일 서비스 - * - * packageName : kr.xit.biz.ens.service - * fileName : EnsCctvFileService - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Service -public class EnsCctvFileService extends AbstractService implements IEnsCctvFileService { - - @Value("${app.ssh.host}") private String host; - @Value("${app.ssh.port}") private int port; - @Value("${app.ssh.id}") private String id; - @Value("${app.ssh.passwd}") private String passwd; - - @Value("${app.ssh.sg.ens-path}") private String ensPath; - @Value("${app.ssh.sg.rcv}") private String rcvPath; - @Value("${app.ssh.sg.backup}") private String backupPath; - @Value("${app.ssh.sg.err}") private String errPath; - - private final IEnsCctvFileMapper mapper; - - /** - * 전자 고지 cctv 단속 자료 생성(서광) - */ - @Override - @Transactional - public void createCctvFileOfSg() { - - // 전자 고지 라이선스 유효성 체크 - int licenseCnt = mapper.selectLicense("ENS"); - if(licenseCnt == 0) return; - - SFTPUtils sftp = null; - - try { - // SFTP connect - sftp = new SFTPUtils(); - sftp.init(host, port, id, passwd, StringUtils.EMPTY); - - // 서광 CCTV 전자 고지 대상 조회 - final String srcPath = ensPath + rcvPath; - ArrayListfileNameList = sftp.findFileNameList(srcPath); - //if(fileNameList.size() == 0) throw BizRuntimeException.create("사전고지[서광] 처리 대상이 없습니다"); - - // 에러 파일 목록 - ArrayList errFileList = new ArrayList<>(); - // 성공 파일 목록 - ArrayList rtnFileList = new ArrayList<>(); - for (String fn : fileNameList) { - String[] arrFi = fn.split("_"); - - // 파일 이름 정보 오류시 - if (arrFi.length != 4 || arrFi[0].length() != 14) { - errFileList.add(fn); - continue; - } - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // FIXME :: GS 임시 소스 - // 파일 다운로드 - final String downLoadPath = "D:/ImageData/ENS" + "/" + DateUtils.getToday(StringUtils.EMPTY); - - File Folder = new File(downLoadPath); - if (!Folder.exists()) Folder.mkdir(); //폴더 생성합니다. - sftp.fileDownload(srcPath + "/" + fn, downLoadPath); - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - // FIXME : 중복데이타(단속시간 + 차량번호)인 경우 데이타 skip 하도록 해야 할 듯 - // 전자 고지 연계 데이타 생성 - mapper.insertNtcnCntcData( - EnsDTO.NtcnCntcData.builder() - .regltDt(arrFi[0]) - .vhcleNo(arrFi[1]) - .sptNm(arrFi[2]) - .sptAcctoCode(arrFi[3].split("\\.")[0]) - .fileNm(fn) - .build() - ); - rtnFileList.add(fn); - - // FIXME :: sftp rm 기능 추후 제거 - // 파일 삭제 - sftp.rm(fn); - } - - // FIXME :: sftp move 기능 추후 사용 - // 처리한 데이타 backup - //fileBackup(sftp, srcPath, errFileList, rtnFileList); - - } finally { - if(sftp != null) sftp.disconnect(); - } - } - - /** - * 전자 고지 accept 연계발송 데이타 생성 - * 1. 전자 고지 연계 발송 데이타 생성 대상 조회 - * 2. 전자 고지 연계 발송 마스터 생성 - * 3. 전자 고지 연계 발송 상세 생성 - * 4. 전자 고지 연계 결과 반영 - */ - @Override - @Transactional - public void acceptEnsNtnccntcSndng() { - List tgtList = mapper.selectEnsNtncCntcSndngs(); - - if(tgtList.isEmpty()) return; - - // search 전자 고지 연계발송 데이타 생성 대상 - Optional first = tgtList.stream() - .filter(dto -> "Y".equals(dto.getTgtYn())) - .findFirst(); - - // 전자 고지 연계발송 master 생성 - final String unitySndngMastrId; - final String closDt; - if(first.isPresent()){ - EnsNtncCntcSndngTgt tgtDTO = first.get(); - mapper.insertCntcSndngMst(tgtDTO); - unitySndngMastrId = tgtDTO.getUnitySndngMastrId(); - closDt = tgtDTO.getClosDt(); - MDC.put("unitySndngMastrId", unitySndngMastrId); - } else { - unitySndngMastrId = null; - closDt = null; - } - - // 전자 고지 연계발송 상세 생성 및 결과 처리(전자 고지 연계 데이타 반영) - // 전자 고지 대상 -> 전자 고지 연계 발송 상세 생성 - // 전자 고지 연계 데이타 -> 연계 결과 반영 - // : 대상 : 연계대상-Y, 진행상태-Y, 통합발송상세ID - // 미대상 : 연계대상-N, 진행상태-Y, 통합발송상세ID = null - tgtList.forEach(dto -> { - dto.setProcessAt("Y"); - if("Y".equals(dto.getTgtYn())){ - dto.setUnitySndngMastrId(unitySndngMastrId); - dto.setClosDt(closDt); - dto.setMobilePageCn(jsonCn(dto)); - mapper.insertCntcSndngDtl(dto); - } - mapper.updateEnsNtcnCntcData(dto); - }); - } - - private void fileBackup(SFTPUtils sftp, String srcPath, ArrayList errFileList, ArrayList rtnFileList) { - final String errorPath = ensPath + errPath; - String destPath = ensPath + backupPath; - destPath = destPath + "/" + DateUtils.getToday(StringUtils.EMPTY); - - log.info("src path::[{}]", srcPath); - log.info("tgt path::[{}]", destPath); - - // file backup - for (String fn : rtnFileList) { - log.info("fileName::[{}]", fn); - sftp.mv(srcPath + "/" + fn, destPath + "/" + fn); - } - - // error file backup - for (String fn : errFileList) { - sftp.mv(srcPath + "/" + fn, errorPath + "/" + fn); - } - } - - private String jsonCn(EnsNtncCntcSndngTgt dto){ - String jsonCn = "{" - + "\"details\": [" - + "{" - + "\"title\": \"주정차 위반 과태료 통지서\"," - + "\"item_type\": \"SUBJECT_TEXT\"," - + "\"elements\": [" - + "\"\"" - + "]" - + "}," - + "{" - + "\"title\": \"위반내역\"," - + "\"item_type\": \"KEY_VALUE\"," - + "\"properties\": {" - + "}," - + "\"elements\": [" - + "{" - + "\"key\": \"차량번호\"," - + "\"value\": \""+ Checks.checkVal(dto.getVhcleNo(),"") +"\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"성명\"," - + "\"value\": \""+ Checks.checkVal(dto.getNm(),"") +"\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"위반일시\"," - + "\"value\": \""+ Checks.checkVal(formatDate(dto.getRegltDt().substring(0,8), "-") + " " + formatTime(dto.getRegltDt().substring(8,14), ":"),"") +"\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"위반내용\"," - + "\"value\": \"주정차금지 구역\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"위반장소\"," - + "\"value\": \""+ Checks.checkVal(dto.getSptNm(),"") +"\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"납부금액\"," - + "\"value\": \"32,000원\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"단속구분\"," - + "\"value\": \"CCTV\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"자진납부 기한\"," - + "\"value\": \""+ Checks.checkVal(formatDate(dto.getClosDt().substring(0,8), "-"),"") +"\\\\n위 납부 기한이 경과 시에는 과태료 감경 혜택을 받으실 수 없습니다.\"," - + "\"level\": 1" - + "}" - + "]" - + "}," - + "{" - + "\"title\": \"과태료 부과 및 감경\"," - + "\"item_type\": \"TABLE\"," - + "\"elements\": {" - + "\"head\": [" - + "\"구분\"," - + "\"승용 감경금액\\\\n(부과금액)\"," - + "\"승합 감경금액\\\\n(부과금액)\"" - + "]," - + "\"rows\": [" - + "[" - + "\"주정차금지구역\"," - + "\"32,000원\\\\n(40,000원)\"," - + "\"40,000원\\\\n(50,000원)\"" - + "]," - + "[" - + "\"같은 장소 2시간 초과\"," - + "\"40,000원\\\\n(50,000원)\"," - + "\"48,000원\\\\n(60,000원)\"" - + "]" - + "]" - + "}" - + "}," - + "{" - + "\"title\": \"질서위반행위 규제법 시행령 규정 감경 대상\"," - + "\"item_type\": \"KEY_VALUE\"," - + "\"elements\": [" - + "{" - + "\"key\": \"감경대상자\"," - + "\"value\": \"○ 국민기초생활 수급자\\\\n○ 한부모가족 보호대상자\\\\n○ 장애의 정도가 심한 장애인\\\\n○ 국가유공자(상이등급 3급 이상)\\\\n○ 미성년자\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"시행일\"," - + "\"value\": \"2010년 1월 16일 부터\\\\n○ 적용 : 시행일 이후 단속된 차량\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"감경율(%)\"," - + "\"value\": \"과태료 부과금액의 50%\"," - + "\"level\": 1" - + "}," - + "{" - + "\"key\": \"비고\"," - + "\"value\": \"※ 자진 납부 시 추가감경 가능\"," - + "\"level\": 1" - + "}" - + "]" - + "}" - + "]" - +"}"; - return jsonCn; - } -} diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsOtherMergeService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsOtherMergeService.java deleted file mode 100644 index 2128f66..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsOtherMergeService.java +++ /dev/null @@ -1,68 +0,0 @@ -package kr.xit.biz.ens.service; - -import kr.xit.biz.ens.cmm.CmmEnsBizUtils; -import kr.xit.core.exception.BizRuntimeException; -import kr.xit.core.model.ApiResponseDTO; -import kr.xit.core.service.AbstractService; -import kr.xit.core.spring.util.ApiWebClientUtil; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpMethod; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -/** - * - * description : Oracle DB Merge 처리 - * - 배치에서 호출되는 클래스로 배치 로그등 Transaction 분리 필요 - * - 메소드 트랜잭션 Transactional(propagation = Propagation.REQUIRES_NEW)로 선언 - * packageName : kr.xit.biz.ens.service - * fileName : EnsOtherMergeService - * author : jhseo - * date : 2023-08-31 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-08-31 jhseo 최초 생성 - * - *- */ -@Slf4j -@RequiredArgsConstructor -@Service -public class EnsOtherMergeService extends AbstractService implements IEnsOtherMergeService { - @Value("${app.contract.host}") - private String apiHost; - @Value("${app.contract.other.api.merge}") - private String apiOtherMerge; - - private final ApiWebClientUtil apiWebClient; - - /** - *- * 전자고지(문서) send bulks - 문서 중개자별 send - *- */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public void mergeData() { - final String url = apiHost + apiOtherMerge; - - final ApiResponseDTO apiResult = apiWebClient.exchange( - url, - HttpMethod.POST, - "", - ApiResponseDTO.class, - CmmEnsBizUtils.getHeadeMap()); - - String errMsg = ""; - if(apiResult.getData() != null) { - if(!"success".equals(apiResult.getData())){ - errMsg = apiResult.getMessage(); - throw BizRuntimeException.create(errMsg); - } - } - } -} diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsCctvFileService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsCctvFileService.java deleted file mode 100644 index f9367eb..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsCctvFileService.java +++ /dev/null @@ -1,28 +0,0 @@ -package kr.xit.biz.ens.service; - -/** - *- * description : 전자 고지 파일 서비스 - * - * packageName : kr.xit.biz.ens.service - * fileName : IEnsCctvFileService - * author : seojh - * date : 2023-07-17 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-17 seojh 최초 생성 - * - *- */ -public interface IEnsCctvFileService { - /** - * 전자 고지 cctv 단속 자료 생성(서광) - */ - void createCctvFileOfSg(); - - /** - * 전자 고지 accept 연계발송 데이타 생성 - */ - void acceptEnsNtnccntcSndng(); -} diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsOtherMergeService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsOtherMergeService.java deleted file mode 100644 index a7f0570..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsOtherMergeService.java +++ /dev/null @@ -1,20 +0,0 @@ -package kr.xit.biz.ens.service; - -/** - *- * description : Oracle DB Merge 처리 - * - * packageName : kr.xit.biz.ens.service - * fileName : IEnsOtherMergeService - * author : jhseo - * date : 2024-01-10 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2024-01-10 jhseo 최초 생성 - * - *- */ -public interface IEnsOtherMergeService { - void mergeData(); -} diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsCctvFileController.java b/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsCctvFileController.java deleted file mode 100644 index ffbfabd..0000000 --- a/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsCctvFileController.java +++ /dev/null @@ -1,49 +0,0 @@ -package kr.xit.biz.ens.web; - -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import kr.xit.biz.ens.service.IEnsCctvFileService; -import kr.xit.core.model.ApiResponseDTO; -import kr.xit.core.model.IApiResponse; -import lombok.RequiredArgsConstructor; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - *- * description : - * - * packageName : kr.xit.biz.pni.web - * fileName : PniCctvFileController - * author : limju - * date : 2023-07-07 - * ====================================================================== - * 변경일 변경자 변경 내용 - * ---------------------------------------------------------------------- - * 2023-07-07 limju 최초 생성 - * - *- */ -@Tag(name = " EnsCctvFileController", description = "전자고지 CCTV 파일 연계 테스트") -@RequiredArgsConstructor -@RestController -@RequestMapping("/batch/ens/v1") -public class EnsCctvFileController { - private final IEnsCctvFileService service; - - @Operation(summary = "전자고지 파일 연계 데이타 생성(서광)", description = "전자고지 파일 연계 데이타 생성(서광)") - @PostMapping(value = "/createCctvFileOfSg", produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse createCctvFileOfSg() { - service.createCctvFileOfSg(); - return ApiResponseDTO.success(); - } - - @Operation(summary = "전자고지 연계 데이타 생성(accept)", description = "전자고지 연계 데이타 생성(accept)") - @PostMapping(value = "/acceptEnsNtnccntcSndng", produces = MediaType.APPLICATION_JSON_VALUE) - public IApiResponse acceptEnsNtnccntcSndng() { - service.acceptEnsNtnccntcSndng(); - return ApiResponseDTO.success(); - } -} diff --git a/mens-batch/src/main/resources/egovframework/mapper/biz/pni-mysql-mapper.xml b/mens-batch/src/main/resources/egovframework/mapper/biz/pni-mysql-mapper.xml deleted file mode 100644 index 2ef7375..0000000 --- a/mens-batch/src/main/resources/egovframework/mapper/biz/pni-mysql-mapper.xml +++ /dev/null @@ -1,151 +0,0 @@ - - -- - - - - /** pni-mysql-mapper|insertNtcnCntcData-사전알림연계데이타 생성|julim */ - - - - -- SELECT concat(date_format(now(), '%Y%m%d'), LPAD(NEXTVAL(tb_pni_ntcn_cntc_data_seq), 12, '0')) from dual - - INSERT - INTO tb_pni_ntcn_cntc_data ( - ntcn_cntc_data_id, /* 사전알림연계데이타 ID*/ - reglt_dt, /* 단속일시 */ - vhcle_no, /* 차량번호 */ - spt_nm, /* 현장명 */ - spt_accto_code, /* 현장별코드 */ - file_nm, /* 파일명 */ - regist_dt, - register - ) VALUES ( - #{ntcnCntcDataId}, - #{regltDt}, - #{vhcleNo}, - #{sptNm}, - #{sptAcctoCode}, - #{fileNm}, - now(), - 'batch' - ) -- /** pni-mysql-mapper|insertCntcSndngMst-연계발송마스터 생성|julim */ - - -- SELECT concat('P', signgu_code, ffnlg_code, RIGHT(date_format(now(), '%Y'),2), LPAD(NEXTVAL(tb_cntc_sndng_mastr_seq), 7, '0')) - FROM tb_ens_tmplat_manage - WHERE sndng_ty_code = #{sndngTyCode} - AND tmplat_id = #{tmplatId} - - INSERT - INTO tb_cntc_sndng_mastr ( - unity_sndng_mastr_id, /* 통합발송마스터 id */ - signgu_code, /* 시군구코드 */ - ffnlg_code, /* 과태료코드 */ - tmplat_id, /* 템플릿ID */ - sndng_ty_code, /* 발송유형 코드 */ - sndng_co, /* 발송 건수 */ - sndng_process_sttus, /* 발송처리 상태 */ - sndng_dt, /* 발송일시 */ - clos_dt, /* 마감일시 */ - regist_dt, - register - ) - SELECT #{unitySndngMastrId} - , tetm.signgu_code - , tetm.ffnlg_code - , tetm.tmplat_id - , tetm.sndng_ty_code - , #{sndngCo} - , #{sndngProcessSttus} - , date_format(now(), '%Y%m%d%H%i%S') - , date_format(date_add(now(), interval +1 day), '%Y%m%d%H%i%S') - , now() - , 'batch' - FROM tb_ens_tmplat_manage tetm - WHERE sndng_ty_code = #{sndngTyCode} - AND tmplat_id = #{tmplatId} -- /** pni-mysql-mapper|insertCntcSndngDtl-연계발송상세 생성|julim */ - - -- SELECT concat('P', signgu_code, ffnlg_code, RIGHT(date_format(now(), '%Y'),2), LPAD(NEXTVAL(tb_cntc_sndng_detail_seq), 7, '0')) - FROM tb_ens_tmplat_manage - WHERE sndng_ty_code = #{sndngTyCode} - AND tmplat_id = #{tmplatId} - - INSERT - INTO tb_cntc_sndng_detail ( - unity_sndng_detail_id, /* 통합발송 상세ID */ - unity_sndng_mastr_id, /* 통합발송 마스터ID */ - signgu_code, /* 시군구 코드 */ - ffnlg_code, /* 과태료 코드 */ - ihidnum, /* 주민번호 */ - vhcle_no, /* 차량번호 */ - moblphon_no, /* 핸드폰 번호 */ - nm, /* 이름 */ - tmplt_msg_data, /* 템플릿메시지 데이타 */ - mobile_page_cn, /* 모바일 페이지 내용 */ - regist_dt, - register - ) - SELECT #{unitySndngDetailId} - , #{unitySndngMastrId} - , tetm.signgu_code - , tetm.ffnlg_code - , #{brthdy} - , #{vhcleNo} - , #{moblphonNo} - , #{nm} - , #{tmpltMsgData} - , #{mobilePageCn} - , now() - , 'batch' - FROM tb_ens_tmplat_manage tetm - WHERE sndng_ty_code = #{sndngTyCode} - AND tmplat_id = #{tmplatId} -- /** pni-mysql-mapper|updatePniNtcnCntcData-사전알림 연계데이타 연계결과 반영|julim */ - UPDATE tb_pni_ntcn_cntc_data - SET process_at = #{processAt} - , trget_at = #{tgtYn} - , unity_sndng_detail_id = #{unitySndngDetailId} - , updt_dt = now() - , updusr = 'batch' - WHERE ntcn_cntc_data_id = #{ntcnCntcDataId} - -