Althars123 vor 4 Jahren
Ursprung
Commit
0ff991835d

+ 2 - 0
hzgzpt-admin/src/main/resources/application.yml

@@ -57,6 +57,8 @@ logging:
 
 # Spring配置
 spring:
+  jmx:
+    default-domain: hzgzpt
   # 资源信息
   messages:
     # 国际化资源文件路径

+ 1 - 9
hzgzpt-framework/src/main/java/com/miaxis/framework/security/token/MoblieCodeAuthenticationToken.java

@@ -23,15 +23,7 @@ import org.springframework.security.core.SpringSecurityCoreVersion;
 import java.util.Collection;
 
 /**
- * An {@link org.springframework.security.core.Authentication} implementation that is
- * designed for simple presentation of a username and password.
- * <p>
- * The <code>principal</code> and <code>credentials</code> should be set with an
- * <code>Object</code> that provides the respective property via its
- * <code>Object.toString()</code> method. The simplest such <code>Object</code> to use is
- * <code>String</code>.
- *
- * @author Ben Alex
+ * @author chenjian
  */
 public class MoblieCodeAuthenticationToken extends AbstractAuthenticationToken {
 

+ 5 - 0
hzgzpt-service/pom.xml

@@ -32,6 +32,11 @@
             <artifactId>commons-httpclient</artifactId>
             <version>3.1</version>
         </dependency>
+        <dependency>
+            <groupId>com.github.wechatpay-apiv3</groupId>
+            <artifactId>wechatpay-apache-httpclient</artifactId>
+            <version>0.2.1</version>
+        </dependency>
 
 
     </dependencies>

+ 3 - 1
hzgzpt-service/src/main/java/com/miaxis/coach/service/impl/CoachInfoServiceImpl.java

@@ -48,7 +48,9 @@ public class CoachInfoServiceImpl extends ServiceImpl<CoachInfoMapper, CoachInfo
      */
     @Override
     public List<CoachInfo> selectCoachInfoList(CoachInfo coachInfo){
-        return coachInfoMapper.selectCoachInfoList(coachInfo);
+        List<CoachInfo> list = coachInfoMapper.selectCoachInfoList(coachInfo);
+        System.out.println("111");
+        return list;
     }
 
     /**

+ 89 - 0
hzgzpt-service/src/main/java/com/miaxis/wechatpay/wechatpaytest.java

@@ -0,0 +1,89 @@
+package com.miaxis.wechatpay;
+
+
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.util.EntityUtils;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+
+@Service
+public class wechatpaytest {
+
+    public void CreateOrder() throws Exception{
+        //请求URL
+        HttpPost httpPost = new HttpPost("https://api.mch.weixin.qq.com/v3/pay/transactions/app");
+        // 请求body参数
+        String reqdata = "{"
+                + "\"time_expire\":\"2018-06-08T10:34:56+08:00\","
+                + "\"amount\": {"
+                + "\"total\":100,"
+                + "\"currency\":\"CNY\""
+                + "},"
+                + "\"mchid\":\"1230000109\","
+                + "\"description\":\"Image形象店-深圳腾大-QQ公仔\","
+                + "\"notify_url\":\"https://www.weixin.qq.com/wxpay/pay.php\","
+                + "\"out_trade_no\":\"1217752501201407033233368018\","
+                + "\"goods_tag\":\"WXG\","
+                + "\"appid\":\"wxd678efh567hg6787\","
+                + "\"attach\":\"自定义数据说明\","
+                + "\"detail\": {"
+                + "\"invoice_id\":\"wx123\","
+                + "\"goods_detail\": ["
+                + "{"
+                + "\"goods_name\":\"iPhoneX 256G\","
+                + "\"wechatpay_goods_id\":\"1001\","
+                + "\"quantity\":1,"
+                + "\"merchant_goods_id\":\"商品编码\","
+                + "\"unit_price\":828800"
+                + "},"
+                + "{"
+                + "\"goods_name\":\"iPhoneX 256G\","
+                + "\"wechatpay_goods_id\":\"1001\","
+                + "\"quantity\":1,"
+                + "\"merchant_goods_id\":\"商品编码\","
+                + "\"unit_price\":828800"
+                + "}"
+                + "],"
+                + "\"cost_price\":608800"
+                + "},"
+                + "\"scene_info\": {"
+                + "\"store_info\": {"
+                + "\"address\":\"广东省深圳市南山区科技中一道10000号\","
+                + "\"area_code\":\"440305\","
+                + "\"name\":\"腾讯大厦分店\","
+                + "\"id\":\"0001\""
+                + "},"
+                + "\"device_id\":\"013467007045764\","
+                + "\"payer_client_ip\":\"14.23.150.211\""
+                + "}"
+                + "}";
+        StringEntity entity = new StringEntity(reqdata);
+        entity.setContentType("application/json");
+        httpPost.setEntity(entity);
+        httpPost.setHeader("Accept", "application/json");
+
+        //完成签名并执行请求
+        CloseableHttpResponse response = null;
+//        CloseableHttpResponse response = httpClient.execute(httpPost);
+
+        try {
+            int statusCode = response.getStatusLine().getStatusCode();
+            if (statusCode == 200) { //处理成功
+                System.out.println("success,return body = " + EntityUtils.toString(response.getEntity()));
+            } else if (statusCode == 204) { //处理成功,无返回Body
+                System.out.println("success");
+            } else {
+                System.out.println("failed,resp code = " + statusCode+ ",return body = " + EntityUtils.toString(response.getEntity()));
+                throw new IOException("request failed");
+            }
+        } finally {
+            response.close();
+        }
+    }
+
+
+
+}