diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java index 86be13c..33ba2ef 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java @@ -180,7 +180,12 @@ public class FlowTaskController extends BaseController { return ResultVoUtil.success("审批成功" + success + "条," + "无权审核" + (flowTaskInfoList.size() - success) + "条", ""); } } - return ResultVoUtil.success("审核成功0条," + "无权审核" + flowTaskInfoList.size() + "条", ""); + + int noApproveCount = 1; + if (flowTaskInfoList != null){ + noApproveCount = flowTaskInfoList.size(); + } + return ResultVoUtil.success("审核成功0条," + "无权审核" + noApproveCount + "条", ""); } @GetMapping("/listhistore") diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/entity/PictureSourceResult.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/entity/PictureSourceResult.java index 17aa056..035fa7e 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/entity/PictureSourceResult.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/api/entity/PictureSourceResult.java @@ -165,7 +165,7 @@ public class PictureSourceResult { /** * 厂商 */ - Map manufacturer; + Object manufacturer; /** * 拜访小节 diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrCheckDuplicateServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrCheckDuplicateServiceImpl.java index ee63559..1a00f60 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrCheckDuplicateServiceImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrCheckDuplicateServiceImpl.java @@ -224,6 +224,8 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl compareMap = new HashMap<>(); //定义当前图片比对的最高阈值 BigDecimal maxSimilarity = new BigDecimal("0"); + //定义当前图片比对的最低阈值 + Map.Entry minEntry = null; //1.1 开始便利进行比对 for (OcrPicture ocrPictureNext : ocrPictureList) { //排除当前图片,自己跟自己没必要比较 @@ -287,7 +289,26 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl=200){ + //获取最小阈值 + for (Map.Entry entry : resultMap.entrySet()) { + BigDecimal currentValue = new BigDecimal(entry.getValue()); + if (minEntry == null || currentValue.compareTo(new BigDecimal(minEntry.getValue())) < 0) { + minEntry = entry; + } + } + BigDecimal oldMin = new BigDecimal(minEntry.getValue()); + BigDecimal newMin = new BigDecimal(resultValue); + if(oldMin.compareTo(newMin)==-1){ + resultMap.remove(minEntry.getKey()); + resultMap.put(ocrPictureNext.getId().toString(), resultValue); + minEntry = new AbstractMap.SimpleEntry<>(ocrPictureNext.getId().toString(), resultValue); + } + }else{ + resultMap.put(ocrPictureNext.getId().toString(), resultValue); + } // 判断相似度是否一样 BigDecimal allSimilarity = new BigDecimal("100"); @@ -324,9 +345,6 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl pictures = new ArrayList<>(); pictures.add(ocrPicture); try { - if ("287798960352200777".equals(ocrPicture.getId()) || "287798960268309961".equals(ocrPicture.getId())) { - System.out.println("adsd"); - } this.saveCheckDuplicateData(checkDuplicateId,saveList,pictures,ocrPictureList.get(0).getTenantId().toString(),sysUser); } catch (Exception e) { logger.error("比对结果入库异常! error:{}",e.getMessage()); @@ -475,9 +493,22 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl1000){ + hisMap = newMap; + }else{ + newMap.putAll(hisMap); + //倒序排序,获取map top200,如果有重复则取新值。 + hisMap = newMap.entrySet() + .stream() + .sorted((entry1, entry2) -> new BigDecimal(entry2.getValue().toString()).compareTo(new BigDecimal(entry1.getValue().toString()))) + .limit(200) // 取前200个 + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue, + (oldValue, newValue) -> newValue, + HashMap::new + )); } pictureDuplicate.setId(pictureDuplicateHis.getId()); pictureDuplicate.setCheckDuplicateResultHisJson(JSONObject.toJSONString(hisMap)); diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPictureServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPictureServiceImpl.java index 8f9b286..c40c400 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPictureServiceImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/service/impl/OcrPictureServiceImpl.java @@ -366,7 +366,10 @@ public class OcrPictureServiceImpl extends BaseServiceImpl picturesMap = JSONObject.parseObject(ocrPictureDuplicateHis.getCheckDuplicateResultHisJson()); // 将Map转换成List - List> pictureMapList = new ArrayList(picturesMap.entrySet()); + List> pictureMapList = new ArrayList<>(); + for (Map.Entry entry : picturesMap.entrySet()) { + pictureMapList.add(new AbstractMap.SimpleEntry<>(entry.getKey(), Integer.parseInt(entry.getValue().toString()))); + } // 根据Map的值进行排序 pictureMapList.sort(Map.Entry.comparingByValue()); //将排序后的list倒序 @@ -404,7 +407,7 @@ public class OcrPictureServiceImpl extends BaseServiceImpl Integer.compare(o2.getSimilarityscore(), o1.getSimilarityscore())); page.setRecords(pictures); diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/thread/tasks/PictureDisposeTask.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/thread/tasks/PictureDisposeTask.java index 94d8bf6..a076f15 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/thread/tasks/PictureDisposeTask.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/ocr/thread/tasks/PictureDisposeTask.java @@ -196,11 +196,17 @@ public class PictureDisposeTask implements Runnable { } //厂商 - if (pictureSourceResult.getManufacturer() != null) { - if (pictureSourceResult.getManufacturer().get("name") != null) { - picture.setField5(pictureSourceResult.getManufacturer().get("name").toString()); - } + if (pictureSourceResult.getManufacturer() instanceof String) { + // 处理字符串类型的 manufacturer + String manufacturer = (String) pictureSourceResult.getManufacturer(); + picture.setField5(manufacturer); + } else if (pictureSourceResult.getManufacturer() instanceof Map) { + // 处理 Map 类型的 manufacturer + Map manufacturer = (Map) pictureSourceResult.getManufacturer(); + picture.setField5(manufacturer.get("name").toString()); + } + //拜访科室 if (StringUtils.isNotBlank(pictureSourceResult.getCompanyDepartment())) { picture.setField7(pictureSourceResult.getCompanyDepartment());