From 4e665643caa5912c240dee6f34bf2c227de6d304 Mon Sep 17 00:00:00 2001 From: qiuyt Date: Mon, 11 Nov 2024 18:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=9B=E5=B7=9D=E5=B9=B3?= =?UTF-8?q?=E6=AD=A6json=E8=BD=AC=E6=8D=A2=E7=B2=BE=E5=BA=A6=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E5=9B=9B=E5=B7=9D=E5=B9=B3=E6=AD=A6=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E6=B3=95=E9=83=BD=E5=8F=98=E6=88=90=E4=BB=96?= =?UTF-8?q?=E4=BB=AC=E4=B8=93=E7=94=A8=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../mipsdl/client/scpwxyy/ScpwxyyClient.java | 17 ++++++++++++----- .../com/glxp/mipsdl/service/yb/YbClient.java | 13 ++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 8bf2cb8..ebffb18 100644 --- a/pom.xml +++ b/pom.xml @@ -121,7 +121,7 @@ cn.hutool hutool-all - 5.8.12 + 5.8.33 diff --git a/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java b/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java index 4a7e37e..0e3f83b 100644 --- a/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java +++ b/src/main/java/com/glxp/mipsdl/client/scpwxyy/ScpwxyyClient.java @@ -6,10 +6,13 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONConfig; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.TypeReference; +import com.alibaba.fastjson.serializer.SerializeConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -1872,9 +1875,12 @@ public class ScpwxyyClient extends CommonHttpClient { JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPostScyh("3505A", dataJson); + return ybClient.ybPostScyh("3505A", dataJson); + + }else { + return ResultVOUtils.error(500,"未上传医保视图数据查不到"); } - return ResultVOUtils.success(); + } @@ -1918,7 +1924,7 @@ public class ScpwxyyClient extends CommonHttpClient { basePcsc3501Request.setSelinfoDetail(pcsc3501Requests); String jsonStr = JSONUtil.toJsonStr(basePcsc3501Request); JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPost("3501A", dataJson); + ybClient.ybPostScyh("3501A", dataJson); } } @@ -1964,7 +1970,7 @@ public class ScpwxyyClient extends CommonHttpClient { baseKcbg3502Request.setSelinfoDetail(kcbg3502Requests); String jsonStr = JSONUtil.toJsonStr(baseKcbg3502Request); JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPost("3502A", dataJson); + ybClient.ybPostScyh("3502A", dataJson); } } @@ -2022,10 +2028,11 @@ public class ScpwxyyClient extends CommonHttpClient { } + BaseXsth3506Request baseXsth3506Request = new BaseXsth3506Request(); baseXsth3506Request.setSelinfoDetail(xsth3506Requests); String jsonStr = JSONUtil.toJsonStr(baseXsth3506Request); JSONObject dataJson = JSONObject.parseObject(jsonStr); - ybClient.ybPost("3506A", dataJson); + ybClient.ybPostScyh("3506A", dataJson); } } diff --git a/src/main/java/com/glxp/mipsdl/service/yb/YbClient.java b/src/main/java/com/glxp/mipsdl/service/yb/YbClient.java index 7afdfe8..d963374 100644 --- a/src/main/java/com/glxp/mipsdl/service/yb/YbClient.java +++ b/src/main/java/com/glxp/mipsdl/service/yb/YbClient.java @@ -91,7 +91,9 @@ public class YbClient { log.info("[" + apiNo + "]医保接口请求参数:" + data); ThrYbSetup thrYbSetup = thrYbSetupService.getSetUp(); if (thrYbSetup == null) + { throw new RuntimeException("未配置医保接口"); + } // 组装访问数据 SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); // 获取当前日期和时间 @@ -135,7 +137,10 @@ public class YbClient { jsonObject.put("input", jsonObjectSignIn); try { - String json = HttpUtil.post(thrYbSetup.getIp(), JSONUtil.toJsonStr(jsonObject)); + log.info("医保签到入参===" + JSONUtil.toJsonStr(jsonObject)); + String json = HttpUtil.post(thrYbSetup.getUrl(), JSONUtil.toJsonStr(jsonObject)); + log.info("医保签到返回===" + json); + // String json = "{\n" + // " \"output\":{\n" + // " \"signinoutb\":{\n" + @@ -178,16 +183,18 @@ public class YbClient { jsonObject.put("infno", apiNo); jsonObject.put("input", data); jsonObject.put("sign_no", signNo); + log.info("上传医保入参===" + JSONUtil.toJsonStr(jsonObject)); + String json; try { - String json = HttpUtil.post(thrYbSetup.getIp(), JSONUtil.toJsonStr(jsonObject)); + json= HttpUtil.post(thrYbSetup.getUrl(), JSONUtil.toJsonStr(jsonObject)); log.info("上传医保结果===" + json); + return ResultVOUtils.success("上传医保结果===" + json); }catch (Exception e){ return ResultVOUtils.error(500, "上传医保失败!!"+e.getMessage()); } // - return ResultVOUtils.success(); }