医共体绑定新增本院信息和医共体信息返回,用作默认用户账

debug
王绍全 2 weeks ago
parent 6629aff939
commit 4516c95876
  1. 13
      src/main/java/com/ynxbd/common/action/SmsAction.java
  2. 2
      src/main/java/com/ynxbd/common/action/pay/PEnum.java
  3. 4
      src/main/java/com/ynxbd/common/action/pay/PayAction.java
  4. 14
      src/main/java/com/ynxbd/common/bean/Patient.java
  5. 36
      src/main/java/com/ynxbd/common/service/GMCService.java
  6. 9
      src/main/java/com/ynxbd/common/service/PatientService.java

@ -9,6 +9,7 @@ import com.ynxbd.common.bean.wxMessage.WaitReg;
import com.ynxbd.common.dao.RegisterDao; import com.ynxbd.common.dao.RegisterDao;
import com.ynxbd.common.helper.common.CodeHelper; import com.ynxbd.common.helper.common.CodeHelper;
import com.ynxbd.common.helper.common.SmsHelper; import com.ynxbd.common.helper.common.SmsHelper;
import com.ynxbd.common.helper.common.URLHelper;
import com.ynxbd.common.result.Result; import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum; import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.wx.config.WeChatConfig; import com.ynxbd.wx.config.WeChatConfig;
@ -287,9 +288,11 @@ public class SmsAction extends BaseAction {
@Action("smsHis") @Action("smsHis")
public Result smsHis(String callNo, String tel, String temParamsJson, String sign) { public Result smsHis(String callNo, String tel, String temParamsJson, String sign) {
log.info("[天助平台-旦米短信]callNo={}, tel={}, temParamsJson={}, sign={}", callNo, tel, temParamsJson, sign); log.info("[天助平台-旦米短信]callNo={}, tel={}, temParamsJson={}, sign={}", callNo, tel, temParamsJson, sign);
temParamsJson = URLHelper.decodeURL(temParamsJson);
if (callNo == null || tel == null || temParamsJson == null || sign == null) { if (callNo == null || tel == null || temParamsJson == null || sign == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID); return Result.error(ResultEnum.PARAM_IS_DEFECT);
} }
String key = "xbd_sms"; String key = "xbd_sms";
String md5 = DigestUtils.md5Hex(callNo + tel + key).toUpperCase(); String md5 = DigestUtils.md5Hex(callNo + tel + key).toUpperCase();
if (!md5.equals(sign)) { if (!md5.equals(sign)) {
@ -321,4 +324,12 @@ public class SmsAction extends BaseAction {
} }
} }
public static void main(String[] args) {
String callNo = "dept_kq";
String tel = "15559603353";
String key = "xbd_sms";
String md5 = DigestUtils.md5Hex(callNo + tel + key).toUpperCase();
System.out.println(md5);
}
} }

