|
|
|
@ -39,15 +39,23 @@ public class CallBackWlyUtils {
|
|
|
|
|
//总明细数量
|
|
|
|
|
int detail_detailCount = 0;
|
|
|
|
|
int detailValidationCount=0;
|
|
|
|
|
BigDecimal imageTagRetrievePercentage = new BigDecimal("0");//成功率
|
|
|
|
|
String taskResultInfo = ocrIdentify.getTaskResultInfo();
|
|
|
|
|
if (StringUtils.isNotBlank(taskResultInfo)) {
|
|
|
|
|
//循环获取哪些字段通过了
|
|
|
|
|
List<JSONObject> taskResultInfoList = JSONArray.parseArray(taskResultInfo).toJavaList(JSONObject.class);
|
|
|
|
|
detail_detailCount=taskResultInfoList.size();
|
|
|
|
|
// detail_detailCount=taskResultInfoList.size();
|
|
|
|
|
// for (JSONObject jsonObject : taskResultInfoList) {
|
|
|
|
|
// Boolean ruleValidation = (Boolean) jsonObject.getOrDefault("ruleValidation", false);
|
|
|
|
|
// if (ruleValidation) {
|
|
|
|
|
// //通过了,
|
|
|
|
|
// detailValidationCount++;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
for (JSONObject jsonObject : taskResultInfoList) {
|
|
|
|
|
Boolean ruleValidation = (Boolean) jsonObject.getOrDefault("ruleValidation", false);
|
|
|
|
|
if (ruleValidation) {
|
|
|
|
|
//通过了,
|
|
|
|
|
Double ruleValidation = jsonObject.getDouble("textRate");
|
|
|
|
|
if (ruleValidation!=null) {
|
|
|
|
|
imageTagRetrievePercentage=imageTagRetrievePercentage.add(new BigDecimal(ruleValidation));
|
|
|
|
|
detailValidationCount++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -64,12 +72,7 @@ public class CallBackWlyUtils {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//组装回调参数
|
|
|
|
|
//成功率
|
|
|
|
|
double imageTagRetrievePercentage = 0.0d;
|
|
|
|
|
if (detail_detailCount > 0) {
|
|
|
|
|
BigDecimal divide = new BigDecimal(detailValidationCount).divide(new BigDecimal(detail_detailCount), 2, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
|
|
|
|
|
imageTagRetrievePercentage = divide.doubleValue();
|
|
|
|
|
}
|
|
|
|
|
imageTagRetrievePercentage = imageTagRetrievePercentage.divide(new BigDecimal(detailValidationCount), 2, RoundingMode.HALF_UP);
|
|
|
|
|
if (StringUtils.isNotBlank(ocrIdentify.getTaskResult()) && "1".equals(ocrIdentify.getTaskResult())) {
|
|
|
|
|
result.setRuleValidation(true);
|
|
|
|
|
}else{
|
|
|
|
|