|
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.tags.*;
|
|
|
|
|
import kr.xit.biz.ens.model.ktgbs.*;
|
|
|
|
|
import kr.xit.biz.mbl.model.*;
|
|
|
|
|
import kr.xit.biz.mbl.service.*;
|
|
|
|
|
import kr.xit.core.consts.*;
|
|
|
|
|
import kr.xit.core.exception.*;
|
|
|
|
|
import lombok.*;
|
|
|
|
|
|
|
|
|
|
@ -55,13 +56,12 @@ public class MobilePageAsIsController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if ((StringUtils.isEmpty(documentBinderUuid) && StringUtils.isEmpty(envelopeId))
|
|
|
|
|
|| StringUtils.isEmpty(srcKey)) {
|
|
|
|
|
if (StringUtils.isEmpty(documentBinderUuid) && StringUtils.isEmpty(envelopeId) && StringUtils.isEmpty(srcKey)) {
|
|
|
|
|
throw BizRuntimeException.create("정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(documentBinderUuid) || !StringUtils.isEmpty(envelopeId)) {
|
|
|
|
|
return findKkoReadyAndMblData(
|
|
|
|
|
findKkoReadyAndMblData(
|
|
|
|
|
MobilePageDTO.KakaoValidTokenRequest.builder()
|
|
|
|
|
.document_binder_uuid(documentBinderUuid)
|
|
|
|
|
.envelopeId(envelopeId)
|
|
|
|
|
@ -73,21 +73,22 @@ public class MobilePageAsIsController {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
return findKtMblPage(token, srcKey, model);
|
|
|
|
|
findKtMblPage(token, srcKey, model);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (BizRuntimeException e) {
|
|
|
|
|
model.addAttribute("errCode", e.getErrorCode());
|
|
|
|
|
ErrorCode errorCode = e.getErrorCode();
|
|
|
|
|
String errCode = errorCode != null? errorCode.getHttpStatus().value() + "": ErrorCode.BAD_REQUEST.getHttpStatus().value() + "";
|
|
|
|
|
model.addAttribute("errCode", errCode);
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
return "notiprnt";
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.addAttribute("errCode", e.getMessage());
|
|
|
|
|
model.addAttribute("errCode", "500");
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
return "notiprnt";
|
|
|
|
|
}
|
|
|
|
|
return "notiPrnt";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String findKkoReadyAndMblData(final MobilePageDTO.KakaoValidTokenRequest reqDTO, Model model) {
|
|
|
|
|
private void findKkoReadyAndMblData(final MobilePageDTO.KakaoValidTokenRequest reqDTO, Model model) {
|
|
|
|
|
|
|
|
|
|
if ((StringUtils.isEmpty(reqDTO.getDocument_binder_uuid()) && StringUtils.isEmpty(reqDTO.getEnvelopeId()))
|
|
|
|
|
|| StringUtils.isEmpty(reqDTO.getToken())) {
|
|
|
|
|
@ -103,23 +104,18 @@ public class MobilePageAsIsController {
|
|
|
|
|
model.addAttribute("payButtonLinks", "{}");
|
|
|
|
|
|
|
|
|
|
} catch (BizRuntimeException e) {
|
|
|
|
|
model.addAttribute("errCode", e.getErrorCode());
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
model.addAttribute("details", "{}");
|
|
|
|
|
throw e;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.addAttribute("errCode", e.getMessage());
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
model.addAttribute("details", "{}");
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
return "notiPrnt";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String findKtMblPage(final String token, final String srcKey, Model model) {
|
|
|
|
|
public void findKtMblPage(final String token, final String srcKey, Model model) {
|
|
|
|
|
try {
|
|
|
|
|
final MobilePageDTO.MobilePageManage mobilePageManage = service.findKtGbsSignguCode(srcKey);
|
|
|
|
|
if(mobilePageManage == null) {
|
|
|
|
|
final List<MobilePageDTO.MobilePageManage> sigunguList = service.findKtGbsSignguCode(srcKey);
|
|
|
|
|
if(sigunguList.size() == 0 || sigunguList.size() > 1) {
|
|
|
|
|
throw BizRuntimeException.create(
|
|
|
|
|
String.format("정상적인 요청이 아닙니다. src_key를 확인해 주세요.\n(요청 src_key: %s)", srcKey));
|
|
|
|
|
String.format("정상적인 요청이 아닙니다. src_key를 확인해 주세요.(요청 src_key: %s)", srcKey));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
@ -147,8 +143,8 @@ public class MobilePageAsIsController {
|
|
|
|
|
model.addAttribute("details",
|
|
|
|
|
service.findKtGbsMblPage(
|
|
|
|
|
KtGbsDTO.TokenConfirmRequest.builder()
|
|
|
|
|
.signguCode(mobilePageManage.getSignguCode())
|
|
|
|
|
.ffnlgCode(mobilePageManage.getFfnlgCode())
|
|
|
|
|
.signguCode(sigunguList.get(0).getSignguCode())
|
|
|
|
|
.ffnlgCode(sigunguList.get(0).getFfnlgCode())
|
|
|
|
|
.token(token)
|
|
|
|
|
.srcKey(srcKey)
|
|
|
|
|
.build()
|
|
|
|
|
@ -156,14 +152,9 @@ public class MobilePageAsIsController {
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} catch (BizRuntimeException e) {
|
|
|
|
|
model.addAttribute("errCode", e.getErrorCode());
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
model.addAttribute("details", "{}");
|
|
|
|
|
throw e;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
model.addAttribute("errCode", e.getMessage());
|
|
|
|
|
model.addAttribute("errMsg", e.getMessage());
|
|
|
|
|
model.addAttribute("details", "{}");
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
return "notiPrnt";
|
|
|
|
|
}
|
|
|
|
|
}
|