商家是否会员支付控制
登录获取手机号报错问题 团购卷会员卡支付 个人中心 客服电话
This commit is contained in:
@@ -60,7 +60,7 @@ public class LoginContoller {
|
||||
RedisUtil redisUtil;
|
||||
|
||||
|
||||
@RequestMapping("/wx/business/login")
|
||||
// @RequestMapping("/wx/business/login")
|
||||
public Result wxBusinessLogin(@RequestParam(value = "code", required = false) String code,
|
||||
@RequestParam(value = "rawData", required = false) String rawData,
|
||||
@RequestParam(value = "signature", required = false) String signature
|
||||
@@ -178,10 +178,13 @@ public class LoginContoller {
|
||||
String openid = SessionKeyOpenId.getString("openid");
|
||||
String sessionKey = SessionKeyOpenId.getString("session_key");
|
||||
String data = WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr);
|
||||
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
|
||||
try {
|
||||
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
|
||||
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
|
||||
}
|
||||
} finally {
|
||||
return Result.fail("获取手机号失败");
|
||||
}
|
||||
return Result.fail("获取手机号失败");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public class PayController {
|
||||
// String orderType = map.get("orderType").toString();
|
||||
String payType = map.get("payType");
|
||||
String userId = "";
|
||||
if (environment.equals("wx")) {
|
||||
if (environment.equals("wx") && payType.equals("wechatPay")) {
|
||||
userId = TokenUtil.parseParamFromToken(token).getString("openId");
|
||||
} else {
|
||||
userId = TokenUtil.parseParamFromToken(token).getString("userId");
|
||||
@@ -81,10 +81,7 @@ public class PayController {
|
||||
//订单支付 orderId:62,payType=wechatPay,userId:or1l860rwM-rU_j9KrgMOwued
|
||||
log.info("订单支付 orderId:{},payType={},userId:{}", orderId, payType, userId);
|
||||
try {
|
||||
// if(StringUtils.isNotBlank(orderType) && orderType.equals("group")){
|
||||
// return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request));
|
||||
// }
|
||||
return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request));
|
||||
return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request), map.get("pwd"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -76,8 +76,24 @@ public class UserContoller {
|
||||
// return jsonObject;
|
||||
// }
|
||||
@GetMapping("/shopUserInfo")
|
||||
public Result shopUserInfo(@RequestParam("userId") String userId ,@RequestParam("shopId") String shopId ) throws Exception {
|
||||
public Result shopUserInfo(@RequestParam("userId") String userId ,@RequestHeader("openId") String openId,@RequestParam("shopId") String shopId ) throws Exception {
|
||||
TbShopUser shopUser = shopUserMapper.selectByUserIdAndShopId(userId,shopId);
|
||||
if (ObjectUtil.isEmpty(shopUser)) {
|
||||
shopUser = new TbShopUser();
|
||||
shopUser.setAmount(BigDecimal.ZERO);
|
||||
shopUser.setIsVip(Byte.parseByte("0"));
|
||||
shopUser.setCreditAmount(BigDecimal.ZERO);
|
||||
shopUser.setConsumeAmount(BigDecimal.ZERO);
|
||||
shopUser.setConsumeNumber(0);
|
||||
shopUser.setLevelConsume(BigDecimal.ZERO);
|
||||
shopUser.setStatus(Byte.parseByte("1"));
|
||||
shopUser.setShopId(shopId);
|
||||
shopUser.setUserId(userId);
|
||||
shopUser.setMiniOpenId(openId);
|
||||
shopUser.setCreatedAt(System.currentTimeMillis());
|
||||
shopUser.setUpdatedAt(System.currentTimeMillis());
|
||||
shopUserMapper.insert(shopUser);
|
||||
}
|
||||
return Result.success(CodeEnum.SUCCESS,shopUser);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user