型侃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,50 +336,47 @@ 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> listWithEmptyStrings2 = new ArrayList<>(Arrays.asList(bb));
 | 
				
			||||||
			            			   List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(bb));
 | 
							            			   listWithEmptyStrings2.removeIf(String::isEmpty);
 | 
				
			||||||
			            			   listWithEmptyStrings.removeIf(String::isEmpty);
 | 
							            			   String[] resultArray2 = listWithEmptyStrings2.toArray(new String[0]);
 | 
				
			||||||
			            			   String[] resultArray = listWithEmptyStrings.toArray(new String[0]);
 | 
							            			   cpdm=resultArray2[1];
 | 
				
			||||||
			            			   cpdm=resultArray[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(resultArray2[0]);
 | 
				
			||||||
				            		   line=Integer.parseInt(resultArray[0]);
 | 
									            	   System.out.println(line);
 | 
				
			||||||
					            	   System.out.println(line);
 | 
							            		   // 使用removeIf方法移除所有空字符串
 | 
				
			||||||
			            		   }
 | 
							            		  String [] aa=info;
 | 
				
			||||||
			            		   // 使用removeIf方法移除所有空字符串
 | 
							            		  List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(aa));
 | 
				
			||||||
			            		  String [] aa=info;
 | 
							            		  listWithEmptyStrings.removeIf(String::isEmpty);
 | 
				
			||||||
			            		  List<String> listWithEmptyStrings = new ArrayList<>(Arrays.asList(aa));
 | 
							            		  String[] resultArray = listWithEmptyStrings.toArray(new String[0]);
 | 
				
			||||||
			            		  listWithEmptyStrings.removeIf(String::isEmpty);
 | 
								            	  for(int x=2;x<resultArray.length;x++){
 | 
				
			||||||
			            		  String[] resultArray = listWithEmptyStrings.toArray(new String[0]);
 | 
								            		  String s=resultArray[x];
 | 
				
			||||||
				            	  for(int x=2;x<resultArray.length;x++){
 | 
								            		  if(s.equals("**")){
 | 
				
			||||||
				            		  String s=resultArray[x];
 | 
								            			  qty=resultArray[x-1];
 | 
				
			||||||
				            		  if(s.equals("**")){
 | 
								            			  unit="个";
 | 
				
			||||||
				            			  qty=resultArray[x-1];
 | 
								            			  break;
 | 
				
			||||||
				            			  unit="个";
 | 
								            		  }
 | 
				
			||||||
				            			  break;
 | 
								            	  }
 | 
				
			||||||
				            		  }
 | 
								            	  SdPdf pdf=new SdPdf();
 | 
				
			||||||
				            	  }
 | 
								            	   pdf.setPage(p);
 | 
				
			||||||
				            	  SdPdf pdf=new SdPdf();
 | 
								            	   pdf.setLine(line);
 | 
				
			||||||
				            	   pdf.setPage(p);
 | 
								            	   pdf.setMdmc(mdmc);
 | 
				
			||||||
				            	   pdf.setLine(line);
 | 
								            	   pdf.setCusName(cusName);
 | 
				
			||||||
				            	   pdf.setMdmc(mdmc);
 | 
								            	   pdf.setLinkMan(linkMan);
 | 
				
			||||||
				            	   pdf.setCusName(cusName);
 | 
								            	   pdf.setHth(hth);
 | 
				
			||||||
				            	   pdf.setLinkMan(linkMan);
 | 
								            	   pdf.setTel(tel);
 | 
				
			||||||
				            	   pdf.setHth(hth);
 | 
								            	   pdf.setShdh(shdh.replaceAll("\\s*|\r|\n|\t",""));
 | 
				
			||||||
				            	   pdf.setTel(tel);
 | 
								            	   pdf.setShdz(shdz);
 | 
				
			||||||
				            	   pdf.setShdh(shdh.replaceAll("\\s*|\r|\n|\t",""));
 | 
								            	   pdf.setDyrq(dyrq);
 | 
				
			||||||
				            	   pdf.setShdz(shdz);
 | 
								            	   pdf.setCpdm(cpdm);
 | 
				
			||||||
				            	   pdf.setDyrq(dyrq);
 | 
								            	   pdf.setUnit(unit);
 | 
				
			||||||
				            	   pdf.setCpdm(cpdm);
 | 
								            	   /*String REGEX_CHINESE = "[\u4e00-\u9fa5]";
 | 
				
			||||||
				            	   pdf.setUnit(unit);
 | 
								            	   String string = qty.replaceAll(REGEX_CHINESE, "");
 | 
				
			||||||
				            	   /*String REGEX_CHINESE = "[\u4e00-\u9fa5]";
 | 
								            	   pdf.setQty(Double.parseDouble(string));*/
 | 
				
			||||||
				            	   String string = qty.replaceAll(REGEX_CHINESE, "");
 | 
								            	   pdf.setQty(Double.parseDouble(qty));
 | 
				
			||||||
				            	   pdf.setQty(Double.parseDouble(string));*/
 | 
								            	   pdf.setBzh(bzh);
 | 
				
			||||||
				            	   pdf.setQty(Double.parseDouble(qty));
 | 
								            	   pdfs.add(pdf);
 | 
				
			||||||
				            	   pdf.setBzh(bzh);
 | 
					 | 
				
			||||||
				            	   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