|
|
|
@ -425,9 +425,14 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void callbackWly(String ocrIdentifyId){
|
|
|
|
|
OcrIdentifyCallbackLog ocrIdentifyCallbackLog=new OcrIdentifyCallbackLog();
|
|
|
|
|
ocrIdentifyCallbackLog.setIdentifyId(ocrIdentifyId);
|
|
|
|
|
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
ocrIdentifyCallbackLog.setCreateTime(date);
|
|
|
|
|
LambdaUpdateWrapper<OcrIdentify> updateWrapper = new LambdaUpdateWrapper<OcrIdentify>();
|
|
|
|
|
updateWrapper.eq(OcrIdentify::getId, ocrIdentifyId);
|
|
|
|
|
long time = new Date().getTime();
|
|
|
|
|
long time = date.getTime();
|
|
|
|
|
//回调 无量云接口
|
|
|
|
|
OcrIdentify ocrIdentify = super.getById(ocrIdentifyId);
|
|
|
|
|
if (ocrIdentify!=null) {
|
|
|
|
@ -475,6 +480,7 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
log.info("请求无量云回调接口");
|
|
|
|
|
JSONObject semanticResponseJson = null;
|
|
|
|
|
try {
|
|
|
|
|
ocrIdentifyCallbackLog.setStartTime(new Date());
|
|
|
|
|
semanticResponseJson = RestUtil.post("https://192.168.1.21:8686/api/task/image/ocr/callback", requestBody);
|
|
|
|
|
} catch (org.springframework.web.client.ResourceAccessException e){
|
|
|
|
|
log.error("请求无量云回调接口失败-拒绝连接 (Connection refused)");
|
|
|
|
@ -484,17 +490,22 @@ public class OcrIdentifyServiceImpl extends ServiceImpl<OcrIdentifyMapper, OcrId
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} finally {
|
|
|
|
|
log.info("回调返回------------------");
|
|
|
|
|
ocrIdentifyCallbackLog.setEndTime(new Date());
|
|
|
|
|
|
|
|
|
|
if (semanticResponseJson != null) {
|
|
|
|
|
log.info(semanticResponseJson.toJSONString());
|
|
|
|
|
updateWrapper.set(OcrIdentify::getNoticeStatus, "1");
|
|
|
|
|
super.update(updateWrapper);
|
|
|
|
|
ocrIdentifyCallbackLog.setStatus(1);
|
|
|
|
|
} else {
|
|
|
|
|
log.info("回调返回-----:null");
|
|
|
|
|
ocrIdentifyCallbackLog.setStatus(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ocrIdentifyCallbackLogService.save(ocrIdentifyCallbackLog);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|