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 8548677..6e5a00d 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 @@ -557,35 +557,34 @@ public class BabyStatisticsManagerFacade { "WHEN A.BIRTH_HOSPITAL_NO IS NULL THEN '未知'" + "END)"; // jdbc查oracle -// List> list = JdbcUtil.getOracleListDataBySql("com.mysql.jdbc.Driver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); ExceptionUtils.catchException("babyStatisticsManagerBuildSourceList: " + sql); - // List> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); - List> list = new ArrayList<>(); - Map m1 = new HashMap<>(); - m1.put("LB_NAME","本院分娩"); - m1.put("CNT",1594); - m1.put("CHILD_CATEGORY_ID",2); - Map m2 = new HashMap<>(); - m2.put("LB_NAME","未知"); - m2.put("CNT",630); - m2.put("CHILD_CATEGORY_ID",2); - Map m3 = new HashMap<>(); - m3.put("LB_NAME","外院分娩"); - m3.put("CNT",2); - m3.put("CHILD_CATEGORY_ID",2); - Map m4 = new HashMap<>(); - m4.put("LB_NAME","本院分娩"); - m4.put("CNT",172); - m4.put("CHILD_CATEGORY_ID",1); - Map m5 = new HashMap<>(); - m5.put("LB_NAME","未知"); - m5.put("CNT",7186); - m5.put("CHILD_CATEGORY_ID",1); - list.add(m1); - list.add(m2); - list.add(m3); - list.add(m4); - list.add(m5); + List> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); + // List> list = new ArrayList<>(); + // Map m1 = new HashMap<>(); + // m1.put("LB_NAME", "本院分娩"); + // m1.put("CNT", 1594); + // m1.put("CHILD_CATEGORY_ID", 2); + // Map m2 = new HashMap<>(); + // m2.put("LB_NAME", "未知"); + // m2.put("CNT", 630); + // m2.put("CHILD_CATEGORY_ID", 2); + // Map m3 = new HashMap<>(); + // m3.put("LB_NAME", "外院分娩"); + // m3.put("CNT", 2); + // m3.put("CHILD_CATEGORY_ID", 2); + // Map m4 = new HashMap<>(); + // m4.put("LB_NAME", "本院分娩"); + // m4.put("CNT", 172); + // m4.put("CHILD_CATEGORY_ID", 1); + // Map m5 = new HashMap<>(); + // m5.put("LB_NAME", "未知"); + // m5.put("CNT", 7186); + // m5.put("CHILD_CATEGORY_ID", 1); + // list.add(m1); + // list.add(m2); + // list.add(m3); + // list.add(m4); + // list.add(m5); // 构造返回list,这里写死的4条,因为高帆说只有4条 BabyStatisticsManagerBuildSourceListQueryModel babyStatisticsManagerBuildSourceListQueryModel1 = new BabyStatisticsManagerBuildSourceListQueryModel(); babyStatisticsManagerBuildSourceListQueryModel1.setLbName("本院分娩"); @@ -611,23 +610,23 @@ public class BabyStatisticsManagerFacade { for (Map map : list) { if ("本院分娩".equals(map.get("LB_NAME"))) { buildCnt1 += Integer.valueOf(map.get("CNT").toString()); - if ("2".equals(map.get("CHILD_CATEGORY_ID"))) { + if ("2".equals(map.get("CHILD_CATEGORY_ID").toString())) { highRiskCnt1 += Integer.valueOf(map.get("CNT").toString()); } } else if ("外院分娩".equals(map.get("LB_NAME"))) { buildCnt2 += Integer.valueOf(map.get("CNT").toString()); - if ("2".equals(map.get("CHILD_CATEGORY_ID"))) { + if ("2".equals(map.get("CHILD_CATEGORY_ID").toString())) { highRiskCnt2 += Integer.valueOf(map.get("CNT").toString()); } } else if ("未知".equals(map.get("LB_NAME"))) { buildCnt3 += Integer.valueOf(map.get("CNT").toString()); - if ("2".equals(map.get("CHILD_CATEGORY_ID"))) { + if ("2".equals(map.get("CHILD_CATEGORY_ID").toString())) { highRiskCnt3 += Integer.valueOf(map.get("CNT").toString()); } } // 总计 buildCnt4 += Integer.valueOf(map.get("CNT").toString()); - if ("2".equals(map.get("CHILD_CATEGORY_ID"))) { + if ("2".equals(map.get("CHILD_CATEGORY_ID").toString())) { highRiskCnt4 += Integer.valueOf(map.get("CNT").toString()); } } @@ -714,9 +713,8 @@ public class BabyStatisticsManagerFacade { "TRUNC(MONTHS_BETWEEN(C.EXAMINE_DATE,A.BIRTHDAY))"; // jdbc查oracle -// List> list = JdbcUtil.getOracleListDataBySql("com.mysql.jdbc.Driver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList: " + sql); - List> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.1.32:1521:orcl", "LYMS_ODS", "Welcome1", sql); + List> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); // List> list = new ArrayList<>(); // Map test1 = new HashMap<>(); // test1.put("EXAMINE_MONTH", 2); @@ -787,7 +785,7 @@ public class BabyStatisticsManagerFacade { // } // } - if (CollectionUtils.isEmpty(list)||i>list.size()-1 || list.get(i) == null || null == list.get(i).get("EXAMINE_MONTH")) { + if (CollectionUtils.isEmpty(list) || i > list.size() - 1 || list.get(i) == null || null == list.get(i).get("EXAMINE_MONTH")) { result.add(0); } else { try { @@ -804,16 +802,16 @@ public class BabyStatisticsManagerFacade { Integer check30 = 0; Integer check36 = 0; for (Map other : list) { - if (null!=other.get("EXAMINE_MONTH")&&"18".equals(other.get("EXAMINE_MONTH").toString())) { + 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())) { + 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())) { + 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())) { + if (null != other.get("EXAMINE_MONTH") && "36".equals(other.get("EXAMINE_MONTH").toString())) { check36 = Integer.valueOf(other.get("CNT").toString()); } } @@ -835,21 +833,11 @@ public class BabyStatisticsManagerFacade { // 下面的表格 Integer check1 = result.get(0); - Integer check3 = 0; - Integer check6 = 0; - Integer check12 = 0; - for (int i = 0; i < 12; i++) { - if (i < 3) { - check3 += result.get(i); - } - if (i < 6) { - check6 += result.get(i); - } - if (i < 12) { - check12 += result.get(i); - } - } - Integer checkOther = total - check12; + Integer check3 = result.get(2) - result.get(0); + Integer check6 = result.get(5) - result.get(2); + Integer check12 = result.get(11) - result.get(5); + + Integer checkOther = total - result.get(11); List babyCount = new ArrayList<>(); List percent = new ArrayList<>();