|
@ -478,32 +478,36 @@ public class OnePayService {
|
|
|
// 如医保卡绑卡信息返回参数
|
|
|
if (OnepayDefaultClient.isSuccessful(res)) {
|
|
|
JavaType javaType = objectMapper.getTypeFactory().constructParametricType(List.class, BindCard.class);
|
|
|
//获取本人绑卡情况
|
|
|
String idNo = res.getParam().getString("idNo");
|
|
|
Patient user = patientDao.findByIdcard(idNo);
|
|
|
String userCode = user.getCode();
|
|
|
List<BindCard> result = objectMapper.readValue(objectMapper.writeValueAsString(res.getParam().get("attachList")), javaType);
|
|
|
//更新患者信息
|
|
|
if (result != null && result.size() > 0) {
|
|
|
String userCode = "";
|
|
|
//获取本人绑卡情况
|
|
|
for (BindCard card : result) {
|
|
|
if (!"98".equals(card.getAttachRelation())) {
|
|
|
if ("98".equals(card.getAttachRelation())) {
|
|
|
String idcard = card.getAttachIdNo();
|
|
|
Patient patient = patientDao.findByIdcard(idcard);
|
|
|
userCode = patient.getCode();
|
|
|
patient.setSicardStatus(1);
|
|
|
// ********************以绑定时为主****************
|
|
|
patient.setSicardTime(new Date());
|
|
|
// ************************************
|
|
|
patient.setPrincipalCode(userCode);
|
|
|
patientDao.save(patient);
|
|
|
LOGGER.info("myself ==========> userCode " + userCode);
|
|
|
}
|
|
|
}
|
|
|
//获取家人绑卡情况
|
|
|
for (BindCard familyCard : result) {
|
|
|
if (!"98".equals(familyCard.getAttachRelation())) {
|
|
|
String idcard = familyCard.getAttachIdNo();
|
|
|
Patient patient = patientDao.findByIdcard(idcard);
|
|
|
patient.setSicardStatus(1);
|
|
|
patient.setSicardTime(new Date());
|
|
|
patient.setPrincipalCode(userCode);
|
|
|
patientDao.save(patient);
|
|
|
LOGGER.info("family ==========> userCode "+userCode +" ========== >> "+patient.getOpenid());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
user.setSicardStatus(1);
|
|
|
// ********************以绑定时为主****************
|
|
|
user.setSicardTime(new Date());
|
|
|
// ************************************
|
|
|
user.setPrincipalCode(userCode);
|
|
|
patientDao.save(user);
|
|
|
} else {
|
|
|
isSuccess = false;
|
|
|
error = "请求失败,返回结果:" + res.getRespCode() + "," + res.getRespMsg();
|
|
@ -520,6 +524,6 @@ public class OnePayService {
|
|
|
if (!isSuccess) {
|
|
|
throw new Exception(error);
|
|
|
}
|
|
|
LOGGER.info(error);
|
|
|
LOGGER.info("OnePayService SicardQueryJob " + error);
|
|
|
}
|
|
|
}
|