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.List;
import kr.xit.biz.cmm.service.ICmmEnsCacheService;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
@ -42,7 +43,6 @@ import org.springframework.stereotype.Service;
@RequiredArgsConstructor
@Service
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;
@Value("${contract.kt.api.dp-callback-url}")
@ -73,7 +73,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
CmmEnsRlaybsnmDTO.builder()
.signguCode(paramDTO.getSignguCode())
.ffnlgCode(paramDTO.getFfnlgCode())
.profile(profile)
.profile(ApiConstants.PROFILE)
.ktAccessToken(resDTO.getAccessToken())
.ktTokenExpiresIn(resDTO.getExpiresIn())
.ktScope(resDTO.getScope())
@ -121,7 +121,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
KtMainSendRequest.builder()
.signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode())
.profile(profile)
.profile(ApiConstants.PROFILE)
//.serviceCd("cache")
//.serviceKey("cache")
.msgCd("db")
@ -168,7 +168,7 @@ public class BizKtMmsService extends EgovAbstractServiceImpl implements IBizKtMm
KtMsgRsltRequest.builder()
.signguCode(reqDTO.getSignguCode())
.ffnlgCode(reqDTO.getFfnlgCode())
.profile(profile)
.profile(ApiConstants.PROFILE)
.reqs(reqs)
.build()
);

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

@ -2,6 +2,9 @@ package kr.xit.ens.kt.service;
import java.util.HashMap;
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.kt.KtAcmdDTO.KtAcmdCerfRequest;
import kr.xit.biz.ens.model.kt.KtAcmdDTO.KtAcmdCerfResponse;
@ -263,6 +266,14 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
@Override
@TraceLogging
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());
reqDTO.setServiceCd(ktMnsInfo.getKtServiceCode());
reqDTO.setSignguCode(null);
@ -270,13 +281,15 @@ public class KtMmsService extends EgovAbstractServiceImpl implements IKtMmsServi
reqDTO.setProfile(null);
CmmEnsUtils.validate(reqDTO);
return webClient.exchangeKt(
HOST + API_RESULT_MESSAGE,
HttpMethod.POST,
JsonUtils.toJson(reqDTO),
KtCommonResponse.class,
ktMnsInfo
);
//TODO :: BIZ 처리 반영 할것
// return webClient.exchangeKt(
// HOST + API_RESULT_MESSAGE,
// HttpMethod.POST,
// JsonUtils.toJson(reqDTO),
// KtCommonResponse.class,
// ktMnsInfo
// );
return null;
}
//------------------------------------------------------------------------------

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

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

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

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

Loading…
Cancel
Save