master
周文涛 2 years ago
parent 6674c51c6e
commit 46e22c6ab5

@ -71,11 +71,11 @@ public class HandleCallbacklnit implements ApplicationRunner {
} }
List<OcrIdentify> ocrIdentifyList = ocrIdentifyService.findNeNoticeList(autoPushNoticeMaxNum); List<OcrIdentify> ocrIdentifyList = ocrIdentifyService.findNeNoticeList(autoPushNoticeMaxNum);
for (OcrIdentify ocrIdentify : ocrIdentifyList) { for (OcrIdentify ocrIdentify : ocrIdentifyList) {
ocrIdentifyService.callbackWly(ocrIdentify.getId());
try { try {
ocrIdentifyService.callbackWly(ocrIdentify.getId());
Thread.sleep(pushTimeInterval*1000); Thread.sleep(pushTimeInterval*1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); log.error(e.getMessage());
} }
} }
///TODO 优化下代码,重复执行了这段 获取请求时间间隔的代码了。 ///TODO 优化下代码,重复执行了这段 获取请求时间间隔的代码了。

@ -37,12 +37,14 @@ public class CallBackWlyUtils {
//总明细数量 //总明细数量
int detail_detailCount = 0; int detail_detailCount = 0;
for (OcrIdentifyDetail identifyDetail : identifyDetails) { for (OcrIdentifyDetail identifyDetail : identifyDetails) {
List<JSONObject> jsonObjects1 = JSONArray.parseArray(identifyDetail.getDataStructured()).toJavaList(JSONObject.class); if (StringUtils.isNotBlank(identifyDetail.getDataStructured())) {
if (CollectionUtils.isNotEmpty(jsonObjects1)) { List<JSONObject> jsonObjects1 = JSONArray.parseArray(identifyDetail.getDataStructured()).toJavaList(JSONObject.class);
double textRate = jsonObjects.stream().mapToDouble(o->o.getDouble("textRate")).sum(); if (CollectionUtils.isNotEmpty(jsonObjects1)) {
textRateBigd = textRateBigd.add(new BigDecimal(textRate)); double textRate = jsonObjects.stream().mapToDouble(o->o.getDouble("textRate")).sum();
detail_detailCount += jsonObjects1.size(); textRateBigd = textRateBigd.add(new BigDecimal(textRate));
jsonObjects.addAll(jsonObjects1); detail_detailCount += jsonObjects1.size();
jsonObjects.addAll(jsonObjects1);
}
} }
} }

Loading…
Cancel
Save