From 278da88f21bff29eef96a2e439ac35eb444630fe Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 22 八月 2025 10:27:23 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/jinkuai

---
 server/web/src/main/java/com/doumee/JKWebApplication.java                                       |    8 +-
 server/web/src/main/resources/logback-spring.xml                                                |    2 
 server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java                            |   16 +++
 server/services/src/main/resources/application-dev.yml                                          |    7 +
 server/web/src/main/java/com/doumee/api/web/ConfigApi.java                                      |    1 
 server/services/src/main/resources/application-test.yml                                         |   27 +++---
 small-program/store/index.js                                                                    |    2 
 server/pom.xml                                                                                  |    4 
 server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java                         |    1 
 server/services/src/main/java/com/doumee/core/constants/Constants.java                          |    6 +
 server/services/src/main/java/com/doumee/config/wx/TransferToUser.java                          |   42 ++++++----
 server/services/src/main/java/com/doumee/dao/dto/WithdrawalDTO.java                             |   10 ++
 server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java          |    2 
 server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java                         |   48 ++++++++---
 server/admin/src/main/resources/application.yml                                                 |    2 
 server/admin/src/main/resources/logback-spring.xml                                              |    2 
 server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java |   59 +++++++++++++-
 17 files changed, 172 insertions(+), 67 deletions(-)

diff --git a/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java b/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
index 33f43ee..b2ecae3 100644
--- a/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
+++ b/server/admin/src/main/java/com/doumee/api/business/PaymentCallback.java
@@ -3,10 +3,12 @@
 import com.alibaba.fastjson.JSON;
 import com.doumee.config.wx.TransferDetailEntityNew;
 import com.doumee.config.wx.WxMiniConfig;
+import com.doumee.core.constants.Constants;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.ApiResponse;
 import com.doumee.service.business.OrdersService;
+import com.doumee.service.business.WithdrawalOrdersService;
 import com.wechat.pay.java.core.Config;
 import com.wechat.pay.java.core.RSAAutoCertificateConfig;
 import com.wechat.pay.java.core.RSAPublicKeyConfig;
@@ -16,6 +18,7 @@
 import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
 import com.wechat.pay.java.service.refund.model.RefundNotification;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.mgt.DefaultSecurityManager;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -45,6 +48,9 @@
 
     @Autowired
     private OrdersService ordersService;
+
+    @Autowired
+    private WithdrawalOrdersService withdrawalOrdersService;
 
     /**
      * 銆愬井淇℃敮浠樸�戝紓姝ラ�氱煡
@@ -177,14 +183,30 @@
      * @return
      */
     @PostMapping(value = "/web/wechat/transferNotify")
