From 65b5e690bb94afe9c1de299ac8bef2a99b745d10 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Tue, 20 Aug 2024 17:27:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B6=98=EC=B2=9C/=EC=B2=9C=EC=95=88?= =?UTF-8?q?=20traffic=20=EC=BD=94=EB=93=9C=20=EC=A0=81=EC=9A=A9=20=20=20?= =?UTF-8?q?=20=20=20=20swagger=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=83=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/biz/ktgbs/web/BizKtGbsController.java | 8 +- .../xit/biz/mbl/web/MobilePageController.java | 5 +- .../biz/nice/service/BizNiceCiService.java | 19 ++-- .../batch/ens/web/BatchJobWebController.java | 100 ++++++++++++++++++ .../kr/xit/biz/ens/cmm/CmmEnsBizUtils.java | 11 ++ .../ens/service/EnsBatchAcceptService.java | 14 +-- .../biz/ens/service/EnsBatchCloseService.java | 5 +- .../ens/service/EnsBatchExtractService.java | 10 +- .../biz/ens/service/EnsBatchMakeService.java | 14 ++- .../xit/biz/ens/web/EnsBatchController.java | 94 ++++++++++------ .../java/kr/xit/biz/common/ApiConstants.java | 86 +++++++++++++-- 11 files changed, 294 insertions(+), 72 deletions(-) diff --git a/mens-api/src/main/java/kr/xit/biz/ktgbs/web/BizKtGbsController.java b/mens-api/src/main/java/kr/xit/biz/ktgbs/web/BizKtGbsController.java index 3449e80..9616b45 100644 --- a/mens-api/src/main/java/kr/xit/biz/ktgbs/web/BizKtGbsController.java +++ b/mens-api/src/main/java/kr/xit/biz/ktgbs/web/BizKtGbsController.java @@ -40,14 +40,14 @@ import lombok.extern.slf4j.Slf4j; public class BizKtGbsController { private static final String PARAM1 = """ { - "signguCode": "88328", + "signguCode": "44131", "ffnlgCode": "11", "profile": "local" } """; private static final String PARAM2 = """ { - "signguCode": "88316", + "signguCode": "44133", "ffnlgCode": "11", "profile": "local" } @@ -60,10 +60,10 @@ public class BizKtGbsController { mediaType = "application/json", examples = { @ExampleObject( - name = "교통시설운영처", + name = "천안시동남구청", value = PARAM1), @ExampleObject( - name = "승화원", + name = "천안시서북구청", value = PARAM2) }) }) diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java b/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java index 2049f2f..0c5a084 100644 --- a/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java +++ b/mens-api/src/main/java/kr/xit/biz/mbl/web/MobilePageController.java @@ -82,14 +82,17 @@ public class MobilePageController { produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse findKtMblPage(@RequestParam final String token, final HttpServletRequest request) { final String uri = request.getRequestURI(); + //FIXME: KT mblpage 적용 안됨 final KtTokenDTO.KtTokenConfirmRequest cfmReqDTO = KtTokenDTO.KtTokenConfirmRequest.builder() .signguCode(SignguCode.CHUNCHEON.getCode()) .ffnlgCode(ApiConstants.FFNLN_CODE) .accessToken(token) .build(); + //FIXME: KT mblpage 적용 안됨 if(uri.contains("meMblPage")){ - cfmReqDTO.setSignguCode(SignguCode.FUNERAL.getCode()); + cfmReqDTO.setSignguCode(SignguCode.CHEONAN_ES.getCode()); + //cfmReqDTO.setSignguCode(SignguCode.CHEONAN_WN.getCode()); } return service.findKtMblPage(cfmReqDTO); } diff --git a/mens-api/src/main/java/kr/xit/biz/nice/service/BizNiceCiService.java b/mens-api/src/main/java/kr/xit/biz/nice/service/BizNiceCiService.java index 6ac2172..4ccc693 100644 --- a/mens-api/src/main/java/kr/xit/biz/nice/service/BizNiceCiService.java +++ b/mens-api/src/main/java/kr/xit/biz/nice/service/BizNiceCiService.java @@ -106,7 +106,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi // 공개키 정보 캐쉬 삭제 cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode()); - updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN); + //updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN); //---------------------------------------------------------------------------------- } @@ -146,7 +146,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi // 공개키 정보 캐쉬 삭제 cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode()); - updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN); + //updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.TOKEN); }else{ throw BizRuntimeException.create("토큰을 폐기하지 못했습니다."); } @@ -184,7 +184,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi // 공개키 정보 캐쉬 삭제 cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode()); - updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.PUBLIC_KEY); + //updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.PUBLIC_KEY); return dataBody; } @@ -228,7 +228,7 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi // 공개키 정보 캐쉬 삭제 cacheService.removeNiceCiInfoCache(niceDTO.getSignguCode(), niceDTO.getFfnlgCode()); - updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.SYM_KEY); + //updateNiceCerfInfoSync(niceDTO, reqDTO, NiceCiWrkDiv.SYM_KEY); return symkeyStatInfo; } @@ -247,21 +247,20 @@ public class BizNiceCiService extends AbstractService implements IBizNiceCiServi /** *
-     * 교통시설운영처와 승화원의 Nice CI 정보 sync
+     * Nice CI 정보 sync가 필요한 경우 호출
      * @param niceDTO NiceCiInfo
      * @param reqDTO NiceCiRequest
      * @param wrkDiv NiceCiWrkDiv
      * 
*/ - // FIXME : SignguCode private void updateNiceCerfInfoSync(final NiceCiInfo niceDTO, final NiceCiRequest reqDTO, final NiceCiWrkDiv wrkDiv) { // 교통시설운영처 또는 장사시설인 경우 sync ---------------------------------------- - if(SignguCode.CHUNCHEON.getCode().equals(reqDTO.getSignguCode())){ - niceDTO.setSignguCode(SignguCode.FUNERAL.getCode()); + if(SignguCode.CHEONAN_ES.getCode().equals(reqDTO.getSignguCode())){ + niceDTO.setSignguCode(SignguCode.CHEONAN_WN.getCode()); } - if(SignguCode.FUNERAL.getCode().equals(reqDTO.getSignguCode())){ - niceDTO.setSignguCode(SignguCode.CHUNCHEON.getCode()); + if(SignguCode.CHEONAN_WN.getCode().equals(reqDTO.getSignguCode())){ + niceDTO.setSignguCode(SignguCode.CHEONAN_ES.getCode()); } switch(wrkDiv){ 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 a88fc4b..a48d0c7 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 @@ -20,6 +20,8 @@ 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.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; import io.swagger.v3.oas.annotations.tags.Tag; import kr.xit.batch.ens.job.SndngAcceptJobConfig; import kr.xit.batch.ens.job.SndngCloseJobConfig; @@ -66,6 +68,44 @@ public class BatchJobWebController { private final SndngStatusBulksJobConfig statusJobConfig; private final SndngCloseJobConfig closeJobConfig; + private static final String CAN_1 = """ + { + "signguCode": "44131", + "ffnlgCode": "11", + "profile": "local" + } + """; + private static final String CAN_2 = """ + { + "signguCode": "44133", + "ffnlgCode": "11", + "profile": "local" + } + """; + + private static final String CCN = """ + { + "signguCode": "41220", + "ffnlgCode": "11", + "profile": "local" + } + """; + + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) + }) @Operation(summary = "accept", description = "accept") @PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse accept(@RequestBody final CmmEnsRequestDTO reqDTO) { @@ -88,6 +128,21 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) + }) @Operation(summary = "make", description = "make") @PostMapping(value = "/make", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse make(@RequestBody final CmmEnsRequestDTO reqDTO) { @@ -111,6 +166,21 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) + }) @Operation(summary = "close", description = "close") @PostMapping(value = "/close", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse close(@RequestBody final CmmEnsRequestDTO reqDTO) { @@ -134,6 +204,21 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) + }) @Operation(summary = "sendBulks", description = "sendBulks") @PostMapping(value = "/sendBulks", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse sendBulks(@RequestBody final CmmEnsRequestDTO reqDTO) { @@ -157,6 +242,21 @@ public class BatchJobWebController { return ApiResponseDTO.success(HttpStatus.OK); } + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) + }) @Operation(summary = "statusBulks", description = "statusBulks") @PostMapping(value = "/statusBulks", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse statusBulks(@RequestBody final CmmEnsRequestDTO reqDTO) { diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/cmm/CmmEnsBizUtils.java b/mens-batch/src/main/java/kr/xit/biz/ens/cmm/CmmEnsBizUtils.java index 27b5259..3165044 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/cmm/CmmEnsBizUtils.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/cmm/CmmEnsBizUtils.java @@ -55,4 +55,15 @@ public class CmmEnsBizUtils { return ApiConstants.SndngSeCode.getSndngSeCode(seCode); } + + /** + * 춘천 또는 천안 전자결재 발송 진행상태 set + * @param isChuncheon + * @param dto SndngMssageParam + * @param processStatus 발송처리상태 + */ + public static void setMappingProcessStatus(boolean isChuncheon, final SndngMssageParam dto, final String processStatus) { + if(isChuncheon) dto.setNewSndngProcessSttus(ApiConstants.MappingCcnSndngProcessStatus.fromEns(processStatus)); + else dto.setNewSndngProcessSttus(ApiConstants.MappingCanSndngProcessStatus.fromEns(processStatus)); + } } diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchAcceptService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchAcceptService.java index eb0118e..145d61c 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchAcceptService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchAcceptService.java @@ -23,7 +23,8 @@ import KISINFO.VNO.VNOInterop; import egovframework.com.cmm.util.EgovDateUtil; import egovframework.com.cmm.util.EgovStringUtil; import kr.xit.biz.common.ApiConstants; -import kr.xit.biz.common.ApiConstants.MappingSndngProcessStatus; +import kr.xit.biz.common.ApiConstants.MappingCanSndngProcessStatus; +import kr.xit.biz.common.ApiConstants.MappingCcnSndngProcessStatus; import kr.xit.biz.common.ApiConstants.SndngProcessStatus; import kr.xit.biz.common.ApiConstants.SndngSeCode; import kr.xit.biz.ens.cmm.CmmEnsBizUtils; @@ -123,7 +124,8 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void accept(final EnsDTO.BatchEnsRequest reqDTO) { - reqDTO.setSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode())); + if(IS_CCN) reqDTO.setSndngProcessSttus(MappingCcnSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode())); + else reqDTO.setSndngProcessSttus(MappingCanSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT.getCode())); final List list = mapper.selectAcceptTgts(reqDTO); String sndngDt = null; @@ -181,7 +183,7 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA insCnt)); } - dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT_OK.getCode())); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, SndngProcessStatus.ACCEPT_OK.getCode()); if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("접수 데이타 생성(통합발송마스터 상태변경) 실패"); } @@ -475,13 +477,13 @@ public class EnsBatchAcceptService extends AbstractService implements IEnsBatchA private void updateAcceptCntcSndngMstFailStatus(final List mstIdList, final String stsErrMsg) { for (String id : mstIdList) { - final SndngMssageParam paramDTO = SndngMssageParam.builder() + final SndngMssageParam dto = SndngMssageParam.builder() .unitySndngMastrId(id) - .newSndngProcessSttus(MappingSndngProcessStatus.fromEns(SndngProcessStatus.ACCEPT_FAIL.getCode())) .errorMssage(stsErrMsg) .build(); - if (mapper.updateProcessSttusCntcSndngMst(paramDTO) != 1) { + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, SndngProcessStatus.ACCEPT_FAIL.getCode()); + if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("[accept]연계 발송 마스터 상태변경 실패"); } } 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 4b599f0..17ad44c 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 @@ -7,6 +7,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import kr.xit.biz.common.ApiConstants; +import kr.xit.biz.ens.cmm.CmmEnsBizUtils; import kr.xit.biz.ens.mapper.IEnsBatchMapper; import kr.xit.biz.ens.model.EnsDTO; import kr.xit.biz.ens.model.cmm.SndngMssageParam; @@ -55,10 +56,10 @@ public class EnsBatchCloseService extends AbstractService implements IEnsBatchCl final SndngMssageParam paramDTO = SndngMssageParam.builder() .unitySndngMastrId(id) .sndngProcessSttus(reqDTO.getSndngProcessSttus()) - .newSndngProcessSttus(ApiConstants.SndngProcessStatus.CLOSE.getCode()) .build(); - if(IS_CCN) paramDTO.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(paramDTO.getNewSndngProcessSttus())); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, paramDTO, ApiConstants.SndngProcessStatus.CLOSE.getCode()); + if (mapper.updateProcessSttusCntcSndngMst(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 cc6c04e..fcd7e4a 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,8 +14,8 @@ 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.cmm.CmmEnsBizUtils; import kr.xit.biz.ens.mapper.IEnsBatchMapper; import kr.xit.biz.ens.model.EnsDTO; import kr.xit.biz.ens.model.cmm.SndngMssageParam; @@ -234,17 +234,17 @@ public class EnsBatchExtractService extends AbstractService implements final String status = dto.getNewSndngProcessSttus(); if ("SndngAcceptJob".equals(dto.getErrorCode())) { - if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status); mapper.updateProcessSttusCntcSndngMst(dto); } else if ("SndngMakeJob".equals(dto.getErrorCode())) { - if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status); mapper.updateProcessSttusCntcSndngMst(dto); dto.setNewSndngProcessSttus(status); mapper.updateProcessSttusUnitySndngMst(dto); } else if ("SndngSendBulksJob".equals(dto.getErrorCode())) { - if(IS_CCN) dto.setNewSndngProcessSttus(MappingSndngProcessStatus.fromEns(status)); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, status); mapper.updateProcessSttusCntcSndngMst(dto); dto.setNewSndngProcessSttus(status); mapper.updateProcessSttusUnitySndngMst(dto); @@ -278,7 +278,7 @@ 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)); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, paramDTO, status); if(mapper.updateProcessSttusCntcSndngMst(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 c6225f0..15cfa17 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 @@ -114,7 +114,7 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak } //없으면 연계 발송 마스터, 통합 발송 마스터 send-ok if (sendCnt == 0) { - if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus())); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, dto.getNewSndngProcessSttus()); if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("[make]연계 발송 마스터 상태변경 실패"); } @@ -168,7 +168,7 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak } // 3. status - if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus())); + CmmEnsBizUtils.setMappingProcessStatus(IS_CCN, dto, dto.getNewSndngProcessSttus()); if (mapper.updateProcessSttusCntcSndngMst(dto) != 1) { throw BizRuntimeException.create("[make]데이타 생성(발송마스터 상태변경) 실패"); } @@ -212,7 +212,10 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak dto.setUrl(CHUNCHEON_CALLBACK_URL); } // FIXME: KT callback url 확인 적용 - if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){ + if(SignguCode.CHEONAN_ES.getCode().equals(dto.getSignguCode())){ + dto.setUrl(ME_CALLBACK_URL); + } + if(SignguCode.CHEONAN_WN.getCode().equals(dto.getSignguCode())){ dto.setUrl(ME_CALLBACK_URL); } mapper.insertKtBcMastr(dto); @@ -226,7 +229,10 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak dto.setUrl(CHUNCHEON_CALLBACK_URL); } // FIXME: KT callback url 확인 적용 - if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){ + if(SignguCode.CHEONAN_ES.getCode().equals(dto.getSignguCode())){ + dto.setUrl(ME_CALLBACK_URL); + } + if(SignguCode.CHEONAN_WN.getCode().equals(dto.getSignguCode())){ dto.setUrl(ME_CALLBACK_URL); } //mapper.insertKtBcMastr(dto); 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 108d95b..4ef4b45 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 @@ -42,57 +42,89 @@ public class EnsBatchController { private final IEnsBatchStatusService statusService; private final IEnsBatchCloseService closeService; - @Operation(summary = "통합문서 접수", description = "통합문서 접수") + private static final String CAN_1 = """ + { + "signguCode": "44131", + "ffnlgCode": "11", + "profile": "local" + } + """; + private static final String CAN_2 = """ + { + "signguCode": "44133", + "ffnlgCode": "11", + "profile": "local" + } + """; + + private static final String CCN = """ + { + "signguCode": "41220", + "ffnlgCode": "11", + "profile": "local" + } + """; + @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { - @Content(mediaType = "application/json", examples = { - @ExampleObject(value = """ - { - "signguCode": "51110", - "ffnlgCode": "11", - "sndngProcessSttus": "accept" - } - """ - ) + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) }) }) + @Operation(summary = "통합문서 접수", description = "통합문서 접수") @PostMapping(value = "/accept", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse accept(@RequestBody final EnsDTO.BatchEnsRequest reqDTO) { acceptService.accept(reqDTO); return ApiResponseDTO.success(); } - @Operation(summary = "통합문서 발송 데이타 종료", description = "통합문서 발송 데이타 종료") @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { - @Content(mediaType = "application/json", examples = { - @ExampleObject(value = """ - { - "signguCode": "51110", - "ffnlgCode": "11", - "sndngProcessSttus": "send-ok" - } - """ - ) + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) }) }) + @Operation(summary = "통합문서 발송 데이타 종료", description = "통합문서 발송 데이타 종료") @PostMapping(value = "/close", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse close(@RequestBody final EnsDTO.BatchEnsRequest reqDTO){ closeService.close(reqDTO); return ApiResponseDTO.success(); } - @Operation(summary = "통합문서(bulk) 상태 조회", description = "통합문서 상태 조회") @io.swagger.v3.oas.annotations.parameters.RequestBody(required = true, content = { - @Content(mediaType = "application/json", examples = { - @ExampleObject(value = """ - { - "signguCode": "51110", - "ffnlgCode": "11", - "sndngProcessSttus": "send-ok" - } - """ - ) - }) + @Content( + mediaType = "application/json", + examples = { + @ExampleObject( + name = "춘천", + value = CCN), + @ExampleObject( + name = "천안시 동남구청", + value = CAN_1), + @ExampleObject( + name = "천안시 서북구청", + value = CAN_2) + }) }) + @Operation(summary = "통합문서(bulk) 상태 조회", description = "통합문서 상태 조회") @PostMapping(value = "/statusBulks", produces = MediaType.APPLICATION_JSON_VALUE) public IApiResponse statusBulks(@RequestBody final EnsDTO.BatchEnsRequest reqDTO){ statusService.statusBulks(reqDTO); diff --git a/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java b/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java index 5b99de1..6cbe955 100644 --- a/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java +++ b/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java @@ -216,9 +216,13 @@ public class ApiConstants { */ CHUNCHEON("51110"), /** - * 승화원 : NICE CI는 교통시설운영처와 동일한 코드 사용 + * 천안동남구청 */ - FUNERAL("88316"), + CHEONAN_ES("44131"), + /** + * 천안서북 + */ + CHEONAN_WN("44133"), ; private final String code; @@ -247,13 +251,13 @@ public class ApiConstants { /** *
-     * 발송처리상태 : ENS003 매핑
+     * 춘천의 발송처리상태 : ENS003 매핑
      * 01: 요청, 11: 접수완료, 19: 접수실패
      * 22: 제작완료, 29: 제작실패, 08: 발송완료, 09: 마감, 99: 발송실패
      * 
*/ @Getter - public enum MappingSndngProcessStatus { + public enum MappingCcnSndngProcessStatus { ACCEPT("accept", "01"), ACCEPT_OK("accept-ok", "11"), ACCEPT_FAIL("accept-fail", "19"), @@ -274,7 +278,7 @@ public class ApiConstants { private final String ensCode; private final String trfCode; - MappingSndngProcessStatus(String ensCode, String trfCode) { + MappingCcnSndngProcessStatus(String ensCode, String trfCode) { this.ensCode = ensCode; this.trfCode = trfCode; } @@ -287,10 +291,10 @@ public class ApiConstants { * */ public static String fromTraffic(final String trfCode){ - return Arrays.stream(MappingSndngProcessStatus.values()) + return Arrays.stream(MappingCcnSndngProcessStatus.values()) .filter(en -> en.getTrfCode().equals(trfCode)) .findFirst() - .map(MappingSndngProcessStatus::getEnsCode) + .map(MappingCcnSndngProcessStatus::getEnsCode) .orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", trfCode))); } @@ -302,12 +306,76 @@ public class ApiConstants { * */ public static String fromEns(final String ensCode){ - return Arrays.stream(MappingSndngProcessStatus.values()) + return Arrays.stream(MappingCcnSndngProcessStatus.values()) .filter(en -> en.getEnsCode().equals(ensCode)) .findFirst() - .map(MappingSndngProcessStatus::getTrfCode) + .map(MappingCcnSndngProcessStatus::getTrfCode) .orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", ensCode))); } } + /** + *
+     * 천안의 발송처리상태 : ENS003 매핑
+     * 01: 요청, 11: 접수완료, 19: 접수실패
+     * 22: 제작완료, 29: 제작실패, 08: 발송완료, 09: 마감, 99: 발송실패
+     * 
+ */ + @Getter + public enum MappingCanSndngProcessStatus { + ACCEPT("accept", "accept"), + ACCEPT_OK("accept-ok", "acptok"), + ACCEPT_FAIL("accept-fail", "acptfail"), + MAKE_OK("make-ok", "ensmake"), + MAKE_FAIL1("make-fail1", "makefail"), + MAKE_FAIL2("make-fail2", "makefail"), + MAKE_FAIL3("make-fail3", "makefail"), + SENDING1("sending1", "ensok"), + SENDING2("sending2", "ensok"), + SEND_OK("send-ok", "ensopen"), + SEND_FAIL1("send-fail1", "ensfail"), + SEND_FAIL2("send-fail2", "ensfail"), + SEND_FAIL3("send-fail3", "ensfail"), + CLOSE("close", "ensclose") + + ; + + private final String ensCode; + private final String trfCode; + + MappingCanSndngProcessStatus(String ensCode, String trfCode) { + this.ensCode = ensCode; + this.trfCode = trfCode; + } + + /** + *
+         * traffic 상태코드를 ens 상태코드로 매핑
+         * @param trfCode
+         * @return traffic 상태코드에 매핑된 ens 상태코드
+         * 
+ */ + public static String fromTraffic(final String trfCode){ + return Arrays.stream(MappingCcnSndngProcessStatus.values()) + .filter(en -> en.getTrfCode().equals(trfCode)) + .findFirst() + .map(MappingCcnSndngProcessStatus::getEnsCode) + .orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", trfCode))); + } + + /** + *
+         * ens 상태코드를 traffic 상태코드로 매핑
+         * @param ensCode
+         * @return ens 상태코드에 매핑된 traffic 상태코드
+         * 
+ */ + public static String fromEns(final String ensCode){ + return Arrays.stream(MappingCcnSndngProcessStatus.values()) + .filter(en -> en.getEnsCode().equals(ensCode)) + .findFirst() + .map(MappingCcnSndngProcessStatus::getTrfCode) + .orElseThrow(() -> BizRuntimeException.create(String.format("미정의된 상태코드가[%s]", ensCode))); + } + } }