案件压缩包导入

This commit is contained in:
18792927508
2023-12-07 15:07:51 +08:00
parent 6d720c5757
commit a525fd6a16
5 changed files with 145 additions and 132 deletions
@@ -221,15 +221,20 @@ public class OCRUtils {
// 开始截取字符串 申请人:赵会
// String[] startContentSplit = ocrText.split(fatchRule.getStartContent());
int startFirstIndex = ocrText.indexOf(fatchRule.getStartContent()) + fatchRule.getStartContent().length();
if(startFirstIndex<0){
continue;
}
if (ocrText.length() >= startFirstIndex) {
ocrText = ocrText.substring(startFirstIndex);
}
if (StrUtil.isNotEmpty(fatchRule.getEndContent())) {
int endFirstIndex = ocrText.indexOf(fatchRule.getEndContent()) + fatchRule.getEndContent().length();
if (ocrText.length() >= (endFirstIndex-fatchRule.getEndContent().length())) {
fatchMap.put(fatchRule.getColumn(), ocrText.substring(0, endFirstIndex-fatchRule.getEndContent().length()));
ocrText = ocrText.substring(endFirstIndex-fatchRule.getEndContent().length());
if(ocrText.indexOf(fatchRule.getEndContent())>=0) {
int endFirstIndex = ocrText.indexOf(fatchRule.getEndContent()) + fatchRule.getEndContent().length();
if (ocrText.length() >= (endFirstIndex - fatchRule.getEndContent().length())) {
fatchMap.put(fatchRule.getColumn(), ocrText.substring(0, endFirstIndex - fatchRule.getEndContent().length()));
ocrText = ocrText.substring(endFirstIndex - fatchRule.getEndContent().length());
}
}
}
}