diff --git a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnbill/support/entity/Bill.java b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnbill/support/entity/Bill.java index ef0accf..1380afc 100644 --- a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnbill/support/entity/Bill.java +++ b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnbill/support/entity/Bill.java @@ -13,14 +13,14 @@ import lombok.experimental.*; @Entity @Getter -//@ToString +@ToString(exclude = {"orgMng" }) @NoArgsConstructor @AllArgsConstructor @SuperBuilder //@Inheritance(strategy = InheritanceType.JOINED) //@DiscriminatorColumn(name = "dtype") //@DiscriminatorValue("master") -@Table(name = "ens_bill", schema = "", catalog = "") +@Table(name = "ens_bill") @Schema(name = "Bill") public class Bill extends BillBaseEntity implements Serializable { @Id diff --git a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/domain/IntgrnSendDetail.java b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/domain/IntgrnSendDetail.java index 933286b..d89881f 100644 --- a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/domain/IntgrnSendDetail.java +++ b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/domain/IntgrnSendDetail.java @@ -12,7 +12,7 @@ import lombok.experimental.*; @Entity //@Data @Getter -//@ToString(exclude = {"intgrnSendMast"}) +@ToString(exclude = {"intgrnSendMast"}) @SuperBuilder @EqualsAndHashCode @NoArgsConstructor diff --git a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/service/support/IntgrnNotiSender.java b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/service/support/IntgrnNotiSender.java index 40b4b4b..cc63716 100644 --- a/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/service/support/IntgrnNotiSender.java +++ b/src/main/java/cokr/xit/ens/modules/common/ctgy/intgrnnoti/service/support/IntgrnNotiSender.java @@ -1,26 +1,22 @@ package cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support; -import java.util.Arrays; -import java.util.List; - -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.common.biztmplt.SendProcTemplate; -import cokr.xit.ens.modules.common.code.PostSeCd; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.TryStatCd; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendDetail; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendMast; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.IntgrnSendDetailRepository; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.IntgrnSendMastRepository; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; +import java.util.*; + +import org.springframework.context.*; +import org.springframework.stereotype.*; +import org.springframework.transaction.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.biztmplt.*; +import cokr.xit.ens.modules.common.code.*; +import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.*; +import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.*; +import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.*; +import lombok.*; +import lombok.extern.slf4j.*; // TODO: Send @Slf4j @@ -67,7 +63,7 @@ public class IntgrnNotiSender extends SendProcTemplate { @Override @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(Long intSendMastId) { + public EnsResponseVO execute(Long intSendMastId) { IntgrnSendMast intgrnSendMast = null; List intgrnSendDetails = null; diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/SendDetailKkoTalk.java b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/SendDetailKkoTalk.java index 304e1b6..2c4b07d 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/SendDetailKkoTalk.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/SendDetailKkoTalk.java @@ -12,6 +12,7 @@ import lombok.experimental.*; // FIXME: 카카오톡 신규 추가 @Entity @Getter +@ToString @SuperBuilder @NoArgsConstructor @AllArgsConstructor 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 40e5d53..c0fd595 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 @@ -27,6 +27,7 @@ import cokr.xit.ens.modules.kkotalk.model.*; public interface IKkoTalkMapper { void saveSndDtlKkoTalk(KkotalkDTO.SendDetailKkoTalkDTO sendDetailKkoTalk); void updateSndDtlKkoTalk(KkotalkDTO.SendDetailKkoTalkDTO sendDetailKkoTalk); + void updateKakaotalkSendBulksResult(KkotalkDTO.SendDetailKkoTalkDTO sendDetailKkoTalk); List findAllBySendMastId(Long sendMastId); diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkApiDTO.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkApiDTO.java index dac233e..0d8718a 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkApiDTO.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkApiDTO.java @@ -1,22 +1,17 @@ package cokr.xit.ens.modules.kkotalk.model; -import javax.validation.Valid; -import javax.validation.constraints.Pattern; -import javax.validation.constraints.Size; +import javax.validation.*; +import javax.validation.constraints.*; import org.hibernate.validator.constraints.NotEmpty; -import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.*; -import cokr.xit.ens.core.aop.IApiResponse; -import cokr.xit.ens.modules.kkotalk.ApiConstants; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; +import cokr.xit.ens.core.aop.*; +import cokr.xit.ens.modules.kkotalk.*; +import io.swagger.v3.oas.annotations.media.*; +import lombok.*; +import lombok.experimental.*; /** *
@@ -39,6 +34,7 @@ public class KkotalkApiDTO {
     //------------------- Envelope ------------------------------------------------------------------------------------------------
     @Schema(name = "Envelope", description = "문서발송(단건) 요청 파라메터 DTO")
     @Data
+    @ToString
     @NoArgsConstructor
     @AllArgsConstructor
     @SuperBuilder
@@ -160,6 +156,7 @@ public class KkotalkApiDTO {
 
     @Schema(name = "Content", description = "문서 원문 웹링크 또는 HTML")
     @Data
+    @ToString
     @NoArgsConstructor
     @AllArgsConstructor
     @SuperBuilder
diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkDTO.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkDTO.java
index 1dce06f..1ba3507 100644
--- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkDTO.java
+++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/KkotalkDTO.java
@@ -7,6 +7,7 @@ import javax.validation.*;
 import javax.validation.constraints.*;
 
 import cokr.xit.ens.core.model.*;
+import cokr.xit.ens.modules.common.domain.support.*;
 import cokr.xit.ens.modules.kkotalk.code.*;
 import cokr.xit.ens.modules.kkotalk.model.config.*;
 import io.swagger.v3.oas.annotations.media.*;
@@ -124,6 +125,7 @@ public class KkotalkDTO extends KkotalkApiDTO {
 
     @SuperBuilder
     @Data
+    @ToString
     @Schema(name = "SendDetailKkoTalkDTO")
     @NoArgsConstructor
     @AllArgsConstructor
@@ -147,7 +149,7 @@ public class KkotalkDTO extends KkotalkApiDTO {
         private Long sendMastId;
         private String errorCode;
         private String errorMessage;
-        //private FieldError error;
+        private FieldError error;
         private String mkBillUseYn;
         private String billUid;
 
diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/TmpltMngKkoTalkDTO.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/TmpltMngKkoTalkDTO.java
index 972c243..11cf716 100644
--- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/TmpltMngKkoTalkDTO.java
+++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/TmpltMngKkoTalkDTO.java
@@ -1,22 +1,21 @@
 package cokr.xit.ens.modules.kkotalk.model;
 
-import java.io.Serializable;
+import java.io.*;
 
 import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.Pattern;
+import javax.validation.constraints.*;
 
-import org.hibernate.validator.constraints.Length;
+import org.hibernate.validator.constraints.*;
 
-import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngByTypeDTO;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-import lombok.experimental.SuperBuilder;
+import cokr.xit.ens.modules.common.ctgy.sys.mng.model.*;
+import io.swagger.v3.oas.annotations.media.*;
+import lombok.*;
+import lombok.experimental.*;
 
 // FIXME: 카카오톡 신규 추가
 @EqualsAndHashCode(callSuper = true)
 @Data
+@ToString
 @SuperBuilder
 @NoArgsConstructor
 @Schema(name = "TmpltMngKkoTalkDTO")
diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkSender.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkSender.java
index c40431b..bcd3cb4 100644
--- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkSender.java
+++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkSender.java
@@ -107,13 +107,22 @@ public class KkoTalkSender extends SendProcTemplate {
                                 m -> (KkoTalkApiRespVO)m.get("value"), (k1, k2) -> k1));
 
                         list.stream()
-                            .forEach(row -> this.modifyTalkSendRsltByExtDocUuid(row, mApiResp));
+                            .forEach(row -> {
+                                this.modifyTalkSendRsltByExtDocUuid(row, mApiResp);
+
+                            });
 
                     } catch (EnsException e) {
 
                         list.stream()
                             .forEach(row -> {
                                 row.setStatus(KkoTalkStatusCd.SENT_FAIL);
+                                row.setError(
+                                    FieldError.initBuilder()
+                                        .errorCode(e.getErrCd().getCode())
+                                        .errorMessage(e.getMessage())
+                                        .build()
+                                );
                                 row.setErrorCode(e.getErrCd().getCode());
                                 row.setErrorMessage(e.getMessage());
                             });
@@ -122,10 +131,20 @@ public class KkoTalkSender extends SendProcTemplate {
                         list.stream()
                             .forEach(row -> {
                                 row.setStatus(KkoTalkStatusCd.SENT_FAIL);
+                                row.setError(
+                                    FieldError.initBuilder()
+                                        .errorCode(EnsErrCd.SEND500.getCode())
+                                        .errorMessage(e.getMessage())
+                                        .build()
+                                );
                                 row.setErrorCode(EnsErrCd.SEND500.getCode());
                                 row.setErrorMessage(e.getMessage());
                             });
                     } finally {
+                        // FIXME: 카카오톡 추가 - 카카오톡 테이블 업데이트
+                        list.stream()
+                            .forEach(talkMapper::updateKakaotalkSendBulksResult);
+
                         if (!CmmnUtil.isEmpty(envelopes))
                             sendDetailKkoTalkReqHistRepository.saveAll(
                                 this.toSendDetailReqHist(list, JsonUtils.toJson(envelopes), sendRespBody));
@@ -139,7 +158,7 @@ public class KkoTalkSender extends SendProcTemplate {
             if (cntSuccess.get() > 0)
                 respVO = EnsResponseVO.okBuilder()
                     .resultInfo(sendDetails.stream()
-                        .map(row -> this.toResultInfo(row))
+                        .map(this::toResultInfo)
                         .collect(Collectors.toList()))
                     .build();
             else
@@ -265,9 +284,13 @@ public class KkoTalkSender extends SendProcTemplate {
         if (CmmnUtil.isEmpty(apiRespVO.getErrorCode())) {
             row.setStatus(KkoTalkStatusCd.SENT);
             row.setEnvelopeId(String.valueOf(apiRespVO.getData()));
-            //row.setErrorCode(FieldError.initBuilder().build());
+            row.setError(FieldError.initBuilder().build());
         } else {
             row.setStatus(KkoTalkStatusCd.valueOfEnum(apiRespVO.getErrorCode()));
+            row.setError(FieldError.initBuilder()
+                .errorCode(EnsErrCd.SEND630.getCode())
+                .errorMessage(String.format("%s %s", apiRespVO.getErrorCode(), apiRespVO.getErrorMessage()))
+                .build());
             row.setErrorCode(EnsErrCd.SEND630.getCode());
             row.setErrorMessage(String.format("%s %s", apiRespVO.getErrorCode(), apiRespVO.getErrorMessage()));
         }
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 e9d6cf9..f29fe15 100644
--- a/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml
+++ b/src/main/resources/mybatis-mapper/modules/iup-kkotalk-mapper.xml
@@ -73,6 +73,19 @@
              , last_updt_dt = sysdate
          WHERE send_detail_id = #{sendDetailId}
     
+
+    
+        /** iup-kkotalk-mapper|updateKakaotalkSendBulksResult-카카오톡 문서요청 결과 반영|limju  */
+        UPDATE ens_snd_dtl_kko_talk
+           SET external_id = #{externalId}
+             , envelope_id = #{envelopeId}
+             , status = #{status}
+             , error_code = #{errorCode}
+             , error_message = #{errorMessage}
+             , last_updt_dt = sysdate
+         WHERE send_detail_id = #{sendDetailId}
+    
+