tudc 3 лет назад
Родитель
Сommit
90ddbfdcd6

+ 41 - 39
adm/src/main/java/com/minpay/common/util/FilesUtil.java

@@ -367,47 +367,49 @@ public class FilesUtil {
 		
 		for(int i=firstrow; i<rownum; i++){
 			Row row = sheet.getRow(i);
-			Map<String,Object> map = new HashMap<String,Object>();
-			for(int j=0; j<titleKey.length; j++){
-				System.out.println(i+":"+j);
-				Cell cell = row.getCell(j);
-				String cellValue="";
-				if(cell != null){
-					switch (cell.getCellType()){
-						case NUMERIC: // 数字  
-							if(HSSFDateUtil.isCellDateFormatted(cell)){
-								//用于转化为日期格式
-								Date d = cell.getDateCellValue();
-								DateFormat formater = new SimpleDateFormat("yyyyMMdd");
-								cellValue = formater.format(d);
-							}else{
-								// 用于格式化数字,只保留数字的整数部分
-								cellValue = df.format(cell.getNumericCellValue());  //cell.getNumericCellValue() + "";  
-							}
-		                    break;  
-		                case STRING: // 字符串  
-		                    cellValue = cell.getStringCellValue();  
-		                    break;  
-		                case BOOLEAN: // Boolean  
-		                    cellValue = cell.getBooleanCellValue() + "";  
-		                    break;  
-		                case FORMULA: // 公式  
-		                    cellValue = cell.getCellFormula() + "";  
-		                    break;  
-		                case BLANK: // 空值  
-		                    cellValue = "";  
-		                    break;  
-		                case ERROR: // 故障  
-		                    cellValue = "非法字符";  
-		                    break;  
-		                default:  
-		                    cellValue = "未知类型";  
-		                    break; 
-	                }
+			if(row != null) {
+				Map<String,Object> map = new HashMap<String,Object>();
+				for(int j=0; j<titleKey.length; j++){
+					System.out.println(i+":"+j);
+					Cell cell = row.getCell(j);
+					String cellValue="";
+					if(cell != null){
+						switch (cell.getCellType()){
+							case NUMERIC: // 数字  
+								if(HSSFDateUtil.isCellDateFormatted(cell)){
+									//用于转化为日期格式
+									Date d = cell.getDateCellValue();
+									DateFormat formater = new SimpleDateFormat("yyyyMMdd");
+									cellValue = formater.format(d);
+								}else{
+									// 用于格式化数字,只保留数字的整数部分
+									cellValue = df.format(cell.getNumericCellValue());  //cell.getNumericCellValue() + "";  
+								}
+			                    break;  
+			                case STRING: // 字符串  
+			                    cellValue = cell.getStringCellValue();  
+			                    break;  
+			                case BOOLEAN: // Boolean  
+			                    cellValue = cell.getBooleanCellValue() + "";  
+			                    break;  
+			                case FORMULA: // 公式  
+			                    cellValue = cell.getCellFormula() + "";  
+			                    break;  
+			                case BLANK: // 空值  
+			                    cellValue = "";  
+			                    break;  
+			                case ERROR: // 故障  
+			                    cellValue = "非法字符";  
+			                    break;  
+			                default:  
+			                    cellValue = "未知类型";  
+			                    break; 
+		                }
+					}
+					map.put(titleKey[j], cellValue);
 				}
-				map.put(titleKey[j], cellValue);
+				list.add(map);
 			}
-			list.add(map);
 		}
 		 return list;  
 	}

+ 2 - 2
adm/src/main/webapp/admin/home/homeLv.html

@@ -61,9 +61,9 @@
 					for (var i = 0; i < series.length; i ++) {
 						var data = series[i].data;
 						for (var j = 0; j < data.length; j ++) {
-							if (yminValue == 0) {
+							if (yminValue == 0 && data[j] != 0) {
 								yminValue = data[j];
-							} else if (yminValue > data[j]) {
+							} else if (yminValue > data[j] && data[j] != 0) {
 								yminValue = data[j];
 							}
 							if (ymaxValue == 0) {