| | |
| | | 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); |
| | |
| | | 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"); |
| | | } |
| | | |
| | |
| | | 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")) { |
| | |
| | | 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); |
| | |
| | | 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")) { |
| | |
| | | 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); |
| | |
| | | } |
| | | 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(); |
| | |
| | | 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")){ |
| | |
| | | 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")){ |
| | |
| | | } |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | 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 对象 |
| | |
| | | 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); |