|  |  | @ -152,8 +152,9 @@ public class ExcelOperation { | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * @throws InstantiationException |  |  |  | 	 * @throws InstantiationException | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 * @throws IllegalAccessException |  |  |  | 	 * @throws IllegalAccessException | 
			
		
	
		
		
			
				
					
					|  |  |  | 	 */ |  |  |  | 	 */ | 
			
		
	
		
		
			
				
					
					|  |  |  | 	public static List readExcel4Update(XSSFWorkbook workbook, int excelInitRow, int excelInitCell, Class<?> classz, String... filter) throws InstantiationException, IllegalAccessException { |  |  |  | 	public static List readExcel4Update(XSSFWorkbook workbook, int excelInitRow, int excelInitCell, Object obj, String... filter) throws InstantiationException, IllegalAccessException { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 		List<String> filters = new ArrayList<String>(); |  |  |  | 		List<String> filters = new ArrayList<String>(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		Class<?> classz = obj.getClass(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		filters.addAll(Arrays.asList(filter)); |  |  |  | 		filters.addAll(Arrays.asList(filter)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		List list = null; |  |  |  | 		List list = null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 		 //读取工作表
 |  |  |  | 		 //读取工作表
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -180,7 +181,7 @@ public class ExcelOperation { | 
			
		
	
		
		
			
				
					
					|  |  |  | 				} |  |  |  | 				} | 
			
		
	
		
		
			
				
					
					|  |  |  | 	        	//实例化
 |  |  |  | 	        	//实例化
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 	        	Object newObj = classz.newInstance(); |  |  |  | 	        	Object newObj = classz.newInstance(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 	        	Field[] fields = newObj.getClass().getDeclaredFields(); |  |  |  | 	        	Field[] fields = classz.getDeclaredFields(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 	        	int fieldSize = fields.length; |  |  |  | 	        	int fieldSize = fields.length; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	        	boolean isAddObj = false; |  |  |  | 	        	boolean isAddObj = false; | 
			
		
	
		
		
			
				
					
					|  |  |  | 	        	int num = 0; |  |  |  | 	        	int num = 0; | 
			
		
	
	
		
		
			
				
					|  |  | @ -200,18 +201,19 @@ public class ExcelOperation { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		        		String cellString = getValue(cell); |  |  |  | 		        		String cellString = getValue(cell); | 
			
		
	
		
		
			
				
					
					|  |  |  | 		        		if (!"".equals(cellString)) { |  |  |  | 		        		if (!"".equals(cellString)) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		        			isAddObj = true; |  |  |  | 		        			isAddObj = true; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 		        			String type = tmpField.getGenericType().toString(); | 
			
		
	
		
		
			
				
					
					|  |  |  | 			        		//int型
 |  |  |  | 			        		//int型
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	if (tmpField.getType().toString().contains("Integer") ||tmpField.getType().toString().contains("int")) { |  |  |  | 					    	if (type.contains("Integer") ||type.contains("int")) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					    		double dnum = Double.valueOf(cellString); |  |  |  | 					    		double dnum = Double.valueOf(cellString); | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    		int inum = (int) dnum; |  |  |  | 					    		int inum = (int) dnum; | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    		tmpField.set(newObj, inum); |  |  |  | 					    		tmpField.set(newObj, inum); | 
			
		
	
		
		
			
				
					
					|  |  |  | 							} |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	//double型
 |  |  |  | 					    	//double型
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	else if (tmpField.getType().toString().contains("Double") ||tmpField.getType().toString().contains("double")) { |  |  |  | 					    	else if (type.contains("Double") ||type.contains("double")) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					    		tmpField.set(newObj, Double.valueOf(cellString)); |  |  |  | 					    		tmpField.set(newObj, Double.valueOf(cellString)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 							} |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	//boolean型
 |  |  |  | 					    	//boolean型
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	else if (tmpField.getType().toString().contains("boolean") ||tmpField.getType().toString().contains("Boolean")) { |  |  |  | 					    	else if (type.contains("boolean") ||type.contains("Boolean")) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 					    		tmpField.set(newObj, Boolean.valueOf(cellString)); |  |  |  | 					    		tmpField.set(newObj, Boolean.valueOf(cellString)); | 
			
		
	
		
		
			
				
					
					|  |  |  | 							} |  |  |  | 							} | 
			
		
	
		
		
			
				
					
					|  |  |  | 					    	else { |  |  |  | 					    	else { | 
			
		
	
	
		
		
			
				
					|  |  | @ -240,7 +242,12 @@ public class ExcelOperation { | 
			
		
	
		
		
			
				
					
					|  |  |  | 		} |  |  |  | 		} | 
			
		
	
		
		
			
				
					
					|  |  |  | 		switch (cell.getCellType()) { |  |  |  | 		switch (cell.getCellType()) { | 
			
		
	
		
		
			
				
					
					|  |  |  | 			case XSSFCell.CELL_TYPE_NUMERIC: |  |  |  | 			case XSSFCell.CELL_TYPE_NUMERIC: | 
			
		
	
		
		
			
				
					
					|  |  |  | 				value = String.valueOf(cell.getNumericCellValue()); |  |  |  | 				double	doubleVal = cell.getNumericCellValue(); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			    long longVal = Math.round(cell.getNumericCellValue());   | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			    if(Double.parseDouble(longVal + ".0") == doubleVal)   | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			    	value = String.valueOf(longVal);   | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			    else   | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 			    	value = String.valueOf(doubleVal); | 
			
		
	
		
		
			
				
					
					|  |  |  | 				break; |  |  |  | 				break; | 
			
		
	
		
		
			
				
					
					|  |  |  | 			case XSSFCell.CELL_TYPE_BOOLEAN: |  |  |  | 			case XSSFCell.CELL_TYPE_BOOLEAN: | 
			
		
	
		
		
			
				
					
					|  |  |  | 				value = String.valueOf(cell.getBooleanCellValue()); |  |  |  | 				value = String.valueOf(cell.getBooleanCellValue()); | 
			
		
	
	
		
		
			
				
					|  |  | 
 |