压缩包上传,裁决书生成,案件修改,修改后对比信息
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.FatchRule;
|
||||
import com.tencentcloudapi.bsca.v20210811.models.LicenseSummary;
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
@@ -218,27 +219,26 @@ public class OCRUtils {
|
||||
if (StrUtil.isEmpty(fatchRule.getStartContent())) {
|
||||
continue;
|
||||
}
|
||||
// 开始截取字符串 申请人:赵会
|
||||
// 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())) {
|
||||
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());
|
||||
}
|
||||
if (StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isNotEmpty(fatchRule.getEndContent())) {
|
||||
String s = StringUtils.substringBetween(ocrText, fatchRule.getStartContent(), fatchRule.getEndContent());
|
||||
if(StrUtil.isNotEmpty(s)){
|
||||
fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s));
|
||||
}else {
|
||||
fatchMap.put(fatchRule.getColumnName(),"");
|
||||
}
|
||||
|
||||
}else if(StrUtil.isNotEmpty(fatchRule.getStartContent()) && StrUtil.isEmpty(fatchRule.getEndContent())){
|
||||
String s = StringUtils.substringAfter(ocrText,fatchRule.getStartContent());
|
||||
if(StrUtil.isNotEmpty(s)){
|
||||
fatchMap.put(fatchRule.getColumnName(), StrUtil.trim(s));
|
||||
}else {
|
||||
fatchMap.put(fatchRule.getColumnName(),"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user