|
|
|
@ -93,7 +93,7 @@ public class KkoTalkSender extends SendProcTemplate {
|
|
|
|
|
sendRespBody = resp.getBody();
|
|
|
|
|
if (resp.getStatusCode() != HttpStatus.OK)
|
|
|
|
|
throw new EnsException(EnsErrCd.SEND620, String.format("전송요청 중.. %s %s", resp.getStatusCode().toString(), resp.getBody()));
|
|
|
|
|
EnsResponseVO mResponse = this.respMsgToMap(resp.getBody());
|
|
|
|
|
EnsResponseVO mResponse = this.respMsgToMap(sendRespBody);
|
|
|
|
|
if (!EnsErrCd.OK.equals(mResponse.getErrCode()))
|
|
|
|
|
throw new EnsException(mResponse.getErrCode(), mResponse.getErrMsg());
|
|
|
|
|
|
|
|
|
@ -305,9 +305,9 @@ public class KkoTalkSender extends SendProcTemplate {
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toMap(m -> String.valueOf(m.get("key")), m -> (Long) m.get("value"), (k1, k2) -> k1));
|
|
|
|
|
|
|
|
|
|
if(JsonUtils.isJson(respMsg)) {
|
|
|
|
|
EnsResponseVO<?> respVO = this.respMsgToMap(respMsg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (EnsErrCd.OK.equals(respVO.getErrCode())) {
|
|
|
|
|
Map<String, Object> mRespBody = (Map<String, Object>)respVO.getResultInfo();
|
|
|
|
|
List<Map<String, String>> documents = (List<Map<String, String>>)mRespBody.get("envelopeIds");
|
|
|
|
@ -323,7 +323,9 @@ public class KkoTalkSender extends SendProcTemplate {
|
|
|
|
|
m.put("value", mValue);
|
|
|
|
|
return m;
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toMap(m -> String.valueOf(m.get("key")), m -> (Map<String, String>) m.get("value"), (k1, k2) -> k1));
|
|
|
|
|
.collect(
|
|
|
|
|
Collectors.toMap(m -> String.valueOf(m.get("key")), m -> (Map<String, String>)m.get("value"),
|
|
|
|
|
(k1, k2) -> k1));
|
|
|
|
|
|
|
|
|
|
return sendMsgList.stream()
|
|
|
|
|
.map(row -> {
|
|
|
|
@ -368,6 +370,25 @@ public class KkoTalkSender extends SendProcTemplate {
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
return sendMsgList.stream()
|
|
|
|
|
.map(row -> {
|
|
|
|
|
//Map<String, String> property = (Map<String, String>) row.get("property");
|
|
|
|
|
String externalId = (String)row.get("externalId");
|
|
|
|
|
|
|
|
|
|
return SendDetailKkoTalkReqHist.builder()
|
|
|
|
|
.sendDetailId(mSendDetailIds.get(externalId))
|
|
|
|
|
.sendRawMsg(gson.toJson(row))
|
|
|
|
|
.externalId(externalId)
|
|
|
|
|
.respRawMsg(respMsg)
|
|
|
|
|
.error(FieldError.initBuilder()
|
|
|
|
|
.errorCode("")
|
|
|
|
|
.errorMessage(respMsg)
|
|
|
|
|
.build())
|
|
|
|
|
.build();
|
|
|
|
|
})
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private EnsResponseVO<?> respMsgToMap(String respMsg) {
|
|
|
|
@ -377,7 +398,7 @@ public class KkoTalkSender extends SendProcTemplate {
|
|
|
|
|
try {
|
|
|
|
|
mResp = gson.fromJson(respMsg, Map.class);
|
|
|
|
|
if (CmmnUtil.isEmpty(mResp.get("envelopeIds")))
|
|
|
|
|
throw new EnsException(EnsErrCd.SEND620, String.format("전송요청API 오류. documents 키값이 없습니다. %s", respMsg));
|
|
|
|
|
throw new EnsException(EnsErrCd.SEND620, String.format("전송요청API 오류. envelopeId 키값이 없습니다. %s", respMsg));
|
|
|
|
|
} catch (EnsException e) {
|
|
|
|
|
errCode = e.getErrCd();
|
|
|
|
|
errMsg = e.getMessage();
|
|
|
|
|