feat: KT 사전/본 문자 수신 결과 전송 API 반영중

dev
gitea-관리자 1 year ago
parent 8c3e576465
commit c00b6f545e

@ -3,6 +3,7 @@ package kr.xit.biz.kt.service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import kr.xit.biz.cmm.service.ICmmEnsCacheService; import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode; import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
@ -42,7 +43,6 @@ import org.springframework.stereotype.Service;
@RequiredArgsConstructor @RequiredArgsConstructor
@Service @Service
public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMmsService { public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMmsService {
private static final String profile = System.getProperty("spring.profiles.active");
private static final int MAX_KT_SEND_CNT = 100; private static final int MAX_KT_SEND_CNT = 100;
@Value("${contract.kt.api.dp-callback-url}") @Value("${contract.kt.api.dp-callback-url}")
@ -73,7 +73,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
CmmEnsRlaybsnmDTO.builder() CmmEnsRlaybsnmDTO.builder()
.signguCode(paramDTO.getSignguCode()) .signguCode(paramDTO.getSignguCode())
.ffnlgCode(paramDTO.getFfnlgCode()) .ffnlgCode(paramDTO.getFfnlgCode())
.profile(profile) .profile(ApiConstants.PROFILE)
.ktAccessToken(resDTO.getAccessToken()) .ktAccessToken(resDTO.getAccessToken())
.ktTokenExpiresIn(resDTO.getExpiresIn()) .ktTokenExpiresIn(resDTO.getExpiresIn())
.ktScope(resDTO.getScope()) .ktScope(resDTO.getScope())
@ -121,7 +121,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
KtMainSendRequest.builder() KtMainSendRequest.builder()
.signguCode(reqDTO.getSignguCode()) .signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode()) .ffnlgCode(reqDTO.getFfnlgCode())
.profile(profile) .profile(ApiConstants.PROFILE)
//.serviceCd("cache") //.serviceCd("cache")
//.serviceKey("cache") //.serviceKey("cache")
.msgCd("db") .msgCd("db")
@ -168,7 +168,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
KtMsgRsltRequest.builder() KtMsgRsltRequest.builder()
.signguCode(reqDTO.getSignguCode()) .signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode()) .ffnlgCode(reqDTO.getFfnlgCode())
.profile(profile) .profile(ApiConstants.PROFILE)
.reqs(reqs) .reqs(reqs)
.build() .build()
); );

