| | |
| | | return AjaxResult.success("同步任务已启动,请稍后查看结果"); |
| | | } |
| | | |
| | | @PostMapping("/syncMedInhospForShiyiDaysBefore") |
| | | public AjaxResult syncMedInhospForShiyiDaysBefore(@RequestParam("day") Long day) { |
| | | // 立即返回,后台异步执行 |
| | | ryTask.collectHISDaysBefore(day); |
| | | return AjaxResult.success("【collectHISDaysBefore】同步任务已启动,天数为" + day + "天,请稍后查看结果"); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/syncMedOperForShiyi") |
| | | public AjaxResult syncMedOperForShiyi(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) { |
| | |
| | | Integer count = 0; |
| | | List<Map<String, Object>> syncList = utilsMapper.getList("SELECT id,syncName,DATE_FORMAT(ADDDATE(startTime, INTERVAL -1 MINUTE), '%Y-%m-%d %H:%i:%s') startTime FROM sys_sync_time where state=0"); |
| | | if (syncList.size() > 0) { |
| | | String endTime = chMapper.getSqlString("select sysdate from healthy_inhosp where rownum=1"); |
| | | String endTime = chMapper.getSqlString("select (sysdate-1) as endtime from healthy_inhosp where rownum=1"); |
| | | //同步患者基本信息 |
| | | // List<Map<String, Object>> syncTemp = syncList.stream().filter(row -> row.get("syncName").equals("pat_archive")).collect(Collectors.toList()); |
| | | // if (syncTemp.size() > 0) { |
| | |
| | | String startTime = daysBeforeZeroStart.format(formatter); |
| | | String endTime = daysBeforeZeroEnd.format(formatter); |
| | | // HIS数据采集 |
| | | log.info("【collectHISDaysBefore】HIS开始采集数据"); |
| | | log.info("【collectHISDaysBefore】HIS开始采集数据: startTime:{}, endtime:{}",startTime, endTime); |
| | | // 立即返回,后台异步执行 |
| | | CompletableFuture.runAsync(() -> { |
| | | ichService.syncMedInhosp(startTime, endTime); |
| | | }); |
| | | log.info("【collectHISDaysBefore】HIS结束采集数据"); |
| | | log.info("【collectHISDaysBefore】HIS结束采集数据: startTime:{}, endtime:{}",startTime, endTime); |
| | | } catch (Exception e) { |
| | | log.error("【collectHISDaysBefore】HIS数据采集异常", e); |
| | | } |