diff --git a/pom.xml b/pom.xml
index 2d63ba8..e776c35 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,6 +36,7 @@
1.18.4
3.0.3
2.7.1
+ 0.4.4
@@ -235,6 +236,13 @@
simple-xml
${simple-xml.version}
+
+
+
+ com.github.wechatpay-apiv3
+ wechatpay-apache-httpclient
+ ${wechatpay-apiv3.version}
+
diff --git a/xinelu-admin/src/main/resources/application.yml b/xinelu-admin/src/main/resources/application.yml
index 8f26272..14d25aa 100644
--- a/xinelu-admin/src/main/resources/application.yml
+++ b/xinelu-admin/src/main/resources/application.yml
@@ -243,7 +243,7 @@ xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
- excludes: /system/notice
+ excludes: /system/notice,/system/station/add,/system/station/edit,/system/stationItem/add,/system/stationItem/edit,/system/operateGoodInfo/add,/system/operateGoodInfo/edit,/system/goodsInfo/add,/system/goodsInfo/edit,/system/hospital/add,/system/hospital/edit,/system/informationInfo/add,/system/informationInfo/edit,/system/trainingItem/edit,/system/trainingItem/add
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
@@ -276,21 +276,6 @@ applet-chat-config:
# 微信小程序事件回调消息加密密钥
encoding-aes-key: 5rbyhMBpdnxTEVT54zeHMNcXi3ccilQZ209QqGi89EW
-# 护理员微信小程序参数配置信息
-nurse-applet-chat-config:
- # 微信小程序id,wxa4f2b43d2ccb9908
- applet-id: wxa4f2b43d2ccb9908
- # 微信小程序密钥,
- secret: faeba9fc043cfdcb088f43be1747e054
- # 微信小程序返回国家语言
- lang: zh_CN
- # 微信小程序授权类型
- grant-type: authorization_code
- # 微信小程序事件回调令牌
- token: Yw3vfW1ILpc34qAVDtTpB2hesAMCpvW0
- # 微信小程序事件回调消息加密密钥
- encoding-aes-key: Lr2uq0F3ds36ZA4AUv1h3Pki0JO1Ql0QeG0z1r4A3at
-
# 小程序首页路径
applet-page-config:
# 首页跳转路径
@@ -305,3 +290,37 @@ applet-page-config:
integral-page-url: pages/integral/integral
# 护理结构详情页面跳转路径
nursestation-details-page-url: pages/nursestation/nursestation
+
+# 新医路微信商户号配置参数
+xyl-we-chat-config:
+ xyl-mch-id: 1633348407
+ xyl-mch-serial-no: 7C6A18FC8E1F0445901B1BE1C4DD1ACE284C3D79
+ xyl-private-key-path: xinyilu_apiclient_key.pem
+ xyl-payment-key: Xyl699003981qazVFR4xsw23edcASDFG
+ xyl-wechat-notify-url: https://1608.xinelu.cn
+
+# 医路优品微信商户号配置参数
+ylyp-we-chat-config:
+ ylyp-mch-id: 1633506981
+ ylyp-mch-serial-no: 7840E8CE4B9B1F0F19D5DD2AB7BC159E007F9D90
+ ylyp-private-key-path: yiluyoupin_apiclient_key.pem
+ ylyp-payment-key: Xyk699003981qazxsw23edcvfr4bgt56
+ ylyp-we-chat-notify-url: https://1608.xinelu.cn
+
+# 微信支付接口地址,包含小程序和App支付接口地址
+we-chat-payment-url-config:
+ jsapi-palce-order-url: https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi
+ query-order-no-url: https://api.mch.weixin.qq.com/v3/pay/transactions/id/%s
+ query-mch-id-url: https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/%s
+ close-order-url: https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/%s/close
+ refund-apply-url: https://api.mch.weixin.qq.com/v3/refund/domestic/refunds
+ refund-query-order-url: https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/%s
+ trade-apply-bill-url: https://api.mch.weixin.qq.com/v3/bill/tradebill
+ capital-apply-bill-url: https://api.mch.weixin.qq.com/v3/bill/fundflowbill
+ app-place-order-url: https://api.mch.weixin.qq.com/v3/pay/transactions/app
+
+# 快递鸟物流查询参数配置
+logistics-config:
+ e-business-id: 1781371
+ api-key: 998b273d-c926-4659-a9d5-ae0613782d70
+ express-bird-url: https://api.kdniao.com/Ebusiness/EbusinessOrderHandle.aspx
diff --git a/xinelu-admin/src/main/resources/xinyilu_apiclient_key.pem b/xinelu-admin/src/main/resources/xinyilu_apiclient_key.pem
new file mode 100644
index 0000000..9cf8337
--- /dev/null
+++ b/xinelu-admin/src/main/resources/xinyilu_apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDFgFmuT17PjBIN
+B0wSGnchCCsB9ZRZZFpcpvBpO+VLspmTSM//zV621uTzZeWNONEBzwO4C7VCsbHW
+gu7R5AQj9FYSzTKdycvs+097qQcQAvMr3VwrX0/dtH2U0iFX6zr3ztDKv2eQBegu
+wEcZsoOEgEW1rsjs/t2MTJJLPYWfzDDUbDBJi2hKFzSGAPfpqeOz0+loKNUz/i7V
+/dg5TXlbWfe0gdf4SI04sdrUkNsbQKabc7hWoPSVaRnX4ywfgzW8fHaIP+vuTzHr
+p7h5dnFNUuA5CdobDnIl0sz+ekLfCFuX4pCYNE6uR/58uknmXW0jfrK/WPU5T+F7
+sGDIsuJHAgMBAAECggEADIrkJx+/Q6r/kng+KoAnxJ9CK/OuoiavXmbzqZs2KqKD
+AkmDfBlMxIvNKm/0Lg3HqDe/YrbLohqq0paqGAZFBQuFU9hYOJESNFCZcZ8AZdHq
+I4UBT3fUGJ5Xw1W87Fpx+j7WH6ocJ5dYcW+glE8z7vw+cRVSiUp+Q2SxfbnAfK9c
+anqJLWA8pxkGRcXzE/tcB4JAkPsluWslFPDeKVOZ5/NRs8oE5ppmQKxqx2KFK7rh
+S0irhlJ/6t1jiI3t+syYXJILwbutJ9PUFaS1Uu3CErcvmBwWiLRZEkNa7xMlzEk+
+R2dplVhT0W++Ku1cjtU4q7V+paea+/YZj3mtos45YQKBgQDsFc4KM8/Lm146dNJX
+TOK1pDjZD5rfEpgtHCEm6dBRbueOYjb/D1Lo/JU4L6Yl2fGsJNtTX4a8i38nxTuI
+6b+SEQoLinEyr8JQtBFMvU4vYOIiA5oCHaZIXn0WLLFbUBkOhq/dXC4xDT6MOyNd
+2rDTSwvLqVE8K8sbupcvRP/RLwKBgQDWKVayVKGHz3cT+YyPhGTD19yBM0w6AGBR
+MLNKdKek7/BnKXe009fxDg/gCtGUBmE+umFbEBLStg7zD31JXLm5/LyT2NBkJYRl
+neO9UW8tWbnL6DOGgNvQTqDN650Od39R8rVoRSH4H4az6A/B1qrJReyrGw7xDXOz
+0eAq9vnKaQKBgH1IDPDJEepAZr6qo7yEJoKxxSEa8NqT6YF2vfkCdvPf4K1kXT75
+CMxuzVjloEvR3je1z1XtCXkgpbebKL69HFYNCMGbE/sL3hgplkyc4NKvnRDjzGR3
+C3i3+7U6vltwo/tbahQUCMcq+hg8gcYaeV+HIZlQHrXJn5z1ZalF+mMtAoGAKVgZ
+sJu+A2X96xFGHX7FpTlLDHZGxPvFnGb2de1HYAQiOQg8X+B108ePMQVlqFoC9AUv
+PlFAEQWspSfcXAlWoZ01GqXEtVC42pU8nhPWjr6/q6nMKK8/wFstmBNgYqaXIc7l
+TpfqEuijLKAkSpuSpQCmy/GRVN/v8ksWJ7U+S+ECgYB+e/GAdxHOdMGOFbrqZ3Dx
+jmPshaFFj/3UEsBZ6lBBTbdlMI7wFrSsqxCe1KGh0yG2GnOXE2useggeJyDVuaEY
+7/CNalD9w158WS9Zb7pPOm6QQpKUeIEXvpQbKi6FjKZKaFlUDk2auFT+d1lOga0T
+QRowjmcym1p+moKlqdiXGw==
+-----END PRIVATE KEY-----
diff --git a/xinelu-admin/src/main/resources/yiluyoupin_apiclient_key.pem b/xinelu-admin/src/main/resources/yiluyoupin_apiclient_key.pem
new file mode 100644
index 0000000..cf65f27
--- /dev/null
+++ b/xinelu-admin/src/main/resources/yiluyoupin_apiclient_key.pem
@@ -0,0 +1,28 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC3rkr2Mp+Xb31y
+xfTOJPSmjQkG5/Eko6cyJcb8e6fGrrtsPVM9kExpVIor61oWTS1gyKYLwCQ92xmh
+qjKtazzd6KvqjKdxFknxxH9R1L+n7LnSEfK2KNaxIL17h2vdXOJatuinX0+7A9Ct
+5ZnKb5O5HVctQH0xCca6C6yyuF0q11BFquKyGPVwhqVwQnt+qIeQ/VCKFD5AYf1r
+ebkaHwKCg0rbzPFWeZfVI0z3j6M71DLxdIHV40xDn31ygQYlBeuTOUxFvKnri8m+
+BalcSUhocS9VAIyuPyDXCAdujm3hKz/WgqVtvgB3OOiIeGVppbgDlW+JWgR7lizM
+TzMYfhjPAgMBAAECggEBAJbB6SjVOAO1MEOpklo4Hs0saMJQUK3/3FTeiMnmPDho
+ZdBbLR0UeILjLl0J2HEBe0M6rH5sf9J9KDZ2WQ3ZPKXuOFxUgYHiB2L2IoHpmjyb
+oZB3xrwYHM5Yzuy6o5+Wgvptsdrd8bTPVtHD50wt9BM1r72mdppvKbq9pksx4tYr
+apw4WXfjO2zbdOngY4T5pCk5NZgXrlBfY0/vXsP/3SR+52KXGre/lSt35A4SjNe6
+voI1vZLDNlqzRaEZqBC0tLyvMH3NaYpRhwyEHtoABE9AQvVaQNt+fN1qhbhjtVdQ
+lR64Dqdc6jjIhuUhs1umYswf2umA3duZox8RTLZo1UECgYEA4oM2gLsX7dVNiDI4
+bZsMBdm8cb+N3/npiZBlDL9UL4tWCzLQP8sR/HJH3OZHQ1iLk+7QXi2g0YR5VtNx
+tLvECK1+Cd3sGt2zyFcrSpeYAnvbsMqB9F/K3grCCnvzKKmHJS27c9EVGr+sRTbx
+6hSqQyEAYTP1yRLnLVmWzkCBXh8CgYEAz5eqFmfou3U7B04tK739HTJGAaHTxVAR
+C4u4x0HGUP+NhPKZzySc70vWHoNgyP/QBUgzf5gTEnGCJ7Rk6Y2YZxCLyPksEDFc
+meW9ENSOQMwTWM1PAF+XLr4wXbyojMqlI7vWimTMOPK7WMVt4jYCoaN9lBS+McYj
+e1ZpB5yEj1ECgYEAiSXLXVxq2604GYvW0L59JBm22OSTwZZuycUs+e/qyDLEcVld
+8BJDnKeRTXX8lhFJydNiRHO6GMHuOh0ijrzVsC9jzhOZvpaYIWhuJObuuipGVZ/3
+2YAatCCtZm2wR+GFm4Q6KKDi92QwqWPgS8whXy3fLfupCQsyACprfgxeiB8CgYBF
+pfjm843d9wMK/GujVWbquMdMHONUO/y8BvDDyYmj+1mb1VlNaldM4gDA1AtQ5KMC
+YqsEkB01/udQMvH4eg075w0/LHpgJG+RIsdAMlBX5SBIlvl+gpPSlvTbPkS+l+64
+AnmEjTUHlkjNC9BGKSDQ4m1rlVoKkROuedtbNmQzQQKBgQCQdmmWy2Nr9NRmy5+r
+3FKymUVGujww+R7IiFGnFiBBhec8hUPaBp1xG5d8XVIcLt6nleOX5ZunXBwTOmp6
+XH6tQuup+hjFiNpRLmbVkTv8uQVy5sWEqiGp0i7Jhb+0QEOSEshOr8sQDDAFwWXl
+FyCbC1amAeC1i1knzGrNOdppUw==
+-----END PRIVATE KEY-----
diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/LogisticsConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/LogisticsConfig.java
new file mode 100644
index 0000000..af39e48
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/config/LogisticsConfig.java
@@ -0,0 +1,23 @@
+package com.xinelu.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 快递鸟物流接口配置参数类
+ * @Author 纪寒
+ * @Date 2022-11-01 13:30:47
+ * @Version 1.0
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "logistics-config")
+public class LogisticsConfig {
+
+ private String eBusinessId;
+
+ private String apiKey;
+
+ private String expressBirdUrl;
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/NurseAppletChatConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/NurseAppletChatConfig.java
deleted file mode 100644
index eb05253..0000000
--- a/xinelu-common/src/main/java/com/xinelu/common/config/NurseAppletChatConfig.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.xinelu.common.config;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.stereotype.Component;
-
-/**
- * 护理员小程序配置类
- *
- * @author ljh
- * @version 1.0
- * Create by 2023/3/29 15:40
- */
-@Data
-@Component
-@ConfigurationProperties(prefix = "nurse-applet-chat-config")
-public class NurseAppletChatConfig {
-
- /**
- * 小程序id
- */
- private String appletId;
-
- /**
- * 小程序secret
- */
- private String secret;
-
- /**
- * 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
- */
- private String lang;
-
- /**
- * 授权类型
- */
- private String grantType;
-
- /**
- * 微信小程序事件回调令牌
- */
- private String token;
-
- /**
- * 微信小程序事件回调消息加密密钥
- */
- private String encodingAesKey;
-
- /**
- * 护理站运营人员-服务派单通知-模板id
- */
- private String serviceDispatchOperationsTemplateId;
-
- /**
- * 护理站运营人员-接单提醒-模板id
- */
- private String receivingOrdersOperationsTemplateId;
-
- /**
- * 护理站运营人员-师傅拒绝接单通知-模板id
- */
- private String refusalOrdersOperationsTemplateId;
-
- /**
- * 护理站运营人员和护理员-订单回池通知-模板id
- */
- private String overtimeOrdersOperationsTemplateId;
-
- /**
- * 护理站运营人员-订单完成通知-模板id
- */
- private String orderCompletionOperationsTemplateId;
-
- /**
- * 护理员-接单提醒-模板id
- */
- private String receivingOrdersNurseTemplateId;
-
-}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/WeChatPaymentUrlConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/WeChatPaymentUrlConfig.java
new file mode 100644
index 0000000..efe2237
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/config/WeChatPaymentUrlConfig.java
@@ -0,0 +1,35 @@
+package com.xinelu.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 微信支付接口地址
+ * @Author 纪寒
+ * @Date 2022-10-17 17:56:25
+ * @Version 1.0
+ */
+@Component
+@Data
+@ConfigurationProperties(prefix = "we-chat-payment-url-config")
+public class WeChatPaymentUrlConfig {
+
+ private String jsapiPalceOrderUrl;
+
+ private String queryOrderNoUrl;
+
+ private String queryMchIdUrl;
+
+ private String closeOrderUrl;
+
+ private String refundApplyUrl;
+
+ private String refundQueryOrderUrl;
+
+ private String tradeApplyBillUrl;
+
+ private String capitalApplyBillUrl;
+
+ private String appPlaceOrderUrl;
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/XylWeChatPaymentConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/XylWeChatPaymentConfig.java
new file mode 100644
index 0000000..097ef16
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/config/XylWeChatPaymentConfig.java
@@ -0,0 +1,27 @@
+package com.xinelu.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 新医路商户号微信支付参数配置类
+ * @Author 纪寒
+ * @Date 2022-10-17 16:55:04
+ * @Version 1.0
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "xyl-we-chat-config")
+public class XylWeChatPaymentConfig {
+
+ private String xylMchId;
+
+ private String xylMchSerialNo;
+
+ private String xylPrivateKeyPath;
+
+ private String xylPaymentKey;
+
+ private String xylWeChatNotifyUrl;
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/config/YlypWeChatPaymentConfig.java b/xinelu-common/src/main/java/com/xinelu/common/config/YlypWeChatPaymentConfig.java
new file mode 100644
index 0000000..ea976a4
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/config/YlypWeChatPaymentConfig.java
@@ -0,0 +1,27 @@
+package com.xinelu.common.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description 医路优品商户号微信支付参数配置类
+ * @Author 纪寒
+ * @Date 2022-10-17 16:55:04
+ * @Version 1.0
+ */
+@Data
+@Component
+@ConfigurationProperties(prefix = "ylyp-we-chat-config")
+public class YlypWeChatPaymentConfig {
+
+ private String ylypMchId;
+
+ private String ylypMchSerialNo;
+
+ private String ylypPrivateKeyPath;
+
+ private String ylypPaymentKey;
+
+ private String ylypWeChatNotifyUrl;
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/OrderSourceEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/OrderSourceEnum.java
new file mode 100644
index 0000000..ea7ae23
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/OrderSourceEnum.java
@@ -0,0 +1,29 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @Description 订单来源枚举
+ * @Author 纪寒
+ * @Date 2023-10-16
+ */
+@Getter
+public enum OrderSourceEnum {
+
+ /**
+ * 泉医模块
+ */
+ SPRING_DOCTOR("SPRING_DOCTOR"),
+
+ /**
+ * 家医模块
+ */
+ FAMILY_DOCTOR("FAMILY_DOCTOR"),
+ ;
+
+ final private String info;
+
+ OrderSourceEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/PayTypeEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/PayTypeEnum.java
new file mode 100644
index 0000000..4679dbd
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/PayTypeEnum.java
@@ -0,0 +1,30 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @Description 支付了类型枚举
+ * @Author 纪寒
+ * @Date 2022-10-18 15:16:02
+ * @Version 1.0
+ */
+@Getter
+public enum PayTypeEnum {
+
+ /**
+ * 微信
+ */
+ WECHAT_PAY("WECHAT_PAY"),
+
+ /**
+ * 支付宝
+ */
+ ALI_PAY("ALI_PAY"),
+ ;
+
+ final private String info;
+
+ PayTypeEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/PaymentMerchantTypeEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/PaymentMerchantTypeEnum.java
new file mode 100644
index 0000000..9a2f4d6
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/PaymentMerchantTypeEnum.java
@@ -0,0 +1,30 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @Description 支付账户枚举
+ * @Author 纪寒
+ * @Date 2022-10-20 17:48:32
+ * @Version 1.0
+ */
+@Getter
+public enum PaymentMerchantTypeEnum {
+
+ /**
+ * 新医路
+ */
+ XINYILU("XINYILU"),
+
+ /**
+ * 医路优品
+ */
+ YILUYOUPIN("YILUYOUPIN"),
+ ;
+
+ final private String info;
+
+ PaymentMerchantTypeEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/RefundStatusEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/RefundStatusEnum.java
new file mode 100644
index 0000000..7df7d78
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/RefundStatusEnum.java
@@ -0,0 +1,41 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @Description 微信退款通知枚举
+ * @Author 纪寒
+ * @Date 2022-10-25 13:12:03
+ * @Version 1.0
+ */
+@Getter
+public enum RefundStatusEnum {
+ /**
+ * 退款成功
+ */
+ SUCCESS("SUCCESS"),
+
+ /**
+ * 退款关闭
+ */
+ CLOSED("CLOSED"),
+
+ /**
+ * 退款处理中
+ */
+ PROCESSING("PROCESSING"),
+
+ /**
+ * 退款异常,退款到银行发现用户的卡作废或者冻结了,
+ * 导致原路退款银行卡失败,可前往【商户平台—>交易中心】,手动处理此笔退款
+ */
+ ABNORMAL("ABNORMAL"),
+
+ ;
+
+ final private String info;
+
+ RefundStatusEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/RefundTypeEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/RefundTypeEnum.java
new file mode 100644
index 0000000..bc049d3
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/RefundTypeEnum.java
@@ -0,0 +1,30 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * @Description 退款类型枚举
+ * @Author 纪寒
+ * @Date 2022-10-18 15:16:02
+ * @Version 1.0
+ */
+@Getter
+public enum RefundTypeEnum {
+
+ /**
+ * 微信
+ */
+ WE_CHAT("WE_CHAT"),
+
+ /**
+ * 支付宝
+ */
+ ALI_PAY("ALI_PAY"),
+ ;
+
+ final private String info;
+
+ RefundTypeEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/enums/WeChatTradeStateEnum.java b/xinelu-common/src/main/java/com/xinelu/common/enums/WeChatTradeStateEnum.java
new file mode 100644
index 0000000..009a8b5
--- /dev/null
+++ b/xinelu-common/src/main/java/com/xinelu/common/enums/WeChatTradeStateEnum.java
@@ -0,0 +1,52 @@
+package com.xinelu.common.enums;
+
+import lombok.Getter;
+
+/**
+ * 微信支付回调通知状态
+ */
+@Getter
+public enum WeChatTradeStateEnum {
+
+ /**
+ * 支付成功
+ */
+ SUCCESS("SUCCESS"),
+
+ /**
+ * 未支付
+ */
+ NOTPAY("NOTPAY"),
+
+ /**
+ * 已关闭
+ */
+ CLOSED("CLOSED"),
+
+ /**
+ * 转入退款
+ */
+ REFUND("REFUND"),
+
+ /**
+ * 已撤销(付款码支付)
+ */
+ REVOKED("REVOKED"),
+
+ /**
+ * 用户支付中(付款码支付)
+ */
+ USERPAYING("USERPAYING"),
+
+ /**
+ * 支付失败(其他原因,如银行返回失败)
+ */
+ PAYERROR("PAYERROR")
+ ;
+
+ final private String info;
+
+ WeChatTradeStateEnum(String info) {
+ this.info = info;
+ }
+}
diff --git a/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java b/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java
index 5b3a8d3..c25a523 100644
--- a/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java
+++ b/xinelu-common/src/main/java/com/xinelu/common/utils/http/HttpUtils.java
@@ -16,6 +16,7 @@ import org.apache.http.HttpEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import javax.net.ssl.*;
+import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
@@ -253,4 +254,35 @@ public class HttpUtils {
}
return result;
}
+
+ /**
+ * 将通知参数转化为字符串
+ *
+ * @param request 请求信息
+ * @return 请求参数信息
+ */
+ public static String readRequestData(HttpServletRequest request) {
+ BufferedReader br = null;
+ try {
+ StringBuilder result = new StringBuilder();
+ br = request.getReader();
+ for (String line; (line = br.readLine()) != null; ) {
+ if (result.length() > 0) {
+ result.append("\n");
+ }
+ result.append(line);
+ }
+ return result.toString();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
}
diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java
index 8eb0e0c..1a5eccc 100644
--- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java
+++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/mapper/ResidentPatientInfoMapper.java
@@ -95,5 +95,12 @@ public interface ResidentPatientInfoMapper {
**/
PatientInfo getByCardNo(String cardNo);
- int selectPatientInfoByPhone(String phone);
+ List selectPatientInfoByPhone(String phone);
+ /**
+ *根据用户编号查询
+ *
+ *@param patientCode 用户编号
+ *@return PatientInfo
+ **/
+ PatientInfo getPatientInfoByPatientCode(String patientCode);
}
diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
index 55d4889..b0c3424 100644
--- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
+++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/service/impl/ResidentPatientInfoServiceImpl.java
@@ -152,16 +152,18 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
if (ObjectUtils.isNotEmpty(body.getCardNo())) {
// 修改
if(!StringUtils.isBlank(body.getPatientCode())) {
- PatientInfo patientInfo = residentPatientInfoMapper.getByCardNo(body.getCardNo());
- BeanUtils.copyBeanProp(patientInfo, body);
- if(body.getDiseaseList() != null) {
- patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
- } else {
- patientInfo.setDisease("0");
+ PatientInfo patientInfo = residentPatientInfoMapper.getPatientInfoByPatientCode(body.getPatientCode());
+ if (ObjectUtils.isNotEmpty(patientInfo)) {
+ BeanUtils.copyBeanProp(patientInfo, body);
+ if (body.getDiseaseList() != null) {
+ patientInfo.setDisease(body.getDiseaseList().stream().collect(Collectors.joining(",")));
+ } else {
+ patientInfo.setDisease("0");
+ }
+ patientInfo.setLoginFlag(Long.valueOf(1));
+ updatePatientInfo(patientInfo);
+ // 注册
}
- patientInfo.setLoginFlag(Long.valueOf(1));
- updatePatientInfo(patientInfo);
- // 注册
} else {
// 获取当前微信绑定的居民
List list = residentPatientInfoMapper.getList(body.getOpenid(), body.getCityCode());
@@ -340,12 +342,22 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
+ //获取手机号
String code;
+ String cityCode = "";
AppletPhoneVO phone = getPhone(phoneCode);
String phoneNumber = phone.getPhoneInfo().getPhoneNumber();
HashMap.put("phone",phoneNumber);
- code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1";
+ List infoList = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber);
+ code = infoList.size()== 0 ? "0" : "1";
+ //返回绑定城市
+ if ("1".equals(code)){
+ for (PatientInfo patientInfo : infoList) {
+ cityCode = patientInfo.getCityCode();
+ }
+ }
HashMap.put("code",code);
+ HashMap.put("cityCode",cityCode);
return HashMap;
}
}
diff --git a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java
index b126972..24318f5 100644
--- a/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java
+++ b/xinelu-familydoctor/src/main/java/com/xinelu/familydoctor/applet/utils/AppletAccessTokenUtils.java
@@ -1,7 +1,6 @@
package com.xinelu.familydoctor.applet.utils;
import com.xinelu.common.config.AppletChatConfig;
-import com.xinelu.common.config.NurseAppletChatConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.entity.AppletAccessToken;
import com.xinelu.common.exception.ServiceException;
@@ -27,8 +26,7 @@ public class AppletAccessTokenUtils {
private RedisTemplate redisTemplate;
@Resource
private AppletChatConfig appletChatConfig;
- @Resource
- private NurseAppletChatConfig nurseAppletChatConfig;
+
/**
* 返回成功状态码
*/
@@ -65,34 +63,4 @@ public class AppletAccessTokenUtils {
return accessToken;
}
- /**
- * 护理员小程序获取小程序AccessToken方法
- *
- * @return 小程序的AccessToken
- */
- public String getPersonAppletAccessToken() {
- String accessToken;
- String accessTokenKey = Constants.NURSE_STATION_PERSON_APPLET_ACCESS_TOKEN + "accessToken";
- //从Redis中取出accessToken
- Object object = redisTemplate.opsForValue().get(accessTokenKey);
- if (Objects.isNull(object)) {
- //没有,获取accessToken
- AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(nurseAppletChatConfig.getAppletId(), nurseAppletChatConfig.getSecret());
- if (Objects.isNull(appletAccessToken)) {
- throw new ServiceException("获取微信小程序accessToken信息失败");
- }
- if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != SUCCESS_CODE) {
- throw new ServiceException("获取微信小程序accessToken信息失败,失败信息为:" + appletAccessToken.getErrmsg(), 201);
- }
- if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
- throw new ServiceException("accessToken信息为空");
- }
- //存入Redis中
- redisTemplate.opsForValue().set(accessTokenKey, appletAccessToken.getAccessToken(), 3600, TimeUnit.SECONDS);
- accessToken = appletAccessToken.getAccessToken();
- } else {
- accessToken = (String) object;
- }
- return accessToken;
- }
}
\ No newline at end of file
diff --git a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml
index e7c3870..e06f9b6 100644
--- a/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml
+++ b/xinelu-familydoctor/src/main/resources/mapper/register/ResidentPatientInfoMapper.xml
@@ -479,10 +479,15 @@
-