路泰机电科技体检——数据平台后端
zhaowenxuan
2025-02-15 c00a5c22a3eacb6319a82d3ddabbde226f81a572
20250215
5个文件已修改
46 ■■■■ 已修改文件
src/main/java/com/example/service/gansu/pingliang/JingChuanXianRenMinHisService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/service/shanxiqin/weinan/PbkwyyHisService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/utils/HttpClientUtils.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/example/service/gansu/pingliang/JingChuanXianRenMinHisService.java
@@ -182,7 +182,9 @@
    public void syncDict(String hospName) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("hosp","shanxiqinxamjyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","gspljcxyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map,headers);
        JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data");
        if (jsonArray != null && !jsonArray.isEmpty()) {
            List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class);
src/main/java/com/example/service/shanxiqin/weinan/PbkwyyHisService.java
@@ -50,7 +50,7 @@
        this.applicationContext = applicationContext;
        this.configValue = configValue;
        HIS_URL = configValue.getConfigValue("ShanXi_Qin_WeiNan_Pbkwyy.his_api_url") + ":" + configValue.getConfigValue("ShanXi_Qin_WeiNan_Pbkwyy.his_api_port") + configValue.getConfigValue("ShanXi_Qin_WeiNan_Pbkwyy.hisapiappend");
        TJ_URL = configValue.getConfigValue("ShanXi_Qin_WeiNan_Pbkwyy.tjUrl");
        TJ_URL = configValue.getConfigValue("tjUrl");
        CZY = configValue.getConfigValue("ShanXi_Qin_WeiNan_Pbkwyy.czy");
    }
@@ -406,7 +406,9 @@
        map.put ("yeWuLx",string);
        // 参数类型区分
        map.put("type","1");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/pushZhiFuMsg", map);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","pbkwyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/pushZhiFuMsg", map,headers);
        JSONObject jsonObject = JSONUtil.parseObj(post);
        JSONObject obj = JSONUtil.createObj();
        if (jsonObject.getStr("code").equals("200")) {
@@ -535,7 +537,9 @@
    public void syncDict(String hospName) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("hosp","shanxiqinpbkwyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","pbkwyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map,headers);
        JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data");
        if (jsonArray != null && !jsonArray.isEmpty()) {
            List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class);
src/main/java/com/example/service/shanxiqin/xian/MeiJiHisService.java
@@ -408,7 +408,9 @@
        map.put ("yeWuLx",string);
        // 参数类型区分
        map.put("type","1");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/pushZhiFuMsg", map);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","xamjyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/pushZhiFuMsg", map,headers);
        JSONObject jsonObject = JSONUtil.parseObj(post);
        JSONObject obj = JSONUtil.createObj();
        if (jsonObject.getStr("code").equals("200")) {
@@ -537,7 +539,9 @@
    public void syncDict(String hospName) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("hosp","shanxiqinxamjyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","xamjyy");
        String post = HttpClientUtils.sendPost(TJ_URL + "/callBack/getZdList", map,headers);
        JSONArray jsonArray = JSONUtil.parseObj(post).getJSONArray("data");
        if (jsonArray != null && !jsonArray.isEmpty()) {
            List<HisSyncDict> list = jsonArray.toList(HisSyncDict.class);
src/main/java/com/example/service/shanxiqin/xian/MeiJiLisService.java
@@ -115,7 +115,7 @@
        }
        hashMap.put("OderInfoList",orderInfoList);
        log.info("申请单 ->{}",JSONUtil.toJsonStr(hashMap));
        String post = sendPost(LIS_URL + "/lisinterface" + "/HisApplyList", hashMap);
        String post = sendPost(LIS_URL + "/lisinterface" + "/HisApplyList", hashMap,new HashMap<>());
        JSONObject entries = JSONUtil.parseObj(post);
        if (entries.getStr("MsgCode").equals("0"))
            return AjaxResult.success();
@@ -126,7 +126,9 @@
    public String getXmlList(Map<String, Object> map) {
        Map<String, Object> request = (Map<String, Object>) map.get("Request");
        String hospitalId = request.get("HospitalId").toString();
        String json = sendPost(TJ_URL + "/callBack/getZdList", new HashMap<>());
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","xamjyy");
        String json = sendPost(TJ_URL + "/callBack/getZdList", new HashMap<>(),headers);
        JSONObject entries = JSONUtil.parseObj(json);
        JSONObject result = JSONUtil.createObj();
        if (entries.getStr("code").equals("200")){
@@ -200,7 +202,9 @@
        hashMap.put("keys",keys);
        hashMap.put("czy",personid);
        hashMap.put("hospid",hospitalid);
        String post = sendPost(TJ_URL + "/callBack/lisRevoke", hashMap);
        HashMap<String, Object> headers = new HashMap<>();
        headers.put("hospId","xamjyy");
        String post = sendPost(TJ_URL + "/callBack/lisRevoke", hashMap,headers);
        JSONObject entries = JSONUtil.parseObj(post);
        JSONObject object = JSONUtil.createObj();
        if (entries.getStr("code").equals("200")){
@@ -212,7 +216,7 @@
        }
    }
    private String sendPost(String url, Map<String, Object> hashMap){
        return HttpClientUtils.sendPost(url, hashMap);
    private String sendPost(String url, Map<String, Object> hashMap,Map<String ,Object> headers){
        return HttpClientUtils.sendPost(url, hashMap,headers);
    }
}
src/main/java/com/example/utils/HttpClientUtils.java
@@ -97,7 +97,7 @@
    }
    public static String sendPost(String httpUrl, Map<String, Object> maps) {
    public static String sendPost(String httpUrl, Map<String, Object> maps,Map<String ,Object> headers) {
        try {
            // 1. 创建 URL 对象
@@ -108,11 +108,17 @@
            connection.setRequestMethod("POST");
            // 4. 设置 Content-Type 头部字段
            connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
            if (headers != null && !headers.isEmpty()){
                for (Map.Entry<String, Object> entry : headers.entrySet()) {
                    connection.setRequestProperty(entry.getKey(), entry.getValue().toString());
                }
            }
            // 6. 向服务器发送数据
            String requestBody = JSONUtil.toJsonStr(maps);
            log.info(httpUrl+"入参:   "+requestBody);
            log.info("请求头 ->{}",JSONUtil.toJsonStr(headers));
//            String requestBody1 = maps.toString();
            byte[] postData = requestBody.getBytes("UTF-8");
            byte[] postData = requestBody.getBytes(StandardCharsets.UTF_8);
            connection.setDoOutput(true);
            try (OutputStream outputStream = connection.getOutputStream()) {
                outputStream.write(postData);