feat: 카카오톡 추가 반영 - 모바일 페이지 처리
parent
87885b91a7
commit
462de35545
@ -0,0 +1,90 @@
|
|||||||
|
package cokr.xit.ens.modules.kkotalk.presentation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.*;
|
||||||
|
import org.springframework.ui.*;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import cokr.xit.ens.core.aop.*;
|
||||||
|
import cokr.xit.ens.core.exception.*;
|
||||||
|
import cokr.xit.ens.core.exception.code.*;
|
||||||
|
import cokr.xit.ens.core.utils.*;
|
||||||
|
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.*;
|
||||||
|
import cokr.xit.ens.modules.common.ctgy.mblpage.domain.*;
|
||||||
|
import cokr.xit.ens.modules.common.ctgy.mblpage.domain.ids.*;
|
||||||
|
import cokr.xit.ens.modules.common.ctgy.mblpage.domain.repository.*;
|
||||||
|
import cokr.xit.ens.modules.common.ctgy.mblpage.presentation.*;
|
||||||
|
import cokr.xit.ens.modules.common.domain.*;
|
||||||
|
import cokr.xit.ens.modules.kkotalk.mapper.*;
|
||||||
|
import cokr.xit.ens.modules.kkotalk.model.*;
|
||||||
|
import cokr.xit.ens.modules.kkotalk.service.*;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.*;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.extern.slf4j.*;
|
||||||
|
|
||||||
|
@Tag(name = "KkoTalkMblPageController")
|
||||||
|
@Slf4j
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Controller
|
||||||
|
public class KkoTalkMblPageController extends MblPageControllerSupport {
|
||||||
|
|
||||||
|
private final KkoTalkService kkoTalkService;
|
||||||
|
private final IKkoTalkMapper kkoTalkMapper;
|
||||||
|
private final SendDetailMblPageRepository sendDetailMblPageRepository;
|
||||||
|
|
||||||
|
@GetMapping(value = "/kko/talk/page/prnt")
|
||||||
|
public String mblPagePrnt(@RequestParam Map<String, String> mParam, ModelMap model) {
|
||||||
|
final String token = mParam.get("token");
|
||||||
|
final String envelopeId = mParam.get("envelopeId");
|
||||||
|
final String externalId = mParam.get("externalId");
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (CmmnUtil.isEmpty(token) && CmmnUtil.isEmpty(envelopeId) && CmmnUtil.isEmpty(externalId))
|
||||||
|
throw new EnsException(EnsErrCd.ERR410, "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다.");
|
||||||
|
|
||||||
|
// 조직코드값 조회
|
||||||
|
|
||||||
|
Map<String, String> param = new HashMap<>();
|
||||||
|
param.put("envelopeId", envelopeId);
|
||||||
|
param.put("externalId", externalId);
|
||||||
|
SendMast sendMast = kkoTalkMapper.selectSendMastByExternalIdAndEnvelopeId(param)
|
||||||
|
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, "문서를 찾을 수 없습니다."));
|
||||||
|
|
||||||
|
SendDetailKkoTalkDTO sendDetailKkoTalkDTO = kkoTalkMapper.findFetchByExternalIdAndEnvelopeId(param)
|
||||||
|
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 자료가 없습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
EnsResponseVO<?> responseVO = kkoTalkService.tokenVerify(sendMast.getOrgCd(), envelopeId, token, externalId);
|
||||||
|
if (!EnsErrCd.OK.equals(responseVO.getErrCode()))
|
||||||
|
throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg());
|
||||||
|
|
||||||
|
SendDetailMblPage sendDetailMblPage = sendDetailMblPageRepository.findById(SendDetailMblPageIds.builder()
|
||||||
|
.postSe(sendMast.getPostSe().getCode())
|
||||||
|
.sendDetailId(sendDetailKkoTalkDTO.getSendDetailId())
|
||||||
|
.build())
|
||||||
|
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 페이지데이터가 없습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId)));
|
||||||
|
|
||||||
|
if (CmmnUtil.isEmpty(sendDetailMblPage.getDetails()))
|
||||||
|
throw new EnsException(EnsErrCd.ERR401, String.format("details 필드 값이 비어있습니다. [ envelopeId %s externalId %s ]", envelopeId, externalId));
|
||||||
|
|
||||||
|
model.put("details", sendDetailMblPage.getDetails());
|
||||||
|
|
||||||
|
if ("Y".equals(sendDetailKkoTalkDTO.getMkBillUseYn())) {
|
||||||
|
Bill bill = kkoTalkMapper.selectBillByBillUid(sendDetailKkoTalkDTO.getBillUid())
|
||||||
|
.orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("일치하는 결재 정보가 없습니다. [ bill_uid %s ]", sendDetailKkoTalkDTO.getBillUid())));
|
||||||
|
model.put("payBtnInf", getJsonPayBtnInf(bill, sendMast));
|
||||||
|
}
|
||||||
|
kkoTalkService.readCmplt(sendMast.getOrgCd(), envelopeId);
|
||||||
|
|
||||||
|
} catch (EnsException e) {
|
||||||
|
model.put("errCode", e.getErrCd());
|
||||||
|
model.put("errMsg", e.getMessage());
|
||||||
|
model.put("details", "{}");
|
||||||
|
}
|
||||||
|
|
||||||
|
return "modules/mblpage/notiprnt";
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package cokr.xit.ens.modules.kkotalk.web;
|
package cokr.xit.ens.modules.kkotalk.presentation;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
Loading…
Reference in New Issue