zjh
2024-07-19 2f9691b8de0e2800f22ce96768aacfd129f02b3c
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCheckController.java
@@ -320,8 +320,11 @@
    @GetMapping ("/dataSynchronization")
    @ApiOperation (value = "同步sql server数据到本地数据库数据接口")
    @RepeatSubmit
    @Transactional
//    @Transactional
    public AjaxResult dataSynchronization(@RequestParam String tjNumber) {
        //根据配置调取存储过程 将临时表数据存入预约表2023.12.12
        final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData");
@@ -377,10 +380,7 @@
                        return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!");
                    }
                    JSONArray data = object.getJSONArray("ResultData");
//                    int size = data.size();
//                    if(size>0){
//
//                     }
                    for (Object datum : data) {
                        JSONObject jsonObject = (JSONObject) datum;
                        LtkjHysqd jybgid = ltkjHysqdService.getLtkjHysqdByTjhAndTmh(order.getCardId(), jsonObject.getStr("JYBGID"));
@@ -469,13 +469,21 @@
                        }
                    }
                    //同步检查
                    Map<String, Object> maps = new HashMap<>();
                    maps.put("his_registration_id", order.getCardId());
                    maps.put("ksbm", "体检中心");
                    maps.put("pagecount", 100);
                    maps.put("page", 1);
                    AjaxResult results = service.getHISDataNew("Getexamreportinfo", maps);
                    /*同步检查 his接口*/
//                    Map<String, Object> maps = new HashMap<>();
//                    maps.put("his_registration_id", order.getCardId());
//                    maps.put("ksbm", "体检中心");
//                    maps.put("pagecount", 100);
//                    maps.put("page", 1);
//                    AjaxResult results = service.getHISDataNew("Getexamreportinfo", maps);
                    /*同步检查 his存储过程*/
                    AjaxResult results = jcsqdService.getTjJcProByHisCall("体检中心",order.getCardId(),"''",100,1,"'1'");
                    DynamicDataSourceContextHolder.clearDataSourceType();
                    if (Integer.parseInt(results.get("code").toString()) == 200) {
                        List<Map<String, Object>> datas = (List<Map<String, Object>>) results.get("data");
                        if(null !=datas && datas.size()>0){
@@ -541,6 +549,7 @@
                asyncService.updateCheckType(order.getTjNumber());
            }
            return AjaxResult.success("同步成功");
//            return AjaxResult.error("化验项目暂时无结果,请稍后同步!!!");
        }
        return AjaxResult.error();
    }