|
|
|
@ -286,6 +286,12 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl<OcrCheckDuplicateM
|
|
|
|
|
OcrCheckDuplicateResult ocrCheckDuplicateResult = new OcrCheckDuplicateResult();
|
|
|
|
|
ocrCheckDuplicateResult.setPictureId(ocrPicture.getId());
|
|
|
|
|
ocrCheckDuplicateResult.setMaxSimilarity(maxSimilarity.doubleValue());
|
|
|
|
|
BigDecimal b3 = new BigDecimal("100");
|
|
|
|
|
if (maxSimilarity.compareTo(b3)==0) {
|
|
|
|
|
ocrCheckDuplicateResult.setIsRepeat(1);
|
|
|
|
|
}else {
|
|
|
|
|
ocrCheckDuplicateResult.setIsRepeat(0);
|
|
|
|
|
}
|
|
|
|
|
ocrCheckDuplicateResult.setCompareResultJson(JSONObject.toJSONString(resultMap));
|
|
|
|
|
ocrCheckDuplicateResult.setCheckDuplicateId(checkDuplicateId);
|
|
|
|
|
if(similarityGroupOrderMap.get(ocrPicture.getId().toString())!=null){
|
|
|
|
@ -370,9 +376,19 @@ public class OcrCheckDuplicateServiceImpl extends ServiceImpl<OcrCheckDuplicateM
|
|
|
|
|
*/
|
|
|
|
|
private boolean updatePictureSimilarityScore(List<OcrCheckDuplicateResult> saveList) throws Exception {
|
|
|
|
|
List<OcrPicture> updateList = new ArrayList<>();
|
|
|
|
|
List<OcrPicture> updateList1 = new ArrayList<>();
|
|
|
|
|
for (OcrCheckDuplicateResult ocrCheckDuplicateResult : saveList) {
|
|
|
|
|
OcrPicture picture = pictureService.selectDtoById(ocrCheckDuplicateResult.getPictureId());
|
|
|
|
|
OcrPicture ocrPicture = new OcrPicture();
|
|
|
|
|
if(ocrCheckDuplicateResult.getIsRepeat()==1){
|
|
|
|
|
OcrPicture ocrPicture1 = new OcrPicture();
|
|
|
|
|
if(picture.getIsRepeat() == null || picture.getIsRepeat() != 1){
|
|
|
|
|
ocrPicture1.setId(picture.getId());
|
|
|
|
|
ocrPicture1.setIsRepeat(1);
|
|
|
|
|
updateList1.add(ocrPicture1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pictureService.updateBatchById(updateList1);
|
|
|
|
|
//如果当前图片没有历史阈值,直接更新上阈值
|
|
|
|
|
if (picture.getSimilarityscore() == null) {
|
|
|
|
|
ocrPicture.setId(picture.getId());
|
|
|
|
|