浏览代码

微信获取配置

fllmoyu 4 年之前
父节点
当前提交
e9cc05d466

+ 3 - 2
common/src/main/java/com/jpsoft/bus/modules/common/utils/WeixinUtil.java

@@ -2,6 +2,7 @@ package com.jpsoft.bus.modules.common.utils;
 
 import cn.hutool.core.date.DateTime;
 import com.jpsoft.bus.modules.wechat.entity.AccessToken;
+import com.jpsoft.bus.modules.wechat.vo.UserInfo;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONException;
 import net.sf.json.JSONObject;
@@ -121,7 +122,7 @@ public class WeixinUtil {
 		return accessToken;
 	}
 
-	/*// 获取用户信息
+	// 获取用户信息
 	public static String user_info_url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
 	public static String subscribe_user_info_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN ";
 
@@ -148,7 +149,7 @@ public class WeixinUtil {
 				}
 			}
 		return userInfo;
-	}*/
+	}
 
 	public static boolean checkSignature(String token,String signature, String timestamp, String nonce) {
 		String[] arr = new String[] { token, timestamp, nonce };

+ 1 - 0
web/src/main/java/com/jpsoft/bus/config/WebMvcConfig.java

@@ -59,6 +59,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
 				.excludePathPatterns("/mobile/driverApi/findByPhone")
 				.excludePathPatterns("/mobile/passengerApi/getShiftInfo")
 				.excludePathPatterns("/mobile/passengerApi/upload")
+				.excludePathPatterns("/wechat/findUserInfo/**")
 				;
 	}
 }

+ 65 - 0
web/src/main/java/com/jpsoft/bus/modules/driver/controller/DriverApiController.java

@@ -609,4 +609,69 @@ public class DriverApiController {
         return messageResult;
     }
 
+
+    @PostMapping("driverCreateOrder")
+    @ApiOperation(value = "司机为乘客创建订单")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
+            @ApiImplicitParam(name = "id", value = "乘客主id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "ticketUpStationId", value = "乘客买票站点id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "ticketDownStationId", value = "乘客买票下车站点id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "ticketType", value = "购票类型(1:儿童票,2:成人票)", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "goodsTicket", value = "货票金额", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "payName", value = "cash:现金,ticket:车票,wechat:微信,alipay:支付宝", required = true, paramType = "form"),
+    })
+    public MessageResult<Map> driverCreateOrder(String id,String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+
+
+
+
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+    @PostMapping("ticketAmount")
+    @ApiOperation(value = "站点之间的车票金额")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "token", value = "令牌", paramType = "form"),
+            @ApiImplicitParam(name = "subject", value = "目标(不传)", paramType = "form"),
+            @ApiImplicitParam(name = "ticketUpStationId", value = "乘客买票站点id", required = true, paramType = "form"),
+            @ApiImplicitParam(name = "ticketDownStationId", value = "乘客买票下车站点id", required = true, paramType = "form")
+    })
+    public MessageResult<Map> ticketAmount(String ticketUpStationId,String ticketDownStationId,String token, @RequestAttribute String subject) {
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+
+
+
+
+
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            log.error(ex.getMessage(),ex);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
+
+
+
 }

+ 3 - 2
web/src/main/java/com/jpsoft/bus/wechat/controller/WxController.java

@@ -8,6 +8,7 @@ import com.jpsoft.bus.modules.common.dto.MessageResult;
 import com.jpsoft.bus.modules.common.utils.Sign;
 import com.jpsoft.bus.modules.common.utils.WeixinUtil;
 import com.jpsoft.bus.modules.wechat.entity.AccessToken;
+import com.jpsoft.bus.modules.wechat.vo.UserInfo;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -103,7 +104,7 @@ public class WxController {
         return new MessageResult(true, "获取成功", dataMap, 200);
     }
 
-   /* @ApiOperation(value = "获取公众号用户信息")
+    @ApiOperation(value = "获取公众号用户信息")
     @GetMapping(value = "findUserInfo/{code}")
     public MessageResult findUserInfo(@PathVariable String code) {
         try {
@@ -133,7 +134,7 @@ public class WxController {
             ex.printStackTrace();
             return new MessageResult(false, "系统错误", "", 500);
         }
-    }*/
+    }