路泰机电科技体检——数据平台后端
zhaowenxuan
2024-12-30 dd45098812d61999f588bb34b483d236470a1067
调整西安煤机医院字典同步类
1个文件已修改
31 ■■■■ 已修改文件
src/main/java/com/example/utils/synczd/DictionaryUtilShanXiXiAnMeiJiYy.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/utils/synczd/DictionaryUtilShanXiXiAnMeiJiYy.java
@@ -85,7 +85,11 @@
            return;
        for (HisSyncDict hisSyncDict : hisSyncDicts) {
            boolean isFormatJson = false;
            if (hisSyncDict.getDictName().equals("getKeShizd") || hisSyncDict.getDictName().equals("getKeShiByConditionszd")|| hisSyncDict.getDictName().equals("getShouFeiXmzd"))
            if (hisSyncDict.getDictName().equals("getKeShizd")
                    || hisSyncDict.getDictName().equals("getKeShiByConditionszd")
                    || hisSyncDict.getDictName().equals("getShouFeiXmzd")
                    || hisSyncDict.getDictName().equals("getListYiShengZd")
            )
                isFormatJson = true;
            hisSyncDict.setDictName(hisSyncDict.getHospId()+"_"+hisSyncDict.getDictName());
            extracted(NAME, connection, hisSyncDict,token,isFormatJson);
@@ -115,7 +119,7 @@
        JSONObject entries = execRequest(object.toString(),hisSyncDict,token);
        log.info("请求返回 ->{}", entries.toString());
        if (isFormatJson){
            if (entries != null && "1".equals(entries.getStr("returnCode"))) {
            if ("1".equals(entries.getStr("returnCode"))) {
                JSONObject response = entries.getJSONObject("returnData");
                try {
                    dropTable(tabName, connection);
@@ -151,7 +155,17 @@
                }
            }
        }else {
            if (entries != null && "1".equals(entries.getStr("returnCode"))) {
            if ("1".equals(entries.getStr("returnCode"))) {
                Object returnData = entries.get("returnData");
                if (returnData instanceof JSONObject){
                    JSONObject response = entries.getJSONObject("returnData");
                    try {
                        dropTable(tabName, connection);
                    } catch (SQLException e) {
                        log.error("删除表异常 ->{}", e.getMessage());
                    }
                    editDataBase(connection, tabName, response, name);
                }else {
                JSONArray response = entries.getJSONArray("returnData");
                try {
                    dropTable(tabName, connection);
@@ -162,7 +176,9 @@
                } catch (SQLException e) {
                    log.error("删除表异常 ->{}", e.getMessage());
                }
                }
                if (isLimit) {
                    JSONArray response = entries.getJSONArray("returnData");
                    if (tabName.contains("_getjianchaxmzd")) maxPage = 10000;
                    log.info("计算页码为 ->{}", maxPage);
                    if (maxPage > 1) {
@@ -184,15 +200,12 @@
                        }
                    }
                } else {
                    JSONArray response = entries.getJSONArray("returnData");
                    List<JSONObject> list = JSONUtil.toList(response, JSONObject.class);
                    for (JSONObject jsonObject : list) {
                        editDataBase(connection, tabName, jsonObject, name);
                    }
                }
            }
        }
@@ -248,6 +261,7 @@
            log.error("对比字段插入数据异常");
            log.error(e.getSQLState());
            log.error(e.getMessage());
            e.printStackTrace();
        }
    }
@@ -269,7 +283,8 @@
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            connection.setRequestProperty("Authorization", token);
            if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){
            log.info("请求接口 ->{}", hisSyncDict.getUrl());
            if (hisSyncDict.getUrl().equals("/zhuShuJu/getListYiShengZd") || hisSyncDict.getUrl().equals("/zhuShuJu/getZhiGongPage") || hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm")){
                connection.setRequestProperty("dangQianYhId","DBA");
                if (hisSyncDict.getUrl().equals("/zhuShuJu/getJianChaXm"))
                    connection.setRequestProperty("yuanQuId","1");