feat: profile 별 scheduler 실행되도록 반영

(천안 or 춘천)
main
Jonguk. Lim 3 months ago
parent 428fcace7b
commit f84683f677

@ -15,6 +15,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.KtGbsAccessTokenUpdateJobConfig; import kr.xit.batch.ens.job.KtGbsAccessTokenUpdateJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants; import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode; import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -56,7 +57,7 @@ public class KtGbsAccessTokenUpdateJobScheduler {
confMap.put("isSlackEnabled", new JobParameter(isSlackEnabled)); confMap.put("isSlackEnabled", new JobParameter(isSlackEnabled));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -3,11 +3,7 @@ package kr.xit.batch.ens.scheduler;
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.SndngAcceptJobConfig;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersInvalidException;
@ -18,6 +14,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.SndngAcceptJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
* description : - * description : -
@ -56,7 +59,7 @@ public class SndngAcceptJobScheduler {
confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.ACCEPT.getCode())); confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.ACCEPT.getCode()));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -3,11 +3,7 @@ package kr.xit.batch.ens.scheduler;
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.SndngCloseJobConfig;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersInvalidException;
@ -18,6 +14,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.SndngCloseJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
* description : close - send-ok * description : close - send-ok
@ -55,7 +58,7 @@ public class SndngCloseJobScheduler {
confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.SEND_OK.getCode())); confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.SEND_OK.getCode()));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -3,11 +3,7 @@ package kr.xit.batch.ens.scheduler;
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.SndngMakeJobConfig;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersInvalidException;
@ -18,6 +14,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.SndngMakeJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
* description : - * description : -
@ -55,7 +58,7 @@ public class SndngMakeJobScheduler {
confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.ACCEPT_OK.getCode())); confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.ACCEPT_OK.getCode()));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -3,11 +3,7 @@ package kr.xit.batch.ens.scheduler;
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.SndngSnedBulksJobConfig;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersInvalidException;
@ -18,6 +14,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.SndngSnedBulksJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
* description : - * description : -
@ -54,7 +57,7 @@ public class SndngSendBulksJobScheduler {
confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.MAKE_OK.getCode())); confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.MAKE_OK.getCode()));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -3,11 +3,7 @@ package kr.xit.batch.ens.scheduler;
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.SndngStatusBulksJobConfig;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.JobParameter; import org.springframework.batch.core.JobParameter;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.JobParametersInvalidException;
@ -18,6 +14,13 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import kr.xit.batch.ens.job.SndngStatusBulksJobConfig;
import kr.xit.batch.ens.task.cmm.TaskCmmUtils;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/** /**
* <pre> * <pre>
* description : - * description : -
@ -54,7 +57,7 @@ public class SndngStatusBulksJobScheduler {
confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.SEND_OK.getCode())); confMap.put("sndngProcessSttus", new JobParameter(ApiConstants.SndngProcessStatus.SEND_OK.getCode()));
try { try {
for(SignguCode signguCode : SignguCode.values()) { for(SignguCode signguCode : TaskCmmUtils.getSignguCodeList()) {
confMap.put("signguCode", new JobParameter(signguCode.getCode())); confMap.put("signguCode", new JobParameter(signguCode.getCode()));
confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE)); confMap.put("ffnlgCode", new JobParameter(ApiConstants.FFNLN_CODE));
JobParameters jobParameters = new JobParameters(confMap); JobParameters jobParameters = new JobParameters(confMap);

@ -1,6 +1,10 @@
package kr.xit.batch.ens.task.cmm; package kr.xit.batch.ens.task.cmm;
import static egovframework.com.cmm.util.EgovStringUtil.cutString; import static egovframework.com.cmm.util.EgovStringUtil.*;
import java.util.Arrays;
import org.slf4j.MDC;
import kr.xit.biz.common.ApiConstants; import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.model.cmm.SndngMssageParam; import kr.xit.biz.ens.model.cmm.SndngMssageParam;
@ -8,7 +12,6 @@ import kr.xit.core.biz.batch.model.BatchCmmDTO.BatchLock;
import kr.xit.core.spring.util.BatchSpringUtils; import kr.xit.core.spring.util.BatchSpringUtils;
import lombok.AccessLevel; import lombok.AccessLevel;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.slf4j.MDC;
/** /**
* <pre> * <pre>
@ -79,4 +82,16 @@ public class TaskCmmUtils {
.build() .build()
); );
} }
public static ApiConstants.SignguCode[] getSignguCodeList() {
if(ApiConstants.IS_CCN){
return (ApiConstants.SignguCode[])Arrays.stream(ApiConstants.SignguCode.values())
.filter(d -> d.getCode().equals(ApiConstants.SignguCode.CHUNCHEON.getCode()))
.toArray();
}
return (ApiConstants.SignguCode[])Arrays.stream(ApiConstants.SignguCode.values())
.filter(d -> !d.getCode().equals(ApiConstants.SignguCode.CHUNCHEON.getCode()))
.toArray();
}
} }

Loading…
Cancel
Save