|
@@ -119,12 +119,11 @@ public class DHOutpatientController {
|
|
|
private static final int DATA_TYPE_OUTPATIENT = 0; // 门诊缴费
|
|
|
private static final int DATA_TYPE_HIS_PRES = 1; // 白云外转处方
|
|
|
|
|
|
- // payAuthNo 缓存 key,后缀 hisOrderNo-userId
|
|
|
- public static final String REDIS_KEY_PAY_AUTH_NO_PATTERN = "wapapi:payAuthNo:%s-%s";
|
|
|
-
|
|
|
// 腾讯医保订单交易状态
|
|
|
public static final String MED_TRADE_STATE_SUCCESS = "SUCCESS"; // 支付成功
|
|
|
public static final String MED_TRADE_STATE_PAYING = "PAYING"; // 支付中
|
|
|
+ // payAuthNo 缓存 key,后缀 hisOrderNo-userId
|
|
|
+ public static final String REDIS_KEY_PAY_AUTH_NO_PATTERN = "wapapi:payAuthNo:%s-%s";
|
|
|
|
|
|
/**
|
|
|
* 获取门诊缴费列表
|
|
@@ -156,7 +155,7 @@ public class DHOutpatientController {
|
|
|
GetMedicalCardInfoByPatientIdRequest gResp = GetMedicalCardInfoByPatientIdRequest.newBuilder()
|
|
|
.setHisPatientId(hisPatientId)
|
|
|
.setHospitalId(hospitalId)
|
|
|
- .setUserId(userSrv.getCurrentUserIdWrapped())
|
|
|
+ .setUserId(userId)
|
|
|
.build();
|
|
|
GetMedicalCardInfoByPatientIdResponse resp = taiheOutpatientServiceBlockingStub.getMedicalCardInfoByPatientId(gResp);
|
|
|
if (resp.getCode() == ResultCode.SUCCEED_VALUE) {
|
|
@@ -953,21 +952,26 @@ public class DHOutpatientController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 如果是医保支付,查询是否有已支付或支付中的订单
|
|
|
- QueryPayInsOrderResponse qpioResp = wxInsPayServiceBlockingStub.queryPayInsOrder(QueryPayInsOrderRequest.newBuilder()
|
|
|
- .setHospOutTradeNo(response.getOrderNo())
|
|
|
- .setTerminal(BizUtil.getCurrentTerminalWrapped())
|
|
|
- .build());
|
|
|
- if (qpioResp.getCode() != ResultCode.SUCCEED_VALUE) {
|
|
|
- logger.error("DHOutpatientController#getPrevOrderInfo(hisOrderNo={} ): 调用腾讯接口查单失败:{}", hisOrderNo, qpioResp.getMsg());
|
|
|
- throw new AppMessageException(String.format("查单失败:%s", qpioResp.getMsg()));
|
|
|
- } else {
|
|
|
- if (qpioResp.getMedTradeState().equals(MED_TRADE_STATE_SUCCESS)) {
|
|
|
- throw new AppMessageException("该订单已支付成功,请返回刷新");
|
|
|
- }
|
|
|
- if (qpioResp.getMedTradeState().equals(MED_TRADE_STATE_PAYING)) {
|
|
|
- throw new AppMessageException("该订单正在支付中,请稍后");
|
|
|
+ String medTransId = response.getMedTransId();
|
|
|
+ if (!StringHelper.isNullOrEmpty(medTransId)) {
|
|
|
+ // 如果是医保支付,查询是否有已支付或支付中的订单
|
|
|
+ QueryPayInsOrderResponse qpioResp = wxInsPayServiceBlockingStub.queryPayInsOrder(QueryPayInsOrderRequest.newBuilder()
|
|
|
+ .setHospOutTradeNo(response.getOrderNo())
|
|
|
+ .setTerminal(BizUtil.getCurrentTerminalWrapped())
|
|
|
+ .build());
|
|
|
+ if (qpioResp.getCode() != ResultCode.SUCCEED_VALUE) {
|
|
|
+ logger.error("DHOutpatientController#getPrevOrderInfo(hisOrderNo={} ): 调用腾讯接口查单失败:{}", hisOrderNo, qpioResp.getMsg());
|
|
|
+ throw new AppMessageException(String.format("查单失败:%s", qpioResp.getMsg()));
|
|
|
+ } else {
|
|
|
+ if (qpioResp.getMedTradeState().equals(MED_TRADE_STATE_SUCCESS)) {
|
|
|
+ throw new AppMessageException("该订单已支付成功,请返回刷新");
|
|
|
+ }
|
|
|
+ if (qpioResp.getMedTradeState().equals(MED_TRADE_STATE_PAYING)) {
|
|
|
+ throw new AppMessageException("该订单正在支付中,请稍后");
|
|
|
+ }
|
|
|
}
|
|
|
+ } else {
|
|
|
+ logger.info("DHOutpatientController#getPrevOrderInfo(hisOrderNo={} , isIns={} ): 找不到腾讯下单号", hisOrderNo, isIns);
|
|
|
}
|
|
|
}
|
|
|
} else {
|