Commit 3ab4c6e15d6a73d2d06723db83afe8e4374a4a49

Authored by gengxiaokai
1 parent e9a9e9cc8b

德州分娩接口

Showing 1 changed file with 8 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/dzfy/DzfyFmService.java View file @ 3ab4c6e
... ... @@ -157,7 +157,7 @@
157 157  
158 158  
159 159 //Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection();
160   - Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeLocalConnection();
  160 + Connection conn = com.lyms.hospitalapi.dzfy.ConnTools.makeHisConnection();
161 161 QueryRunner queryRunner = new QueryRunner();
162 162 SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
163 163 try {
164 164  
... ... @@ -180,13 +180,17 @@
180 180 String id = fm.getID();//获取所有的孕妇ID,方便孕妇产下双胞胎而用
181 181  
182 182 //用来查询这个孕妇分娩的最近日期的sql
183   - String dateSql = "select max(to_char(BABY_DELIVERY_TIME,'yyyy-mm-dd')) as babyDate from zlhis.v_deliveryinfo where " +
  183 + String dateSql = "select max(to_char(BABY_DELIVERY_TIME,'yyyy-mm-dd hh24:mi:ss')) as babyDate from zlhis.v_deliveryinfo where " +
184 184 " ID='"+id+"'" ;
185 185  
186 186 //获取到这个孕妇的最近的分娩日期
187 187 List<Fm> dateList = queryRunner.query(conn, dateSql, new BeanListHandler<Fm>(Fm.class));
188   - String startDate = dateList.get(0).getBabyDate()+" 00:00:00";
189   - String endDate = dateList.get(0).getBabyDate()+" 23:59:59";
  188 + Calendar calendar = Calendar.getInstance();
  189 + calendar.setTime(fmt.parse(dateList.get(0).getBabyDate()));
  190 + calendar.add(Calendar.DAY_OF_MONTH, -1);
  191 + Date sDate = calendar.getTime();
  192 + String startDate = fmt.format(sDate);
  193 + String endDate = dateList.get(0).getBabyDate();
190 194  
191 195 //查询这个孕妇最近日期所有分娩记录的sql
192 196 String allSql = "select "+cloumns+" from zlhis.v_deliveryinfo where " +