2、挂号公用获取参数方法移动到对象下。 3、调整部分静态方法为普通方法。 4、支付宝医保接口新增下单、查询订单、退费等。 5、查询区域接口传递的areaCode的位数根据区域级别调整,5级传递为9位。debug
parent
c935b675fb
commit
2afb724ed5
57 changed files with 1266 additions and 774 deletions
@ -0,0 +1,287 @@ |
||||
package com.ynxbd.ali.helper; |
||||
|
||||
import com.alibaba.fastjson.JSONArray; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.alipay.api.AlipayApiException; |
||||
import com.alipay.api.AlipayClient; |
||||
import com.alipay.api.DefaultAlipayClient; |
||||
import com.alipay.api.domain.AlipayCommerceMedicalAuthinfoAuthQueryModel; |
||||
import com.alipay.api.domain.AuthExtendParams; |
||||
import com.alipay.api.request.AlipayCommerceMedicalAuthinfoAuthQueryRequest; |
||||
import com.alipay.api.request.AlipayTradeAppPayRequest; |
||||
import com.alipay.api.response.AlipayCommerceMedicalAuthinfoAuthQueryResponse; |
||||
import com.alipay.api.response.AlipayTradeAppPayResponse; |
||||
import com.ynxbd.ali.config.AliConfig; |
||||
import com.ynxbd.common.helper.common.DateHelper; |
||||
import com.ynxbd.common.helper.common.ErrorHelper; |
||||
import com.ynxbd.wx.wxfactory.bean.OrderMIEnum; |
||||
import com.ynxbd.wx.wxfactory.medical.MIConfig; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.commons.lang3.ObjectUtils; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
import java.util.UUID; |
||||
|
||||
@Slf4j |
||||
public class AliMedicalHelper { |
||||
|
||||
/** |
||||
* 国家医保局线上业务身份核验信息授权查询接口[alipay_commerce_medical_authinfo_auth_query_response] |
||||
* |
||||
* @param openId openId |
||||
* @param accessToken accessToken |
||||
* @param patientName 用户姓名 |
||||
* @param patientCardNo 用户证件号 |
||||
* @param callUrl 回调地址 |
||||
* @return |
||||
*/ |
||||
public static String queryMIAuth(String openId, String accessToken, String patientName, String patientCardNo, String callUrl) { |
||||
try { |
||||
// 初始化SDK
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(AliConfig.getAlipayConfig()); |
||||
// 构造请求参数以调用接口
|
||||
AlipayCommerceMedicalAuthinfoAuthQueryRequest request = new AlipayCommerceMedicalAuthinfoAuthQueryRequest(); |
||||
AlipayCommerceMedicalAuthinfoAuthQueryModel model = new AlipayCommerceMedicalAuthinfoAuthQueryModel(); |
||||
|
||||
// 设置用户标识
|
||||
if (AliConfig.IS_NEW_USER_ID_VERSION) { // 新版
|
||||
// model.setOpenId("074a1CcTG1LelxKe4xQC0zgNdId0nxi95b5lsNpazWYoCo5");
|
||||
model.setOpenId(openId); |
||||
} else { |
||||
// uid参数未来计划废弃,存量商户可继续使用,新商户请使用openid。请根据应用-开发配置-openid配置选择支持的字段。
|
||||
model.setAlipayUserId(openId); |
||||
} |
||||
|
||||
// 设置商户请求流水号
|
||||
model.setReqBizNo(UUID.randomUUID().toString()); |
||||
// 设置机构编码-固定为NATHSA
|
||||
model.setInsCode("NATHSA"); |
||||
// 设置线上业务类型编码
|
||||
model.setOlBizTypeCode("04107"); |
||||
// 设置授权回调地址{url}?resultCode=SUCCESS&openapiAppId=2021**3&reqBizNo=20230***
|
||||
model.setCallUrl(callUrl); |
||||
|
||||
// 设置olBizTypeCode=04107(医保移动支付业务)时必传
|
||||
model.setOrgAppId(MIConfig.ORG_APP_ID); |
||||
// 设置机构渠道认证编码
|
||||
model.setOrgChnlCrtfCode(MIConfig.ORG_CHNL_CRTF_CODG); |
||||
// 设置定点医药机构代码
|
||||
model.setOrgCode(MIConfig.ORG_NO); |
||||
|
||||
// 设置扩展信息-亲情账户支付场景增加
|
||||
AuthExtendParams extendParams = new AuthExtendParams(); |
||||
// 系统商签约协议的PID
|
||||
extendParams.setSysServiceProviderId(AliConfig.ISV_PARTNER_ID); |
||||
// 就诊人证件类型
|
||||
extendParams.setPatientCertType("01"); |
||||
// 就诊人真实姓名
|
||||
extendParams.setPatientName(patientName); |
||||
// 就诊人证件号
|
||||
extendParams.setPatientCertNo(patientCardNo); |
||||
model.setExtendParams(extendParams); |
||||
|
||||
// 设置线上购药渠道ID
|
||||
// odel.setOnlineDrugChnlAppId("1DBHJRS5I01E0F34A8C00000B959FA87");
|
||||
|
||||
request.setBizModel(model); |
||||
// 第三方代调用模式下请设置app_auth_token
|
||||
// request.putOtherTextParam("app_auth_token", "<-- 请填写应用授权令牌 -->");
|
||||
|
||||
// 设置auth_token,同access_token(用户访问令牌)
|
||||
request.putOtherTextParam("auth_token", accessToken); |
||||
|
||||
AlipayCommerceMedicalAuthinfoAuthQueryResponse response = alipayClient.execute(request); |
||||
log.info("[支付宝]国家医保局线上业务身份核验信息授权查询接口-返回{}", response.getBody()); |
||||
if (response.isSuccess()) { |
||||
System.out.println("调用成功"); |
||||
return response.getBody(); |
||||
} else { |
||||
System.out.println("调用失败"); |
||||
// sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接
|
||||
// String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response);
|
||||
// System.out.println(diagnosisUrl);
|
||||
} |
||||
} catch (Exception e) { |
||||
ErrorHelper.println(e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public static AlipayClient getGBKAliClient() { |
||||
return new DefaultAlipayClient(AliConfig.SERVICE_URL, AliConfig.APP_ID, AliConfig.APP_PRIVATE_KEY, "json", "GBK", AliConfig.ALI_PUBLIC_KEY, "RSA2"); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 5.2.2.4 APP支付接口alipay.trade.app.pay |
||||
* |
||||
* @param orderMIEnum 医保订单类型 |
||||
* @param openid openid |
||||
* @param outTradeNo 商户订单号 |
||||
* @param payOrdId 医保订单id |
||||
* @param payAuthNo 医保授权 |
||||
* @param totalAmount 总金额 |
||||
* @param cashFee 现金部分 |
||||
* @param subject 订单标题 |
||||
* @param notifyUrl 携带了业务类型,用于区分挂号和处方缴费 |
||||
* @param notifyType 业务类型 |
||||
* @param familyType 保卡类型"1":”亲情支付“,"0":"本人支付",为空默认本人支付。 |
||||
* @param familyName 家属姓名(这里不使用) |
||||
* @param familyCardNo 医保电子凭证授权码 获取线上医保业务授权接口返回medicalCardId参数。"6638aabe-7b4d-4d10-bdf0-b44804da3dab" |
||||
* @return |
||||
*/ |
||||
public static Map<String, Object> createOrder(OrderMIEnum orderMIEnum, String openid, String outTradeNo, String payOrdId, String payAuthNo, BigDecimal totalAmount, BigDecimal cashFee, String subject, String notifyUrl, String notifyType, String familyType, String familyName, String familyCardNo) { |
||||
try { |
||||
AlipayClient alipayClient = new DefaultAlipayClient(AliConfig.getAlipayConfig()); |
||||
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
||||
|
||||
request.setNotifyUrl(notifyUrl); |
||||
JSONObject bizContent = new JSONObject(); |
||||
bizContent.put("out_trade_no", outTradeNo); |
||||
// 订单总金额
|
||||
bizContent.put("total_amount", totalAmount); |
||||
// 订单标题
|
||||
bizContent.put("subject", subject); |
||||
bizContent.put("product_code", "JSAPI_PAY"); // JSAPI_PAY
|
||||
//亲情账户增加 start
|
||||
bizContent.put("query_options", new String[]{"medical_insurance_info"}); |
||||
//亲情账户增加 end
|
||||
JSONObject extendParams = new JSONObject(); |
||||
extendParams.put("sys_service_provider_id", AliConfig.ISV_PARTNER_ID); |
||||
extendParams.put("IS_INSURANCE_PAY", "T"); // 是否使用医保支付
|
||||
extendParams.put("medical_card_inst_id", ObjectUtils.isEmpty(familyType) ? "0" : familyType); // 医保电子凭证机构号 获取线上医保业务授权接口返回medicalCardInstId参数。医保卡类型"1":”亲情支付“,"0":"本人支付",为空默认本人支付。
|
||||
extendParams.put("medical_card_id", familyCardNo); // 医保电子凭证授权码 获取线上医保业务授权接口返回medicalCardId参数。"6638aabe-7b4d-4d10-bdf0-b44804da3dab"
|
||||
JSONObject medicalRequestContent = new JSONObject(); // 医保参数透传体,没有需传空对象串
|
||||
extendParams.put("medical_request_content", JSONObject.toJSONString(medicalRequestContent)); |
||||
|
||||
JSONObject medicalRequestExt = new JSONObject(); //医保扩展参数
|
||||
medicalRequestExt.put("gmt_out_create", DateHelper.getCurDateTime());//医疗机构下单时间
|
||||
medicalRequestExt.put("out_trade_no", outTradeNo); //商户网站唯一订单号 医院订单号medOrgOrd
|
||||
medicalRequestExt.put("serial_no", payOrdId); // 移动支付中心订单号payOrdId
|
||||
medicalRequestExt.put("bill_no", payOrdId); // 移动支付中心订单号payOrdId
|
||||
medicalRequestExt.put("pay_auth_no", payAuthNo); // 移动支付中心返回授权编号 获取线上医保业务授权接口返回payAuthNo参数
|
||||
//
|
||||
medicalRequestExt.put("org_no", MIConfig.ORG_NO); //医药机构编号
|
||||
medicalRequestExt.put("org_name", MIConfig.HOSPITAL_NAME); // 医药机构名称
|
||||
medicalRequestExt.put("payment_city_code", MIConfig.CITY_CODE); // 医保结算地城市编码(国标)
|
||||
//
|
||||
medicalRequestExt.put("industry", "HOSPITAL"); //行业标识 医院:HOSPITAL
|
||||
medicalRequestExt.put("chinfo", "gjydzf"); // 渠道标识-默认为gjydzf
|
||||
medicalRequestExt.put("scene", "TREATMENT"); //使用场景
|
||||
medicalRequestExt.put("insurance_pay_scene", orderMIEnum.ALI_MI_CODE); // 医保结算场景 是 医保结算场景:OUTPATIENT - 门诊;INPATIENT - 住院;APPOINTMENT- 挂号;DRUGSTORE- 药店
|
||||
extendParams.put("medical_request_ext", JSONObject.toJSONString(medicalRequestExt)); |
||||
bizContent.put("extend_params", extendParams); |
||||
|
||||
//如需补充资产,如院内预交金等 begin
|
||||
JSONArray merchantCardZkt = new JSONArray(); |
||||
JSONObject zkt = new JSONObject(); |
||||
zkt.put("amount", cashFee); // 现金部分
|
||||
zkt.put("templateId", "2023062500391002246600206403"); |
||||
zkt.put("forceUse", "Y"); // 固定为Y
|
||||
merchantCardZkt.add(zkt); |
||||
JSONObject presetPayTool = new JSONObject(); |
||||
presetPayTool.put("MERCHANTCARD_ZKT", merchantCardZkt); |
||||
extendParams.put("preset_pay_tool", JSONObject.toJSONString(presetPayTool)); |
||||
extendParams.put("scene", "PLATFORM_DRUG_STORE"); //场景(有三方购药渠道场景使用)
|
||||
// 如需补充资产,如院内预交金等 end
|
||||
|
||||
request.setBizContent(JSONObject.toJSONString(bizContent)); |
||||
|
||||
log.info("[支付宝]医保下单-入参 {}", JSONObject.toJSONString(request)); |
||||
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
||||
log.info("[支付宝]医保下单-返回 {}", response.getBody()); |
||||
if (response.isSuccess()) { |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("tradeNo", response.getTradeNo()); |
||||
map.put("outTradeNo", response.getOutTradeNo()); |
||||
return map; |
||||
} |
||||
} catch (AlipayApiException e) { |
||||
ErrorHelper.println(e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
// 5.2.2.5 线下交易查询alipay.trade.query
|
||||
public static String queryTrade(String outTradeNo, String tradeNo) { |
||||
try { |
||||
AlipayClient alipayClient = new DefaultAlipayClient(AliConfig.getAlipayConfig()); |
||||
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
||||
JSONObject bizContent = new JSONObject(); |
||||
bizContent.put("trade_no", tradeNo); |
||||
bizContent.put("out_trade_no", outTradeNo); |
||||
bizContent.put("query_options", new String[]{"fund_bill_list", "medical_insurance_info"}); //查询本次交易用户付款的支付渠道和亲情账户关系
|
||||
|
||||
request.setBizContent(JSONObject.toJSONString(bizContent)); |
||||
|
||||
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
||||
log.info("[支付宝]线下交易查询-返回 {}", response.getBody()); |
||||
if (response.isSuccess()) { |
||||
return response.getBody(); |
||||
} |
||||
} catch (AlipayApiException e) { |
||||
ErrorHelper.println(e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
// 5.2.2.6 交易退款接口alipay.trade.refund.apply
|
||||
public static String refundTrade(String outRefundNo, BigDecimal refundAmount, String refundReason, String outTradeNo, String tradeNo) { |
||||
try { |
||||
AlipayClient alipayClient = new DefaultAlipayClient(AliConfig.getAlipayConfig()); |
||||
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
||||
JSONObject bizContent = new JSONObject(); |
||||
bizContent.put("trade_no", tradeNo); |
||||
bizContent.put("out_trade_no", outTradeNo); |
||||
bizContent.put("refund_amount", refundAmount.toString()); |
||||
bizContent.put("out_request_no", outRefundNo); // 退款请求号-如需部分退款,则此参数必传
|
||||
// 退款原因说明
|
||||
bizContent.put("refund_reason", refundReason); |
||||
|
||||
//亲情账户增加 end
|
||||
JSONObject extendParams = new JSONObject(); |
||||
extendParams.put("cancel_serial_no", outRefundNo); |
||||
extendParams.put("cancel_bill_no", outRefundNo); |
||||
bizContent.put("extend_params", extendParams); |
||||
|
||||
request.setBizContent(JSONObject.toJSONString(bizContent)); |
||||
|
||||
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
||||
log.info("[支付宝]交易退款接口-返回 {}", response.getBody()); |
||||
if (response.isSuccess()) { |
||||
return response.getBody(); |
||||
} |
||||
} catch (AlipayApiException e) { |
||||
ErrorHelper.println(e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
|
||||
// 5.2.2.7 交易退款查询alipay.trade.fastpay.refund.query
|
||||
public static String queryRefund(String outRefundNo, String outTradeNo, String tradeNo) { |
||||
try { |
||||
AlipayClient alipayClient = new DefaultAlipayClient(AliConfig.getAlipayConfig()); |
||||
AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
||||
JSONObject bizContent = new JSONObject(); |
||||
bizContent.put("out_request_no", outRefundNo); |
||||
bizContent.put("trade_no", tradeNo); |
||||
bizContent.put("out_trade_no", outTradeNo); |
||||
bizContent.put("query_options", new String[]{"refund_detail_item_list"}); // 查询本次交易用户付款的支付渠道和亲情账户关系
|
||||
|
||||
request.setBizContent(JSONObject.toJSONString(bizContent)); |
||||
|
||||
AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
||||
log.info("[支付宝]交易退款查询-返回 {}", response.getBody()); |
||||
if (response.isSuccess()) { |
||||
return response.getBody(); |
||||
} |
||||
} catch (AlipayApiException e) { |
||||
ErrorHelper.println(e); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,23 @@ |
||||
package com.ynxbd.common.bean.his; |
||||
|
||||
import lombok.Getter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.Setter; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Getter |
||||
@Setter |
||||
@ToString |
||||
@NoArgsConstructor |
||||
public class HisArea implements Serializable { |
||||
private static final long serialVersionUID = -2025081111550001L; |
||||
|
||||
private String areaName; |
||||
private String areaCode; |
||||
private String level; |
||||
private String pym; |
||||
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.ynxbd.common.helper.common; |
||||
|
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
@Slf4j |
||||
public class AesMicroHelper { |
||||
private final static String KEY = "ynxbdysdssjtwrin"; |
||||
|
||||
private final static String IV = "ynxbdqsdsbjtwrin"; |
||||
|
||||
public static String encode(String data) { |
||||
return AesHelper.encryptHex(data, KEY, IV); |
||||
} |
||||
|
||||
public static String decode(String data) { |
||||
return AesHelper.decryptHex(data, KEY, IV); |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
package com.ynxbd.common.service.cache; |
||||
|
||||
import com.ynxbd.common.bean.his.HisArea; |
||||
import com.ynxbd.common.config.EhCacheConfig; |
||||
import org.ehcache.Cache; |
||||
|
||||
public class AreaCache { |
||||
|
||||
static { |
||||
createHisAreaCache(); |
||||
} |
||||
|
||||
private static Cache<String, HisArea> AREA_CACHE; |
||||
|
||||
private synchronized static void createHisAreaCache() { |
||||
if (AREA_CACHE == null) { |
||||
AREA_CACHE = EhCacheConfig.createCacheTTL(String.class, HisArea.class, "his_area_cache", (7100L)); // 一个半小时
|
||||
} |
||||
} |
||||
|
||||
} |
@ -1,158 +0,0 @@ |
||||
package com.ynxbd.common.service.params; |
||||
|
||||
import com.ynxbd.common.bean.pay.Register; |
||||
import com.ynxbd.common.result.ResultEnum; |
||||
import com.ynxbd.common.result.ServiceException; |
||||
import com.ynxbd.common.service.RegService; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.math.BigDecimal; |
||||
|
||||
@Slf4j |
||||
public class RegParams { |
||||
|
||||
/** |
||||
* * // * @param regFee 金额
|
||||
* * // * @param clinicFee 金额
|
||||
* * // * @param payMoney 金额
|
||||
* * // * @param tel 电话
|
||||
* * // * @param openid openid
|
||||
* * // * @param idCardNo 身份证号码
|
||||
* * // * @param patientId 患者id
|
||||
* * // * @param deptCode 科室编码
|
||||
* * // * @param deptName 科室名称
|
||||
* * // * @param doctCode 医生编码
|
||||
* * // * @param doctName 医生名
|
||||
* * // * @param address 地址
|
||||
* * // * @param hospitalArea 院区
|
||||
* * // * @param tid 时段名
|
||||
* * // * @param tName 时段名
|
||||
* * // * @param begTime 开始时间(分时段)
|
||||
* * // * @param endTime 开始时间(分时段)
|
||||
* * // * @param regCode 挂号编码
|
||||
* * // * @param regDate 挂号日期
|
||||
* * // * @param sourceId 号源id(分时段)
|
||||
* * // * @param queueNum 序列号(分时段)
|
||||
* * // * @param clinicCode 编码
|
||||
* |
||||
* @param request |
||||
* @param isDesc |
||||
*/ |
||||
public static Register getRegParams(HttpServletRequest request, boolean isDesc) throws ServiceException { |
||||
Register reg = new Register(); |
||||
RequestParams params = new RequestParams(request); |
||||
|
||||
String openid = params.getString("openid"); |
||||
String patientId = params.getString("patientId"); |
||||
String cardNo = params.getString("idCardNo"); |
||||
String patientName = params.getString("patientName"); |
||||
if (cardNo == null) { |
||||
cardNo = params.getString("cardNo"); |
||||
} |
||||
|
||||
BigDecimal payMoney = params.getBigDecimal("payMoney"); |
||||
BigDecimal totalFee = params.getBigDecimal("totalFee"); |
||||
|
||||
String deptCode = params.getString("deptCode"); |
||||
String subDeptCode = params.getString("subDeptCode"); |
||||
String doctCode = params.getString("doctCode"); |
||||
String regCode = params.getString("regCode"); |
||||
String regDate = params.getString("regDate"); |
||||
String tid = params.getString("tid"); |
||||
|
||||
if (openid == null || patientId == null || cardNo == null || deptCode == null || doctCode == null || regDate == null || tid == null) { |
||||
log.info("[挂号]参数缺失 patientId={}, deptCode={}, doctCode={}, regCode={}, regDate={}, tid={}", |
||||
patientId, deptCode, doctCode, regCode, regDate, tid); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
if (payMoney == null || totalFee == null) { |
||||
log.info("[挂号]参数缺失 payMoney"); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
Boolean isSplitTime = params.getBoolean("isSplitTime"); |
||||
if (isSplitTime == null) { |
||||
log.info("[挂号]挂号类型参数缺失isSplitTime"); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
log.info("[挂号类型]{}", (isSplitTime ? "分时段挂号" : "普通挂号")); |
||||
|
||||
reg.setIsSplitTime(isSplitTime); |
||||
if (isSplitTime) { // 分时段
|
||||
String tName = params.getString("tName"); |
||||
String queueNum = params.getString("queueNum"); |
||||
String sourceId = params.getString("sourceId"); |
||||
String begTime = params.getString("begTime"); |
||||
String endTime = params.getString("endTime"); |
||||
if (tName == null || queueNum == null || sourceId == null || begTime == null || endTime == null) { |
||||
log.info("[挂号]参数缺失 tName={}, queueNum={}, sourceId={}, begTime={}, endTime={}", tName, queueNum, sourceId, begTime, endTime); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
reg.setTName(tName); |
||||
reg.setBegTime(begTime); |
||||
reg.setEndTime(endTime); |
||||
reg.setSourceId(sourceId); |
||||
reg.setQueueNum(queueNum); |
||||
} else { |
||||
String clinicCode = params.getString("clinicCode"); |
||||
if (clinicCode == null) { |
||||
log.info("[普通挂号]参数缺失clinicCode"); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
reg.setClinicCode(clinicCode); |
||||
} |
||||
|
||||
if (isDesc) { |
||||
|
||||
BigDecimal regFee = params.getBigDecimal("regFee"); |
||||
BigDecimal clinicFee = params.getBigDecimal("clinicFee"); |
||||
|
||||
if (regFee == null || clinicFee == null) { |
||||
log.info("[挂号]参数缺失 regFee={}, clinicFee={}", regFee, clinicFee); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
|
||||
String tel = params.getString("tel"); |
||||
String address = params.getString("address"); |
||||
String deptName = params.getString("deptName"); |
||||
String doctName = params.getString("doctName"); |
||||
String hospitalArea = params.getString("hospitalArea"); |
||||
|
||||
if (deptName == null || doctName == null) { |
||||
log.info("[挂号]参数缺失 tel={}, address={}, deptName={}, hospitalArea={}", tel, address, deptName, hospitalArea); |
||||
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT); |
||||
} |
||||
reg.setRegFee(regFee); |
||||
reg.setClinicFee(clinicFee); |
||||
|
||||
reg.setTel(tel); |
||||
reg.setAddress(address); |
||||
reg.setHospitalArea(hospitalArea); |
||||
reg.setDeptName(deptName); |
||||
reg.setDoctName(doctName); |
||||
|
||||
reg.setRegType(RegService.setRegType(regDate, isSplitTime)); |
||||
} |
||||
|
||||
reg.setRegCode(regCode); |
||||
reg.setPayMoney(payMoney); |
||||
// 信息
|
||||
reg.setPatientId(patientId); |
||||
reg.setOpenid(openid); |
||||
reg.setIdCardNo(cardNo); |
||||
|
||||
reg.setDeptCode(deptCode); |
||||
reg.setSubDeptCode(subDeptCode); |
||||
reg.setDoctCode(doctCode); |
||||
reg.setRegDate(regDate); |
||||
reg.setTid(tid); |
||||
reg.setPayMoney(payMoney); |
||||
reg.setTotalFee(totalFee); |
||||
|
||||
return reg; |
||||
} |
||||
} |
@ -0,0 +1,31 @@ |
||||
package com.ynxbd.wx.wxfactory.bean; |
||||
|
||||
import lombok.ToString; |
||||
|
||||
@ToString |
||||
public enum OrderMIEnum { |
||||
|
||||
REG_PAY("RegPay", "挂号支付", "APPOINTMENT"), |
||||
MED_PAY("MedPay", "药费支付", "OUTPATIENT"), |
||||
DIAG_PAY("DiagPay", "诊间支付", "OUTPATIENT"), |
||||
IN_HOSP_PAY("InHospPay", "住院费支付", "INPATIENT"), |
||||
PHARMACY_PAY("PharmacyPay", "药店支付", "DRUGSTORE"), |
||||
INSURANCE_PAY("InsurancePay", "保险费支付", "OUTPATIENT"), |
||||
INT_REG_PAY("IntRegPay", "互联网医院挂号支付", "APPOINTMENT"), |
||||
INT_RE_DIAG_PAY("IntReDiagPay", "互联网医院复诊支付", ""), |
||||
INT_PSC_PAY("IntPscPay", "互联网医院处方支付", "OUTPATIENT"), |
||||
COVID_EXAM_PAY("CovidExamPay", "新冠检测费用", "OUTPATIENT"); |
||||
|
||||
// 微信医保编码
|
||||
public final String WX_MI_CODE; |
||||
// 名称
|
||||
public final String NAME; |
||||
// 支付宝医保编码
|
||||
public final String ALI_MI_CODE; |
||||
|
||||
OrderMIEnum(String WX_MI_CODE, String NAME, String ALI_MI_CODE) { |
||||
this.WX_MI_CODE = WX_MI_CODE; |
||||
this.NAME = NAME; |
||||
this.ALI_MI_CODE = ALI_MI_CODE; |
||||
} |
||||
} |
@ -1,28 +0,0 @@ |
||||
package com.ynxbd.wx.wxfactory.bean; |
||||
|
||||
import lombok.ToString; |
||||
|
||||
@ToString |
||||
public enum OrderTypeEnum { |
||||
|
||||
REG_PAY("RegPay", "挂号支付"), |
||||
MED_PAY("MedPay", "药费支付"), |
||||
DIAG_PAY("DiagPay", "诊间支付"), |
||||
IN_HOSP_PAY("InHospPay", "住院费支付"), |
||||
PHARMACY_PAY("PharmacyPay", "药店支付"), |
||||
INSURANCE_PAY("InsurancePay", "保险费支付"), |
||||
INT_REG_PAY("IntRegPay", "互联网医院挂号支付"), |
||||
INT_RE_DIAG_PAY("IntReDiagPay", "互联网医院复诊支付"), |
||||
INT_PSC_PAY("IntPscPay", "互联网医院处方支付"), |
||||
COVID_EXAM_PAY("CovidExamPay", "新冠检测费用"); |
||||
|
||||
// 编码
|
||||
public final String CODE; |
||||
// 名称
|
||||
public final String NAME; |
||||
|
||||
OrderTypeEnum(String CODE, String NAME) { |
||||
this.CODE = CODE; |
||||
this.NAME = NAME; |
||||
} |
||||
} |
@ -1,42 +1,42 @@ |
||||
ali.is_log=true |
||||
ali.is_enable=true |
||||
# 消息推送 |
||||
# \u6D88\u606F\u63A8\u9001 |
||||
ali.is_push_msg=true |
||||
# 公司isv_pid(唯一) |
||||
# \u7CFB\u7EDF\u5546\u7B7E\u7EA6\u534F\u8BAE\u7684PID-\u516C\u53F8isv_pid\uFF08\u552F\u4E00\uFF09 |
||||
ali.isv_partner_id=2088041605229629 |
||||
#----------------------------------------- |
||||
# appid(和商户相关-钱到的地方) |
||||
# appid\uFF08\u548C\u5546\u6237\u76F8\u5173-\u94B1\u5230\u7684\u5730\u65B9\uFF09 |
||||
ali.app_id=2021003163655042 |
||||
# 医院账号id = 商户pid |
||||
# \u533B\u9662\u8D26\u53F7id = \u5546\u6237pid |
||||
ali.hosp_id=2088541276656015 |
||||
# 应用公钥->支付宝公钥 |
||||
# \u5E94\u7528\u516C\u94A5->\u652F\u4ED8\u5B9D\u516C\u94A5 |
||||
ali.public_key=miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqeaiirkzafc4fuxbmtprisjiy/ongxhpkpqemhqjroehgydcd+fwsqmi4cougift27vktqokw23df2mnhjws/nbofswgqdkbstjr2eqhnmzhkyf6d30wnb1c19ocdrburaeaotctt7equamnz5updzpv5w6qoh1nwysshuoyzxdhpwsanjrw5a3gdsqtodikoxgfzrvw7yzszbtwsvnrezk7yxyi2nxalnehquoypbxe6a30kjcehlze9dn3eaho5/h2o3xxgqiunwltkqrc5uo785e6b7eyuswl2cky3eauguaiidzdkslavi+5bgfwhhexgskf4bd1acapc9bhmgiwwidaqab |
||||
# 应用私钥 |
||||
# \u5E94\u7528\u79C1\u94A5 |
||||
ali.app_private_key=miievgibadanbgkqhkig9w0baqefaascbkgwggskageaaoibaqdni1a+z5ha7msqjeim11covr3m0faybpsx82cmgh1soquq98mrtgybmj44fzitezkqsyu0auwbzke35aquncgdop9k0q5eeok4pzzo6dxgcp6gzsd/p6tiynaoqrxuroxy45stzvv32g/ufb6h9t2htx+qn33d0mnqtklm1buqim1iobnbsjmcrdbkewfx32qxxqxzeoq9eepphu7yuigohjya5tvpd6mykd7bwph6fvgy8rpl7shr+iwzt4kmq+qkyi5a93z51qa41d+i12hwgr4je25rlu6arhuoxu9uvzd57zsckn5wx6zkud+k6khklinv7utyqbrrrdiqsmlhagmbaaecggebamrptuyc96iev1q7woukxsmfwlezl8sjwklu63vezrro6r4bjdxyniozzmen/cqumuywcwjndksxzsncvt2pdsktkrcmh3k825dtcdati1ofstqdxd2uugt8u9l26c6i8rrkd9lcxdw8zzdlufvpphcnlzkg/ao9gwtkykwuqzzuimewk9rllgorp7bqxgth8r2cutdylzbue2aq2w3pf0xkhpkg82cgwmtnxhjbxfhoo+3ciyta5ncrymzc+icuqwersdktctp1+s83aks6cya66rxzlp2rz3eb2n4maj+y+dodkju4gok7askmxth+wgwwqxbvbftu+99jw5a9laecgyea5o8mjhfc7b04u/jn7y2hyfrqwixjqhzf8cqoogprrb/y5f3pvzlpiltfgtgkodnsvbc3ilt0svf56zganhrwf8rteyerun5tl8vzdutp5enjvqb1jxo0w1urklnrx13dysxcrt6maumvcu8w5em+jh2v+nv5qwu9w9vwwtddx3ecgyea5dmre5k1yuk3c8kppmul/quwououfswqnaz9z6ojaref9y6rdqdoruzgokmi4lu3s9jz3pmn0ezzd8svplzzr9gnrpo39jwag5zwnllysjjllk+yjijplb78fxz4/eey+s3ynspy0t73c0wcnfbpuwb4jeiaijw6iykd8dvfkdccgyea0x1qsjwmjhq4zjrxqevcqe5xun13aw7tg0p/oreu4wtzsgstcyod6fc1hzk6pu3i9hdsdck7x40ifk4wcda6qsolvnx9iyudmmsqh5/qtaddzazorgvnw95bhnuuxnqzvvkhl9knc8fib97is1ltczyydysf9gggyvyy5jgiceecgyadcue8wkovvw1zc9ggd8a3hduf3dj8gmilismvt0pvaopjjzpwaoembokwpuqwcd7tynmhbbrwpv4eanzrr6ridmvgcrtpndq5iyejefo8gzguek3wpyucurxz7fm5yzqcl7r8blpffnxcsq6g8vwiuwa6fndr6wgmyhgccex+zqkbgdjweqqx9m7zivj3dzbzn5bbs0fgbm0vascwcx1fgd2kml1qm6rj2unjaen2yi81bdrn5calu9eipvopia3jvxtfrubrf5l+0/vyaj9olqayumzgk6qf1a4rmfglxfugo7jd8ow9mq5tqtz3ldelaqlijkvyu+5ssphj2twgtzan |
||||
#------------------------------------------ |
||||
# 医院登记号 |
||||
# \u533B\u9662\u767B\u8BB0\u53F7 |
||||
ali.hosp_register_id=43278598053310011a2101 |
||||
# 租户应用id |
||||
# \u79DF\u6237\u5E94\u7528id |
||||
ali.tenant_app_id= 20221116560100034264 |
||||
# 医院名称 |
||||
ali.hosp_name=德宏州中医医院 |
||||
# 医院别名 |
||||
ali.hosp_alias=德宏州中医医院 |
||||
# 医疗定点机构编号 |
||||
# \u533B\u9662\u540D\u79F0 |
||||
ali.hosp_name=\u5FB7\u5B8F\u5DDE\u4E2D\u533B\u533B\u9662 |
||||
# \u533B\u9662\u522B\u540D |
||||
ali.hosp_alias=\u5FB7\u5B8F\u5DDE\u4E2D\u533B\u533B\u9662 |
||||
# \u533B\u7597\u5B9A\u70B9\u673A\u6784\u7F16\u53F7 |
||||
ali.hosp_standard_code=h53310300023 |
||||
# 医院所在省份 |
||||
ali.hosp_province=云南省 |
||||
# 医院所在城市 |
||||
ali.hosp_city=芒市 |
||||
# 医院所在城市区划编码 |
||||
# \u533B\u9662\u6240\u5728\u7701\u4EFD |
||||
ali.hosp_province=\u4E91\u5357\u7701 |
||||
# \u533B\u9662\u6240\u5728\u57CE\u5E02 |
||||
ali.hosp_city=\u8292\u5E02 |
||||
# \u533B\u9662\u6240\u5728\u57CE\u5E02\u533A\u5212\u7F16\u7801 |
||||
ali.hosp_district=530600 |
||||
# 医院地址 |
||||
ali.hosp_addr=云南省德宏傣族景颇族自治州芒市南蚌路87号 |
||||
# 医院经度 |
||||
# \u533B\u9662\u5730\u5740 |
||||
ali.hosp_addr=\u4E91\u5357\u7701\u5FB7\u5B8F\u50A3\u65CF\u666F\u9887\u65CF\u81EA\u6CBB\u5DDE\u8292\u5E02\u5357\u868C\u8DEF87\u53F7 |
||||
# \u533B\u9662\u7ECF\u5EA6 |
||||
ali.hosp_lgt=98.574521 |
||||
# 医院纬度 |
||||
# \u533B\u9662\u7EAC\u5EA6 |
||||
ali.hosp_lat=24.414922 |
||||
# 医院类型 |
||||
ali.hosp_type=公立 |
||||
# 医院等级 |
||||
ali.hosp_grade=三级 |
||||
# \u533B\u9662\u7C7B\u578B |
||||
ali.hosp_type=\u516C\u7ACB |
||||
# \u533B\u9662\u7B49\u7EA7 |
||||
ali.hosp_grade=\u4E09\u7EA7 |
@ -1 +1 @@ |
||||
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09
his.is_recipe_prepay=false
lis.url=192.168.1.185:8090
lis.unifiedEntrance=true
# \u672C\u5730
#his.url=127.0.0.1:8888
# \u6D4B\u8BD5\u73AF\u5883
ali_code=675448357
# \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E
his.is_log_resp=true
# \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F
his.is_push_msg=false
#-------------------------------------------------------------
#\u672C\u5730
his.md_url=127.0.0.1:7777
his.dev_url=127.0.0.1:7777
## \u5FB7\u5B8F\u4E2D\u533B
his.url=200.200.200.60:8888
## \u7EA2\u6CB3\u5DDE\u533B\u9662
#his.url=10.20.10.6:8888
# \u5B81\u8497\u5987\u5E7C
#his.url=172.19.3.15:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.39:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.10:8888
# \u7EA2\u6CB3
#his.url=10.20.10.6:8888
# \u7EA2\u6CB3\u533B\u4FDD
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
#his.md_url=192.168.1.128:7885
#his.dev_url=10.20.10.6:9988
# \u6C38\u80DC
#his.url=200.200.200.20:8888
# \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u534E\u576A
#his.url=192.168.1.115:8888
# \u8499\u81EA\u4E2D\u533B
#his.url=192.168.0.228:8888
# \u7389\u9F99
#his.url=192.168.0.17:8888
# \u4E91\u9F99
#his.url=200.200.200.69:8888
#
#his.url=172.16.10.15:8888
# \u7984\u529D\u949F\u7231
#his.url=200.200.200.5:8888
# \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662
#his.url=200.200.200.174:8080
# \u5143\u8C0B
#his.url=200.200.200.29:8888
# \u5143\u8C0B\u533B\u4FDD
#his.dev_url=200.200.200.36:9999
# \u8292\u5E02
#his.url=192.168.100.8:8888
# \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662
#his.url=192.168.1.204:8888
# \u8292\u5E02\u5987\u5E7C
#his.url=192.168.11.7:8888
#
#his.url=10.10.11.23:8888
# \u77F3\u6797
#his.url=192.168.10.10:8888
# \u5BCC\u6C11
#his.url=200.200.201.27:8888
# \u897F\u53CC\u7248\u7EB3
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
||||
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09
his.is_recipe_prepay=false
lis.url=192.168.1.185:8090
lis.unifiedEntrance=true
# \u672C\u5730
#his.url=127.0.0.1:8888
# \u6D4B\u8BD5\u73AF\u5883
ali_code=675448357
# \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E
his.is_log_resp=true
# \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F
his.is_push_msg=false
#-------------------------------------------------------------
#\u672C\u5730
his.md_url=127.0.0.1:7777
his.dev_url=127.0.0.1:7777
### \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u7EA2\u6CB3\u5DDE\u533B\u9662
#his.url=10.20.10.6:8888
# \u8292\u5E02\u5987\u5E7C
his.url=192.168.11.7:8888
# \u5B81\u8497\u5987\u5E7C
#his.url=172.19.3.15:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.39:8888
# \u516C\u53F8\u6D4B\u8BD5
#his.url=192.168.12.10:8888
# \u7EA2\u6CB3
#his.url=10.20.10.6:8888
# \u7EA2\u6CB3\u533B\u4FDD
#his.url=10.20.10.6:8888
#his.url=192.168.12.10:8888
#his.md_url=192.168.1.128:7885
#his.dev_url=10.20.10.6:9988
# \u6C38\u80DC
#his.url=200.200.200.20:8888
# \u5FB7\u5B8F\u4E2D\u533B
#his.url=200.200.200.60:8888
# \u534E\u576A
#his.url=192.168.1.115:8888
# \u8499\u81EA\u4E2D\u533B
#his.url=192.168.0.228:8888
# \u7389\u9F99
#his.url=192.168.0.17:8888
# \u4E91\u9F99
#his.url=200.200.200.69:8888
#
#his.url=172.16.10.15:8888
# \u7984\u529D\u949F\u7231
#his.url=200.200.200.5:8888
# \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662
#his.url=200.200.200.174:8080
# \u5143\u8C0B
#his.url=200.200.200.29:8888
# \u5143\u8C0B\u533B\u4FDD
#his.dev_url=200.200.200.36:9999
# \u8292\u5E02
#his.url=192.168.100.8:8888
# \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662
#his.url=192.168.1.204:8888
# \u8292\u5E02\u5987\u5E7C
#his.url=192.168.11.7:8888
#
#his.url=10.10.11.23:8888
# \u77F3\u6797
#his.url=192.168.10.10:8888
# \u5BCC\u6C11
#his.url=200.200.201.27:8888
# \u897F\u53CC\u7248\u7EB3
#his.url=10.10.11.23:8888
#wx.password=ynxbd@6910 |
Loading…
Reference in new issue