From 28ad4dfa5a8a046912b54126649f1138507f8044 Mon Sep 17 00:00:00 2001 From: kjh Date: Wed, 4 Sep 2024 16:49:00 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A7=80=EB=B9=84=EC=8A=A4=20=EB=B0=9C?= =?UTF-8?q?=EC=86=A1=20=EA=B2=B0=EA=B3=BC=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/ktgbs/service/BizKtGbsService.java | 15 +++- .../ens/ktgbs/web/KtGbsInboundController.java | 2 +- .../mapper/biz/ens-kt-oracle-mapper.xml | 87 ++++++++++--------- .../mapper/biz/ens-mysql-mapper.xml | 4 +- .../mapper/biz/ens-oracle-mapper.xml | 1 - 5 files changed, 61 insertions(+), 48 deletions(-) diff --git a/mens-api/src/main/java/kr/xit/biz/ktgbs/service/BizKtGbsService.java b/mens-api/src/main/java/kr/xit/biz/ktgbs/service/BizKtGbsService.java index ef231d3..0b07ac7 100644 --- a/mens-api/src/main/java/kr/xit/biz/ktgbs/service/BizKtGbsService.java +++ b/mens-api/src/main/java/kr/xit/biz/ktgbs/service/BizKtGbsService.java @@ -112,13 +112,24 @@ public class BizKtGbsService extends AbstractService implements IBizKtGbsService dto.setMmsRsltDvcd("60"); } dto.setMmsRsltDvcdMsg(messageUtil.getMessage("info.api.kt.msg.rslt."+dto.getMmsRsltDvcd())); - // FIXME: KT GIBIS 적용 안됨 - 기존API 반영 결과와 신규 발송 결과에 따른 반영 구분{ if(mapper.updateKtGbsDtl(dto) != 1) { errors.add(new ErrorMsg( String.format("존재 하지 않는 발송 대상(src_key[%s], mms_rslt_sqno[%s]) 입니다", dto.getSrcKey(), dto.getMmsSndgRsltSqno()))); } - //FIXME: KT GIBIS 적용 안됨 + + // 업무 테이블에 발송 결과 상태 적용 + if (("40").equals(dto.getMmsRsltDvcd())) { + dto.setMmsRsltDvcd("RECEIVED"); + } else if (("60").equals(dto.getMmsRsltDvcd())) { + dto.setMmsRsltDvcd("READ"); + } else if (("4N").equals(dto.getMmsRsltDvcd())) { + dto.setMmsRsltDvcd("FORBIDDEN"); + } else if (("4T").equals(dto.getMmsRsltDvcd())) { + dto.setMmsRsltDvcd("UNIDENTIFIED_USER"); + } else { + dto.setMmsRsltDvcd("FAIL"); + } mapper.saveKtGbsCntcSndngResult(dto); } diff --git a/mens-api/src/main/java/kr/xit/ens/ktgbs/web/KtGbsInboundController.java b/mens-api/src/main/java/kr/xit/ens/ktgbs/web/KtGbsInboundController.java index 92c0692..929af55 100644 --- a/mens-api/src/main/java/kr/xit/ens/ktgbs/web/KtGbsInboundController.java +++ b/mens-api/src/main/java/kr/xit/ens/ktgbs/web/KtGbsInboundController.java @@ -74,7 +74,7 @@ public class KtGbsInboundController { }) @Operation(summary = "메세지 발송/수신 결과 전송 -> KT GIBIS에서 호출", description = "메세지 발송/수신 결과 전송 -> KT GIBIS에서 호출") //@PostMapping(value = "/goji/kt/gibis/stat/bulk", produces = MediaType.APPLICATION_JSON_VALUE) - @PostMapping(value = "/api/msg/result", produces = MediaType.APPLICATION_JSON_VALUE) + @PostMapping(value = "/goji/api/msg/result", produces = MediaType.APPLICATION_JSON_VALUE) public KtCommonDTO.KtCommonResponse messageResult(@RequestBody final KtGbsDTO.MsgRsltRequest reqDTO) { return bizService.messageResult(reqDTO); } diff --git a/mens-api/src/main/resources/egovframework/mapper/biz/ens-kt-oracle-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/biz/ens-kt-oracle-mapper.xml index c7ecbf8..1155c50 100644 --- a/mens-api/src/main/resources/egovframework/mapper/biz/ens-kt-oracle-mapper.xml +++ b/mens-api/src/main/resources/egovframework/mapper/biz/ens-kt-oracle-mapper.xml @@ -56,52 +56,55 @@ , mms_rdg_tmst = NVL(#{mmsRdgTmst}, mms_rdg_tmst) /* 열람 타임 스탬프 */ , updt_dt = sysdate , updusr = 'api_inbound' - WHERE unity_sndng_detail_id = #{srcKey} + WHERE src_key = #{srcKey} /** ens-kt-oracle-mapper|saveKtGbsCntcSndngResult-KT GIBIS 연계발송결과반영|julim */ - - SELECT tesn.signgu_code AS signguCode - , tesn.ffnlg_code AS ffnlgCode - , tesn.sndng_se_code AS sndngSeCode - FROM tb_ens_sndng_mastr tesn - JOIN tb_elctrn_ntic_sndng_detail tcsnd - ON tesn.unity_sndng_mastr_id = tcsnd.elctrn_ntic_sndng_detail_id - WHERE tcsnd.elctrn_ntic_sndng_detail_id = #{srcKey} + + SELECT tekg.signgu_code AS "signguCode" + , tekg.ffnlg_code AS "ffnlgCode" + FROM tb_ens_kt_gbs tekg + WHERE tekg.src_key = #{srcKey} - INSERT INTO tb_elctrn_ntic_sndng_result ( - elctrn_ntic_sndng_detail_id, /* 통합 발송 상세 ID*/ - sndng_se_code, /* 발송구분코드 - KAKAO-MY-DOC|KT-BC */ - signgu_code, /* 시군구코드 */ - ffnlg_code, /* 과태료코드 */ - sndng_result_sttus, - requst_dt, /* 송신(요청) 일시 */ - inqire_dt, /* 수신(조회) 일시 */ - readng_dt, /* 최초열람일시 */ - error_cn, /* 에러내용 */ - regist_dt, - register - ) VALUES ( - #{srcKey} - , #{sndngSeCode} /* 발송구분코드 - KAKAO-MY-DOC|KT-BC */ - , #{signguCode} /* 시군구코드 */ - , #{ffnlgCode} /* 과태료코드 */ - , #{mmsRsltDvcd} - , #{mmsSndgTmst} /* 송신(요청) 일시 */ - , #{mmsRcvTmst} /* 수신(조회) 일시 */ - , #{mmsRdgTmst} /* 최초열람일시 */ - , #{errorMsg} /* 에러내용 */ - , sysdate - , 'batch' - ) - ON DUPLICATE KEY UPDATE - sndng_result_sttus = NVL(#{mmsRsltDvcd}, sndng_result_sttus) - , requst_dt = NVL(#{mmsSndgTmst}, requst_dt) /* 송신(요청) 일시 */ - , inqire_dt = NVL(#{mmsRcvTmst}, inqire_dt) /* 수신(조회) 일시 */ - , readng_dt = NVL(#{mmsRdgTmst}, readng_dt) /* 최초열람일시 */ - , error_cn = NVL(#{errorMsg}, error_cn) - , updt_dt = sysdate - , updusr = 'batch' + + MERGE INTO tb_elctrn_ntic_sndng_result tensr + USING (SELECT unity_sndng_detail_id FROM tb_ens_kt_gbs WHERE src_key = #{srcKey}) tekg + ON (tensr.elctrn_ntic_sndng_detail_id = tekg.unity_sndng_detail_id) + WHEN MATCHED THEN + UPDATE + SET sndng_result_sttus = NVL(#{mmsRsltDvcd}, sndng_result_sttus) + , requst_dt = NVL(#{mmsSndgTmst}, requst_dt) /* 송신(요청) 일시 */ + , inqire_dt = NVL(#{mmsRcvTmst}, inqire_dt) /* 수신(조회) 일시 */ + , readng_dt = NVL(#{mmsRdgTmst}, readng_dt) /* 최초열람일시 */ + , error_cn = NVL(#{errorMsg}, error_cn) + , updt_dt = sysdate + , updusr = 'batch' + WHEN NOT MATCHED THEN + INSERT ( + elctrn_ntic_sndng_detail_id, /* 통합 발송 상세 ID*/ + sndng_se_code, /* 발송구분코드 - KAKAO-NEW|KT-GBS */ + signgu_code, /* 시군구코드 */ + ffnlg_code, /* 과태료코드 */ + sndng_result_sttus, /* 발송결과상태 */ + requst_dt, /* 송신(요청) 일시 */ + inqire_dt, /* 수신(조회) 일시 */ + readng_dt, /* 최초열람일시 */ + error_cn, /* 에러내용 */ + regist_dt, + register + ) VALUES ( + #{srcKey} + , 'ktGibis' + , #{signguCode} /* 시군구코드 */ + , #{ffnlgCode} /* 과태료코드 */ + , #{mmsRsltDvcd} /* 발송결과상태 */ + , #{mmsSndgTmst} /* 송신(요청) 일시 */ + , #{mmsRcvTmst} /* 수신(조회) 일시 */ + , #{mmsRdgTmst} /* 최초열람일시 */ + , #{errorMsg} /* 에러내용 */ + , sysdate + , 'batch' + ) diff --git a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml index 3d2bc73..b8f515a 100644 --- a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml +++ b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml @@ -957,7 +957,7 @@ UPDATE tb_elctrn_ntic_sndng_result SET sndng_result_code = CASE WHEN #{sndngResultSttus} IN ('RECEIVED', 'EXPIRED') THEN '1' WHEN #{sndngResultSttus} IN ('READ') THEN '2' - WHEN #{sndngResultSttus} IS NULL THEN '' + WHEN #{sndngResultSttus} IS NULL THEN NULL ELSE '3' END , requst_dt = from_unixtime(#{requstDt}, '%Y%m%d%H%i%s') /* 송신(요청) 일시 */ , inqire_dt = from_unixtime(#{inqireDt}, '%Y%m%d%H%i%s') /* 수신(조회) 일시 */ @@ -976,7 +976,7 @@ UPDATE tb_elctrn_ntic_sndng_result SET sndng_result_code = CASE WHEN #{sndngResultSttus} IN ('RECEIVED', 'EXPIRED') THEN '1' WHEN #{sndngResultSttus} IN ('READ') THEN '2' - WHEN #{sndngResultSttus} IS NULL THEN '' + WHEN #{sndngResultSttus} IS NULL THEN NULL ELSE '3' END , requst_dt = DATE_FORMAT(#{requstDt}, '%Y%m%d%H%i%s') /* 송신(요청) 일시 */ , inqire_dt = DATE_FORMAT(#{inqireDt}, '%Y%m%d%H%i%s') /* 수신(조회) 일시 */ diff --git a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-oracle-mapper.xml b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-oracle-mapper.xml index bfd412c..e594184 100644 --- a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-oracle-mapper.xml +++ b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-oracle-mapper.xml @@ -764,7 +764,6 @@ ORDER BY tekbd.sndng_detail_id -