Commit c76de10ae4370ca24c3932af2646b97c344c6441
1 parent
1ef0c5ea7a
Exists in
master
and in
1 other branch
分娩作废产检劵
Showing 1 changed file with 31 additions and 20 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
View file @
c76de10
... | ... | @@ -533,13 +533,13 @@ |
533 | 533 | " FROM ODS_F_INFANT_RECORD A" + |
534 | 534 | " INNER JOIN ODS_D_HOSPITAL B ON A.HOSPITAL_NO=B.HOSPITAL_NO" + |
535 | 535 | // 医院,判断本院外院使用 |
536 | - " WHERE B.YCY_STSTEM_ID='" + hospitalId+"'"; | |
536 | + " WHERE B.YCY_STSTEM_ID='" + hospitalId + "'"; | |
537 | 537 | // 这三个查询条件暂时没用,直接注释掉 |
538 | 538 | // "AND B.PROVINCE_ID=" + |
539 | 539 | // "AND B.CITY_ID=" + |
540 | 540 | // "AND B.AREA_COUNTY_ID=" |
541 | 541 | if (StringUtils.isNotEmpty(babyStatisticsManagerBuildSourceListRequest.getBuildDate())) { |
542 | - sql += " AND A.INSERT_DATE BETWEEN TO_DATE('" + buildDateStart + "','YYYY-MM-DD') AND TO_DATE('" + buildDateEnd+"','YYYY-MM-DD')"; | |
542 | + sql += " AND A.INSERT_DATE BETWEEN TO_DATE('" + buildDateStart + "','YYYY-MM-DD') AND TO_DATE('" + buildDateEnd + "','YYYY-MM-DD')"; | |
543 | 543 | } |
544 | 544 | sql += " GROUP BY " + |
545 | 545 | "B.PROVINCE_ID," + |
... | ... | @@ -558,7 +558,7 @@ |
558 | 558 | "END)"; |
559 | 559 | // jdbc查oracle |
560 | 560 | // List<Map<String, Object>> list = JdbcUtil.getOracleListDataBySql("com.mysql.jdbc.Driver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); |
561 | - ExceptionUtils.catchException("babyStatisticsManagerBuildSourceList: "+sql); | |
561 | + ExceptionUtils.catchException("babyStatisticsManagerBuildSourceList: " + sql); | |
562 | 562 | List<Map<String, Object>> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.1.32:1521:orcl", "LYMS_ODS", "Welcome1", sql); |
563 | 563 | // 构造返回list,这里写死的4条,因为高帆说只有4条 |
564 | 564 | BabyStatisticsManagerBuildSourceListQueryModel babyStatisticsManagerBuildSourceListQueryModel1 = new BabyStatisticsManagerBuildSourceListQueryModel(); |
565 | 565 | |
... | ... | @@ -668,13 +668,13 @@ |
668 | 668 | " INNER JOIN ODS_D_HOSPITAL B ON A.HOSPITAL_NO=B.HOSPITAL_NO" + |
669 | 669 | " LEFT JOIN ODS_F_CHILD_PHYSICAL C ON A.RECORD_ID=C.RECORD_ID AND C.EXAMINE_HISTORY_NUM=1" + |
670 | 670 | " WHERE A.HOSPITAL_NO=A.BIRTH_HOSPITAL_NO" + |
671 | - " AND B.YCY_STSTEM_ID='" + hospitalId+"'"; | |
671 | + " AND B.YCY_STSTEM_ID='" + hospitalId + "'"; | |
672 | 672 | // 这三个查询条件暂时没用,直接注释掉 |
673 | 673 | // "AND B.PROVINCE_ID="+ |
674 | 674 | // "AND B.CITY_ID="+ |
675 | 675 | // "AND B.AREA_COUNTY_ID="+'2015-01-19','YYYY-MM-DD') |
676 | 676 | if (StringUtils.isNotEmpty(babyStatisticsManagerSelfConversionListRequest.getBirthDate())) { |
677 | - sql += " AND A.INSERT_DATE BETWEEN TO_DATE('" + birthDateStart + "','YYYY-MM-DD') AND TO_DATE('" + birthDateEnd+"','YYYY-MM-DD')"; | |
677 | + sql += " AND A.INSERT_DATE BETWEEN TO_DATE('" + birthDateStart + "','YYYY-MM-DD') AND TO_DATE('" + birthDateEnd + "','YYYY-MM-DD')"; | |
678 | 678 | } |
679 | 679 | sql += " GROUP BY " + |
680 | 680 | "B.PROVINCE_ID," + |
... | ... | @@ -689,7 +689,7 @@ |
689 | 689 | |
690 | 690 | // jdbc查oracle |
691 | 691 | // List<Map<String, Object>> list = JdbcUtil.getOracleListDataBySql("com.mysql.jdbc.Driver", "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "LYMS_ODS", "Welcome1", sql); |
692 | - ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList: "+sql); | |
692 | + ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList: " + sql); | |
693 | 693 | List<Map<String, Object>> list = JdbcUtil.getOracleListDataBySql("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@192.168.1.32:1521:orcl", "LYMS_ODS", "Welcome1", sql); |
694 | 694 | // List<Map<String, Object>> list = new ArrayList<>(); |
695 | 695 | // Map<String, Object> test1 = new HashMap<>(); |
696 | 696 | |
697 | 697 | |
698 | 698 | |
... | ... | @@ -737,27 +737,38 @@ |
737 | 737 | // 检查人数 |
738 | 738 | List<Integer> result = new ArrayList<>(); |
739 | 739 | Integer total = 0; |
740 | - ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList list result :" +list); | |
740 | + ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList list result :" + list); | |
741 | 741 | // 从0开始,没有也填充 |
742 | 742 | int index = 0; |
743 | - for (Integer i = 0; i <12 /*13*/; i++) { | |
744 | - try { | |
745 | - while (!i.toString().equals(list.get(index).get("examineMonth").toString()) && index > Integer.valueOf(list.get(index).get("examineMonth").toString())) { | |
746 | - index++; | |
747 | - } | |
748 | - } catch (Exception e) { | |
749 | - index++; | |
750 | - } | |
751 | - if (CollectionUtils.isEmpty(list) || list.size() /*< */>index || list.get(index) == null || !i.toString().equals(list.get(index).get("examineMonth").toString())) { | |
743 | + for (Integer i = 0; i < 12 /*13*/; i++) { | |
744 | +// try { | |
745 | +// while (!i.toString().equals(list.get(index).get("examineMonth").toString()) && index > Integer.valueOf(list.get(index).get("examineMonth").toString())) { | |
746 | +// index++; | |
747 | +// } | |
748 | +// } catch (Exception e) { | |
749 | +// index++; | |
750 | +// } | |
751 | +// if (CollectionUtils.isEmpty(list) || list.size() /*< */>index || list.get(index) == null || !i.toString().equals(list.get(index).get("examineMonth").toString())) { | |
752 | +// result.add(0); | |
753 | +// } else { | |
754 | +// try { | |
755 | +// result.add(Integer.valueOf(list.get(index).get("cnt").toString())); | |
756 | +// total += Integer.valueOf(list.get(index).get("cnt").toString()); | |
757 | +// index++; | |
758 | +// } catch (Exception e) { | |
759 | +// result.add(0); | |
760 | +// index++; | |
761 | +// } | |
762 | +// } | |
763 | + | |
764 | + if (CollectionUtils.isEmpty(list) || list.get(i) == null || null == list.get(i).get("examineMonth")) { | |
752 | 765 | result.add(0); |
753 | 766 | } else { |
754 | 767 | try { |
755 | - result.add(Integer.valueOf(list.get(index).get("cnt").toString())); | |
756 | - total += Integer.valueOf(list.get(index).get("cnt").toString()); | |
757 | - index++; | |
768 | + result.add(Integer.valueOf(list.get(i).get("cnt").toString())); | |
769 | + total += Integer.valueOf(list.get(i).get("cnt").toString()); | |
758 | 770 | } catch (Exception e) { |
759 | 771 | result.add(0); |
760 | - index++; | |
761 | 772 | } |
762 | 773 | } |
763 | 774 | } |