@ -3,6 +3,7 @@ package kr.xit.ens.kt.cmm;
import egovframework.com.cmm.EgovMessageSource; import egovframework.com.cmm.EgovMessageSource;
import java.util.Objects; import java.util.Objects;
import kr.xit.biz.cmm.service.ICmmEnsCacheService; import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kt.KtCommonDTO.KtMnsRequest; import kr.xit.biz.ens.model.kt.KtCommonDTO.KtMnsRequest;
@ -37,8 +38,6 @@ public class CmmKtMmsUtils {
private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService(); private static final ICmmEnsCacheService cacheService = ApiSpringUtils.getCmmEnsCacheService();
private static final IKtMmsService ktMmsService = ApiSpringUtils.getKtMmsService(); private static final IKtMmsService ktMmsService = ApiSpringUtils.getKtMmsService();
private static final String profile = System.getProperty("spring.profiles.active");
/** /**
* KT MMS * KT MMS
* @return * @return
@ -47,7 +46,7 @@ public class CmmKtMmsUtils {
CmmEnsRequestDTO ensDTO = CmmEnsRequestDTO.builder() CmmEnsRequestDTO ensDTO = CmmEnsRequestDTO.builder()
.signguCode(signguCode) .signguCode(signguCode)
.ffnlgCode(ffnlgCode) .ffnlgCode(ffnlgCode)
.profile(profile) .profile(ApiConstants.PROFILE)
.build(); .build();
final CmmEnsRlaybsnmDTO dto = cacheService.getRlaybsnmInfoCache(ensDTO); final CmmEnsRlaybsnmDTO dto = cacheService.getRlaybsnmInfoCache(ensDTO);
@ -63,7 +62,7 @@ public class CmmKtMmsUtils {
KtMnsRequest.builder() KtMnsRequest.builder()
.signguCode(signguCode) .signguCode(signguCode)
.ffnlgCode(ffnlgCode) .ffnlgCode(ffnlgCode)
.profile(profile) .profile(ApiConstants.PROFILE)
.build() .build()
); );
return cacheService.getRlaybsnmInfoCache(ensDTO); return cacheService.getRlaybsnmInfoCache(ensDTO);

@ -2,6 +2,9 @@ package kr.xit.ens.kt.service;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.KtServiceCode;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO; import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfRequest; import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfResponse; import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfResponse;
@ -263,6 +266,14 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
@Override @Override
@TraceLogging @TraceLogging
public KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO) { public KtCommonResponse messageResult(final KtMsgRsltRequest reqDTO) {
switch(KtServiceCode.compare(reqDTO.getServiceCd())){
case SISUL -> reqDTO.setSignguCode(SignguCode.TRAFFIC.getCode());
case CHUMO -> reqDTO.setSignguCode(SignguCode.FUNERAL.getCode());
}
reqDTO.setFfnlgCode(ApiConstants.FFNLN_CODE);
reqDTO.setProfile(ApiConstants.PROFILE);
final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()); final CmmEnsRlaybsnmDTO ktMnsInfo = CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode()); reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setSignguCode(null); reqDTO.setSignguCode(null);
@ -270,13 +281,15 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
reqDTO.setProfile(null); reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO); CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt( //TODO :: BIZ 처리 반영 할것
HOST + API_RESULT_MESSAGE, // return webClient.exchangeKt(
HttpMethod.POST, // HOST + API_RESULT_MESSAGE,
JsonUtils.toJson(reqDTO), // HttpMethod.POST,
KtCommonResponse.class, // JsonUtils.toJson(reqDTO),
ktMnsInfo // KtCommonResponse.class,
); // ktMnsInfo
// );
return null;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

@ -77,8 +77,6 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
@Value("${contract.kt.api.bulkstatus}") @Value("${contract.kt.api.bulkstatus}")
private String apiKtBcBulkStatus; private String apiKtBcBulkStatus;
private static final String profile = System.getProperty("spring.profiles.active");
private final IEnsBatchRequireNewService requireNewService; private final IEnsBatchRequireNewService requireNewService;
private final ApiWebClientUtil apiWebClient; private final ApiWebClientUtil apiWebClient;
private final IEnsBatchMapper mapper; private final IEnsBatchMapper mapper;
@ -138,7 +136,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
for (EnsDTO.SndngMssageParam dto : list) { for (EnsDTO.SndngMssageParam dto : list) {
dto.setSignguCode(reqDTO.getSignguCode()); dto.setSignguCode(reqDTO.getSignguCode());
dto.setFfnlgCode(reqDTO.getFfnlgCode()); dto.setFfnlgCode(reqDTO.getFfnlgCode());
dto.setProfile(profile); dto.setProfile(ApiConstants.PROFILE);
final List<String> mstIdList = new ArrayList<>(); final List<String> mstIdList = new ArrayList<>();
String mstId = ""; String mstId = "";
if (!Objects.equals(mstId, dto.getUnitySndngMastrId())) { if (!Objects.equals(mstId, dto.getUnitySndngMastrId())) {
@ -226,7 +224,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
dto.setSignguCode(reqDTO.getSignguCode()); dto.setSignguCode(reqDTO.getSignguCode());
dto.setFfnlgCode(reqDTO.getFfnlgCode()); dto.setFfnlgCode(reqDTO.getFfnlgCode());
dto.setProfile(profile); dto.setProfile(ApiConstants.PROFILE);
dto.setSndngProcessSttus(reqDTO.getSndngProcessSttus()); dto.setSndngProcessSttus(reqDTO.getSndngProcessSttus());
dto.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.MAKE_OK.getCode()); dto.setNewSndngProcessSttus(ApiConstants.SndngProcessStatus.MAKE_OK.getCode());
//FIXME: try1,try2,tr3이 있는 경우 try1 이전에 try2,3이 실행될 수 있는 경우??? //FIXME: try1,try2,tr3이 있는 경우 try1 이전에 try2,3이 실행될 수 있는 경우???
@ -242,7 +240,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
dto.setSignguCode(reqDTO.getSignguCode()); dto.setSignguCode(reqDTO.getSignguCode());
dto.setFfnlgCode(reqDTO.getFfnlgCode()); dto.setFfnlgCode(reqDTO.getFfnlgCode());
dto.setProfile(profile); dto.setProfile(ApiConstants.PROFILE);
//try2 발송 대상이 있는지 확인 //try2 발송 대상이 있는지 확인
final int sendCnt = mapper.selectSendOkTgts(dto); final int sendCnt = mapper.selectSendOkTgts(dto);
@ -297,7 +295,7 @@ public class EnsBatchService extends EgovAbstractServiceImpl implements IEnsBatc
for (EnsDTO.SndngMssageParam tgtDTO : tgtList) { for (EnsDTO.SndngMssageParam tgtDTO : tgtList) {
tgtDTO.setSignguCode(reqDTO.getSignguCode()); tgtDTO.setSignguCode(reqDTO.getSignguCode());
tgtDTO.setFfnlgCode(reqDTO.getFfnlgCode()); tgtDTO.setFfnlgCode(reqDTO.getFfnlgCode());
tgtDTO.setProfile(profile); tgtDTO.setProfile(ApiConstants.PROFILE);
MDC.put(UNITY_SNDNG_MST_ID, tgtDTO.getUnitySndngMastrId()); MDC.put(UNITY_SNDNG_MST_ID, tgtDTO.getUnitySndngMastrId());
MDC.put("sndngMastrId", tgtDTO.getSndngMastrId()); MDC.put("sndngMastrId", tgtDTO.getSndngMastrId());

@ -2,6 +2,7 @@ package kr.xit.core.biz.batch.service;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import kr.xit.biz.common.ApiConstants;
import kr.xit.core.biz.batch.mapper.IBatchCmmMapper; import kr.xit.core.biz.batch.mapper.IBatchCmmMapper;
import kr.xit.core.biz.batch.model.BatchCmmDTO.BatchCmmRequest; import kr.xit.core.biz.batch.model.BatchCmmDTO.BatchCmmRequest;
import kr.xit.core.biz.batch.model.BatchCmmDTO.BatchLock; import kr.xit.core.biz.batch.model.BatchCmmDTO.BatchLock;
@ -28,7 +29,6 @@ import org.springframework.transaction.annotation.Transactional;
*/ */
@Service @Service
public class BatchCmmService extends EgovAbstractServiceImpl implements IBatchCmmService { public class BatchCmmService extends EgovAbstractServiceImpl implements IBatchCmmService {
private static final String profile = System.getProperty("spring.profiles.active");
private final IBatchCmmMapper mapper; private final IBatchCmmMapper mapper;
public BatchCmmService(IBatchCmmMapper mapper) { public BatchCmmService(IBatchCmmMapper mapper) {
@ -78,7 +78,7 @@ public class BatchCmmService extends EgovAbstractServiceImpl implements IBatchCm
@Transactional(readOnly = true) @Transactional(readOnly = true)
public String execBatch(final BatchCmmRequest reqDTO){ public String execBatch(final BatchCmmRequest reqDTO){
BatchLock rtnDTO = mapper.selectBatchLock(reqDTO.getInstanceId()).orElseThrow(() -> BizRuntimeException.create("배치 인스턴스를 찾을 수 없습니다.")); BatchLock rtnDTO = mapper.selectBatchLock(reqDTO.getInstanceId()).orElseThrow(() -> BizRuntimeException.create("배치 인스턴스를 찾을 수 없습니다."));
reqDTO.setProfile(profile); reqDTO.setProfile(ApiConstants.PROFILE);
String uri = rtnDTO.getInstanceUrl(); String uri = rtnDTO.getInstanceUrl();

@ -35,7 +35,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/batch/cmm/v1") @RequestMapping("/batch/cmm/v1")
public class BatchCmmController { public class BatchCmmController {
private static final String profile = System.getProperty("spring.profiles.active");
private static final String PARAM1 = """ private static final String PARAM1 = """
{ {
"signguCode": "88328", "signguCode": "88328",

@ -21,6 +21,7 @@ import lombok.Getter;
*/ */
public class ApiConstants { public class ApiConstants {
public static final String PROFILE = System.getProperty("spring.profiles.active");
public static final String FFNLN_CODE = "11"; public static final String FFNLN_CODE = "11";
/** /**
@ -199,4 +200,13 @@ public class ApiConstants {
SYM_KEY, SYM_KEY,
CI CI
} }
public enum KtServiceCode {
SISUL,
CHUMO;
public static KtServiceCode compare(final String en){
return valueOf(en);
}
}
} }

Loading…
Cancel
Save