瀏覽代碼

fix 新增配置

daiyihua 1 年之前
父節點
當前提交
c69bc6961c

+ 1 - 0
ywt-platform-outpatient-common/src/main/java/com/ywt/outpatient/core/utils/BizUtil.java

@@ -227,6 +227,7 @@ public final class BizUtil {
             case TAI_HE_INTERNET_HOSPITAL_DOCTOR_WX_OFFICIAL:
             case TaiheWxOfficial:
             case DOCTOR_MINI_PROGRAM:
+            case TH_ALIPAY_MP:
                 return Constant.TAIHE_HOSPITAL_ID;
             default:
                 return 0;

+ 3 - 0
ywt-platform-outpatient-rpc/src/main/resources/application.yml

@@ -10,6 +10,9 @@ spring:
     host: @redis.host@
     port: @redis.port@
   jpa:
+    properties:
+      hibernate:
+        enable_lazy_load_no_trans: true
     hibernate:
       ddl-auto: none
       naming-strategy: org.hibernate.cfg.EJB3NamingStrategy

+ 1 - 0
ywt-platform-outpatient-taihe-rpc/src/main/java/com/ywt/outpatient/taihe/rpc/domain/enums/TerminalEnum.java

@@ -40,6 +40,7 @@ public enum TerminalEnum {
     NFYYBYFY_OPTICAL_SHOP_PAY_HELPER("白云视光中心支付助手", 23),
     NFYYBYFY_ALIPAY_MP("南方医院白云分院支付宝小程序", 24),
     TH_ALIPAY_MP("南方医院太和分院支付宝小程序", 25),
+    EXPERTS_STUDIO_WX_MP("专家工作室微信小程序", 26)
     ;
 
     private final String displayName;

+ 22 - 18
ywt-platform-outpatient-web/src/main/java/com/ywt/outpatient/controllers/taihe/DHOutpatientController.java

@@ -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 {