From 462de355454441f81dee22cff8f1dae77378561e Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Wed, 11 Sep 2024 16:51:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=ED=86=A1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EB=B0=98=EC=98=81=20-=20=EB=AA=A8?= =?UTF-8?q?=EB=B0=94=EC=9D=BC=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/mens-iup-query.sql | 8 +- .../IntgrnNotiMblPageController.java | 9 ++ .../kkotalk/mapper/IKkoTalkMapper.java | 8 +- .../KkoTalkMblPageController.java | 90 +++++++++++++++++++ .../KkotalkApiController.java | 0 .../KkotalkController.java | 2 +- src/main/resources/application.yml | 4 +- src/main/resources/config/conf-app.yml | 3 +- .../modules/iup-kkotalk-mapper.xml | 19 ++++ 9 files changed, 134 insertions(+), 9 deletions(-) create mode 100644 src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkoTalkMblPageController.java rename src/main/java/cokr/xit/ens/modules/kkotalk/{web => presentation}/KkotalkApiController.java (100%) rename src/main/java/cokr/xit/ens/modules/kkotalk/{web => presentation}/KkotalkController.java (99%) diff --git a/db/mens-iup-query.sql b/db/mens-iup-query.sql index 0a0929a..95d94ff 100644 --- a/db/mens-iup-query.sql +++ b/db/mens-iup-query.sql @@ -69,7 +69,7 @@ select * from ENS_NICE_JID_MNG order by REGIST_DT desc; select * from ENS_NICE_CI_MNG order by regist_dt desc; -select to_char(to_timestamp(sendDetailKkoTalk.sentAt, 'yyyy-mm-dd"T"hh24:mi:ss'), 'yyyymmddhh24miss') +select to_char(to_timestamp(null, 'yyyy-mm-dd"T"hh24:mi:ss'), 'yyyymmddhh24miss') from dual; @@ -193,3 +193,9 @@ SELECT * FROM TB_SEND_RESULT_V2; ens_intgrn_snd_mast intgrnsend0_ where intgrnsend0_.int_send_mast_id=2452; + +select esdkt.EXTERNAL_ID, esdkt.ENVELOPE_ID + from ens_snd_mast esm + join ENS_SND_DTL_KKO_TALK esdkt + ON esm.SEND_MAST_ID = esdkt.SEND_MAST_ID + and esdkt.EXTERNAL_ID = diff --git a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/presentation/IntgrnNotiMblPageController.java b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/presentation/IntgrnNotiMblPageController.java index 4450bb3..aa53138 100644 --- a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/presentation/IntgrnNotiMblPageController.java +++ b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/presentation/IntgrnNotiMblPageController.java @@ -42,15 +42,24 @@ public class IntgrnNotiMblPageController { String docUuid = null; String linkedUuid = null; + // 카카오페이 if (docUuid == null) docUuid = mParam.get("document_binder_uuid"); if (linkedUuid == null) linkedUuid = mParam.get("external_document_uuid"); + // 네이버페이 if (docUuid == null) docUuid = mParam.get("docId"); if (linkedUuid == null) linkedUuid = mParam.get("clientDocId"); + + // kt if (docUuid == null) { docUuid = CmmnUtil.isEmpty(mParam.get("src_key")) ? null : mParam.get("src_key").replaceAll("[\\\"\\,\\[\\]]", ""); linkedUuid = null; } + if (docUuid == null) { + docUuid = CmmnUtil.isEmpty(mParam.get("envelopeId")) ? null : mParam.get("envelopeId").replaceAll("[\\\"\\,\\[\\]]", ""); + linkedUuid = null; + } + try { if (CmmnUtil.isEmpty(docUuid)) throw new EnsException(EnsErrCd.ERR410, "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다. ( 내부식별ID는 필수조건 입니다 )"); diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/mapper/IKkoTalkMapper.java b/src/main/java/cokr/xit/ens/modules/kkotalk/mapper/IKkoTalkMapper.java index a16393e..05eb8c8 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/mapper/IKkoTalkMapper.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/mapper/IKkoTalkMapper.java @@ -4,6 +4,7 @@ import java.util.*; import org.apache.ibatis.annotations.*; +import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.*; import cokr.xit.ens.modules.common.domain.*; import cokr.xit.ens.modules.kkotalk.model.*; @@ -34,10 +35,11 @@ public interface IKkoTalkMapper { List findAllFetchBySendMastId(Long sendMastId); - Optional findFetchByExternalIdAndEnvelopeId(Map map); + Optional findFetchByExternalIdAndEnvelopeId(final Map map); - List findAllBySendMastAndEnvlopeIdIsNotNull(SendMast sendMast); + List findAllBySendMastAndEnvlopeIdIsNotNull(final SendMast sendMast); - //Optional findByExternalId(String externalId); + Optional selectSendMastByExternalIdAndEnvelopeId(final Map map); + Optional selectBillByBillUid(final String billUid); } diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkoTalkMblPageController.java b/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkoTalkMblPageController.java new file mode 100644 index 0000000..72a5fb6 --- /dev/null +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkoTalkMblPageController.java @@ -0,0 +1,90 @@ +package cokr.xit.ens.modules.kkotalk.presentation; + +import java.util.*; + +import org.springframework.stereotype.*; +import org.springframework.ui.*; +import org.springframework.web.bind.annotation.*; + +import cokr.xit.ens.core.aop.*; +import cokr.xit.ens.core.exception.*; +import cokr.xit.ens.core.exception.code.*; +import cokr.xit.ens.core.utils.*; +import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.*; +import cokr.xit.ens.modules.common.ctgy.mblpage.domain.*; +import cokr.xit.ens.modules.common.ctgy.mblpage.domain.ids.*; +import cokr.xit.ens.modules.common.ctgy.mblpage.domain.repository.*; +import cokr.xit.ens.modules.common.ctgy.mblpage.presentation.*; +import cokr.xit.ens.modules.common.domain.*; +import cokr.xit.ens.modules.kkotalk.mapper.*; +import cokr.xit.ens.modules.kkotalk.model.*; +import cokr.xit.ens.modules.kkotalk.service.*; +import io.swagger.v3.oas.annotations.tags.*; +import lombok.*; +import lombok.extern.slf4j.*; + +@Tag(name = "KkoTalkMblPageController") +@Slf4j +@RequiredArgsConstructor +@Controller +public class KkoTalkMblPageController extends MblPageControllerSupport { + + private final KkoTalkService kkoTalkService; + private final IKkoTalkMapper kkoTalkMapper; + private final SendDetailMblPageRepository sendDetailMblPageRepository; + + @GetMapping(value = "/kko/talk/page/prnt") + public String mblPagePrnt(@RequestParam Map mParam, ModelMap model) { + final String token = mParam.get("token"); + final String envelopeId = mParam.get("envelopeId"); + final String externalId = mParam.get("externalId"); + + + try { + if (CmmnUtil.isEmpty(token) && CmmnUtil.isEmpty(envelopeId) && CmmnUtil.isEmpty(externalId)) + throw new EnsException(EnsErrCd.ERR410, "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다."); + + // 조직코드값 조회 + + Map param = new HashMap<>(); + param.put("envelopeId", envelopeId); + param.put("externalId", externalId); + SendMast sendMast = kkoTalkMapper.selectSendMastByExternalIdAndEnvelopeId(param) + .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, "문서를 찾을 수 없습니다.")); + + SendDetailKkoTalkDTO sendDetailKkoTalkDTO = kkoTalkMapper.findFetchByExternalIdAndEnvelopeId(param) + .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 자료가 없습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId))); + + + + EnsResponseVO responseVO = kkoTalkService.tokenVerify(sendMast.getOrgCd(), envelopeId, token, externalId); + if (!EnsErrCd.OK.equals(responseVO.getErrCode())) + throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg()); + + SendDetailMblPage sendDetailMblPage = sendDetailMblPageRepository.findById(SendDetailMblPageIds.builder() + .postSe(sendMast.getPostSe().getCode()) + .sendDetailId(sendDetailKkoTalkDTO.getSendDetailId()) + .build()) + .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 페이지데이터가 없습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId))); + + if (CmmnUtil.isEmpty(sendDetailMblPage.getDetails())) + throw new EnsException(EnsErrCd.ERR401, String.format("details 필드 값이 비어있습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId)); + + model.put("details", sendDetailMblPage.getDetails()); + + if ("Y".equals(sendDetailKkoTalkDTO.getMkBillUseYn())) { + Bill bill = kkoTalkMapper.selectBillByBillUid(sendDetailKkoTalkDTO.getBillUid()) + .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 결재 정보가 없습니다. [ bill_uid %s ]", sendDetailKkoTalkDTO.getBillUid()))); + model.put("payBtnInf", getJsonPayBtnInf(bill, sendMast)); + } + kkoTalkService.readCmplt(sendMast.getOrgCd(), envelopeId); + + } catch (EnsException e) { + model.put("errCode", e.getErrCd()); + model.put("errMsg", e.getMessage()); + model.put("details", "{}"); + } + + return "modules/mblpage/notiprnt"; + } +} diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/web/KkotalkApiController.java b/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkotalkApiController.java similarity index 100% rename from src/main/java/cokr/xit/ens/modules/kkotalk/web/KkotalkApiController.java rename to src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkotalkApiController.java diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/web/KkotalkController.java b/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkotalkController.java similarity index 99% rename from src/main/java/cokr/xit/ens/modules/kkotalk/web/KkotalkController.java rename to src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkotalkController.java index 64cd656..35f17ea 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/web/KkotalkController.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/presentation/KkotalkController.java @@ -1,4 +1,4 @@ -package cokr.xit.ens.modules.kkotalk.web; +package cokr.xit.ens.modules.kkotalk.presentation; import java.util.*; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e48e584..f3cefab 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -124,7 +124,7 @@ xit: host: ${xit.app.url}${xit.app.ctx} postse: intgrn: - # url: ${xit.app.url}${xit.app.ctx} + # url: ${xit.app.url}${xit.app.ctx} url: https://xit.co.kr path: /ens/kko/mydoc/noti/prnt kkomd: @@ -133,7 +133,7 @@ xit: # //FIXME: 카카오톡 추가 kkotalk: url: ${xit.app.url}${xit.app.ctx} - path: /kko/mydoc/page/prnt + path: /kko/talk/page/prnt nvst: url: ${xit.app.url}${xit.app.ctx} path: /nv/signtalk/page/prnt diff --git a/src/main/resources/config/conf-app.yml b/src/main/resources/config/conf-app.yml index 8d7c13d..33e48d8 100644 --- a/src/main/resources/config/conf-app.yml +++ b/src/main/resources/config/conf-app.yml @@ -2,11 +2,10 @@ app: access: auth: exclude: - uri: ${xit.app.ctx}/example/.*, ${xit.app.ctx}/kko/mydoc/.*, ${xit.app.ctx}/kko/alimtalk/.*, ${xit.app.ctx}/nv/signtalk/.*, ${xit.app.ctx}/kt/signtalk/.*, ${xit.app.ctx}/kt/gibis/.*, ${xit.app.ctx}/api/msg/result, ${xit.app.ctx}/iup/.*, ${xit.app.ctx}/traffic/.*, ${xit.app.ctx}/sys/mng/.*, ${xit.app.ctx}/sys/util/.*, ${xit.app.ctx}/intgrn/noti/.*, ${xit.app.ctx}/cmft/.*, ${xit.app.ctx}/bill/.* + uri: ${xit.app.ctx}/example/.*, ${xit.app.ctx}/kko/mydoc/.*, ${xit.app.ctx}/kko/talk/.*, ${xit.app.ctx}/kko/alimtalk/.*, ${xit.app.ctx}/nv/signtalk/.*, ${xit.app.ctx}/kt/signtalk/.*, ${xit.app.ctx}/kt/gibis/.*, ${xit.app.ctx}/api/msg/result, ${xit.app.ctx}/iup/.*, ${xit.app.ctx}/traffic/.*, ${xit.app.ctx}/sys/mng/.*, ${xit.app.ctx}/sys/util/.*, ${xit.app.ctx}/intgrn/noti/.*, ${xit.app.ctx}/cmft/.*, ${xit.app.ctx}/bill/.* pallel: thread: basic: cnt: 5 bill: cnt: 2 - diff --git a/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml b/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml index 157ec93..ed49855 100644 --- a/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml +++ b/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml @@ -139,6 +139,25 @@ + + + + SELECT send_detail_id, title,