电子健康卡绑定和绑定业务参数调整,电子健康卡新增区域地址和详细地址拼接

debug
王绍全 2 months ago
parent 1b59077f3e
commit 5389a69d9f
  1. 8
      src/main/java/com/ynxbd/common/action/AliAction.java
  2. 28
      src/main/java/com/ynxbd/common/action/HealthCodeAction.java
  3. 8
      src/main/java/com/ynxbd/common/action/PatientAction.java
  4. 2
      src/main/java/com/ynxbd/common/action/pay/MedicalAction.java
  5. 2
      src/main/java/com/ynxbd/common/bean/Patient.java
  6. 81
      src/main/java/com/ynxbd/common/dao/PatientDao.java
  7. 15
      src/main/java/com/ynxbd/common/service/HCodeService.java
  8. 32
      src/main/java/com/ynxbd/common/service/PatientService.java
  9. 1
      src/main/java/com/ynxbd/wx/wxfactory/medical/Client.java

@ -14,6 +14,7 @@ import com.ynxbd.common.result.ServiceException;
import com.ynxbd.common.service.PatientService;
import com.ynxbd.wx.wxfactory.WxCacheHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.ehcache.Cache;
@ -99,7 +100,7 @@ public class AliAction extends BaseAction {
* 绑定新患者不通过电子健康卡
*/
@Action("bindMyself")
public Result bindMyself(String openid, String accessToken, String address, String county, String nation, String birthday, boolean isVerifyCode, String smsCode) {
public Result bindMyself(String openid, String accessToken, String address, String county, String areaCode, String areaAddress, String nation, String birthday, boolean isVerifyCode, String smsCode) {
log.info("【支付宝】用户授权 accessToken={}", accessToken);
if (accessToken == null) {
return Result.error(ResultEnum.PARAM_IS_BLANK);
@ -124,7 +125,10 @@ public class AliAction extends BaseAction {
String gender = user.getGender();
HCardTypeEnum cardTypeEnum = user.getCardTypeEnum();
return new PatientService().bindMyself(trueName, idCardNo, cardTypeEnum, address, county, openid, gender, nation, birthday, isVerifyCode, tel, smsCode);
if (ObjectUtils.isEmpty(areaCode)) {
areaCode = county;
}
return new PatientService().bindMyself(trueName, idCardNo, cardTypeEnum, areaCode, areaAddress, address, openid, gender, nation, birthday, isVerifyCode, tel, smsCode);
}

@ -191,8 +191,8 @@ public class HealthCodeAction extends BaseAction {
* [电子健康卡]患者绑定成人
*/
@Action("bind")
public Result bind(boolean isCounty, boolean isFace, String orderId, String registerOrderId, String county, String address, String openid, String tel, String sex, String name, String nation, String birthday, String idCardNo, String cardType, Boolean isHealthCard, String healthCardId, String weChatCode) {
log.info("[电子健康卡]身份绑定 name={}, address={}, nation={}, sex={}, birthday={}, tel={}, healthCardId={}, cardType={}", name, address, nation, sex, birthday, tel, healthCardId, cardType);
public Result bind(boolean isAreaCode, boolean isFace, String orderId, String registerOrderId, String address, String areaCode, String areaAddress, String openid, String tel, String sex, String name, String nation, String birthday, String idCardNo, String cardType, Boolean isHealthCard, String healthCardId, String wechatCode) {
log.info("[电子健康卡]身份绑定 name={}, address={}, areaCode={}, areaAddress={}, nation={}, sex={}, birthday={}, tel={}, healthCardId={}, cardType={}", name, address, areaCode, areaAddress, nation, sex, birthday, tel, healthCardId, cardType);
if (isHealthCard == null || openid == null || tel == null || sex == null || birthday == null || name == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -231,21 +231,21 @@ public class HealthCodeAction extends BaseAction {
return Result.error(ResultEnum.PARAM_DATE_ERROR);
}
if (address == null || county == null) {
log.info("[电子健康卡]地址错误 county={}, address={}", county, address);
if (address == null || areaCode == null) {
log.info("[电子健康卡]地址错误 areaCode={}, address={}", areaCode, address);
return Result.error(ResultEnum.PARAM_ADDRESS_ERROR);
}
String uuid = null;
if (HCodeService.isEnableHCode() && isHealthCard && healthCardId == null) { // 没有禁用电子健康卡
log.info("[电子健康卡]绑定 weChatCode={}", weChatCode);
if (weChatCode == null) {
log.info("[电子健康卡]绑定 wechatCode={}", wechatCode);
if (wechatCode == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
// 先注册,后修改-->先获取健康卡ID
JSONObject respObj = hCodeService.registerHealthCard(null, weChatCode, birthday, cardTypeEnum, address, sex, nation, name, idCardNo, tel);
JSONObject respObj = hCodeService.registerHealthCard(null, wechatCode, birthday, cardTypeEnum, address, areaAddress, sex, nation, name, idCardNo, tel);
if (respObj == null) {
log.info("[电子健康卡]注册健康卡失败,响应内容为空");
@ -275,7 +275,7 @@ public class HealthCodeAction extends BaseAction {
}
}
}
return new PatientService().bindCard(false, isCounty, healthCardId, openid, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, county, uuid);
return new PatientService().bindCard(false, isAreaCode, healthCardId, openid, name, sex, idCardNo, cardTypeEnum, tel, birthday, nation, uuid, address, areaCode, areaAddress);
}
@ -302,7 +302,7 @@ public class HealthCodeAction extends BaseAction {
/**
* [升级绑定]-->已在HIS绑定-->注册健康卡
*
* @param weChatCode weChatCode
* @param wechatCode wechatCode
* @param idCardNo idCardNo
* @param cardType cardType
* @param openid openid
@ -314,9 +314,9 @@ public class HealthCodeAction extends BaseAction {
* @return Result
*/
@Action("upBind")
public Result upBind(String weChatCode, String idCardNo, String cardType, String openid, String tel, String name, String nation, String patientId, String address) {
log.info("[电子健康卡]升级绑定 name={}, address={}, nation={}, patientId={}, tel={}, idType={}, weChatCode={}", name, address, nation, patientId, tel, cardType, weChatCode);
if (weChatCode == null || openid == null || patientId == null || name == null || idCardNo == null || tel == null || address == null || nation == null) {
public Result upBind(String wechatCode, String idCardNo, String cardType, String openid, String tel, String name, String nation, String patientId, String address) {
log.info("[电子健康卡]升级绑定 name={}, address={}, nation={}, patientId={}, tel={}, idType={}, wechatCode={}", name, address, nation, patientId, tel, cardType, wechatCode);
if (wechatCode == null || openid == null || patientId == null || name == null || idCardNo == null || tel == null || address == null || nation == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -339,7 +339,7 @@ public class HealthCodeAction extends BaseAction {
HCodeService hCodeService = new HCodeService();
// 先注册,后修改-->先获取健康卡ID
JSONObject rspObj = hCodeService.registerHealthCard(patientId, weChatCode, birthday, cardTypeEnum, address, sex, nation, name, idCardNo, tel);
JSONObject rspObj = hCodeService.registerHealthCard(patientId, wechatCode, birthday, cardTypeEnum, address, null, sex, nation, name, idCardNo, tel);
if (rspObj == null) {
log.info("[电子健康卡]升级绑定失败, 响应内容为空");
return Result.error("[电子健康卡]升级绑定失败, 响应内容为空");
@ -356,7 +356,7 @@ public class HealthCodeAction extends BaseAction {
return Result.error(healthCardRespCodeEnum.MESSAGE);
}
boolean isUpdate = new PatientDao().updateInfo(openid, patientId, idCardNo, healthCardId, name, nation, tel, address, null, null);
boolean isUpdate = new PatientDao().updateInfo(openid, patientId, idCardNo, healthCardId, name, nation, tel, null, address, null, null);
if (isUpdate) {
Cache<String, User> cache = WxCacheHelper.getUserCache();
cache.remove(openid);

@ -196,8 +196,8 @@ public class PatientAction extends BaseAction {
* [无证绑定-有证绑定]绑定新患者不通过电子健康卡
*/
@Action("bind")
public Result bind(boolean isVerifyCode, String address, String county, String idCardNo, String openid, String sex, String name, String nation, String birthday, String cardType, String tel, String smsCode) {
log.info("[身份绑定] openid={}, name={}, county={}, address={}, nation={}, sex={}, birthday={}, cardType={}", openid, name, county, address, nation, sex, birthday, cardType);
public Result bind(boolean isVerifyCode, String address, String areaCode, String areaAddress, String idCardNo, String openid, String sex, String name, String nation, String birthday, String cardType, String tel, String smsCode) {
log.info("[身份绑定] openid={}, name={}, address={}, areaCode={}, areaAddress={}, nation={}, sex={}, birthday={}, cardType={}", openid, name, address, areaCode, areaAddress, nation, sex, birthday, cardType);
if (openid == null || sex == null || birthday == null || name == null || nation == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -214,7 +214,7 @@ public class PatientAction extends BaseAction {
}
}
if (address == null || county == null) {
if (address == null || areaCode == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -262,7 +262,7 @@ public class PatientAction extends BaseAction {
String uuid = UUID.randomUUID().toString().replace("-", ""); // 儿童身份证代码
return new PatientService().bind(false, true, null, openid, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, county, uuid, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo);
return new PatientService().bind(false, true, null, openid, name, sex, idCardNo, cardTypeEnum, tel, birthday, nation, uuid, address, areaCode, areaAddress, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo);
}
/**

@ -118,7 +118,7 @@ public class MedicalAction extends BaseAction {
public Result medicalAuth(String openid, String qrCode) {
log.info("[医保建档] openid-{}, qrCode={}", openid, qrCode);
MedicalUserInfo info = WxFactory.Medical.Common().getUserInfo(WxMedConfig.PARTNER_URL, openid, qrCode);
log.info("[医保建档获取用户信息] resp-{}", info);
log.info("[医保建档获取用户信息] resp:{}", info);
return Result.success(info);
}

@ -70,4 +70,6 @@ public class Patient implements Serializable {
private String showTel;
// 地区编码
private String areaCode;
// 地区
private String areaAddress;
}

@ -74,6 +74,7 @@ public class PatientDao {
/**
* 根据openid查询患者 部分信息 用作外部对接 不回传openId
*
* @param openid
* @return
*/
@ -136,13 +137,14 @@ public class PatientDao {
*/
public Patient selectByOpenidAndPatientId(String openid, String patientId) {
String sql = "select * from patientBase where openid= ? and patientId= ? and deletedState = 0";
List<Patient> resultList = DataBase.select(sql, Patient.class, ps -> {
List<Patient> dataList = DataBase.select(sql, Patient.class, ps -> {
ps.setString(1, openid);
ps.setString(2, patientId);
});
return !resultList.isEmpty() ? resultList.get(0) : null;
return !dataList.isEmpty() ? dataList.get(0) : null;
}
/**
* 查询患者本人
*
@ -184,8 +186,8 @@ public class PatientDao {
* @param address 地址
* @return 是否成功
*/
public boolean updateInfo(String openid, String idCardNo, String patientId, String healthCardId, String name, String nation, String tel, String address, String uuid, String county) {
String sql = "update patientBase set deletedState=0, healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, county=?, patientId=? where openid=? and idCardNo=?";
public boolean updateInfo(String openid, String idCardNo, String patientId, String healthCardId, String name, String nation, String tel, String uuid, String address, String areaCode, String areaAddress) {
String sql = "update patientBase set deletedState=0, healthCardId=?, name=?, nation=?, tel=?, address=?, uuid=?, areaCode=?, areaAddress=?, patientId=? where openid=? and idCardNo=?";
return DataBase.update(sql, ps -> {
ps.setString(1, healthCardId);
@ -194,11 +196,12 @@ public class PatientDao {
ps.setString(4, tel);
ps.setString(5, address);
ps.setString(6, uuid);
ps.setString(7, county);
ps.setString(8, patientId);
ps.setString(7, areaCode);
ps.setString(8, areaAddress);
ps.setString(9, patientId);
// 条件
ps.setString(9, openid);
ps.setString(10, idCardNo);
ps.setString(10, openid);
ps.setString(11, idCardNo);
}) > 0;
}
@ -219,14 +222,15 @@ public class PatientDao {
*/
public boolean insertCard(boolean isMyself, String healthCardId, String openid, String patientId, String hisTransNo,
String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String birthday, String age,
String address, String nation, String tel, String uuid, String county) {
return insert(isMyself, healthCardId, openid, patientId, hisTransNo, name, sex, idCardNo, cardTypeEnum, birthday, age, address, nation, tel, uuid, county, null, null, null, null, null, null);
String nation, String tel, String uuid, String address, String areaCode, String areaAddress) {
return insert(isMyself, healthCardId, openid, patientId, hisTransNo, name, sex, idCardNo, cardTypeEnum, birthday, age, nation, tel, uuid, address, areaCode, areaAddress, null, null, null, null, null, null);
}
/**
* [患者]绑定身份证
*
* @param isMyself 是否为自己
* @param healthCardId 健康卡ID
* @param openid openid
* @param patientId 患者ID
@ -234,25 +238,31 @@ public class PatientDao {
* @param name 姓名
* @param sex 性别
* @param idCardNo 身份证
* @param tel 电话
* @param address 地址
* @param cardTypeEnum 证件类型
* @param birthday 生日
* @param age 年龄
* @param address 详细地址
* @param nation 民族
* @param tel 电话
* @param uuid uuid
* @param areaCode 地区编码
* @param areaAddress 地区地址
* @param fName 父亲姓名
* @param fTel 父亲电话
* @param fIDCardNo 父亲身份证
* @param mName 母亲姓名
* @param mTel 母亲电话
* @param mIDCardNo 母亲身份证号
* @return bool
*/
public boolean insert(boolean isMyself, String healthCardId, String openid, String patientId, String hisTransNo,
String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String birthday, String age,
String address, String nation, String tel, String uuid, String county,
String nation, String tel, String uuid, String address, String areaCode, String areaAddress,
String fName, String fTel, String fIDCardNo,
String mName, String mTel, String mIDCardNo) {
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, address, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, county, isMyself, cardType) " +
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?)";
String sql = "insert into patientBase(bindDate, openid, patientId, hisTransNo, name, sex, idCardNo, tel, birthday, nation, healthCardId, age, uuid, fatherName, fatherTel, fatherIDCardNo, motherName, motherTel, motherIDCardNo, address, areaCode, areaAddress, isMyself, cardType) " +
" values(now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
return DataBase.insert(sql, ps -> {
ps.setString(1, openid);
ps.setString(2, patientId);
@ -261,22 +271,23 @@ public class PatientDao {
ps.setString(5, sex);
ps.setString(6, idCardNo);
ps.setString(7, tel);
ps.setString(8, address);
ps.setString(9, birthday);
ps.setString(10, nation);
ps.setString(11, healthCardId);
ps.setString(12, age);
ps.setString(13, uuid);
ps.setString(8, birthday);
ps.setString(9, nation);
ps.setString(10, healthCardId);
ps.setString(11, age);
ps.setString(12, uuid);
//
ps.setString(14, fName);
ps.setString(15, fTel);
ps.setString(16, fIDCardNo);
ps.setString(17, mName);
ps.setString(18, mTel);
ps.setString(19, mIDCardNo);
ps.setString(20, county);
ps.setBoolean(21, isMyself);
ps.setString(22, cardTypeEnum.WX_CODE);
ps.setString(13, fName);
ps.setString(14, fTel);
ps.setString(15, fIDCardNo);
ps.setString(16, mName);
ps.setString(17, mTel);
ps.setString(18, mIDCardNo);
ps.setString(19, address);
ps.setString(20, areaCode);
ps.setString(21, areaAddress);
ps.setBoolean(22, isMyself);
ps.setString(23, cardTypeEnum.WX_CODE);
}) > 0;
}
@ -285,8 +296,8 @@ public class PatientDao {
* 查询所有未领取健康卡的用户信息民族电话不能为空,一次读取15条信息
*/
public List<Patient> selectPatient4BatchUpdateHealthCard() {
String sql = "select * from patientBase where HealthCardID is null and ifnull(idcardno,'') <> '' " +
"and ifnull(nation,'') <> '' and ifnull(tel, '') <> '' and callFlag=0 LIMIT 15";
String sql = "select * from patientBase where HealthCardID is null and ifNull(idCardNo,'') <> '' " +
"and ifNull(nation,'') <> '' and ifNull(tel, '') <> '' and callFlag=0 LIMIT 15";
return DataBase.select(sql, Patient.class);
}
@ -352,14 +363,14 @@ public class PatientDao {
}
public boolean updateMyself(String openid, String idCardNo, String patientId, String name, String address, String county, String nation, String tel) {
public boolean updateMyself(String openid, String idCardNo, String patientId, String name, String address, String areaCode, String nation, String tel) {
if (idCardNo == null) {
return false;
}
idCardNo = "'" + idCardNo + "'";
String sql = "update patientBase set isMyself = (CASE idCardNo WHEN " + idCardNo + " THEN 1 else 0 end)," +
" deletedState = (CASE idCardNo WHEN " + idCardNo + " THEN 0 else deletedState end)," +
" county = (CASE idCardNo WHEN " + idCardNo + " THEN ? else county end)," +
" areaCode = (CASE idCardNo WHEN " + idCardNo + " THEN ? else areaCode end)," +
" address = (CASE idCardNo WHEN " + idCardNo + " THEN ? else address end)," +
" patientId = (CASE idCardNo WHEN " + idCardNo + " THEN ? else patientId end)," +
" name = (CASE idCardNo WHEN " + idCardNo + " THEN ? else name end)," +
@ -367,7 +378,7 @@ public class PatientDao {
" nation = (CASE idCardNo WHEN " + idCardNo + " THEN ? else nation end)" +
" where openid = ?";
return DataBase.update(sql, ps -> {
ps.setString(1, county);
ps.setString(1, areaCode);
ps.setString(2, address);
ps.setString(3, patientId);
ps.setString(4, name);

@ -171,9 +171,10 @@ public class HCodeService {
/**
* 注册健康卡
*
* @param weChatCode 微信身份码
* @param wechatCode 微信身份码
* @param birthday 出生年月日
* @param cardTypeEnum 证件类型01-居民身份证其他参考证件类型表
* @param areaAddress 区域地址
* @param address 地址
* @param sex 性别
* @param nation 民族
@ -181,8 +182,8 @@ public class HCodeService {
* @param idCardNo 证件号码
* @param phone1 联系方式1
*/
public JSONObject registerHealthCard(String patientId, String weChatCode,
String birthday, HCardTypeEnum cardTypeEnum, String address,
public JSONObject registerHealthCard(String patientId, String wechatCode,
String birthday, HCardTypeEnum cardTypeEnum, String address, String areaAddress,
String sex, String nation, String name, String idCardNo, String phone1) {
try {
String appToken = getAppToken();
@ -194,13 +195,17 @@ public class HCodeService {
cardTypeEnum = HCardTypeEnum._01; // 居民身份证
}
if (ObjectUtils.isEmpty(areaAddress)) {
areaAddress = "";
}
HealthCardServerImpl healthCard = new HealthCardServerImpl(H_APP_SECRET);
// 构造公共输入参数commonIn
String requestId = UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
CommonIn commonIn = new CommonIn(appToken, requestId, H_HOSPITAL_ID, 0);
HealthCardInfo healthCardInfoReq = new HealthCardInfo();
healthCardInfoReq.setAddress(address);
healthCardInfoReq.setAddress(areaAddress + address);
healthCardInfoReq.setBirthday(birthday);
healthCardInfoReq.setGender(sex);
healthCardInfoReq.setIdNumber(idCardNo);
@ -208,7 +213,7 @@ public class HCodeService {
healthCardInfoReq.setNation(nation);
healthCardInfoReq.setName(name);
healthCardInfoReq.setPhone1(phone1);
healthCardInfoReq.setWechatCode(weChatCode);
healthCardInfoReq.setWechatCode(wechatCode);
healthCardInfoReq.setPatid(patientId);
//调用接口
JSONObject resultObj = healthCard.registerHealthCard(commonIn, healthCardInfoReq);

@ -89,15 +89,15 @@ public class PatientService {
/**
* [有证绑定]
*/
public Result bindCard(boolean isMyself, boolean isAreaCode, String healthCardId, String openid, String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String tel, String address, String birthday, String nation, String areaCode, String uuid) {
return bind(isMyself, isAreaCode, healthCardId, openid, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, areaCode, uuid, null, null, null, null, null, null);
public Result bindCard(boolean isMyself, boolean isAreaCode, String healthCardId, String openid, String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String tel, String birthday, String nation, String uuid, String address, String areaCode, String areaAddress) {
return bind(isMyself, isAreaCode, healthCardId, openid, name, sex, idCardNo, cardTypeEnum, tel, birthday, nation, uuid, address, areaCode, areaAddress, null, null, null, null, null, null);
}
/**
* [绑定]
*
* @param isMyself 是否为自己
* @param isArea 是否传递行政区编码
* @param isAreaCode 是否传递行政区编码
* @param healthCardId 健康卡id
* @param openid openid
* @param name 姓名
@ -116,8 +116,8 @@ public class PatientService {
* @param mTel 母电话
* @param mIDCardNo 母身份证号码
*/
public Result bind(boolean isMyself, boolean isArea, String healthCardId, String openid, String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String tel, String address, String birthday, String nation, String areaCode, String uuid, String fName, String fTel, String fIDCardNo, String mName, String mTel, String mIDCardNo) {
log.info("[患者]身份绑定 name={}, county={}, address={}, nation={}, sex={}, birthday={}, tel={}", name, areaCode, address, nation, sex, birthday, tel);
public Result bind(boolean isMyself, boolean isAreaCode, String healthCardId, String openid, String name, String sex, String idCardNo, HCardTypeEnum cardTypeEnum, String tel, String birthday, String nation, String uuid, String address, String areaCode, String areaAddress, String fName, String fTel, String fIDCardNo, String mName, String mTel, String mIDCardNo) {
log.info("[患者]身份绑定 name={}, address={}, areaCode={}, areaAddress={}, nation={}, sex={}, birthday={}, tel={}", name, address, areaCode, areaAddress, nation, sex, birthday, tel);
if (openid == null || sex == null || birthday == null || name == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -131,7 +131,7 @@ public class PatientService {
Patient hisPatient;
try {
hisPatient = new HisPatientDao().bind(isArea, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, areaCode, uuid, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo);
hisPatient = new HisPatientDao().bind(isAreaCode, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, areaCode, uuid, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo);
} catch (ServiceException e) {
return Result.error(e);
}
@ -144,8 +144,8 @@ public class PatientService {
// 判断是否已有数据
Patient patient = patientDao.selectByIdCardNo(openid, idCardNo);
if (patient == null) { // 数据库没有-->添加
log.info("[患者]添加 name={}, county={}, healthCardId={}, address={}, nation={}, sex={}, birthday={}, tel={}", name, areaCode, healthCardId, address, nation, sex, birthday, tel);
if (!patientDao.insert(isMyself, healthCardId, openid, patientId, hisPatient.getHisTransNo(), name, sex, idCardNo, cardTypeEnum, birthday, null, address, nation, tel, uuid, areaCode, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo)) {
log.info("[患者]添加 name={}, address={}, areaCode={}, healthCardId={}, nation={}, sex={}, birthday={}, tel={}", name, address, areaCode, healthCardId, nation, sex, birthday, tel);
if (!patientDao.insert(isMyself, healthCardId, openid, patientId, hisPatient.getHisTransNo(), name, sex, idCardNo, cardTypeEnum, birthday, null, nation, tel, uuid, address, areaCode, areaAddress, fName, fTel, fIDCardNo, mName, mTel, mIDCardNo)) {
log.info("[身份绑定]添加患者失败");
return Result.error(ResultEnum.PATIENT_ADD_ERROR);
}
@ -155,9 +155,9 @@ public class PatientService {
log.info("[电子健康卡]绑定患者和医院关系失败");
}
String hid = patient.getHealthCardId();
if (hid != null && !"".equals(hid)) {
healthCardId = hid;
String hcId = patient.getHealthCardId();
if (!ObjectUtils.isEmpty(hcId)) {
healthCardId = hcId;
}
log.info("[患者]更新 isMyself={}, patientId={}, name={}, healthCardId={}", isMyself, patient.getPatientId(), name, healthCardId);
@ -167,7 +167,7 @@ public class PatientService {
return Result.error(ResultEnum.DATA_UPDATE_ERROR);
}
} else {
if (!patientDao.updateInfo(openid, idCardNo, patientId, healthCardId, name, nation, tel, address, uuid, areaCode)) {
if (!patientDao.updateInfo(openid, idCardNo, patientId, healthCardId, name, nation, tel, uuid, address, areaCode, areaAddress)) {
log.info("[患者]更新失败 patientId={}", patient.getPatientId());
return Result.error(ResultEnum.PATIENT_UPDATE_ERROR);
}
@ -229,8 +229,8 @@ public class PatientService {
/**
* [绑定本人]
*/
public Result bindMyself(String name, String idCardNo, HCardTypeEnum cardTypeEnum, String address, String county, String openid, String sex, String nation, String birthday, boolean isVerifyCode, String tel, String smsCode) {
log.info("[身份绑定] openid={}, name={}, county={}, address={}, nation={}, sex={}, birthday={}, cardType={}", openid, name, county, address, nation, sex, birthday, cardTypeEnum.ALI_CODE);
public Result bindMyself(String name, String idCardNo, HCardTypeEnum cardTypeEnum, String address, String areaCode, String areaAddress, String openid, String sex, String nation, String birthday, boolean isVerifyCode, String tel, String smsCode) {
log.info("[身份绑定] openid={}, name={}, address={}, areaCode={}, areaAddress={},nation={}, sex={}, birthday={}, cardType={}", openid, name, address, areaCode, areaAddress, nation, sex, birthday, cardTypeEnum.ALI_CODE);
if (openid == null || sex == null || birthday == null || name == null || nation == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -248,7 +248,7 @@ public class PatientService {
}
}
if (address == null || county == null) {
if (address == null || areaCode == null) {
log.info("[身份绑定]地址为空");
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -275,7 +275,7 @@ public class PatientService {
String uuid = UUID.randomUUID().toString().replace("-", ""); // 儿童身份证代码
return bindCard(true, true, null, openid, name, sex, idCardNo, cardTypeEnum, tel, address, birthday, nation, county, uuid);
return bindCard(true, true, null, openid, name, sex, idCardNo, cardTypeEnum, tel, birthday, nation, uuid, address, areaCode, areaAddress);
}

@ -353,6 +353,7 @@ public class Client {
}
String code = respJson.getString("code");
String message = respJson.getString("message");
log.info("respJson={}", JsonHelper.toJsonString(respJson));
if (!"0".equals(code)) {
log.error("[微信医保][授权]失败 resp={}", respJson);

Loading…
Cancel
Save