refactor: Nice CI Accept, Send code refactoring

dev
Jonguk. Lim 1 month ago
parent 9565456542
commit 5aed628da0

@ -107,14 +107,37 @@ public class NiceCiAcceptService {
final String prefixBillUid = PostSeCd.intgrnNoti.getCode() + "-" + IdGenerator.getCurrentTimeSec(); final String prefixBillUid = PostSeCd.intgrnNoti.getCode() + "-" + IdGenerator.getCurrentTimeSec();
for(NiceCiDTO.InputXit xit : list){ for(NiceCiDTO.InputXit xit : list){
try {
processAccept(xit, prefixBillUid);
// FIXME: API 호출 에러
} catch (EnsException e) {
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
} catch (Exception e){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
}
private void processAccept(NiceCiDTO.InputXit xit, String prefixBillUid) throws Exception {
final KkoPayUrlRespData kkoPayUrlRespData = buildKkoPayUrlRespData(xit.getPayExpiresDt()); final KkoPayUrlRespData kkoPayUrlRespData = buildKkoPayUrlRespData(xit.getPayExpiresDt());
final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd()) final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd())
.orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm())); .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
NiceCiDTO.BillHistDTO billHistDTO = null; //List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits();
try { for (NiceCiDTO.InputDataXit data : xit.getInputDataXits()) {
List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits(); NiceCiDTO.BillHistDTO billHistDTO = new NiceCiDTO.BillHistDTO();
for (NiceCiDTO.InputDataXit data : inputDataXits) {
//---------------------------------------------------------- //----------------------------------------------------------
// pay Url API call & Get Result // pay Url API call & Get Result
@ -142,25 +165,6 @@ public class NiceCiAcceptService {
} }
xit.setPrcsCd(IupPrcsCd.GRUC.getCode()); xit.setPrcsCd(IupPrcsCd.GRUC.getCode());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit); niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
// FIXME: API 호출 에러
} catch (EnsException e) {
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
} catch (Exception e){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
} }
/** /**

Loading…
Cancel
Save