From af430e03b2f1a1db9369b17a96896dcec9217919 Mon Sep 17 00:00:00 2001 From: zss <zss@example.com> Date: 星期二, 26 十一月 2024 08:57:25 +0800 Subject: [PATCH] Merge branch 'master' into dev --- inspect-server/src/main/java/com/yuanchu/mom/utils/FuSheUtils.java | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 deletions(-) diff --git a/inspect-server/src/main/java/com/yuanchu/mom/utils/FuSheUtils.java b/inspect-server/src/main/java/com/yuanchu/mom/utils/FuSheUtils.java index 1593dd4..b64a4d0 100644 --- a/inspect-server/src/main/java/com/yuanchu/mom/utils/FuSheUtils.java +++ b/inspect-server/src/main/java/com/yuanchu/mom/utils/FuSheUtils.java @@ -59,6 +59,7 @@ Exceldata exceldata = new Exceldata(); Map<Integer, Object> project = new HashMap<>(); HashMap<String, Object> datas1 = new HashMap<>(); + Boolean exitLoop=false; for (int i = 0; i < workbook.getNumberOfSheets(); i++) { String s = ""; Sheet sheet = workbook.getSheetAt(i); @@ -91,6 +92,10 @@ } else { switch (cell.getCellType()) { case STRING: + if (cell.getColumnIndex()==1) { + exitLoop=true; + break; + } if (StringUtils.isNotEmpty(s)) { datas.put(s, list); } @@ -115,6 +120,10 @@ System.out.print("NULL\t"); } } + if (exitLoop){ + exitLoop=false; + break; + } if (map.isEmpty()) { list.add(map); } @@ -137,15 +146,17 @@ for (Map<String, Object> number : hashMaps) { number.put("绔彛", s1); Double o = (Double) number.get("棰戠巼"); - floatList.add(o); + if (o!=null) { + floatList.add(o); + } } Double maxValue = Collections.max(floatList); Double minValue = Collections.min(floatList); - if (map.get(minValue + "-" + maxValue + "-" + s) == null) { - map.put(minValue + "-" + maxValue + "-" + s, s1); + if (map.get(minValue + "," + maxValue + "," + s) == null) { + map.put(minValue + "," + maxValue + "," + s, s1); } else { - Object o = map.get(minValue + "-" + maxValue + "-" + s); - map.put(minValue + "-" + maxValue + "-" + s, s1 + "," + o); + Object o = map.get(minValue + "," + maxValue + "," + s); + map.put(minValue + "," + maxValue + "," + s, s1 + "," + o); } } } @@ -341,8 +352,8 @@ runs.setText("杈愬皠鏂瑰悜鍥惧弬鏁�"); for (String s : map.keySet()) { Map<String, Object> dataRow = exceldata.getDataRow(); - String result = s.substring(s.lastIndexOf("-") + 1); - String result1 = s.substring(0, s.lastIndexOf("-")); + String result = s.substring(s.lastIndexOf(",") + 1); + String result1 = s.substring(0, s.lastIndexOf(",")); String o = map.get(s).toString(); String[] split = o.split(","); Integer s1 = Integer.parseInt(split[split.length - 1]); -- Gitblit v1.9.3