|
|
|
@ -2,13 +2,11 @@ package org.jeecg.modules.ocr.utils;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.jeecg.common.util.RestUtil;
|
|
|
|
|
import org.jeecg.modules.ocr.entity.OcrIdentify;
|
|
|
|
|
import org.jeecg.modules.ocr.entity.OcrIdentifyCallbackLog;
|
|
|
|
|
import org.jeecg.modules.ocr.entity.OcrIdentifyDetail;
|
|
|
|
|
import org.jeecg.modules.ocr.model.wlycallback.CallBackWlyRequestBody;
|
|
|
|
|
import org.jeecg.modules.ocr.model.wlycallback.CallBackWlyResult;
|
|
|
|
@ -17,7 +15,6 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -38,17 +35,16 @@ public class CallBackWlyUtils {
|
|
|
|
|
//成功率
|
|
|
|
|
BigDecimal textRateBigd = new BigDecimal(0);
|
|
|
|
|
//总明细数量
|
|
|
|
|
Integer detail_detailCount = 0;
|
|
|
|
|
int detail_detailCount = 0;
|
|
|
|
|
for (OcrIdentifyDetail identifyDetail : identifyDetails) {
|
|
|
|
|
List<JSONObject> jsonObjects1 = JSONArray.parseArray(identifyDetail.getDataStructured()).toJavaList(JSONObject.class);
|
|
|
|
|
if (jsonObjects1 != null) {
|
|
|
|
|
//double ocrPrecisionRate = jsonObjects.stream().mapToDouble(o -> o.getDouble("ocrPrecisionRate")).sum();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(jsonObjects1)) {
|
|
|
|
|
double textRate = jsonObjects.stream().mapToDouble(o->o.getDouble("textRate")).sum();
|
|
|
|
|
textRateBigd = textRateBigd.add(new BigDecimal(textRate));
|
|
|
|
|
detail_detailCount += jsonObjects1.size();
|
|
|
|
|
}
|
|
|
|
|
jsonObjects.addAll(jsonObjects1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//组装回调参数
|
|
|
|
|
double imageTagRetrievePercentage = 0.0d;
|
|
|
|
|