From 81c3a68c503be78e0c0b3145381bbdd897191846 Mon Sep 17 00:00:00 2001 From: hujiaqi Date: Mon, 13 Feb 2017 14:55:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AB=98=E5=8D=B1=E8=AF=84=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/facade/BabyStatisticsManagerFacade.java | 69 ++++++++++++---------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java index 57d5c73..944a857 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java @@ -834,12 +834,12 @@ public class BabyStatisticsManagerFacade { }); // 检查人数 - List result = new ArrayList<>(); + List temp = new ArrayList<>(); Integer total = 0; ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList list result :" + list); // 从0开始,没有也填充 int index = 0; - for (Integer i = 0; i < 13; i++) { + for (Integer i = 0; i < 37; i++) { try { while (!i.toString().equals(list.get(index).get("EXAMINE_MONTH").toString()) && i > Integer.valueOf(list.get(index).get("EXAMINE_MONTH").toString())) { index++; @@ -848,48 +848,55 @@ public class BabyStatisticsManagerFacade { index++; } if (CollectionUtils.isEmpty(list) || list.size() < index) { - result.add(0); + temp.add(0); } else if (list.size() < index && (list.get(index) == null || !i.toString().equals(list.get(index).get("EXAMINE_MONTH").toString()))) { - result.add(0); + temp.add(0); } else { try { - result.add(Integer.valueOf(list.get(index).get("CNT").toString())); + temp.add(Integer.valueOf(list.get(index).get("CNT").toString())); total += Integer.valueOf(list.get(index).get("CNT").toString()); index++; } catch (Exception e) { - result.add(0); + temp.add(0); index++; } } } - Integer check18 = 0; - Integer check24 = 0; - Integer check30 = 0; - Integer check36 = 0; - for (Map other : list) { - if (null != other.get("EXAMINE_MONTH") && "18".equals(other.get("EXAMINE_MONTH").toString())) { - check18 = Integer.valueOf(other.get("CNT").toString()); - } - if (null != other.get("EXAMINE_MONTH") && "24".equals(other.get("EXAMINE_MONTH").toString())) { - check24 = Integer.valueOf(other.get("CNT").toString()); - } - if (null != other.get("EXAMINE_MONTH") && "30".equals(other.get("EXAMINE_MONTH").toString())) { - check30 = Integer.valueOf(other.get("CNT").toString()); - } - if (null != other.get("EXAMINE_MONTH") && "36".equals(other.get("EXAMINE_MONTH").toString())) { - check36 = Integer.valueOf(other.get("CNT").toString()); - } - } - result.add(check18); - result.add(check24); - result.add(check30); - result.add(check36); + // Integer check18 = 0; + // Integer check24 = 0; + // Integer check30 = 0; + // Integer check36 = 0; + // for (Map other : list) { + // if (null != other.get("EXAMINE_MONTH") && "18".equals(other.get("EXAMINE_MONTH").toString())) { + // check18 = Integer.valueOf(other.get("CNT").toString()); + // } + // if (null != other.get("EXAMINE_MONTH") && "24".equals(other.get("EXAMINE_MONTH").toString())) { + // check24 = Integer.valueOf(other.get("CNT").toString()); + // } + // if (null != other.get("EXAMINE_MONTH") && "30".equals(other.get("EXAMINE_MONTH").toString())) { + // check30 = Integer.valueOf(other.get("CNT").toString()); + // } + // if (null != other.get("EXAMINE_MONTH") && "36".equals(other.get("EXAMINE_MONTH").toString())) { + // check36 = Integer.valueOf(other.get("CNT").toString()); + // } + // } + // result.add(check18); + // result.add(check24); + // result.add(check30); + // result.add(check36); - for (int i = 1; i < result.size(); i++) { - result.set(i, result.get(i) + result.get(i - 1)); + for (int i = 1; i < temp.size(); i++) { + temp.set(i, temp.get(i) + temp.get(i - 1)); } - result.remove(0); + temp.remove(0); + + List result = new ArrayList<>(); + result.addAll(temp.subList(0,12)); + result.add(temp.get(18)); + result.add(temp.get(24)); + result.add(temp.get(30)); + result.add(temp.get(36)); // 未检查人数 List resultOther = new ArrayList<>(); -- 1.8.3.1