|
|
|
@ -94,12 +94,8 @@ public class ImageClassUtil {
|
|
|
|
|
responseDataVi = HttpClient.doService(serverurl, paramersVi, headerVi, 15000, 30000);
|
|
|
|
|
JSONObject jsonObjectSimi = JSON.parseObject(responseDataVi);
|
|
|
|
|
if (null != jsonObjectSimi && jsonObjectSimi.getString("code").equals("0") && jsonObjectSimi.get("data") != null && jsonObjectSimi.getJSONArray("data").size() > 0) {
|
|
|
|
|
JSONObject data = jsonObjectSimi.getJSONArray("data").getJSONObject(0);
|
|
|
|
|
Map<String, String> map = new HashMap();
|
|
|
|
|
map.put("classId", data.getString("classId"));
|
|
|
|
|
map.put("hash", data.getString("hash"));
|
|
|
|
|
ocrPictureLog.setCallStatus("1");
|
|
|
|
|
ocrPictureLog.setPictureUrl(imgurl);
|
|
|
|
|
ocrPictureLog.setCallMsg(responseDataVi);
|
|
|
|
|
} else {
|
|
|
|
|
ocrPictureLog.setCallStatus("2");
|
|
|
|
|
ocrPictureLog.setCallMsg(responseDataVi);
|
|
|
|
@ -107,11 +103,12 @@ public class ImageClassUtil {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("classify={}", e);
|
|
|
|
|
ocrPictureLog.setCallStatus("3");
|
|
|
|
|
ocrPictureLog.setCallMsg(e.getMessage());
|
|
|
|
|
ocrPictureLog.setCallMsg(responseDataVi+"Exception:"+e.getMessage());
|
|
|
|
|
} finally {
|
|
|
|
|
ApplicationContext applicationContext = SpringUtil.getApplicationContext();
|
|
|
|
|
OcrPictureLogService ocrPictureLogService = applicationContext.getBean(OcrPictureLogService.class);
|
|
|
|
|
ocrPictureLog.setCallTime(DateUtil.now());
|
|
|
|
|
ocrPictureLog.setPictureUrl(imgurl);
|
|
|
|
|
ocrPictureLogService.save(ocrPictureLog);
|
|
|
|
|
}
|
|
|
|
|
JSONObject jsonObject = JSON.parseObject(responseDataVi);
|
|
|
|
|