Commit 8939072c16ff7dce1444d40e75e5dc2f8b66c9e8
1 parent
c5e5a541c3
Exists in
master
and in
6 other branches
德州分娩接口
Showing 2 changed files with 25 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyFmService.java
View file @
8939072
| ... | ... | @@ -176,18 +176,27 @@ |
| 176 | 176 | int a = 0;//用来判断是否建了儿童档案,如果建了儿童档案就不保存分娩记录 |
| 177 | 177 | int count = 0; |
| 178 | 178 | List<Users> users = new ArrayList<Users>(); |
| 179 | - //String id = fm.getID();//获取所有的孕妇ID,方便孕妇产下双胞胎而用 | |
| 180 | - //String allSql = "select "+cloumns+" from zlhis.v_deliveryinfo where " + | |
| 181 | - // " BABY_DELIVERY_TIME > to_date('"+start+"', 'yyyy-mm-dd hh24:mi:ss') and BABY_DELIVERY_TIME <= to_date('"+end+"', 'yyyy-mm-dd hh24:mi:ss')" + | |
| 182 | - // " ID='"+id+"'" ; | |
| 179 | + String id = fm.getID();//获取所有的孕妇ID,方便孕妇产下双胞胎而用 | |
| 183 | 180 | |
| 181 | + //用来查询这个孕妇分娩的最近日期的sql | |
| 182 | + String dateSql = "select max(to_char(BABY_DELIVERY_TIME,'yyyy-mm-dd')) as babyDate from zlhis.v_deliveryinfo where " + | |
| 183 | + " ID='"+id+"'" ; | |
| 184 | 184 | |
| 185 | + //获取到这个孕妇的最近的分娩日期 | |
| 186 | + List<Fm> dateList = queryRunner.query(conn, dateSql, new BeanListHandler<Fm>(Fm.class)); | |
| 187 | + String startDate = dateList.get(0).getBabyDate()+" 00:00:00"; | |
| 188 | + String endDate = dateList.get(0).getBabyDate()+" 23:59:59"; | |
| 185 | 189 | |
| 190 | + //查询这个孕妇最近日期所有分娩记录的sql | |
| 191 | + String allSql = "select "+cloumns+" from zlhis.v_deliveryinfo where " + | |
| 192 | + " BABY_DELIVERY_TIME > to_date('"+startDate+"', 'yyyy-mm-dd hh24:mi:ss') and BABY_DELIVERY_TIME <= to_date('"+endDate+"', 'yyyy-mm-dd hh24:mi:ss')" + | |
| 193 | + " ID='"+id+"'" ; | |
| 194 | + | |
| 186 | 195 | //查出这个ID对应孕妇在这个时间段的分娩记录 |
| 187 | - //List<Fm> allList = queryRunner.query(conn, allSql, new BeanListHandler<Fm>(Fm.class)); | |
| 196 | + List<Fm> allList = queryRunner.query(conn, allSql, new BeanListHandler<Fm>(Fm.class)); | |
| 188 | 197 | |
| 189 | - List<Fm> allList = new ArrayList<Fm>(); | |
| 190 | - allList.add(fm); | |
| 198 | + //List<Fm> allList = new ArrayList<Fm>(); | |
| 199 | + //allList.add(fm); | |
| 191 | 200 | |
| 192 | 201 | Date dueDate = null; |
| 193 | 202 | List<MatDeliverAddRequest.Baby> babies = new ArrayList<>(); |
platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/Fm.java
View file @
8939072
| ... | ... | @@ -68,6 +68,15 @@ |
| 68 | 68 | private Date MODIFIED; //修改时间 |
| 69 | 69 | private Date CREATED; //创建时间 |
| 70 | 70 | |
| 71 | + private String babyDate;//接收孕妇分娩最近日期 | |
| 72 | + | |
| 73 | + public String getBabyDate() { | |
| 74 | + return babyDate; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setBabyDate(String babyDate) { | |
| 78 | + this.babyDate = babyDate; | |
| 79 | + } | |
| 71 | 80 | |
| 72 | 81 | public String getID() { |
| 73 | 82 |