@@ -24,7 +24,21 @@ public class YgzCardBlackUploadManager extends AbstractCommNioManager implements | |||
long begin = System.currentTimeMillis(); | |||
CardBlackUploadNioRequest nioRequest = toNioRequest(request.getStatus(), request.getBlackType(), request.getCardId(), request.getCreationTime(), request.getDataSource()); | |||
CardBlackUploadNioResponse nioResponse = (CardBlackUploadNioResponse) sendRequest(nioRequest, CardBlackUploadNioResponse.class); | |||
return onSuccess(request, new YgzCardBlackUploadResponse().setUploadStatus(nioResponse.getUploadStatus()), YgzInterfaceLog.class, System.currentTimeMillis() - begin); | |||
if (nioResponse == null || !hasText(nioResponse.getStatusCode())) { | |||
YgzCardBlackUploadResponse response = new YgzCardBlackUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg("接口无法返回值"); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, "接口无法返回值"); | |||
} | |||
if (hasText(nioResponse.getErrorMsg())) { | |||
YgzCardBlackUploadResponse response = new YgzCardBlackUploadResponse(); | |||
response.setUploadStatus(nioResponse.getUploadStatus()); | |||
response.setSuccess(false); | |||
response.setMsg(nioResponse.getErrorMsg()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, nioResponse.getErrorMsg()); | |||
} else { | |||
return onSuccess(request, new YgzCardBlackUploadResponse().setUploadStatus(nioResponse.getUploadStatus()), YgzInterfaceLog.class, System.currentTimeMillis() - begin); | |||
} | |||
} | |||
private CardBlackUploadNioRequest toNioRequest(final Integer status, final Integer blackType, final String cardId, final LocalDateTime creationTime, final DataSourceEnum dataSource) { |
@@ -24,7 +24,21 @@ public class YgzObuBlackUploadManager extends AbstractCommNioManager implements | |||
long begin = System.currentTimeMillis(); | |||
ObuBlackUploadNioRequest nioRequest = toNioRequest(request.getStatus(), request.getBlackType(), request.getObuId(), request.getCreationTime(), request.getDataSource()); | |||
ObuBlackUploadNioResponse nioResponse = (ObuBlackUploadNioResponse) sendRequest(nioRequest, ObuBlackUploadNioResponse.class); | |||
return onSuccess(request, new YgzObuBlackUploadResponse().setUploadStatus(nioResponse.getUploadStatus()), YgzInterfaceLog.class, System.currentTimeMillis() - begin); | |||
if (nioResponse == null || !hasText(nioResponse.getStatusCode())) { | |||
YgzObuBlackUploadResponse response = new YgzObuBlackUploadResponse(); | |||
response.setSuccess(false); | |||
response.setMsg("接口无法返回值"); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, "接口无法返回值"); | |||
} | |||
if (hasText(nioResponse.getErrorMsg())) { | |||
YgzObuBlackUploadResponse response = new YgzObuBlackUploadResponse(); | |||
response.setUploadStatus(nioResponse.getUploadStatus()); | |||
response.setSuccess(false); | |||
response.setMsg(nioResponse.getErrorMsg()); | |||
return onFailed(request, response, YgzInterfaceLog.class, System.currentTimeMillis() - begin, nioResponse.getErrorMsg()); | |||
} else { | |||
return onSuccess(request, new YgzObuBlackUploadResponse().setUploadStatus(nioResponse.getUploadStatus()), YgzInterfaceLog.class, System.currentTimeMillis() - begin); | |||
} | |||
} | |||
private ObuBlackUploadNioRequest toNioRequest(final Integer status, final Integer blackType, final String obuId, final LocalDateTime creationTime, final DataSourceEnum dataSource) { |