Commit 4e0f11f0344797e8500844526dade937641bcd4b
1 parent
78a08e39e4
Exists in
master
and in
6 other branches
update code
Showing 2 changed files with 30 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java
View file @
4e0f11f
... | ... | @@ -55,7 +55,13 @@ |
55 | 55 | queryFmPatient(startStr, endStr); |
56 | 56 | } |
57 | 57 | |
58 | + public void syncWorker(String startStr,String endStr) { | |
59 | + System.out.println("sync start="+startStr+"end="+endStr); | |
60 | + ExceptionUtils.catchException("start="+startStr+"end="+endStr); | |
61 | + queryFmPatient(startStr, endStr); | |
62 | + } | |
58 | 63 | |
64 | + | |
59 | 65 | public void queryFmPatient(String start,String end) { |
60 | 66 | |
61 | 67 | String cloumns = " SYXH as syxh,\n" + |
62 | 68 | |
... | ... | @@ -104,10 +110,12 @@ |
104 | 110 | " and SYXH not in (select SYXH from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null" + |
105 | 111 | " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 '))"; |
106 | 112 | List<FmItem> list = queryRunner.query(conn, sql, new BeanListHandler<FmItem>(FmItem.class)); |
107 | - ExceptionUtils.catchException("size=" + list.size()); | |
113 | + ExceptionUtils.catchException("size====" + list.size()); | |
114 | + ExceptionUtils.catchException("sql===" + sql); | |
108 | 115 | if (CollectionUtils.isNotEmpty(list)) { |
109 | 116 | for (FmItem item : list) { |
110 | 117 | try { |
118 | + ExceptionUtils.catchException("item===" + item); | |
111 | 119 | String dueDateStr = item.getSsrq(); |
112 | 120 | if (!StringUtils.isNotEmpty(dueDateStr)) { |
113 | 121 | continue; |
... | ... | @@ -196,7 +204,7 @@ |
196 | 204 | as.put("pf5", item.getWfz()); |
197 | 205 | as.put("pf10", item.getSfz()); |
198 | 206 | baby.setApgarScore(JsonUtil.obj2JsonString(as)); |
199 | - baby.setBabyGender(" 男 ".equals(item.getYexb()) ? "1" : "0"); | |
207 | + baby.setBabyGender("男".equals(item.getYexb()) ? "1" : "0"); | |
200 | 208 | baby.setBabyHeight(item.getSc());//新生儿生长 |
201 | 209 | baby.setBabyWeight(item.getTz());//新生儿重量 |
202 | 210 | baby.setDeformity("无".equals(item.getJx()) ? 0 : 1); //畸形 0非畸形 1畸形 |
... | ... | @@ -206,8 +214,8 @@ |
206 | 214 | baby.setDueTime(fmt1.format(dueDate));//分娩时间 |
207 | 215 | babies.add(baby); |
208 | 216 | deliverAddRequest.setFmHospital("216"); //设置为秦皇岛分娩医院 |
209 | - | |
210 | - matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
217 | + ExceptionUtils.catchException("deliverAddRequest===" + deliverAddRequest); | |
218 | +// matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
211 | 219 | } |
212 | 220 | |
213 | 221 | } |
... | ... | @@ -304,8 +312,8 @@ |
304 | 312 | deliverAddRequest.setDueWeek(week); |
305 | 313 | } |
306 | 314 | |
307 | - deliverAddRequest.setTireNumber(items.size());//TODO 胎数 | |
308 | - deliverAddRequest.setPlacenta(items.size()+"");//TODO 胎盘 | |
315 | + deliverAddRequest.setTireNumber(items.size()); | |
316 | + deliverAddRequest.setPlacenta(items.size()+""); | |
309 | 317 | |
310 | 318 | if ("完好".equals(item.getHyqk())) |
311 | 319 | { |
... | ... | @@ -381,7 +389,8 @@ |
381 | 389 | |
382 | 390 | } |
383 | 391 | deliverAddRequest.setFmHospital("216"); |
384 | - matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
392 | + ExceptionUtils.catchException("double deliverAddRequest===" + deliverAddRequest); | |
393 | +// matDeliverFacade.addOrUpdateMatDeliver(deliverAddRequest, users.get(0).getId()); | |
385 | 394 | } |
386 | 395 | |
387 | 396 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TestController.java
View file @
4e0f11f
1 | 1 | package com.lyms.platform.operate.web.controller; |
2 | 2 | |
3 | +import com.lyms.hospitalapi.qhdfy.QhdfyFmService; | |
3 | 4 | import com.lyms.hospitalapi.qhdfy.QhdfyHisService; |
4 | 5 | import com.lyms.platform.biz.JdbcUtil; |
5 | 6 | import com.lyms.platform.biz.service.*; |
... | ... | @@ -79,6 +80,9 @@ |
79 | 80 | |
80 | 81 | @Autowired |
81 | 82 | private BabyCheckFacade babyCheckFacade; |
83 | + | |
84 | + @Autowired | |
85 | + private QhdfyFmService qhdfyFmService; | |
82 | 86 | ; |
83 | 87 | |
84 | 88 | /** |
... | ... | @@ -981,6 +985,16 @@ |
981 | 985 | e.printStackTrace(); |
982 | 986 | } |
983 | 987 | return "updateBabyFmHid finish"; |
988 | + } | |
989 | + | |
990 | + | |
991 | + | |
992 | + | |
993 | + @RequestMapping(value = "/syncFmData", method = RequestMethod.GET) | |
994 | + @ResponseBody | |
995 | + public String syncFmData(@RequestParam(required = true) String start,@RequestParam(required = true) String end) { | |
996 | + qhdfyFmService.syncWorker(start,end); | |
997 | + return "syncFmData finish"; | |
984 | 998 | } |
985 | 999 | |
986 | 1000 | public static void main(String[] a) { |