From 5c36a213f59bc6d6ded1f160c1bd878510aaeeb9 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Wed, 25 Sep 2024 11:35:24 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20FIXME=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intgrnnoti/domain/IntgrnSendDetail.java | 2 +- .../kkotalk/domain/SendDetailKkoTalk.java | 3 +- .../kkotalk/domain/TmpltMngKkoTalk.java | 21 +++----- .../repository/TmpltMngKkoTalkRepository.java | 5 +- .../TmpltMngKkoTalkRepositoryCustom.java | 9 ++-- .../TmpltMngKkoTalkRepositoryImpl.java | 21 ++++---- .../kkotalk/mapper/IKkoTalkMapper.java | 2 - .../ens/modules/kkotalk/model/KkotalkDTO.java | 1 - .../kkotalk/model/TmpltMngKkoTalkDTO.java | 1 - .../kkotalk/model/config/Document.java | 18 +++---- .../kkotalk/model/config/KkoTalkStat.java | 19 ++++--- .../model/struct/TmpltMngKkoTalkMapper.java | 15 ++---- .../kkotalk/service/KkoTalkService.java | 5 -- .../strategy/TmpltMngStrategyKkoTalk.java | 54 +++++++------------ .../service/support/KkoTalkAcceptor.java | 1 - .../service/support/KkoTalkApiService.java | 2 - .../kkotalk/service/support/KkoTalkMaker.java | 1 - .../service/support/KkoTalkRsltFetcher.java | 3 -- .../service/support/KkoTalkRsltProvider.java | 3 -- .../service/support/KkoTalkSender.java | 5 +- 20 files changed, 64 insertions(+), 127 deletions(-) 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 d89881f..212444a 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 @@ -14,7 +14,7 @@ import lombok.experimental.*; @Getter @ToString(exclude = {"intgrnSendMast"}) @SuperBuilder -@EqualsAndHashCode +@EqualsAndHashCode(callSuper = false) @NoArgsConstructor @AllArgsConstructor @Table(name = "ens_intgrn_snd_dtl", indexes = { 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 7bfb777..0e4f63d 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 @@ -9,10 +9,9 @@ import cokr.xit.ens.modules.kkotalk.code.*; import lombok.*; import lombok.experimental.*; -// FIXME: 카카오톡 신규 추가 @Entity @Getter -@ToString +@ToString(exclude = {"sendMast"}) @SuperBuilder @NoArgsConstructor @AllArgsConstructor diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/TmpltMngKkoTalk.java b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/TmpltMngKkoTalk.java index c0d806c..afd4213 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/TmpltMngKkoTalk.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/TmpltMngKkoTalk.java @@ -1,28 +1,21 @@ package cokr.xit.ens.modules.kkotalk.domain; -import java.util.Objects; +import java.util.*; -import javax.persistence.Column; -import javax.persistence.DiscriminatorValue; -import javax.persistence.Entity; -import javax.persistence.Table; +import javax.persistence.*; -import org.hibernate.proxy.HibernateProxy; +import org.hibernate.proxy.*; -import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.TmpltMng; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.ToString; -import lombok.experimental.SuperBuilder; +import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*; +import lombok.*; +import lombok.experimental.*; -// FIXME: 카카오톡 신규 추가 @Entity @Getter @ToString @SuperBuilder @NoArgsConstructor -@Table(name = "ens_tmplt_mng_kko_talk", schema = "", catalog = "") +@Table(name = "ens_tmplt_mng_kko_talk") @DiscriminatorValue("kkotalk") public class TmpltMngKkoTalk extends TmpltMng { diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepository.java b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepository.java index cdf8dc3..eb6d80b 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepository.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepository.java @@ -1,10 +1,9 @@ package cokr.xit.ens.modules.kkotalk.domain.repository; -import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.*; -import cokr.xit.ens.modules.kkotalk.domain.TmpltMngKkoTalk; +import cokr.xit.ens.modules.kkotalk.domain.*; -// FIXME: 카카오톡 신규 추가 public interface TmpltMngKkoTalkRepository extends JpaRepository, TmpltMngKkoTalkRepositoryCustom { } diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryCustom.java b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryCustom.java index 6d1e8df..2597809 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryCustom.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryCustom.java @@ -1,11 +1,10 @@ package cokr.xit.ens.modules.kkotalk.domain.repository; -import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.repository.TmpltMngRepositorySupport; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngSearchDTO; -import cokr.xit.ens.modules.kkotalk.domain.TmpltMngKkoTalk; -import cokr.xit.ens.modules.kkotalk.model.TmpltMngKkoTalkDTO; +import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.repository.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.model.*; +import cokr.xit.ens.modules.kkotalk.domain.*; +import cokr.xit.ens.modules.kkotalk.model.*; -// FIXME: 카카오톡 신규 추가 public interface TmpltMngKkoTalkRepositoryCustom extends TmpltMngRepositorySupport { } diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryImpl.java b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryImpl.java index 11e7efe..52041c7 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryImpl.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/domain/repository/TmpltMngKkoTalkRepositoryImpl.java @@ -3,21 +3,18 @@ package cokr.xit.ens.modules.kkotalk.domain.repository; import static cokr.xit.ens.modules.common.ctgy.sys.mng.domain.QOrgMng.*; import static cokr.xit.ens.modules.kkotalk.domain.QTmpltMngKkoTalk.*; -import java.util.List; -import java.util.Optional; +import java.util.*; -import com.querydsl.core.BooleanBuilder; -import com.querydsl.core.types.Projections; -import com.querydsl.core.types.QBean; -import com.querydsl.jpa.impl.JPAQueryFactory; +import com.querydsl.core.*; +import com.querydsl.core.types.*; +import com.querydsl.jpa.impl.*; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngSearchDTO; -import cokr.xit.ens.modules.kkotalk.domain.TmpltMngKkoTalk; -import cokr.xit.ens.modules.kkotalk.model.TmpltMngKkoTalkDTO; -import lombok.RequiredArgsConstructor; +import cokr.xit.ens.core.utils.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.model.*; +import cokr.xit.ens.modules.kkotalk.domain.*; +import cokr.xit.ens.modules.kkotalk.model.*; +import lombok.*; -// FIXME: 카카오톡 신규 추가 @RequiredArgsConstructor public class TmpltMngKkoTalkRepositoryImpl implements TmpltMngKkoTalkRepositoryCustom { 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 05eb8c8..4ad6cca 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 @@ -22,7 +22,6 @@ import cokr.xit.ens.modules.kkotalk.model.*; * * */ -// FIXME: 카카오톡 신규 추가 @Mapper public interface IKkoTalkMapper { void saveSndDtlKkoTalk(SendDetailKkoTalkDTO sendDetailKkoTalk); @@ -41,5 +40,4 @@ public interface IKkoTalkMapper { Optional selectSendMastByExternalIdAndEnvelopeId(final Map map); Optional selectBillByBillUid(final String billUid); - } 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 a52164b..c5e7fa7 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 @@ -26,7 +26,6 @@ import lombok.experimental.*; * * */ -// FIXME: 카카오톡 신규 추가 public class KkotalkDTO extends KkotalkApiDTO { //------------------ envelop ---------------------------------------------------------------------- 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 11cf716..a39f6f5 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 @@ -12,7 +12,6 @@ import io.swagger.v3.oas.annotations.media.*; import lombok.*; import lombok.experimental.*; -// FIXME: 카카오톡 신규 추가 @EqualsAndHashCode(callSuper = true) @Data @ToString diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/Document.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/Document.java index f738dee..33da0b5 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/Document.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/Document.java @@ -1,18 +1,14 @@ package cokr.xit.ens.modules.kkotalk.model.config; -import javax.validation.Valid; -import javax.validation.constraints.Size; +import javax.validation.*; +import javax.validation.constraints.*; -import cokr.xit.ens.modules.kkomydoc.model.config.XitProperty; -import cokr.xit.ens.modules.kkotalk.model.KkotalkApiDTO; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.ToString; -import lombok.experimental.SuperBuilder; +import cokr.xit.ens.modules.kkomydoc.model.config.*; +import cokr.xit.ens.modules.kkotalk.model.*; +import io.swagger.v3.oas.annotations.media.*; +import lombok.*; +import lombok.experimental.*; -// FIXME: 카카오톡 신규 추가 @Getter @ToString @SuperBuilder diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/KkoTalkStat.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/KkoTalkStat.java index ac6edd5..7bbff9c 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/KkoTalkStat.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/config/KkoTalkStat.java @@ -32,23 +32,22 @@ public class KkoTalkStat { @Schema(required = true, title = "진행 상태", example = " ") private KkoTalkStatusCd status; - @Schema(required = false, title = "송신 시간(yyyyMMddHHmmss)", example = " ") + @Schema(required = false, title = "송신 시간", example = " ") private String sentDt; - @Schema(required = false, title = "수신 시간(yyyyMMddHHmmss)", example = " ") + @Schema(required = false, title = "수신 시간", example = " ") private String receivedDt; - // FIXME: 카카오톡 적용 필요 - // @Schema(required = false, title = "열람 인증을 성공한 최초 시간(yyyyMMddHHmmss)", example = " ") + @Schema(required = false, title = "열람 인증을 성공한 최초 시간", example = " ") private String authenticatedAt; - // - // @Schema(required = false, title = "OTT 검증을 성공한 최초 시간(yyyyMMddHHmmss)", example = " ") + + @Schema(required = false, title = "OTT 검증을 성공한 최초 시간", example = " ") private String ottVerifiedAt; - // - // @Schema(required = false, title = "최초 열람 시간(yyyyMMddHHmmss)", example = " ") + + @Schema(required = false, title = "최초 열람 시간", example = " ") private String readAt; - // - // @Schema(required = false, title = "알림톡 수신 시간(yyyyMMddHHmmss)", example = " ") + + @Schema(required = false, title = "알림톡 수신 시간", example = " ") private String userNotifiedAt; @Schema(required = false, title = "에러코드", example = " ") diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/model/struct/TmpltMngKkoTalkMapper.java b/src/main/java/cokr/xit/ens/modules/kkotalk/model/struct/TmpltMngKkoTalkMapper.java index f25aba2..c6cacd3 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/model/struct/TmpltMngKkoTalkMapper.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/model/struct/TmpltMngKkoTalkMapper.java @@ -1,18 +1,13 @@ package cokr.xit.ens.modules.kkotalk.model.struct; -import org.mapstruct.Mapper; -import org.mapstruct.Mapping; +import org.mapstruct.*; -import cokr.xit.ens.core.mapstruct.GenericMapper; -import cokr.xit.ens.core.mapstruct.StructMapperConfig; -import cokr.xit.ens.modules.kkotalk.domain.TmpltMngKkoTalk; -import cokr.xit.ens.modules.kkotalk.model.TmpltMngKkoTalkDTO; +import cokr.xit.ens.core.mapstruct.*; +import cokr.xit.ens.modules.kkotalk.domain.*; +import cokr.xit.ens.modules.kkotalk.model.*; -// FIXME: 카카오톡 신규 추가 @Mapper(config = StructMapperConfig.class) public interface TmpltMngKkoTalkMapper extends GenericMapper { - - @Override @Mapping(target = "orgMng.orgCd", source = "orgCd") TmpltMngKkoTalk toEntity(TmpltMngKkoTalkDTO tmpltMngKkoTalkDTO); @@ -20,6 +15,4 @@ public interface TmpltMngKkoTalkMapper extends GenericMapper resp = kkoTalkApi.validToken( orgMng, KkotalkApiDTO.ValidTokenRequest.builder() @@ -326,7 +324,6 @@ public class KkoTalkService { throw new EnsException(EnsErrCd.ERR505, String.format("토큰검증 응답데이터 파싱 실패. %s", resp.getBody())); } - // FIXME: 카카오톡 적용 확인 String envelopeStatus = (String) mResponse.get("status"); if (!CmmnUtil.isEmpty(envelopeStatus)) { responseVO = EnsResponseVO.okBuilder() @@ -356,7 +353,6 @@ public class KkoTalkService { } finally { if (EnsErrCd.OK.equals(responseVO.getErrCode())) { Map resultInfo = (Map) responseVO.getResultInfo(); - // FIXME: 카카오톡 적용 확인 필요?? sendDetailKkoTalkTokenHistRepository.save(SendDetailKkoTalkTokenHist.builder() .envelopeId(envelopeId) .externalId(externalId) @@ -403,7 +399,6 @@ public class KkoTalkService { throw new EnsException(EnsErrCd.ERR401, "문서식별번호(은)는 필수조건 입니다."); OrgMng orgMng = orgMngService.find(orgCd).getResultInfo(); - // FIXME: 카카오툭 토큰 확인 API 호출 처리 ResponseEntity resp = kkoTalkApi.modifyStatus( orgMng, KkotalkDTO.EnvelopeId.builder() diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/strategy/TmpltMngStrategyKkoTalk.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/strategy/TmpltMngStrategyKkoTalk.java index f5633ff..425d588 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/strategy/TmpltMngStrategyKkoTalk.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/strategy/TmpltMngStrategyKkoTalk.java @@ -1,34 +1,25 @@ package cokr.xit.ens.modules.kkotalk.service.strategy; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; +import java.util.*; +import java.util.stream.*; + +import javax.validation.*; + +import org.mapstruct.factory.*; +import org.springframework.stereotype.*; + +import cokr.xit.ens.core.exception.*; +import cokr.xit.ens.core.exception.code.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.repository.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.model.*; +import cokr.xit.ens.modules.common.ctgy.sys.mng.service.strategy.*; +import cokr.xit.ens.modules.kkotalk.domain.*; +import cokr.xit.ens.modules.kkotalk.domain.repository.*; +import cokr.xit.ens.modules.kkotalk.model.*; +import cokr.xit.ens.modules.kkotalk.model.struct.*; +import lombok.*; -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; - -import org.mapstruct.factory.Mappers; -import org.springframework.stereotype.Component; - -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.OrgMng; -import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.repository.OrgMngRepository; -import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.repository.TmpltMngRepository; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngDTO; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngSearchDTO; -import cokr.xit.ens.modules.common.ctgy.sys.mng.service.strategy.TmpltMngStrategyTemplate; -import cokr.xit.ens.modules.kkotalk.domain.TmpltMngKkoTalk; -import cokr.xit.ens.modules.kkotalk.domain.repository.TmpltMngKkoTalkRepository; -import cokr.xit.ens.modules.kkotalk.model.TmpltMngKkoTalkDTO; -import cokr.xit.ens.modules.kkotalk.model.struct.TmpltMngKkoTalkMapper; -import lombok.RequiredArgsConstructor; - -// FIXME: 카카오톡 신규 추가 @Component("tmpltMngStrategy_kkotalk") @RequiredArgsConstructor public class TmpltMngStrategyKkoTalk extends TmpltMngStrategyTemplate, TmpltMngKkoTalkDTO> { @@ -37,7 +28,6 @@ public class TmpltMngStrategyKkoTalk extends TmpltMngStrategyTemplate findAll(TmpltMngSearchDTO tmpltMngSearchDTO) { @@ -47,10 +37,6 @@ public class TmpltMngStrategyKkoTalk extends TmpltMngStrategyTemplate find(String orgCd, String tmpltCd) { return tmpltMngKkoTalkRepository.findDtoByOrgCdAndTmpltCd(orgCd, tmpltCd); - -// String key = super.pushCache(redisTemplate, orgCd, tmpltCd, tmpltMngKkoMydocRepository); -// HashOperations hashOperations = redisTemplate.opsForHash(); -// return Optional.ofNullable(hashOperations.entries(KEY).get(key)); } @@ -97,7 +83,5 @@ public class TmpltMngStrategyKkoTalk extends TmpltMngStrategyTemplate */ -// FIXME: 카카오톡 신규 추가 @Slf4j @RequiredArgsConstructor @Component @@ -370,7 +369,6 @@ public class KkoTalkApiService { return responseEntity; } - // FIXME: 카카오톡 API 호출 시 API 호출 정보 추가 필요 private HttpHeaders getHeaders(final OrgMng orgMng){ HttpHeaders headers = new HttpHeaders(); headers.setContentType(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("utf-8"))); diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkMaker.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkMaker.java index ec803f5..1a6bbe5 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkMaker.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkMaker.java @@ -31,7 +31,6 @@ import cokr.xit.ens.modules.kkotalk.service.strategy.*; import lombok.*; import lombok.extern.slf4j.*; -// FIXME: 카카오톡 신규 추가 @Slf4j @Component @RequiredArgsConstructor diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltFetcher.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltFetcher.java index f0db530..af4a3ab 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltFetcher.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltFetcher.java @@ -32,7 +32,6 @@ import cokr.xit.ens.modules.kkotalk.model.*; import lombok.*; import lombok.extern.slf4j.*; -// FIXME: 카카오톡 신규 추가 @Slf4j @Component @RequiredArgsConstructor @@ -111,7 +110,6 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate { .build()) ); } finally { - // FIXME: 카카오톡 추가 - 카카오톡 테이블 업데이트 list .forEach(talkMapper::updateKakaotalkStatusBulksResult); @@ -135,7 +133,6 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate { if (EnsErrCd.OK.equals(respVO.getErrCode())) { sendMast.setError(FieldError.initBuilder().build()); - // FIXME: 카카오톡 코드 반영 필요 Integer readCnt = sendDetails.stream() .map(row -> KkoTalkStatusCd.READ.equals(row.getStatus()) ? 1 : 0) .reduce(Integer::sum) diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltProvider.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltProvider.java index 4278578..c6a8d12 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltProvider.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkRsltProvider.java @@ -21,7 +21,6 @@ import cokr.xit.ens.modules.kkotalk.model.config.*; import lombok.*; import lombok.extern.slf4j.*; -// FIXME: 카카오톡 신규 추가 @Slf4j @Component @RequiredArgsConstructor @@ -53,7 +52,6 @@ public class KkoTalkRsltProvider implements EnsPhaseProcSupport sendDetailKkoTalks = talkMapper.findAllBySendMastId(sendMast.getSendMastId()); - // FIXME: 카카오톡 적용 필요 KkoTalkRsltRespDTO respDTO = KkoTalkRsltRespDTO.builder() .sendMastId(sendMast.getSendMastId()) .statCd(sendMast.getStatCd()) @@ -71,7 +69,6 @@ public class KkoTalkRsltProvider implements EnsPhaseProcSupport Date: Wed, 25 Sep 2024 11:49:08 +0900 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=EC=9E=AC=EC=97=B4=EB=9E=8C=EB=A7=8C?= =?UTF-8?q?=EB=A3=8C=EC=9D=BC=EC=8B=9C=EC=99=80=20=EB=A7=88=EA=B0=90?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ens/modules/kkotalk/service/support/KkoTalkAcceptor.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java index 35effa0..67d6879 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java @@ -108,9 +108,8 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport, Kk if (!CmmnUtil.isEmpty(document.getReviewExpiresAt())) { String expDate = DateUtil.getTimeOfTimeT(document.getReviewExpiresAt(), "yyyyMMddHHmmss"); int sec = DateUtil.secByFromBetweenTo(DateUtil.toLocalDateTime(expDate), DateUtil.toLocalDateTime(reqDTO.getClose_dt())); - // FIXME: 테스트를 위해 skip - 테스트완료후 활성화 - // if (sec < 0) - // result.add(String.format("마감일시보다 \"재열람 만료일시\"가 느립니다. [ document[%d].acpt_data.kko_talk.readExpiresAt ]", i.get())); + if (sec < 0) + result.add(String.format("마감일시보다 \"재열람 만료일시\"가 느립니다. [ document[%d].acpt_data.kko_talk.readExpiresAt ]", i.get())); } } i.getAndIncrement(); From 7545312a8f6ccb6405879095fd232839f0e4d58a Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Wed, 25 Sep 2024 11:37:38 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=EC=B9=B4=EC=B9=B4=EC=98=A4=ED=86=A1?= =?UTF-8?q?=20=EC=9E=AC=EC=97=B4=EB=9E=8C=20=EB=A7=8C=EB=A3=8C=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EC=84=A4=EC=A0=95=20=EB=B0=98=EC=98=81=20=20=20=20?= =?UTF-8?q?=20=20=EC=B5=9C=EC=B4=88=EC=97=B4=EB=9E=8C=EB=A7=88=EA=B0=90?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=20+=201=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/mens-iup-query.sql | 160 +----------------- .../support/accept/AcptDocKkoTalk.java | 8 +- .../cokr/xit/ens/core/utils/DateUtil.java | 33 +++- 3 files changed, 37 insertions(+), 164 deletions(-) diff --git a/db/mens-iup-query.sql b/db/mens-iup-query.sql index 95d94ff..c20916f 100644 --- a/db/mens-iup-query.sql +++ b/db/mens-iup-query.sql @@ -1,47 +1,19 @@ Insert into TB_INPUT_XIT (LNK_INPUT_ID, ORG_CD, JOB_CD, TOT_CNT, PRCS_CD, RUN_DT, EXPIRES_DT, SEND_TYPE, REG_ID, REG_DT, PAY_EXPIRES_DT) Values - (302400001120, '0002', 'B0001', 1, 'TGRG', SYSDATE, SYSDATE + 30 + (302400001123, '0002', 'B0001', 1, 'TGRG', SYSDATE, SYSDATE + 30 , 'KP', 'cntc', SYSDATE, SYSDATE+30); Insert into TB_INPUT_DATA_XIT (LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY, GENDER, MSG_DATA, MSG_DTL_DATA, REG_ID, REG_DT, CAR_NO, CALL_CENTER_NO) Values - (302400001120, '300799990000000001120', '8312181157213', '김지호', '19831218','1' + (302400001123, '300799990000000001123', '8312181157213', '김지호', '19831218','1' , '{"~~@@!!CAR_NO!!@@~~":"20우3412","~~@@!!DEGREE!!@@~~":"3","~~@@!!FEE!!@@~~":"1,900","~~@@!!YYYY!!@@~~":"2022","~~@@!!MM!!@@~~":"03","~~@@!!DD!!@@~~":"11","~~@@!!BANK!!@@~~":"우체국","~~@@!!ACCOUNT!!@@~~":"8608-90-80907938","~~@@!!HISTORY!!@@~~":"-2021-11-29 12:33 (별내 550)\n-2021-11-29 12:19 (양주 900)\n-2021-11-30 14:33 (불암산② 450)","~~@@!!CALL_NO!!@@~~":"(031)522-6400~1","~~@@!!HOMEPAGE!!@@~~":"https://seoulbeltway.co.kr/main/esccar.jsp"}' , '{"details":[{"item_type":"TEXT","elements":[],"title":"미납통행료 안내문(1차)","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":"수도권제1순환고속도로 안내문(1차)이 도착하였습니다.\n미납통행료 종이고지서를 모바일 전자문서로 고지하고 있으며, 본 전자문서를 받으신 경우 종이고지서는 발송되지 않습니다.","title":"","properties":{"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"67어3853","key":"차량번호"},{"level":1,"value":"수도권제1순환","key":"미납발생\n노선명"},{"level":1,"value":"미납통행료 안내문(1차)","key":"고지서명"},{"level":1,"value":"1,260원","key":"납부하실 통행료"},{"level":1,"value":"1,260원","key":"- 미납통행료"},{"level":1,"value":"0원","key":"- 부가통행료"},{"level":1,"value":"2023년 06월 22일까지","key":"납부기한"}],"title":"안내내역","properties":{"use_toggle":false}},{"item_type":"TEXT","elements":[],"title":"상세내역","properties":{"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"2023-05-20 13:10","key":"통행일시"},{"level":1,"value":"양주","key":"통행영업소"},{"level":1,"value":"1,260 원","key":"통행요금"},{"level":1,"value":"SC잔액부족","key":"미납사유"}],"title":"","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":" \n","title":"","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":"※ 해당 통행을 포함하여 최근 1년 이내에 20회 이상 통행료 미납 시 누적 20회부터 즉시 부가통행료(미납통행료의 10배)가 미납통행료와 함께 부과될 수 있음을 알려드립니다.","title":"","properties":{"style":{"highlight":{"※ 해당 통행을 포함하여 최근 1년 이내에 20회 이상 통행료 미납 시 누적 20회부터 즉시 부가통행료(미납통행료의 10배)가 미납통행료와 함께 부과될 수 있음을 알려드립니다.":{"font-color":"black","font-weight":"bold"}}},"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"하단의 납부하기 클릭 또는\n가상계좌 납부\n(우체국 8608-89-80215603)","key":"납부방법"},{"level":1,"value":"수도권제1순환고속도로\n고객센터 ☎ (031)894-6300~1\n홈페이지 https://seoulbeltway.co.kr/main/esccar.jsp","key":"문의처"}],"title":"납부방법 및 문의처","properties":{"hyperlink":["https://seoulbeltway.co.kr/main/esccar.jsp"],"style":{"highlight":{"(031)894-6300~1":{"font-color":"blue","font-weight":"bold","font-size":"35px","use-clipboard":true},"우체국":{"font-weight":"bold"},"고객센터 ☎ ":{"font-color":"blue","font-weight":"bold","font-size":"35px"},"8608-89-80215603":{"font-weight":"bold","use-clipboard":true}}},"use_toggle":false}},{"item_type":"TABLE","elements":{"head":[""],"rows":[["발송처 : 민자도로 관리지원센터\n(044-211-3377)"]]},"title":"","properties":{"style":{"highlight":{"발송처 : 민자도로 관리지원센터":{"font-size":"25px"},"(044-211-3377)":{"font-size":"25px"}},"text_align":["right"]},"use_toggle":false}},{"item_type":"PAY_BUTTON","title":"납부하기"}]}' , 'cntc', SYSDATE, '20우3412', '1599-2509'); commit; - select - intgrnsend0_.int_send_detail_id as col_0_0_, - intgrnsend0_.linked_uuid as col_1_0_, - intgrnsend0_.cur_post_se as col_2_0_, - senddetail1_.status as col_3_0_, - senddetail1_.sent_at as col_4_0_, - senddetail1_.received_at as col_5_0_, - senddetail1_.authenticated_at as col_6_0_, - senddetail1_.ott_verified_at as col_7_0_, - senddetail1_.read_at as col_8_0_, - senddetail1_.user_notified_at as col_9_0_, - senddetail1_.error_code as col_10_0_, - senddetail1_.error_message as col_11_0_, - sendmast2_.error_code as col_12_0_, - sendmast2_.error_message as col_13_0_ - from - ens_intgrn_snd_dtl intgrnsend0_ - inner join - ens_snd_dtl_kko_talk senddetail1_ - on ( - senddetail1_.send_detail_id=intgrnsend0_.send_detail_id_kko_talk - ) - inner join - ens_snd_mast sendmast2_ - on senddetail1_.send_mast_id=sendmast2_.send_mast_id - where - intgrnsend0_.cur_post_se='kkoTalk' - and intgrnsend0_.int_send_mast_id=1553; @@ -71,131 +43,3 @@ select * from ENS_NICE_CI_MNG order by regist_dt desc; select to_char(to_timestamp(null, 'yyyy-mm-dd"T"hh24:mi:ss'), 'yyyymmddhh24miss') from dual; - - -select * - from ens_tmplt_mng etm - join ens_org_mng eom - on etm.ORG_CD = eom.ORG_CD - left join ens_tmplt_mng_intgrn etmi - on etm.ORG_CD = etmi.ORG_CD - and etm.TMPLT_CD = etmi.TMPLT_CD - left join ens_tmplt_mng_kko_at etmka - on etm.ORG_CD = etmka.ORG_CD - and etm.TMPLT_CD = etmka.TMPLT_CD - left join ens_tmplt_mng_kko_md etmkm - on etm.ORG_CD = etmkm.ORG_CD - and etm.TMPLT_CD = etmkm.TMPLT_CD - left join ens_tmplt_mng_kt_st etmks - on etm.ORG_CD = etmks.ORG_CD - and etm.TMPLT_CD = etmks.TMPLT_CD - left join ens_tmplt_mng_kt_gbs etmkg - on etm.ORG_CD = etmkg.ORG_CD - and etm.TMPLT_CD = etmkg.TMPLT_CD - left join ens_tmplt_mng_nv_st etmns - on etm.ORG_CD = etmns.ORG_CD - and etm.TMPLT_CD = etmns.TMPLT_CD - where etm.ORG_CD = '0001' - and etm.TMPLT_CD = 'A0001'; -select * from ens_org_mng where ORG_CD = '0001'; - -select * from ens_intgrn_snd_dtl; - -select * from TB_INPUT_XIT; -select * from TB_INPUT_DATA_XIT; -SELECT * FROM TB_SEND_RESULT_V2; - - - select - sendmast0_.send_mast_id as send_mast_id1_35_, - sendmast0_.last_updt_dt as last_updt_dt2_35_, - sendmast0_.regist_dt as regist_dt3_35_, - sendmast0_.accept_dt as accept_dt4_35_, - sendmast0_.close_dt as close_dt5_35_, - sendmast0_.error_code as error_code6_35_, - sendmast0_.error_message as error_message7_35_, - sendmast0_.org_cd as org_cd8_35_, - sendmast0_.post_bundle_title as post_bundle_title9_35_, - sendmast0_.read_cnt as read_cnt10_35_, - sendmast0_.send_cnt as send_cnt11_35_, - sendmast0_.send_dt as send_dt12_35_, - sendmast0_.stat_cd as stat_cd13_35_, - sendmast0_.tmplt_cd as tmplt_cd14_35_, - sendmast0_.vender as vender15_35_, - sendmast0_.post_se as post_se16_35_ - from - ens_snd_mast sendmast0_ - where - sendmast0_.send_mast_id=3302; - - select - intgrnsend0_.int_send_mast_id as col_0_0_ - from - ens_intgrn_snd_dtl intgrnsend0_ - inner join - ens_snd_dtl_kko_talk senddetail1_ - on ( - intgrnsend0_.send_detail_id_kko_talk=senddetail1_.send_detail_id - ) - where - senddetail1_.send_mast_id=3302 - group by - intgrnsend0_.int_send_mast_id; - - select - intgrnsend0_.int_send_mast_id as int_send_mast_id1_6_0_, - intgrnsend0_.last_updt_dt as last_updt_dt2_6_0_, - intgrnsend0_.regist_dt as regist_dt3_6_0_, - intgrnsend0_.accept_dt as accept_dt4_6_0_, - intgrnsend0_.close_dt as close_dt5_6_0_, - intgrnsend0_.error_code as error_code6_6_0_, - intgrnsend0_.error_message as error_message7_6_0_, - intgrnsend0_.org_cd as org_cd8_6_0_, - intgrnsend0_.post_bundle_title as post_bundle_title9_6_0_, - intgrnsend0_.read_cnt as read_cnt10_6_0_, - intgrnsend0_.send_cnt as send_cnt11_6_0_, - intgrnsend0_.send_dt as send_dt12_6_0_, - intgrnsend0_.stat_cd as stat_cd13_6_0_, - intgrnsend0_.tmplt_cd as tmplt_cd14_6_0_, - intgrnsend0_.vender as vender15_6_0_, - intgrnsend0_.try1 as try16_6_0_, - intgrnsend0_.try2 as try17_6_0_, - intgrnsend0_.try3 as try18_6_0_, - intgrnsend0_.try_cnt as try_cnt19_6_0_, - intgrnsend0_.try_seq as try_seq20_6_0_, - intgrnsend0_.try_stat_cd as try_stat_cd21_6_0_ - from - ens_intgrn_snd_mast intgrnsend0_ - where - intgrnsend0_.int_send_mast_id=2452;; select - intgrnsend0_.int_send_mast_id as int_send_mast_id1_6_0_, - intgrnsend0_.last_updt_dt as last_updt_dt2_6_0_, - intgrnsend0_.regist_dt as regist_dt3_6_0_, - intgrnsend0_.accept_dt as accept_dt4_6_0_, - intgrnsend0_.close_dt as close_dt5_6_0_, - intgrnsend0_.error_code as error_code6_6_0_, - intgrnsend0_.error_message as error_message7_6_0_, - intgrnsend0_.org_cd as org_cd8_6_0_, - intgrnsend0_.post_bundle_title as post_bundle_title9_6_0_, - intgrnsend0_.read_cnt as read_cnt10_6_0_, - intgrnsend0_.send_cnt as send_cnt11_6_0_, - intgrnsend0_.send_dt as send_dt12_6_0_, - intgrnsend0_.stat_cd as stat_cd13_6_0_, - intgrnsend0_.tmplt_cd as tmplt_cd14_6_0_, - intgrnsend0_.vender as vender15_6_0_, - intgrnsend0_.try1 as try16_6_0_, - intgrnsend0_.try2 as try17_6_0_, - intgrnsend0_.try3 as try18_6_0_, - intgrnsend0_.try_cnt as try_cnt19_6_0_, - intgrnsend0_.try_seq as try_seq20_6_0_, - intgrnsend0_.try_stat_cd as try_stat_cd21_6_0_ - from - 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/biz/iup/signtalk/service/support/accept/AcptDocKkoTalk.java b/src/main/java/cokr/xit/ens/biz/iup/signtalk/service/support/accept/AcptDocKkoTalk.java index c4de311..6996269 100644 --- a/src/main/java/cokr/xit/ens/biz/iup/signtalk/service/support/accept/AcptDocKkoTalk.java +++ b/src/main/java/cokr/xit/ens/biz/iup/signtalk/service/support/accept/AcptDocKkoTalk.java @@ -15,17 +15,15 @@ public class AcptDocKkoTalk implements Accept { @Override public KkotalkApiDTO.Envelope createDocument() { + final String readExpiresAt = DateUtil.getTimeTOfTime(tbInputDataXit.getTbInputXit().getPayExpiresDt().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))); return KkotalkApiDTO.Envelope.builder() .hash(null) .content( KkotalkApiDTO.Content.builder() .link(redirectUrl) .build()) - .readExpiresAt( - DateUtil.getTimeTOfTime(tbInputDataXit.getTbInputXit().getPayExpiresDt().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")))) - // FIXME: readExpiresAt + 1일로 설정 - .reviewExpiresAt( - "2024-10-30T23:59:59") + .readExpiresAt(readExpiresAt) + .reviewExpiresAt(DateUtil.getAddDayT(readExpiresAt, 1)) .build(); } } diff --git a/src/main/java/cokr/xit/ens/core/utils/DateUtil.java b/src/main/java/cokr/xit/ens/core/utils/DateUtil.java index 3b7f7d6..3cbe72d 100644 --- a/src/main/java/cokr/xit/ens/core/utils/DateUtil.java +++ b/src/main/java/cokr/xit/ens/core/utils/DateUtil.java @@ -15,6 +15,7 @@ import lombok.extern.slf4j.*; @Slf4j public class DateUtil { + private static final String DEFAULT_YMD_DT_FMT ="yyyy-MM-dd HH:mm:ss"; /** *
메소드 설명: 절대시간(단위: milliesecond)을 현재 시간으로 반환 한다.
@@ -415,7 +416,7 @@ public class DateUtil { */ public static String getTimeOfTimeT(String timeT, String fmt) { return LocalDateTime.parse(timeT, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")) - .format(DateTimeFormatter.ofPattern(StringUtils.isEmpty(fmt)? "yyyy-MM-dd HH:mm:ss": fmt)); + .format(DateTimeFormatter.ofPattern(StringUtils.isEmpty(fmt)? DEFAULT_YMD_DT_FMT: fmt)); } /** @@ -428,4 +429,34 @@ public class DateUtil { return LocalDateTime.parse(time, DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) .format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")); } + + /** + * 오늘 날짜 : 년-월-일 시분초 + * + * @param userFormat 사용자가 원하는 포멧 + * @return String + */ + public static String getTodayAndNowTime(final String userFormat) { + String pattern = ""; + + try { + pattern = DEFAULT_YMD_DT_FMT; + if (!org.apache.commons.lang3.StringUtils.isEmpty(userFormat)) { + pattern = userFormat; + } + } catch (Exception e) { + log.error("DateUtils::getTodayAndNowTime", e); + } + + return localDateTime().format(DateTimeFormatter.ofPattern(pattern)); + } + + /** + * LocalDateTime 객체 반환 + * + * @return LocalDateTime + */ + public static LocalDateTime localDateTime() { + return LocalDateTime.now(); + } } From ac6919ca58e3cf9c42b4370281d679f9edeb8a09 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Wed, 25 Sep 2024 11:49:08 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=EC=9E=AC=EC=97=B4=EB=9E=8C=EB=A7=8C?= =?UTF-8?q?=EB=A3=8C=EC=9D=BC=EC=8B=9C=EC=99=80=20=EB=A7=88=EA=B0=90?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=20=EC=9C=A0=ED=9A=A8=EC=84=B1=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/ens/core/utils/DateUtil.java | 148 ++++++++++++++++++ .../service/support/KkoTalkAcceptor.java | 4 +- 2 files changed, 150 insertions(+), 2 deletions(-) diff --git a/src/main/java/cokr/xit/ens/core/utils/DateUtil.java b/src/main/java/cokr/xit/ens/core/utils/DateUtil.java index 3cbe72d..37ad0ef 100644 --- a/src/main/java/cokr/xit/ens/core/utils/DateUtil.java +++ b/src/main/java/cokr/xit/ens/core/utils/DateUtil.java @@ -459,4 +459,152 @@ public class DateUtil { public static LocalDateTime localDateTime() { return LocalDateTime.now(); } + + /** + *
+     * 지난 날짜 확인 : 2020-06-22T23:20:32 ISO 시간 표기법에 따라 'T'를 꼭 붙여야 함.
+     * sourceDate > compareDate = true
+     * sourceDate < compareDate = false
+     * sourceDate == compareDate = false
+     *
+     * @param sourceDate  시작 년-월-일
+     * @param compareDate 비교 년-월-일
+     * @return boolean
+     * 
+ */ + public static boolean isAfterLocalDateTimeT(final String sourceDate, final String compareDate) { + boolean result = false; + + try { + LocalDateTime source = parseLocalDateTime(sourceDate); + result = source.isAfter(parseLocalDateTime(compareDate)); + } catch (Exception e) { + log.error("DateUtils::isAfterLocalDate", e); + } + + return result; + } + + /** + *
+     * 날자 add : 2020-06-22T23:20:32
+     * 빼기는 음수를 붙여서 넘기면 된다.
+     * ex : -1 = 빼기 1
+     *
+     * @param targetDate 계산할 년-월-일
+     * @param day        계산할 일
+     * @return String
+     * 
+ */ + public static String getAddDayT(final String targetDate, final int day) { + return getCalculatorDateAndTime(targetDate, 0, 0, day, 0, 0, 0); + } + + /** + * LocalDate.parse 객체 반환 + * + * @param target yyyy-MM-dd + * @return LocalDate.parse(tartget); + */ + public static LocalDate parseLocalDate(final String target) { + return LocalDate.parse(target); + } + + /** + * LocalDateTime.parse 객체 반환 + * + * @param target yyyy-MM-dd HH:mm:ss + * @return LocalDateTime.parse(tartget); + */ + public static LocalDateTime parseLocalDateTime(final String target) { + return LocalDateTime.parse(target); + } + + /** + *
+     * 현재시간을 microsecond 까지 포함한 형태로 반환
+     * yyyyMMddHHmmssSSSSSSS
+     * 
+     * @return String yyyyMMddHHmmssSSSSSSS 포맷으로
+     */
+    public static String getNowTimeMicrosecond() {
+        ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
+        // 6자리 나노초까지 포함된 포맷 지정
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSSS");
+        return now.format(formatter);
+    }
+
+    /**
+     * 
+     * 년 월 일 계산
+     * 날짜만 계산 년-월-일 형태로 넘겨줘야함(안그럼 예외)
+     * 해당월에 존재하지 않는 일을 넘겨도 예외
+     * 빼기는 음수를 붙여서 넘기면 된다.
+     * ex : -1 = 빼기 1
+     *
+     * @param targetDate 계산할 년-월-일
+     * @param year       계산할 년
+     * @param month      계산할 월
+     * @param day        계산할 일
+     * @return String
+     * 
+ */ + public static String getCalculatorDate(final String targetDate, final int year, final int month, final int day) { + String result = ""; + + try { + LocalDate localDate = parseLocalDate(targetDate); + localDate = localDate.plusYears(year); + localDate = localDate.plusMonths(month); + localDate = localDate.plusDays(day); + result = localDate.toString(); + } catch (Exception e) { + log.error("DateUtils::getCalculatorDate", e); + } + + return result; + } + + /** + *
+     * 날짜&시간 계산 년-월-일THH:mm:ss 형태(안그럼 예외)
+     * 2020-06-22T23:20:32 ISO 시간 표기법에 따라 'T'를 꼭 붙여야 함.
+     * 빼기는 음수를 붙여서 ex : -1 = 빼기 1
+     *
+     * @param targetDate 계산할 년-월-일T시:분:초
+     * @param year       계산할 년
+     * @param month      계산할 월
+     * @param day        계산할 일
+     * @param hour       계산할 시간
+     * @param minute     계산할 분
+     * @param second     계산할 초
+     * @return String
+     * 
+ */ + public static String getCalculatorDateAndTime(final String targetDate, final int year, final int month, final int day, int hour, int minute, int second) { + String result = ""; + + try { + LocalDateTime localDateTime = parseLocalDateTime(targetDate); + localDateTime = localDateTime.plusYears(year); + localDateTime = localDateTime.plusMonths(month); + localDateTime = localDateTime.plusDays(day); + localDateTime = localDateTime.plusHours(hour); + localDateTime = localDateTime.plusMinutes(minute); + localDateTime = localDateTime.plusSeconds(second); + result = localDateTime.toString(); + } catch (Exception e) { + log.error("DateUtils::getCalculatorDateAndTime", e); + } + + return result; + } + + public static void main(String[] args) { + System.out.println(getAddDayT("2024-10-30T23:59:59", 1)); + System.out.println(isAfterLocalDateTimeT("2024-10-30T23:59:59", "2024-10-30T23:59:58")); + System.out.println(isAfterLocalDateTimeT("2024-10-31T23:59:59", "2024-10-30T23:59:58")); + System.out.println(getNowTimeMicrosecond()); + System.out.println(getAddDayT(getTimeTOfTime("20241030235959"), 1)); + } } diff --git a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java index 67d6879..319dd59 100644 --- a/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java +++ b/src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java @@ -108,8 +108,8 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport, Kk if (!CmmnUtil.isEmpty(document.getReviewExpiresAt())) { String expDate = DateUtil.getTimeOfTimeT(document.getReviewExpiresAt(), "yyyyMMddHHmmss"); int sec = DateUtil.secByFromBetweenTo(DateUtil.toLocalDateTime(expDate), DateUtil.toLocalDateTime(reqDTO.getClose_dt())); - if (sec < 0) - result.add(String.format("마감일시보다 \"재열람 만료일시\"가 느립니다. [ document[%d].acpt_data.kko_talk.readExpiresAt ]", i.get())); + if (sec > 0) + result.add(String.format("마감일시보다 \"재열람 만료일시\"가 빠릅니다. [ document[%d].acpt_data.kko_talk.readExpiresAt ]", i.get())); } } i.getAndIncrement();