|
|
|
@ -11,6 +11,7 @@ import com.ynxbd.common.bean.enums.HealthCardEnum; |
|
|
|
import com.ynxbd.common.bean.Patient; |
|
|
|
import com.ynxbd.common.bean.Patient; |
|
|
|
import com.ynxbd.common.bean.enums.HealthCardRespCodeEnum; |
|
|
|
import com.ynxbd.common.bean.enums.HealthCardRespCodeEnum; |
|
|
|
import com.ynxbd.common.helper.ProperHelper; |
|
|
|
import com.ynxbd.common.helper.ProperHelper; |
|
|
|
|
|
|
|
import com.ynxbd.common.helper.common.JsonHelper; |
|
|
|
import com.ynxbd.wx.config.WeChatConfig; |
|
|
|
import com.ynxbd.wx.config.WeChatConfig; |
|
|
|
import com.ynxbd.common.dao.PatientDao; |
|
|
|
import com.ynxbd.common.dao.PatientDao; |
|
|
|
import com.ynxbd.common.config.EhCacheConfig; |
|
|
|
import com.ynxbd.common.config.EhCacheConfig; |
|
|
|
@ -117,7 +118,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.getAppToken(commonIn, H_APP_ID); |
|
|
|
JSONObject resultObj = healthCard.getAppToken(commonIn, H_APP_ID); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]获取appToken失败-" + resultObj); |
|
|
|
log.info("[电子健康卡]获取appToken失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -213,7 +214,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.registerHealthCard(commonIn, healthCardInfoReq); |
|
|
|
JSONObject resultObj = healthCard.registerHealthCard(commonIn, healthCardInfoReq); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]注册失败-" + resultObj); |
|
|
|
log.info("[电子健康卡]注册失败: {}", resultObj); |
|
|
|
return commonOut; |
|
|
|
return commonOut; |
|
|
|
} |
|
|
|
} |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
@ -243,7 +244,7 @@ public class HCodeService { |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject rspObj = resultObj.getJSONObject("rsp"); |
|
|
|
JSONObject rspObj = resultObj.getJSONObject("rsp"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode")) || rspObj == null) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode")) || rspObj == null) { |
|
|
|
log.info("[电子健康卡]授权码获取健康卡失败:" + resultObj); |
|
|
|
log.info("[电子健康卡]授权码获取健康卡失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject card = rspObj.getJSONObject("card"); |
|
|
|
JSONObject card = rspObj.getJSONObject("card"); |
|
|
|
@ -254,7 +255,7 @@ public class HCodeService { |
|
|
|
|
|
|
|
|
|
|
|
Patient patient = new Patient(); |
|
|
|
Patient patient = new Patient(); |
|
|
|
String phone1 = card.getString("phone1"); |
|
|
|
String phone1 = card.getString("phone1"); |
|
|
|
if (phone1 == null || "".equals(phone1)) { |
|
|
|
if (ObjectUtils.isEmpty(phone1)) { |
|
|
|
patient.setTel(card.getString("phone2")); |
|
|
|
patient.setTel(card.getString("phone2")); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
patient.setTel(phone1); |
|
|
|
patient.setTel(phone1); |
|
|
|
@ -268,7 +269,7 @@ public class HCodeService { |
|
|
|
patient.setBirthday(card.getString("birthday")); |
|
|
|
patient.setBirthday(card.getString("birthday")); |
|
|
|
patient.setHealthCardId(card.getString("healthCardId")); |
|
|
|
patient.setHealthCardId(card.getString("healthCardId")); |
|
|
|
patient.setCardType(card.getString("idType")); |
|
|
|
patient.setCardType(card.getString("idType")); |
|
|
|
log.info("[一键绑定]获取用户信息 patient={}", patient); |
|
|
|
log.info("[一键绑定]获取用户信息 {}", JsonHelper.toJsonString(patient)); |
|
|
|
return patient; |
|
|
|
return patient; |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
ErrorHelper.println(e); |
|
|
|
ErrorHelper.println(e); |
|
|
|
@ -299,7 +300,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.getHealthCardByQRCode(commonIn, qrCode); |
|
|
|
JSONObject resultObj = healthCard.getHealthCardByQRCode(commonIn, qrCode); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]二维码获取健康卡失败:" + resultObj); |
|
|
|
log.info("[电子健康卡]二维码获取健康卡失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject respJson = resultObj.getJSONObject("rsp"); |
|
|
|
JSONObject respJson = resultObj.getJSONObject("rsp"); |
|
|
|
@ -349,7 +350,7 @@ public class HCodeService { |
|
|
|
JSONObject resultJson = healthCard.registerUniformVerifyOrder(commonIn, idCardNo, "01", name, wechatCode); |
|
|
|
JSONObject resultJson = healthCard.registerUniformVerifyOrder(commonIn, idCardNo, "01", name, wechatCode); |
|
|
|
JSONObject commonOut = resultJson.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultJson.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]实人认证生成orderId接口失败:" + resultJson); |
|
|
|
log.info("[电子健康卡]实人认证生成orderId接口失败: {}", resultJson); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject respJson = resultJson.getJSONObject("rsp"); |
|
|
|
JSONObject respJson = resultJson.getJSONObject("rsp"); |
|
|
|
@ -384,7 +385,7 @@ public class HCodeService { |
|
|
|
JSONObject resultJson = healthCard.checkUniformVerifyResult(commonIn, verifyOrderId, registerOrderId); |
|
|
|
JSONObject resultJson = healthCard.checkUniformVerifyResult(commonIn, verifyOrderId, registerOrderId); |
|
|
|
JSONObject commonOut = resultJson.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultJson.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]实人认证结果查询失败:" + resultJson); |
|
|
|
log.info("[电子健康卡]实人认证结果查询失败: {}", resultJson); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject respJson = resultJson.getJSONObject("rsp"); |
|
|
|
JSONObject respJson = resultJson.getJSONObject("rsp"); |
|
|
|
@ -419,7 +420,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.getOrderIdByOutAppId(commonIn, WeChatConfig.APP_ID, qrCodeText); |
|
|
|
JSONObject resultObj = healthCard.getOrderIdByOutAppId(commonIn, WeChatConfig.APP_ID, qrCodeText); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]获取卡包订单ID 失败:" + resultObj); |
|
|
|
log.info("[电子健康卡]获取卡包订单ID 失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
@ -512,7 +513,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.getDynamicQRCode(commonIn, healthCardId, "01", idCardNo, codeType); |
|
|
|
JSONObject resultObj = healthCard.getDynamicQRCode(commonIn, healthCardId, "01", idCardNo, codeType); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("获取健康卡二维码失败, resp-{}", resultObj); |
|
|
|
log.info("获取健康卡二维码失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
@ -548,7 +549,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.bindCardRelation(commonIn, patientId, qrCodeText); |
|
|
|
JSONObject resultObj = healthCard.bindCardRelation(commonIn, patientId, qrCodeText); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]绑定健康卡和医院关系-" + resultObj); |
|
|
|
log.info("[电子健康卡]绑定健康卡和医院关系失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
return resultObj.getJSONObject("rsp"); |
|
|
|
@ -670,7 +671,7 @@ public class HCodeService { |
|
|
|
JSONObject resultObj = healthCard.ocrInfo(commonIn, imageContent); |
|
|
|
JSONObject resultObj = healthCard.ocrInfo(commonIn, imageContent); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = resultObj.getJSONObject("commonOut"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode"))) { |
|
|
|
log.info("[电子健康卡]身份证识别失败-" + resultObj); |
|
|
|
log.info("[电子健康卡]身份证识别失败: {}", resultObj); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONObject rsp = resultObj.getJSONObject("rsp"); |
|
|
|
JSONObject rsp = resultObj.getJSONObject("rsp"); |
|
|
|
@ -781,7 +782,7 @@ public class HCodeService { |
|
|
|
JSONObject commonOut = healthCardInfosRsp.getJSONObject("commonOut"); |
|
|
|
JSONObject commonOut = healthCardInfosRsp.getJSONObject("commonOut"); |
|
|
|
JSONObject rspObj = healthCardInfosRsp.getJSONObject("rsp"); |
|
|
|
JSONObject rspObj = healthCardInfosRsp.getJSONObject("rsp"); |
|
|
|
if (!"0".equals(commonOut.getString("resultCode")) || rspObj == null) { |
|
|
|
if (!"0".equals(commonOut.getString("resultCode")) || rspObj == null) { |
|
|
|
log.info("批量领取健康卡-" + healthCardInfosRsp); |
|
|
|
log.info("批量领取健康卡失败: {}", healthCardInfosRsp); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
JSONArray rspItems = rspObj.getJSONArray("rspItems"); |
|
|
|
JSONArray rspItems = rspObj.getJSONArray("rspItems"); |
|
|
|
|