diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchCloseService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchCloseService.java index 3bc598e..4b599f0 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchCloseService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchCloseService.java @@ -1,6 +1,11 @@ package kr.xit.biz.ens.service; import java.util.List; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + import kr.xit.biz.common.ApiConstants; import kr.xit.biz.ens.mapper.IEnsBatchMapper; import kr.xit.biz.ens.model.EnsDTO; @@ -8,9 +13,6 @@ import kr.xit.biz.ens.model.cmm.SndngMssageParam; import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.service.AbstractService; import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; /** *
@@ -33,6 +35,11 @@ import org.springframework.transaction.annotation.Transactional; public class EnsBatchCloseService extends AbstractService implements IEnsBatchCloseService { private final IEnsBatchMapper mapper; + /** + * 춘천 시스템 여부 + */ + private static final boolean IS_CCN = ApiConstants.PROFILE.matches(".*-ccn"); + /** * send-ok 값에 따라 close * @@ -51,9 +58,12 @@ public class EnsBatchCloseService extends AbstractService implements IEnsBatchCl .newSndngProcessSttus(ApiConstants.SndngProcessStatus.CLOSE.getCode()) .build(); + if(IS_CCN) paramDTO.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(paramDTO.getNewSndngProcessSttus())); if (mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) { throw BizRuntimeException.create("[close]연계 발송 마스터 상태변경 실패"); } + + paramDTO.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.CLOSE.getCode()); if (mapper.updateProcessSttusUnitySndngMst(paramDTO) != 1) { throw BizRuntimeException.create("[close]통합 발송 마스터 상태변경 실패"); } diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java index b00462d..c9f4c26 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java @@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional; import kr.xit.batch.ens.task.cmm.TaskCmmUtils; import kr.xit.biz.common.ApiConstants; +import kr.xit.biz.common.ApiConstants.MappingSndngProcessStatus; import kr.xit.biz.common.ApiConstants.SndngSeCode; import kr.xit.biz.ens.mapper.IEnsBatchMapper; import kr.xit.biz.ens.model.EnsDTO; @@ -53,6 +54,11 @@ public class EnsBatchExtractService extends AbstractService implements private final IEnsBatchMapper mapper; + /** + * 춘천 시스템 여부 + */ + private static final boolean IS_CCN = ApiConstants.PROFILE.matches(".*-ccn"); + //----------------------------------------------------------------------------------------------------------------- // REQUIRES_NEW service method //----------------------------------------------------------------------------------------------------------------- @@ -174,13 +180,22 @@ public class EnsBatchExtractService extends AbstractService implements */ @Transactional public void updateErrorLog(final SndngMssageParam dto) { + final String status = dto.getNewSndngProcessSttus(); + if ("SndngAcceptJob".equals(dto.getErrorCode())) { + if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); mapper.updateProcessSttusCntcSndngMst(dto); + } else if ("SndngMakeJob".equals(dto.getErrorCode())) { + if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); mapper.updateProcessSttusCntcSndngMst(dto); + dto.setNewSndngProcessSttus(status); mapper.updateProcessSttusUnitySndngMst(dto); + } else if ("SndngSendBulksJob".equals(dto.getErrorCode())) { + if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); mapper.updateProcessSttusCntcSndngMst(dto); + dto.setNewSndngProcessSttus(status); mapper.updateProcessSttusUnitySndngMst(dto); mapper.updateProcessSttusSndngMst(dto); } @@ -210,9 +225,14 @@ public class EnsBatchExtractService extends AbstractService implements } private void updateMstTable(SndngMssageParam paramDTO, SndngSeCode seCode) { + final String status = paramDTO.getNewSndngProcessSttus(); + + if(IS_CCN) paramDTO.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); if(mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) { throw BizRuntimeException.create(String.format("[send-%s]연계 발송 마스터 상태변경 실패", seCode.getCode())); } + + paramDTO.setNewSndngProcessSttus(status); if(mapper.updateProcessSttusUnitySndngMst(paramDTO) != 1) { throw BizRuntimeException.create(String.format("[send-%s]통합 발송 마스터 상태변경 실패", seCode.getCode())); } 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 32b66b9..284ec5d 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 @@ -48,6 +48,11 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak private static final String SNDNG_PROCESS_STTUS = "sndngProcessSttus"; private static final String UNITY_SNDNG_MST_ID = "unitySndngMastrId"; + /** + * 춘천 시스템 여부 + */ + private static final boolean IS_CCN = ApiConstants.PROFILE.matches(".*-ccn"); + private final IEnsBatchMapper mapper; /** @@ -100,11 +105,12 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak //없으면 연계 발송 마스터, 통합 발송 마스터 send-ok if (sendCnt == 0) { - dto.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.SEND_OK.getCode()); - + if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus())); if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("[make]연계 발송 마스터 상태변경 실패"); } + + dto.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.SEND_OK.getCode()); if (mapper.updateProcessSttusUnitySndngMst(dto) != 1) { throw BizRuntimeException.create("[make]통합 발송 마스터 상태변경 실패"); } @@ -153,9 +159,11 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak } // 3. status + if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus())); if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("[make]데이타 생성(발송마스터 상태변경) 실패"); } + dto.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.MAKE_OK.getCode()); if (mapper.updateProcessSttusUnitySndngMst(dto) != 1) { throw BizRuntimeException.create("[make]데이타 생성(통합발송마스터 상태변경) 실패"); } diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsBatchController.java b/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsBatchController.java index d17262e..108d95b 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsBatchController.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/web/EnsBatchController.java @@ -66,7 +66,7 @@ public class EnsBatchController { @Content(mediaType = "application/json", examples = { @ExampleObject(value = """ { - "signguCode": "88328", + "signguCode": "51110", "ffnlgCode": "11", "sndngProcessSttus": "send-ok" } @@ -85,7 +85,7 @@ public class EnsBatchController { @Content(mediaType = "application/json", examples = { @ExampleObject(value = """ { - "signguCode": "88328", + "signguCode": "51110", "ffnlgCode": "11", "sndngProcessSttus": "send-ok" }