-    public ApiResponse wxPayCallback( HttpServletRequest request) {
+    public ApiResponse transferNotify( HttpServletRequest request) {
         Map<String,String> errMap = new HashMap<>();
         try {
-            log.info("寰俊鍟嗘埛闆剁嚎杞处 - 鍥炶皟閫氱煡 /wxpay/callback");
-            TransferDetailEntityNew entity = wxPaySuccessCallback(request);
-            log.info("transfer ok.{}",entity);
+            log.error("寰俊鍟嗘埛闆剁嚎杞处 - 鍥炶皟閫氱煡 /wxpay/callback");
+
+            Config config = new RSAPublicKeyConfig.Builder()
+                .merchantId(WxMiniConfig.wxProperties.getSubMchId()) //寰俊鏀粯鐨勫晢鎴峰彿
+                .privateKeyFromPath(WxMiniConfig.wxProperties.getWechatPrivateKeyPath()) // 鍟嗘埛API璇佷功绉侀挜鐨勫瓨鏀捐矾寰�
+                .publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //寰俊鏀粯鍏挜鐨勫瓨鏀捐矾寰�
+                .publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //寰俊鏀粯鍏挜ID
+                .merchantSerialNumber(WxMiniConfig.wxProperties.getWechatSerialNumer()) //鍟嗘埛API璇佷功搴忓垪鍙�
+                .apiV3Key("7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB") //APIv3瀵嗛挜
+                .build();
+
+            TransferDetailEntityNew entity = wxSuccessCallback(request,config);
+            log.error("transfer ok.{}",entity);
             //鍥炶皟鎴愬姛鍚庡鐞嗚嚜宸辩殑涓氬姟
             if(entity != null){
+                if((entity.getState().equals(Constants.SUCCESS)
+                        || entity.getState().equals(Constants.CANCELLED)
+                        || entity.getState().equals(Constants.FAIL))
+                        && StringUtils.isNotBlank(entity.getOutBillNo())){
+                    withdrawalOrdersService.transferSuccess(entity.getOutBillNo(),entity.getState().equals(Constants.SUCCESS)?true:false);
+                }
             }
             return ApiResponse.success("澶勭悊鎴愬姛");
         } catch (Exception e) {
@@ -195,7 +217,7 @@
         }
     }
 
-    public TransferDetailEntityNew wxPaySuccessCallback(HttpServletRequest request) throws IOException {
+    public TransferDetailEntityNew wxSuccessCallback(HttpServletRequest request,Config config) throws IOException {
         String requestBody = getBodyString(request, "UTF-8");
         //璇佷功搴忓垪鍙凤紙寰俊骞冲彴锛�   楠岀鐨勨�滃井淇℃敮浠樺钩鍙拌瘉涔︹�濇墍瀵瑰簲鐨勫钩鍙拌瘉涔﹀簭鍒楀彿
         String wechatPaySerial = request.getHeader("Wechatpay-Serial");
@@ -214,14 +236,14 @@
                 .body(requestBody)
                 .build();
         // 2. 鏋勫缓Config RSAPublicKeyConfig
-        Config config = new RSAPublicKeyConfig.Builder()
-                        .merchantId(WxMiniConfig.wxProperties.getMchId()) //寰俊鏀粯鐨勫晢鎴峰彿
-                        .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) // 鍟嗘埛API璇佷功绉侀挜鐨勫瓨鏀捐矾寰�
-                        .publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //寰俊鏀粯鍏挜鐨勫瓨鏀捐矾寰�
-                        .publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //寰俊鏀粯鍏挜ID
-                        .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) //鍟嗘埛API璇佷功搴忓垪鍙�
-                        .apiV3Key("") //APIv3瀵嗛挜
-                        .build();
+//        Config config = new RSAPublicKeyConfig.Builder()
+//                        .merchantId(WxMiniConfig.wxProperties.getMchId()) //寰俊鏀粯鐨勫晢鎴峰彿
+//                        .privateKeyFromPath(WxMiniConfig.wxProperties.getPrivateKeyPath()) // 鍟嗘埛API璇佷功绉侀挜鐨勫瓨鏀捐矾寰�
+//                        .publicKeyFromPath(WxMiniConfig.wxProperties.getWechatPubKeyPath()) //寰俊鏀粯鍏挜鐨勫瓨鏀捐矾寰�
+//                        .publicKeyId(WxMiniConfig.wxProperties.getWechatPayPublicKeyId()) //寰俊鏀粯鍏挜ID
+//                        .merchantSerialNumber(WxMiniConfig.wxProperties.getSerialNumer()) //鍟嗘埛API璇佷功搴忓垪鍙�
+//                        .apiV3Key("") //APIv3瀵嗛挜
+//                        .build();
         log.info("WxPayService.wxPaySuccessCallback request : wechatPaySerial is [{}]  , wechatSignature is [{}] , wechatTimestamp is [{}] , wechatpayNonce  is [{}] , requestBody is [{}]",wechatPaySerial,wechatSignature,wechatTimestamp,wechatpayNonce,requestBody);
         // 3. 鍒濆鍖� NotificationParser
         NotificationParser parser = new NotificationParser((NotificationConfig) config);
diff --git a/server/admin/src/main/resources/application.yml b/server/admin/src/main/resources/application.yml
index fdfac5f..1e003e1 100644
--- a/server/admin/src/main/resources/application.yml
+++ b/server/admin/src/main/resources/application.yml
@@ -12,7 +12,7 @@
 
 spring:
   profiles:
-    active: dev
+    active: test
   # JSON杩斿洖閰嶇疆
   jackson:
     # 榛樿鏃跺尯
diff --git a/server/services/src/main/resources/logback-spring.xml b/server/admin/src/main/resources/logback-spring.xml
similarity index 97%
rename from server/services/src/main/resources/logback-spring.xml
rename to server/admin/src/main/resources/logback-spring.xml
index 4e16308..899ec7a 100644
--- a/server/services/src/main/resources/logback-spring.xml
+++ b/server/admin/src/main/resources/logback-spring.xml
@@ -5,7 +5,7 @@
             <pattern>%highlight(%date{yyyy-MM-dd HH:mm:ss}) | %highlight(%-5level) | %highlight(%thread) | %highlight(%logger) | %msg%n</pattern>
         </layout>
     </appender>
-    <property name="log.path" value="/usr/local/jars/official_website/logs"></property>
+    <property name="log.path" value="/usr/local/jars/logs/admin"></property>
     <property name="log.fileSize" value="100MB"></property>
     <property name="log.historyDays" value="7"></property>
     <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
diff --git a/server/pom.xml b/server/pom.xml
index 4e1b4ed..fd4e99d 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -62,10 +62,10 @@
         </exclusion>
       </exclusions> -->
     </dependency>
-    <dependency>
+    <!--<dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-tomcat</artifactId>
-    </dependency>
+    </dependency>-->
     <!-- Redis -->
     <dependency>
       <groupId>org.springframework.boot</groupId>
diff --git a/server/services/src/main/java/com/doumee/config/wx/TransferToUser.java b/server/services/src/main/java/com/doumee/config/wx/TransferToUser.java
index 15895e4..3e50307 100644
--- a/server/services/src/main/java/com/doumee/config/wx/TransferToUser.java
+++ b/server/services/src/main/java/com/doumee/config/wx/TransferToUser.java
@@ -27,6 +27,14 @@
     private static String CANCEL_PATH = "/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/{out_bill_no}/cancel";
 
 
+    public TransferToUser(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) {
+        this.mchid = mchid;
+        this.certificateSerialNo = certificateSerialNo;
+        this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath);
+        this.wechatPayPublicKeyId = wechatPayPublicKeyId;
+        this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath);
+    }
+
     public static void main(String[] args) {
         // TODO: 璇峰噯澶囧晢鎴峰紑鍙戝繀瑕佸弬鏁帮紝鍙傝�冿細https://pay.weixin.qq.com/doc/v3/merchant/4013070756
 //        TransferToUser client = new TransferToUser(
@@ -38,18 +46,18 @@
 //        );
 
         TransferToUser client = new TransferToUser(
-                "1661772003",                    // 鍟嗘埛鍙凤紝鏄敱寰俊鏀粯绯荤粺鐢熸垚骞跺垎閰嶇粰姣忎釜鍟嗘埛鐨勫敮涓�鏍囪瘑绗︼紝鍟嗘埛鍙疯幏鍙栨柟寮忓弬鑰� https://pay.weixin.qq.com/doc/v3/merchant/4013070756
-                "3C9A32FB6CD453FAAAF97F9737ECAEA9D6625727",         // 鍟嗘埛API璇佷功搴忓垪鍙凤紝濡備綍鑾峰彇璇峰弬鑰� https://pay.weixin.qq.com/doc/v3/merchant/4013053053
-                "d://wechatApiclient_key.pem",    // 鍟嗘埛API璇佷功绉侀挜鏂囦欢璺緞锛屾湰鍦版枃浠惰矾寰�
-                "47E172124E73E8098A565E971064C20ACDE7C911",      // 寰俊鏀粯鍏挜ID锛屽浣曡幏鍙栬鍙傝�� https://pay.weixin.qq.com/doc/v3/merchant/4013038816
-                "d://wechatpay_47E172124E73E8098A565E971064C20ACDE7C911.pem"          // 寰俊鏀粯鍏挜鏂囦欢璺緞锛屾湰鍦版枃浠惰矾寰�
+                "1723326069",                    // 鍟嗘埛鍙凤紝鏄敱寰俊鏀粯绯荤粺鐢熸垚骞跺垎閰嶇粰姣忎釜鍟嗘埛鐨勫敮涓�鏍囪瘑绗︼紝鍟嗘埛鍙疯幏鍙栨柟寮忓弬鑰� https://pay.weixin.qq.com/doc/v3/merchant/4013070756
+                "12C0F0DD0F3D2B565B45586D3FEA225EBF723BEC",         // 鍟嗘埛API璇佷功搴忓垪鍙凤紝濡備綍鑾峰彇璇峰弬鑰� https://pay.weixin.qq.com/doc/v3/merchant/4013053053
+                "d://jinkuai/shanghu/apiclient_key.pem",    // 鍟嗘埛API璇佷功绉侀挜鏂囦欢璺緞锛屾湰鍦版枃浠惰矾寰�
+                "PUB_KEY_ID_0117233260692025072500181939000603",      // 寰俊鏀粯鍏挜ID锛屽浣曡幏鍙栬鍙傝�� https://pay.weixin.qq.com/doc/v3/merchant/4013038816
+                "d://jinkuai/shanghu/pub_key.pem" // 寰俊鏀粯鍏挜鏂囦欢璺緞锛屾湰鍦版枃浠惰矾寰�
         );
 
         TransferToUserRequest request = new TransferToUserRequest();
-        request.appid = "wxcd2b89fd2ff065f8"; //灏忕▼搴廼d
+        request.appid = "wx332441ae5b12be7d"; //灏忕▼搴廼d
         request.outBillNo = "plfk2020042016";
         request.transferSceneId = "1005";
-        request.openid = "oKKHU5IFKpss_DIbFX1lqghFJOEg";
+        request.openid = "oFucG7Nu5teWNIZiWkAINfAE4glE";
 //        request.userName = client.encrypt("鏂芥棴杈�");
         request.transferAmount = 10L;
         request.transferRemark = "~~~";
@@ -83,13 +91,6 @@
     private final String wechatPayPublicKeyId;
     private final PublicKey wechatPayPublicKey;
 
-    public TransferToUser(String mchid, String certificateSerialNo, String privateKeyFilePath, String wechatPayPublicKeyId, String wechatPayPublicKeyFilePath) {
-        this.mchid = mchid;
-        this.certificateSerialNo = certificateSerialNo;
-        this.privateKey = WXPayUtility.loadPrivateKeyFromPath(privateKeyFilePath);
-        this.wechatPayPublicKeyId = wechatPayPublicKeyId;
-        this.wechatPayPublicKey = WXPayUtility.loadPublicKeyFromPath(wechatPayPublicKeyFilePath);
-    }
 
     public TransferToUserResponse testRun(TransferToUserRequest request) {
         String uri = PATH;
@@ -126,7 +127,7 @@
     public TransferToUserResponse run(TransferToUserRequest request,String name) {
         String uri = PATH;
         request.appid = WxMiniConfig.wxProperties.getSubAppId();
-//        request.notifyUrl = WxMiniConfig.wxProperties.getWechatNotifyUrl();
+        request.notifyUrl = WxMiniConfig.wxProperties.getWechatNotifyUrl();
         request.transferSceneId = "1005";
         request.userRecvPerception = "鍔冲姟鎶ラ叕";
         if(request.transferAmount >= 30){
@@ -170,7 +171,10 @@
                         httpResponse.headers(), respBody);
 
                 // 浠嶩TTP搴旂瓟鎶ユ枃鏋勫缓杩斿洖鏁版嵁
-                return WXPayUtility.fromJson(respBody, TransferToUserResponse.class);
+                TransferToUser.TransferToUserResponse response =   WXPayUtility.fromJson(respBody, TransferToUserResponse.class);
+                response.appId = request.appid;
+                response.mchId = WxMiniConfig.wxProperties.getSubMchId();
+                return response;
             } else {
                 throw new WXPayUtility.ApiException(httpResponse.code(), respBody, httpResponse.headers());
             }
@@ -236,6 +240,12 @@
 
         @SerializedName("package_info")
         public String packageInfo;
+
+        @SerializedName("mch_id")
+        public String mchId;
+
+        @SerializedName("app_id")
+        public String appId;
     }
 
     public enum TransferBillStatus {
diff --git a/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java b/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java
index 322a247..a420a14 100644
--- a/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java
+++ b/server/services/src/main/java/com/doumee/config/wx/WxMiniConfig.java
@@ -78,15 +78,27 @@
      */
     public void load_wxPayService()   {
         try {
+//            Config config =
+//                    new RSAPublicKeyConfig.Builder()
+//                            .merchantId(wxPayProperties.getMchId())
+//                            .privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
+//                            .publicKeyFromPath(wxPayProperties.getPubKeyPath())
+//                            .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508")
+//                            .merchantSerialNumber(wxPayProperties.getSerialNumer())
+//                            .apiV3Key(wxPayProperties.getApiV3Key())
+//                            .build();
+
+
             Config config =
                     new RSAAutoCertificateConfig.Builder()
                             .merchantId(wxPayProperties.getMchId())
                             .privateKeyFromPath(wxPayProperties.getPrivateKeyPath())
+//                            .publicKeyFromPath(wxPayProperties.getPubKeyPath())
+//                            .publicKeyId("PUB_KEY_ID_0117000719222024112700219100000508")
                             .merchantSerialNumber(wxPayProperties.getSerialNumer())
                             .apiV3Key(wxPayProperties.getApiV3Key())
                             .build();
-            this.wxPayService =  new JsapiService.Builder().config(config).build();
-
+//            this.wxPayService =  new JsapiService.Builder().config(config).build();
             this.jsapiExtService =  new JsapiServiceExtension.Builder().config(config).build();
             this.refundService = new RefundService.Builder().config(config).build();
             this.billDownloadService = new BillDownloadService.Builder().config(config).build();
diff --git a/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java b/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
index 2a05a1f..1605a27 100644
--- a/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
+++ b/server/services/src/main/java/com/doumee/config/wx/WxPayProperties.java
@@ -62,6 +62,7 @@
     private String typeId;// gybike
     private String privateKeyPath ;
     private String privateCertPath;// gybike
+    private String pubKeyPath;//
 
 
     private String wechatSerialNumer;
diff --git a/server/services/src/main/java/com/doumee/core/constants/Constants.java b/server/services/src/main/java/com/doumee/core/constants/Constants.java
index 14afe17..82cded4 100644
--- a/server/services/src/main/java/com/doumee/core/constants/Constants.java
+++ b/server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -76,6 +76,12 @@
     public static final String WORKORDER_LOG_FILE_PATH ="WORKORDER_LOG_FILE_PATH" ;
 
     public static final String REDIS_TOKEN_KEY = "token_";
+
+    public static final String SUCCESS = "SUCCESS";
+    public static final String FAIL = "FAIL";
+    public static final String CANCELLED = "CANCELLED";
+
+
     public interface   uploadType{
         String blob = "blob";
         String ftp = "ftp";
diff --git a/server/services/src/main/java/com/doumee/dao/dto/WithdrawalDTO.java b/server/services/src/main/java/com/doumee/dao/dto/WithdrawalDTO.java
index 912899d..b265c23 100644
--- a/server/services/src/main/java/com/doumee/dao/dto/WithdrawalDTO.java
+++ b/server/services/src/main/java/com/doumee/dao/dto/WithdrawalDTO.java
@@ -5,6 +5,8 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 /**
  * Created by IntelliJ IDEA.
  *
@@ -15,8 +17,12 @@
 @ApiModel("鎻愮幇鐢宠")
 public class WithdrawalDTO {
 
-    @ApiModelProperty(value = "鎻愮幇閲戦 (鍗曚綅锛氬垎)")
-    private Long amount;
+    @ApiModelProperty(value = "鎻愮幇閲戦 (鍗曚綅锛氬厓)")
+    private BigDecimal amount;
+
+    @ApiModelProperty(value = "鐪熷疄濮撳悕")
+    private String name;
+
 
     @ApiModelProperty(value = "鐢ㄦ埛淇℃伅",hidden = true)
     private Member member;
diff --git a/server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java b/server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java
index 3ca45be..8d00463 100644
--- a/server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java
+++ b/server/services/src/main/java/com/doumee/service/business/WithdrawalOrdersService.java
@@ -102,4 +102,6 @@
 
     void cancelTransfer(TransferToUser.CancelTransferRequest request);
 
+    void transferSuccess(String outBillNo,Boolean isSuccess);
+
 }
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java
index facfcc1..86d9fdb 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/WithdrawalOrdersServiceImpl.java
@@ -28,6 +28,7 @@
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
@@ -181,14 +182,17 @@
     @Transactional(rollbackFor = {BusinessException.class,Exception.class})
     public TransferToUser.TransferToUserResponse  applyWithdrawal(WithdrawalDTO withdrawalDTO){
         if(Objects.isNull(withdrawalDTO)
-        || Objects.isNull(withdrawalDTO.getAmount())){
+        || Objects.isNull(withdrawalDTO.getAmount())
+        || org.apache.commons.lang3.StringUtils.isBlank(withdrawalDTO.getName())
+        || withdrawalDTO.getAmount().compareTo(BigDecimal.ZERO)<=Constants.ZERO
+        ){
             throw new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         Member member = memberMapper.selectById(withdrawalDTO.getMember().getId());
         if(Objects.isNull(member)){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐢ㄦ埛淇℃伅寮傚父,璇疯仈绯荤鐞嗗憳");
         }
-        if(member.getAmount() < withdrawalDTO.getAmount()){
+        if(member.getAmount() < withdrawalDTO.getAmount().multiply(new BigDecimal("100")).intValue()){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝鍙彁鐜颁綑棰濅笉瓒炽��");
         }
         if(StringUtils.isEmpty(member.getName())){
@@ -198,7 +202,7 @@
         withdrawalOrders.setCreateTime(new Date());
         withdrawalOrders.setMemberId(member.getId());
         withdrawalOrders.setOutBillNo(UUID.randomUUID().toString().replace("-",""));
-        withdrawalOrders.setAmount(withdrawalDTO.getAmount());
+        withdrawalOrders.setAmount((withdrawalDTO.getAmount().multiply(new BigDecimal("100"))).longValue());
         withdrawalOrders.setStatus(Constants.ZERO);
         withdrawalOrders.setType(Constants.ZERO);
         withdrawalOrders.setDeleted(Constants.ZERO);
@@ -207,18 +211,17 @@
         TransferToUser.TransferToUserRequest transferToUserRequest = new TransferToUser.TransferToUserRequest();
         transferToUserRequest.openid = member.getOpenid();
         transferToUserRequest.outBillNo =  withdrawalOrders.getOutBillNo();
-        transferToUserRequest.transferAmount = withdrawalDTO.getAmount();
+        transferToUserRequest.transferAmount = withdrawalOrders.getAmount();
         transferToUserRequest.transferRemark = "鎻愮幇鐢宠";
         try {
-            TransferToUser.TransferToUserResponse response =  WxMiniConfig.transferToUser.run(transferToUserRequest,member.getName());
+            TransferToUser.TransferToUserResponse response =  WxMiniConfig.transferToUser.run(transferToUserRequest,withdrawalDTO.getName());
             withdrawalOrders.setRemark(JSONObject.toJSONString(response));
             if(response.state.name().equals("WAIT_USER_CONFIRM") || response.state.name().equals("ACCEPTED")){
                 withdrawalOrders.setWxExternalNo(response.transferBillNo);
             }
             withdrawalOrdersMapper.insert(withdrawalOrders);
             //鏇存柊鐢ㄦ埛浣欓
-            memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" AMOUNT = AMOUNT -  " + withdrawalDTO.getAmount() ).eq(Member::getId,member.getId()));
-
+            memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" AMOUNT = AMOUNT -  " + withdrawalOrders.getAmount() ).eq(Member::getId,member.getId()));
             //瀛樺偍娴佹按璁板綍
             MemberRevenue memberRevenue = new MemberRevenue();
             memberRevenue.setCreateTime(new Date());
@@ -245,6 +248,48 @@
 
 
     @Override
+    public void transferSuccess(String outBillNo,Boolean isSuccess){
+        //杞处鎴愬姛
+        if(isSuccess){
+            withdrawalOrdersMapper.update(new UpdateWrapper<WithdrawalOrders>().lambda()
+                    .set(WithdrawalOrders::getStatus,Constants.ONE)
+                    .eq(WithdrawalOrders::getOutBillNo,outBillNo)
+            );
+        }else {
+            WithdrawalOrders withdrawalOrders = withdrawalOrdersMapper.selectOne(new QueryWrapper<WithdrawalOrders>().lambda()
+                    .eq(WithdrawalOrders::getOutBillNo,outBillNo).last("limit 1"));
+            if(Objects.isNull(withdrawalOrders)){
+                return;
+            }
+            Member member = memberMapper.selectById(withdrawalOrders.getMemberId());
+            if(Objects.isNull(member)){
+                return;
+            }
+            //鏇存柊鐢ㄦ埛浣欓
+            memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" AMOUNT = AMOUNT +  " + withdrawalOrders.getAmount() ).eq(Member::getId,withdrawalOrders.getMemberId()));
+
+            //瀛樺偍娴佹按璁板綍
+            MemberRevenue memberRevenue = new MemberRevenue();
+            memberRevenue.setCreateTime(new Date());
+            memberRevenue.setTransactionNo(withdrawalOrders.getOutBillNo());
+            memberRevenue.setDeleted(Constants.ZERO);
+            memberRevenue.setMemberId(withdrawalOrders.getMemberId());
+            memberRevenue.setType(Constants.FOUR);
+            memberRevenue.setOptType(Constants.ONE);
+            memberRevenue.setBeforeAmount(member.getAmount());
+            memberRevenue.setAmount(withdrawalOrders.getAmount());
+            memberRevenue.setAfterAmount(member.getAmount() + withdrawalOrders.getAmount());
+            memberRevenue.setObjId(withdrawalOrders.getId());
+            memberRevenue.setRemark(Constants.RevenueType.getInfo(memberRevenue.getType()));
+            memberRevenue.setObjType(Constants.ONE);
+            memberRevenue.setDeleted(Constants.ZERO);
+            memberRevenue.setStatus(Constants.ZERO);
+            memberRevenueMapper.insert(memberRevenue);
+
+        }
+    }
+
+    @Override
     public void cancelTransfer(TransferToUser.CancelTransferRequest request){
         if(Objects.isNull(request)
         || StringUtils.isEmpty(request.outBillNo)){
diff --git a/server/services/src/main/resources/application-dev.yml b/server/services/src/main/resources/application-dev.yml
index 2befcf6..b3946b7 100644
--- a/server/services/src/main/resources/application-dev.yml
+++ b/server/services/src/main/resources/application-dev.yml
@@ -85,20 +85,21 @@
   pay:
     #鏈嶅姟鍟�---------start------- 鍙傛暟璇﹁В鍦板潃 https://pay.weixin.qq.com/doc/v3/partner/4013080340
     mchId: 1700071922    #鏈嶅姟鍟嗗湪寰俊鏀粯渚х殑鍞竴韬唤鏍囪瘑
-    appId: wx332441ae5b12be7d    #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
+    appId: wx6cc1087ca79db7f6    #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
     apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
-    serialNumer: 7DCD480EB6DF3791721867A6EB57105DECEF38BE #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
+    serialNumer: 6696086F6EFB8D6A4F821BD47DDBAF75C3BC1209 #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
     #mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S
     notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify
     refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify
     keyPath: d://jinkuai/apiclient_cert.p12
     privateCertPath: d://jinkuai/apiclient_cert.pem
     privateKeyPath: d://jinkuai/apiclient_key.pem
+    pubKeyPath: d://jinkuai/pub_key.pem #鍟嗘埛鏀粯鍏挜
 
     #鏈嶅姟鍟�-------------end---
 
     #鍟嗘埛淇℃伅
-    wechatSerialNumer: 38495CE0137D90E4DC4F64F7ECDE035A35470BE3
+    wechatSerialNumer: 12C0F0DD0F3D2B565B45586D3FEA225EBF723BEC
     wechatPayPublicKeyId: PUB_KEY_ID_0117233260692025072500181939000603 #鍟嗘埛/骞冲彴鏀粯鍏挜id
     wechatPubKeyPath: d://jinkuai/shanghu/pub_key.pem #鍟嗘埛鏀粯鍏挜
     wechatPrivateKeyPath: d://jinkuai/shanghu/apiclient_key.pem #鍟嗘埛绉侀挜
diff --git a/server/services/src/main/resources/application-test.yml b/server/services/src/main/resources/application-test.yml
index 85d8738..585b167 100644
--- a/server/services/src/main/resources/application-test.yml
+++ b/server/services/src/main/resources/application-test.yml
@@ -74,33 +74,34 @@
 ########################寰俊鏀粯鐩稿叧閰嶇疆########################
 wx:
   pay:
-    #鏈嶅姟鍟�---------start-------
-    mchId: 1700071922 #鏈嶅姟鍟嗗晢鎴峰彿
-    appId: wx6cc1087ca79db7f6 #鏈嶅姟鍟咥PPID
-    apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142
-    serialNumer: 38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
+    #鏈嶅姟鍟�---------start------- 鍙傛暟璇﹁В鍦板潃 https://pay.weixin.qq.com/doc/v3/partner/4013080340
+    mchId: 1700071922    #鏈嶅姟鍟嗗湪寰俊鏀粯渚х殑鍞竴韬唤鏍囪瘑
+    appId: wx332441ae5b12be7d    #鏈嶅姟鍟嗗湪寰俊寮�鏀惧钩鍙帮紙绉诲姩搴旂敤锛夋垨鍏紬骞冲彴锛堝叕浼楀彿/灏忕▼搴忥級涓婄敵璇风殑涓�涓敮涓�鏍囪瘑
+    apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB
+    serialNumer: 7DCD480EB6DF3791721867A6EB57105DECEF38BE #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #鏈嶅姟鍟嗚瘉涔﹀簭鍒楀彿
     #mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S
     notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify
     refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify
-    keyPath: /usr/local/zhengshu/apiclient_cert.p12
-    privateCertPath: /usr/local/zhengshu/apiclient_cert.pem
-    privateKeyPath: /usr/local/zhengshu/apiclient_key.pem
+    keyPath: /usr/local/jars/payFile/apiclient_cert.p12
+    privateCertPath: /usr/local/jars/payFile/apiclient_cert.pem
+    privateKeyPath: /usr/local/jars/payFile/apiclient_key.pem
+
+    #鏈嶅姟鍟�-------------end---
 
     #鍟嗘埛淇℃伅
     wechatSerialNumer: 12C0F0DD0F3D2B565B45586D3FEA225EBF723BEC
-    wechatPayPublicKeyId:  PUB_KEY_ID_0117233260692025072500181939000603 #鍟嗘埛/骞冲彴鏀粯鍏挜id
-    wechatPubKeyPath: /usr/local/zhengshu/pub_key.pem #鍟嗘埛鏀粯鍏挜
-    wechatPrivateKeyPath: /usr/local/zhengshu/shanghu/apiclient_key.pem #鍟嗘埛绉侀挜
+    wechatPayPublicKeyId: PUB_KEY_ID_0117233260692025072500181939000603 #鍟嗘埛/骞冲彴鏀粯鍏挜id
+    wechatPubKeyPath: /usr/local/jars/payFile/shanghu/pub_key.pem #鍟嗘埛鏀粯鍏挜
+    wechatPrivateKeyPath: /usr/local/jars/payFile/shanghu/apiclient_key.pem #鍟嗘埛绉侀挜
     wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #鍟嗘埛杞处鍥炶皟鍦板潃
 
 
-    #鏈嶅姟鍟�-------------end---
     existsSub: 1
     appSecret:
     #瀛愬晢鎴�------------start----
+    subMchId: 1723326069    #瀛愬晢鎴峰彿
     subAppId: wx332441ae5b12be7d #灏忕▼搴廼d
     subAppSecret: add86d6406f5c14501ac5bbb1a60e004 #灏忕▼搴忕閽�
-    subMchId: 1723326069    #瀛愬晢鎴峰彿
     #瀛愬晢鎴�------------end----
     #      mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM
     typeId: gybike
diff --git a/server/web/src/main/java/com/doumee/JKWebApplication.java b/server/web/src/main/java/com/doumee/JKWebApplication.java
index d4e8918..f9add5a 100644
--- a/server/web/src/main/java/com/doumee/JKWebApplication.java
+++ b/server/web/src/main/java/com/doumee/JKWebApplication.java
@@ -24,8 +24,8 @@
         context.getEnvironment();
     }
 
-    @Override
-    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
-        return builder.sources(JKWebApplication.class) ;
-    }
+//    @Override
+//    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
+//        return builder.sources(JKWebApplication.class) ;
+//    }
 }
diff --git a/server/web/src/main/java/com/doumee/api/web/ConfigApi.java b/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
index 17e8ed7..f59c98f 100644
--- a/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
@@ -35,7 +35,6 @@
     @Autowired
     private CategoryService categoryService;
 
-    @LoginRequired
     @ApiOperation(value = "鑾峰彇鍒嗙被鍒楄〃", notes = "灏忕▼搴忕")
     @GetMapping("/getCategoryList")
     @ApiImplicitParams({
diff --git a/server/services/src/main/resources/logback-spring.xml b/server/web/src/main/resources/logback-spring.xml
similarity index 97%
copy from server/services/src/main/resources/logback-spring.xml
copy to server/web/src/main/resources/logback-spring.xml
index 4e16308..97326c0 100644
--- a/server/services/src/main/resources/logback-spring.xml
+++ b/server/web/src/main/resources/logback-spring.xml
@@ -5,7 +5,7 @@
             <pattern>%highlight(%date{yyyy-MM-dd HH:mm:ss}) | %highlight(%-5level) | %highlight(%thread) | %highlight(%logger) | %msg%n</pattern>
         </layout>
     </appender>
-    <property name="log.path" value="/usr/local/jars/official_website/logs"></property>
+    <property name="log.path" value="/usr/local/jars/logs/web"></property>
     <property name="log.fileSize" value="100MB"></property>
     <property name="log.historyDays" value="7"></property>
     <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
diff --git a/small-program/store/index.js b/small-program/store/index.js
index 337989e..af4c2ea 100644
--- a/small-program/store/index.js
+++ b/small-program/store/index.js
@@ -16,7 +16,7 @@
 		statusbarHeight: statusbarHeight || '',
 		userInfo: userInfo || {},
 		token: token || '',
-		openid: token || '',
+		openid: openid || '',
 		
 		latitude: '',
 		longitude: '',

--
Gitblit v1.9.3