型侃PDF导入调整
parent
a147da04df
commit
bcc158cb60
|
|
@ -302,11 +302,17 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Boolean temp=Boolean.FALSE;
|
Boolean temp=Boolean.FALSE;
|
||||||
if(info[0].indexOf("送货地")>=0){
|
if(info[0].indexOf("送货地")>=0){
|
||||||
shdz=info[1];
|
shdz=info[1];
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
if(isAddress(info[0])){
|
||||||
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(info[0].indexOf("单据请当场仔细验收")>=0){
|
if(info[0].indexOf("单据请当场仔细验收")>=0){
|
||||||
|
|
||||||
|
|
@ -321,7 +327,6 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
}
|
}
|
||||||
|
|
||||||
if(info[0].indexOf("产品质量")>=0){
|
if(info[0].indexOf("产品质量")>=0){
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -331,17 +336,15 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
bzh=info[1];
|
bzh=info[1];
|
||||||
temp=true;
|
temp=true;
|
||||||
}else{
|
}else{
|
||||||
if(info.length>1){
|
|
||||||
String [] bb=info;
|
String [] bb=info;
|
||||||
List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(bb));
|
List<String> listWithEmptyStrings2 = new ArrayList<>(Arrays.asList(bb));
|
||||||
listWithEmptyStrings.removeIf(String::isEmpty);
|
listWithEmptyStrings2.removeIf(String::isEmpty);
|
||||||
String[] resultArray = listWithEmptyStrings.toArray(new String[0]);
|
String[] resultArray2 = listWithEmptyStrings2.toArray(new String[0]);
|
||||||
cpdm=resultArray[1];
|
cpdm=resultArray2[1];
|
||||||
cpdm=cpdm.replaceAll("([\u4E00-\u9FA5]+)|([\u4E00-\u9FA5])","");
|
cpdm=cpdm.replaceAll("([\u4E00-\u9FA5]+)|([\u4E00-\u9FA5])","");
|
||||||
System.out.println(cpdm);
|
System.out.println(cpdm);
|
||||||
line=Integer.parseInt(resultArray[0]);
|
line=Integer.parseInt(resultArray2[0]);
|
||||||
System.out.println(line);
|
System.out.println(line);
|
||||||
}
|
|
||||||
// 使用removeIf方法移除所有空字符串
|
// 使用removeIf方法移除所有空字符串
|
||||||
String [] aa=info;
|
String [] aa=info;
|
||||||
List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(aa));
|
List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(aa));
|
||||||
|
|
@ -374,7 +377,6 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
pdf.setQty(Double.parseDouble(qty));
|
pdf.setQty(Double.parseDouble(qty));
|
||||||
pdf.setBzh(bzh);
|
pdf.setBzh(bzh);
|
||||||
pdfs.add(pdf);
|
pdfs.add(pdf);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -382,6 +384,7 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(temp){
|
if(temp){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -521,6 +524,22 @@ public class DefaultImportFileManager extends DefaultBaseManager implements Impo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String[] ADDRESS_KEYWORDS = {"省", "市", "区", "街道", "路", "街", "交叉路口","楼"};
|
||||||
|
|
||||||
|
public static boolean isAddress(String input) {
|
||||||
|
if (input == null || input.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String keyword : ADDRESS_KEYWORDS) {
|
||||||
|
if (input.contains(keyword)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void storePdfInfo(List<SdPdf> pdfs) {
|
public void storePdfInfo(List<SdPdf> pdfs) {
|
||||||
if(pdfs.size()>0){
|
if(pdfs.size()>0){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue