zhaowenxuan
2024-10-16 cd6114bf85d19e6bdcd6a17c66f34b8c838870d5
ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiGetMethodService.java
@@ -282,22 +282,26 @@
        } else{
            response = JSONUtil.parseObj(responseJson);
        }
        if (response.getStr(apiConfig.getResultCodeKey()).equals("0")) {
        if (response.getStr(apiConfig.getResultCodeKey()).equals("1")) {
            AjaxResult ajaxResult = AjaxResult.success();
            JSONArray resultData = response.getJSONArray(apiConfig.getResultDataKey());
            List<Map<String, String>> list = new ArrayList<>();
            for (Object resultDatum : resultData) {
                JSONObject object = (JSONObject) resultDatum;
                ajaxResult = save(object, type,apiConfig,JSONUtil.toJsonStr(params));
                Map<String, String> map = new HashMap<>();
                for (String key : object.keySet()) {
                    String defaultVal = object.get(key).toString();
                    String val = defaultVal.trim().replaceAll("\\s+", "");
                    map.put(key, val);
            if (response.getStr(apiConfig.getResultDataKey()) != null && StrUtil.isNotBlank(response.getStr(apiConfig.getResultDataKey()))){
                JSONArray resultData = response.getJSONArray(apiConfig.getResultDataKey());
                List<Map<String, String>> list = new ArrayList<>();
                for (Object resultDatum : resultData) {
                    JSONObject object = (JSONObject) resultDatum;
                    ajaxResult = save(object, type,apiConfig,JSONUtil.toJsonStr(params));
                    Map<String, String> map = new HashMap<>();
                    for (String key : object.keySet()) {
                        String defaultVal = object.get(key).toString();
                        String val = defaultVal.trim().replaceAll("\\s+", "");
                        map.put(key, val);
                    }
                    list.add(map);
                }
                list.add(map);
                ajaxResult.put("data", list);
            }else {
                ajaxResult.put("data",response);
            }
            ajaxResult.put("data", list);
            return ajaxResult;
        } else {
            return AjaxResult.error().put("result", JSONUtil.parseObj(responseJson));