fix: 카카오, KT-BC send, status 시군구코드 반영

dev
gitea-관리자 1 year ago
parent 127c5c660a
commit a50be22304

@ -3,12 +3,13 @@ package kr.xit.biz.mbl.model;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/** /**
* <pre> * <pre>
@ -30,8 +31,9 @@ public class MobilePageDTO {
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Builder @SuperBuilder
public static class MobilePageManage implements Serializable { @EqualsAndHashCode(callSuper = false)
public static class MobilePageManage extends CmmEnsRequestDTO {
/** /**
* id * id
@ -45,6 +47,12 @@ public class MobilePageDTO {
* *
*/ */
private String mobilePageCn; private String mobilePageCn;
private String signguCode;
private String ffnlgCode;
private String profile;
/** /**
* *
*/ */

@ -63,6 +63,8 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil
final MobilePageManage mobilePageManage = mapper.selectKkoMobilePage(reqDTO); final MobilePageManage mobilePageManage = mapper.selectKkoMobilePage(reqDTO);
if(mobilePageManage == null) throw BizRuntimeException.create("데이타 오류[내문서함 문서가 없습니다]"); if(mobilePageManage == null) throw BizRuntimeException.create("데이타 오류[내문서함 문서가 없습니다]");
reqDTO.setSignguCode(mobilePageManage.getSignguCode());
reqDTO.setFfnlgCode(mobilePageManage.getFfnlgCode());
final ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> res = kkoService.findMyDocReadyAndMblPage(reqDTO); final ApiResponseDTO<KkopayDocDTO.ValidTokenResponse> res = kkoService.findMyDocReadyAndMblPage(reqDTO);
if(!res.isSuccess()){ if(!res.isSuccess()){
return res; return res;

@ -292,7 +292,7 @@ public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implemen
CmmEnsRequestDTO.builder() CmmEnsRequestDTO.builder()
.signguCode(signguCode) .signguCode(signguCode)
.ffnlgCode(ffnlgCode) .ffnlgCode(ffnlgCode)
.profile("prod") .profile("")
.build()); .build());
} }
} }

@ -9,8 +9,6 @@ import javax.validation.Validation;
import javax.validation.Validator; import javax.validation.Validator;
import kr.xit.biz.common.ApiConstants; 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.CmmEnsRlaybsnmDTO;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid; import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver; import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq; import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq;
@ -32,7 +30,7 @@ import kr.xit.core.spring.annotation.TraceLogging;
import kr.xit.core.spring.util.ApiWebClientUtil; import kr.xit.core.spring.util.ApiWebClientUtil;
import kr.xit.core.support.utils.Checks; import kr.xit.core.support.utils.Checks;
import kr.xit.core.support.utils.JsonUtils; import kr.xit.core.support.utils.JsonUtils;
import kr.xit.ens.kakao.cmm.CmmKakaoUtils; import kr.xit.ens.kt.cmm.CmmKtMmsUtils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -110,7 +108,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
if(Checks.isEmpty(receiver.getBirthday())) Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다."); if(Checks.isEmpty(receiver.getBirthday())) Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다.");
} }
if(!Objects.requireNonNull(errors).isEmpty()) throw BizRuntimeException.create(errors.toString()); if(!Objects.requireNonNull(errors).isEmpty()) throw BizRuntimeException.create(errors.toString());
return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
/** /**
@ -128,7 +126,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
final String url = HOST final String url = HOST
+ API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid()) + API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
.replace("{tokens}", reqDTO.getToken()); .replace("{tokens}", reqDTO.getToken());
return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
/** /**
@ -149,7 +147,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
final String body = "{\"document\": {\"is_detail_read\": true} }"; final String body = "{\"document\": {\"is_detail_read\": true} }";
final String url = HOST + API_MODIFY_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid()); final String url = HOST + API_MODIFY_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
webClient.exchangeKko(url, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, Void.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); webClient.exchangeKko(url, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, Void.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
/** /**
@ -170,7 +168,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
validate(reqDTO, null); validate(reqDTO, null);
final String url = HOST + API_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid()); final String url = HOST + API_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
/** /**
@ -227,7 +225,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
/** /**
@ -257,7 +255,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
if(!errors.isEmpty()) { if(!errors.isEmpty()) {
throw BizRuntimeException.create(errors.toString()); throw BizRuntimeException.create(errors.toString());
} }
return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
} }
@Override @Override
@ -269,7 +267,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
// 유효성 검증 // 유효성 검증
final ValidTokenResponse validTokenRes = webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, final ValidTokenResponse validTokenRes = webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null,
ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); ValidTokenResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
if(!"USED".equals(validTokenRes.getToken_status())){ if(!"USED".equals(validTokenRes.getToken_status())){
return ApiResponseDTO.error(validTokenRes.getError_code(), validTokenRes.getError_message()); return ApiResponseDTO.error(validTokenRes.getError_code(), validTokenRes.getError_message());
@ -281,7 +279,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
// 정상 : HttpStatus.NO_CONTENT(204) return // 정상 : HttpStatus.NO_CONTENT(204) return
// error : body에 error_code, error_message return // error : body에 error_code, error_message return
final KkopayErrorDTO errorDTO = webClient.exchangeKko(url2, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, KkopayErrorDTO.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode())); final KkopayErrorDTO errorDTO = webClient.exchangeKko(url2, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, KkopayErrorDTO.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
if(errorDTO != null){ if(errorDTO != null){
return ApiResponseDTO.error(errorDTO.getErrorCode(), errorDTO.getErrorMessage()); return ApiResponseDTO.error(errorDTO.getErrorCode(), errorDTO.getErrorMessage());
} }
@ -308,13 +306,4 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
} }
return errList; return errList;
} }
private CmmEnsRlaybsnmDTO getEnsRlaybsnmDTO(final String signguCode, final String ffnlgCode){
return CmmKakaoUtils.getRlaybsnmInfo(
CmmEnsRequestDTO.builder()
.signguCode(signguCode)
.ffnlgCode(ffnlgCode)
.profile("prod")
.build());
}
} }

@ -8,6 +8,8 @@
SELECT tempm.sndng_detail_id SELECT tempm.sndng_detail_id
, tempm.sndng_se_code , tempm.sndng_se_code
, tempm.mobile_page_cn , tempm.mobile_page_cn
, tekmd.signgu_code
, tekmd.ffnlg_code
FROM tb_ens_kakao_my_doc tekmd FROM tb_ens_kakao_my_doc tekmd
JOIN tb_ens_mobile_page_manage tempm JOIN tb_ens_mobile_page_manage tempm
ON tekmd.sndng_detail_id = tempm.sndng_detail_id ON tekmd.sndng_detail_id = tempm.sndng_detail_id

Loading…
Cancel
Save