@ -12,7 +12,7 @@ public enum PEnum {
// ------------------------------------ // ------------------------------------
REG("挂号", "register", "G"), REG("挂号", "register", "G"),
RECIPE("处方", "recipe", "C"), RECIPE("处方", "recipe", "C"),
IN_HOSP("住院预交金", "in_hosp", "Z"), IN_HOSP("住院缴费", "in_hosp", "Z"),
OL_REG("问诊挂号", "ol_register", "OG"), OL_REG("问诊挂号", "ol_register", "OG"),

@ -222,8 +222,8 @@ public class PayAction extends BaseAction {
return Result.error(ResultEnum.PAY_AUTH_CODE_RULES_ERROR); // 条码不符合规则 return Result.error(ResultEnum.PAY_AUTH_CODE_RULES_ERROR); // 条码不符合规则
} }
log.info("{} 盒子支付 callNo={}, title={}, patientId={}, totalFee={}, invoiceTransNo={}, regDate={}", log.info("{} 盒子支付 callNo={}, treatNum={}, patientId={}, title={}, totalFee={}, invoiceTransNo={}, regDate={}",
merchantEnum.NAME, callNo, title, patientId, totalFee, invoiceTransNo, regDate); merchantEnum.NAME, callNo, treatNum, patientId, title, totalFee, invoiceTransNo, regDate);
if (operateUser == null || invoiceTransNo == null if (operateUser == null || invoiceTransNo == null
|| patientId == null || patientId == null

@ -2,6 +2,7 @@ package com.ynxbd.common.bean;
import com.ynxbd.common.bean.enums.HCardTypeEnum; import com.ynxbd.common.bean.enums.HCardTypeEnum;
import com.ynxbd.common.helper.common.ParamHelper; import com.ynxbd.common.helper.common.ParamHelper;
import com.ynxbd.wx.config.WeChatConfig;
import com.ynxbd.wx.wxfactory.AesWxHelper; import com.ynxbd.wx.wxfactory.AesWxHelper;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -132,6 +133,19 @@ public class Patient implements Serializable {
this.motherTel = null; this.motherTel = null;
} }
/**
* [医共体]数据过滤
*
* @param isClearCardNoAndTel 是否清除证件号和电话
*/
public void filterGMCData(boolean isClearCardNoAndTel) {
filterData(isClearCardNoAndTel);
if (WeChatConfig.IS_ENABLE_GMC) {
this.patientId = this.empiId;
this.enPatientId = AesWxHelper.encode(this.patientId, true);
}
}
/** /**
* 数据过滤 * 数据过滤
* *

@ -258,16 +258,15 @@ public class GMCService {
String areaCode = bindInfo.getAreaCode(); String areaCode = bindInfo.getAreaCode();
if (ObjectUtils.isEmpty(areaCode)) { if (ObjectUtils.isEmpty(areaCode)) {
areaCode = idCardNo.substring(0, 6); bindInfo.setAreaCode(idCardNo.substring(0, 6));
} }
String finalAreaCode = areaCode;
JsonResult jsonResult = postFormGMC(request, "/health_card/bindCardGmc", params -> { JsonResult jsonResult = postFormGMC(request, "/health_card/bindCardGmc", params -> {
params.put("enOpenId", enGmcOpenId); // 主服务器的openId params.put("enOpenId", enGmcOpenId); // 主服务器的openId
params.put("healthCardId", AesWxHelper.encode(bindInfo.getHealthCardId())); params.put("healthCardId", AesWxHelper.encode(bindInfo.getHealthCardId()));
params.put("address", bindInfo.getAddress()); params.put("address", bindInfo.getAddress());
params.put("areaCode", finalAreaCode); params.put("areaCode", bindInfo.getAreaCode());
params.put("areaAddress", bindInfo.getAreaAddress()); params.put("areaAddress", bindInfo.getAreaAddress());
params.put("tel", AesWxHelper.encode(bindInfo.getTel())); params.put("tel", AesWxHelper.encode(bindInfo.getTel()));
params.put("sex", bindInfo.getSex()); params.put("sex", bindInfo.getSex());
@ -307,17 +306,34 @@ public class GMCService {
log.error("[医共体]主体绑定-数据enEmpiId解密失败"); log.error("[医共体]主体绑定-数据enEmpiId解密失败");
return null; return null;
} }
Patient hisBindInfo = new HisPatientDao().bind(false, bindInfo);
if (hisBindInfo == null) {
log.error("[医共体]本院绑定失败");
return null;
}
String hisPatientId = hisBindInfo.getHisPatientId(); // 本院患者id
String hisEmpiId = hisBindInfo.getEmpiId(); // 医共体id
if (ObjectUtils.isEmpty(hisPatientId) || ObjectUtils.isEmpty(hisEmpiId)) {
return null;
}
if (!hisEmpiId.equals(empiId)) {
log.error("[医共体]本院id和主体医院id不匹配");
return null;
}
// 主体绑定成功后,清除本院缓存 // 主体绑定成功后,清除本院缓存
GmcCacheManager.removeCacheGmcUser(openid); GmcCacheManager.removeCacheGmcUser(openid);
bindInfo.setHisPatientId(hisPatientId); // 本院患者id
Patient patient = new Patient(); bindInfo.setEnGmcOpenId(enGmcOpenId); // 主体医院openid
patient.setEnGmcOpenId(enGmcOpenId); // 主体医院openid bindInfo.setEnOpenId(enOpenId); // 本院openid
patient.setEnOpenId(enOpenId); // 本院openid
patient.setGmcUniqueId(gmcUniqueId); // 主体医院唯一id bindInfo.setGmcUniqueId(gmcUniqueId); // 主体医院唯一id
patient.setEnEmpiId(enEmpiId); bindInfo.setEnEmpiId(enEmpiId);
patient.setEmpiId(empiId); bindInfo.setEmpiId(empiId);
return patient; bindInfo.setPatientId(empiId); // 返回给前端的医共体id
return bindInfo;
} }

@ -216,6 +216,10 @@ public class PatientService {
map.put("enOpenId", patient.getEnOpenId()); map.put("enOpenId", patient.getEnOpenId());
map.put("enGmcOpenId", patient.getEnGmcOpenId()); map.put("enGmcOpenId", patient.getEnGmcOpenId());
map.put("enEmpiId", patient.getEnEmpiId()); map.put("enEmpiId", patient.getEnEmpiId());
// 数据过滤
patient.filterGMCData(true);
map.put("patient", patient);
return Result.success(map); return Result.success(map);
} catch (Exception e) { } catch (Exception e) {
ErrorHelper.println(e); ErrorHelper.println(e);
@ -241,7 +245,6 @@ public class PatientService {
try { try {
hisPatient = new HisPatientDao().bind(isAreaCode, bindInfo); hisPatient = new HisPatientDao().bind(isAreaCode, bindInfo);
} catch (ServiceException e) { } catch (ServiceException e) {
System.out.println("异常");
return Result.error(e); return Result.error(e);
} }
@ -259,6 +262,7 @@ public class PatientService {
bindInfo.setEmpiId(empiId); bindInfo.setEmpiId(empiId);
bindInfo.setPatientId(hisPatientId); bindInfo.setPatientId(hisPatientId);
bindInfo.setHisPatientId(hisPatientId);
bindInfo.setHisTransNo(hisTransNo); bindInfo.setHisTransNo(hisTransNo);
if (WeChatConfig.IS_ENABLE_GMC) { // 是医共体 if (WeChatConfig.IS_ENABLE_GMC) { // 是医共体
@ -307,6 +311,9 @@ public class PatientService {
if (!ObjectUtils.isEmpty(empiId)) { if (!ObjectUtils.isEmpty(empiId)) {
map.put("enEmpiId", AesWxHelper.encode(empiId)); map.put("enEmpiId", AesWxHelper.encode(empiId));
} }
// 数据过滤
bindInfo.filterGMCData(true);
map.put("patient", bindInfo);
return Result.success(map); return Result.success(map);
} }

Loading…
Cancel
Save