微信公众号端服务基本完成
This commit is contained in:
parent
1073ab28d9
commit
d404295269
@ -55,7 +55,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
<!-- <version>5.1.38</version>-->
|
<version>5.1.38</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块-->
|
<!-- 核心模块-->
|
||||||
|
|||||||
@ -112,6 +112,7 @@ public class WxAuthController {
|
|||||||
|
|
||||||
sysSignInWx.setVipStartTime(sysSignInApp.getVipStartTime());
|
sysSignInWx.setVipStartTime(sysSignInApp.getVipStartTime());
|
||||||
sysSignInWx.setVipStopTime(sysSignInApp.getVipStopTime());
|
sysSignInWx.setVipStopTime(sysSignInApp.getVipStopTime());
|
||||||
|
sysSignInWx.setStatus(sysSignInApp.getStatus());
|
||||||
sysSignInWx.setCalculateNumber(Math.max(10L, sysSignInApp.getCalculateNumber()));
|
sysSignInWx.setCalculateNumber(Math.max(10L, sysSignInApp.getCalculateNumber()));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,20 @@ public class ApiController extends BaseController {
|
|||||||
@GetMapping("/userData/{phone}")
|
@GetMapping("/userData/{phone}")
|
||||||
public AjaxResult getUserData(@PathVariable String phone) {
|
public AjaxResult getUserData(@PathVariable String phone) {
|
||||||
SysUser sysUser = sysUserService.selectUserByUserName(phone);
|
SysUser sysUser = sysUserService.selectUserByUserName(phone);
|
||||||
|
|
||||||
|
int isBind = 0;
|
||||||
|
|
||||||
|
// 若存在手机号说明该微信账号已经绑定过手机号.
|
||||||
|
if(!sysUser.getPhonenumber().isEmpty()){
|
||||||
|
System.out.println("用户手机号: "+ sysUser.getPhonenumber());
|
||||||
|
isBind = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("用户id: "+ sysUser.getUserId());
|
||||||
SysSignIn sysSignIn = sysSignInService.selectSysSignInByUId(sysUser.getUserId());
|
SysSignIn sysSignIn = sysSignInService.selectSysSignInByUId(sysUser.getUserId());
|
||||||
|
|
||||||
|
sysSignIn.setIsBind(isBind);
|
||||||
|
|
||||||
return AjaxResult.success(sysSignIn);
|
return AjaxResult.success(sysSignIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,6 +41,9 @@ public class BackController {
|
|||||||
public String wxRechargeCallback(HttpServletRequest req, @PathVariable String type) throws Exception {
|
public String wxRechargeCallback(HttpServletRequest req, @PathVariable String type) throws Exception {
|
||||||
String result = "failure";
|
String result = "failure";
|
||||||
try {
|
try {
|
||||||
|
System.out.println("微信支付回调函数开始执行");
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> map = getParamsMap(req);
|
Map<String, Object> map = getParamsMap(req);
|
||||||
//获取私钥
|
//获取私钥
|
||||||
String apikey = "fC2ExkJYLY5LI6PrliiZtcp8Egeolp1kc3wyH6hYlhXjg3X8PR1HlQeVPWkxzFNk4ugbtYGLNUQGBsAvMRwZJGUaj94KLnsYfssRciETgBc6CKN1y5hAs29U31XXD7ic";
|
String apikey = "fC2ExkJYLY5LI6PrliiZtcp8Egeolp1kc3wyH6hYlhXjg3X8PR1HlQeVPWkxzFNk4ugbtYGLNUQGBsAvMRwZJGUaj94KLnsYfssRciETgBc6CKN1y5hAs29U31XXD7ic";
|
||||||
|
|||||||
@ -63,24 +63,25 @@ public class PayController extends BaseController {
|
|||||||
String orderTitle;
|
String orderTitle;
|
||||||
int predictCount = 1;
|
int predictCount = 1;
|
||||||
if ("1".equals(type)) {
|
if ("1".equals(type)) {
|
||||||
// amount = 1L;
|
|
||||||
amount = 5000L;
|
amount = 5000L;
|
||||||
|
// amount = 1L;
|
||||||
orderTitle = "优惠购买";
|
orderTitle = "优惠购买";
|
||||||
predictCount = 50;
|
predictCount = 50;
|
||||||
} else if ("2".equals(type)) {
|
} else if ("2".equals(type)) {
|
||||||
amount = 9900L;
|
amount = 9900L;
|
||||||
// amount = 1L;
|
// amount = 1L;
|
||||||
orderTitle = "优惠购买";
|
orderTitle = "优惠购买";
|
||||||
predictCount = 0;
|
predictCount = 99;
|
||||||
} else if ("3".equals(type)) {
|
} else if ("3".equals(type)) {
|
||||||
amount = 29900L;
|
amount = 29900L;
|
||||||
// amount = 1L;
|
// amount = 1L;
|
||||||
predictCount = 0;
|
predictCount = 299;
|
||||||
orderTitle = "优惠购买";
|
orderTitle = "优惠购买";
|
||||||
} else if ("4".equals(type)) {
|
} else if ("4".equals(type)) {
|
||||||
amount = 49900L;
|
amount = 49900L;
|
||||||
// amount = 1L;
|
// amount = 1L;
|
||||||
predictCount = 0;
|
predictCount = 499;
|
||||||
orderTitle = "优惠购买";
|
orderTitle = "优惠购买";
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
@ -117,7 +118,8 @@ public class PayController extends BaseController {
|
|||||||
model.setSubject("" + MCHNO + "");
|
model.setSubject("" + MCHNO + "");
|
||||||
model.setBody(orderTitle + "[" + MCHNO + "]");
|
model.setBody(orderTitle + "[" + MCHNO + "]");
|
||||||
|
|
||||||
model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/" + type); //回调地址
|
// model.setNotifyUrl("http://62.234.19.34:8991/wxPay/result/wxRechargeCallback/" + type); //APP端回调地址
|
||||||
|
model.setNotifyUrl("https://cesuan.doni.link/wxPay/result/wxRechargeCallback/" + type); //微信端回调地址
|
||||||
model.setReturnUrl("");
|
model.setReturnUrl("");
|
||||||
model.setDivisionMode(divisionMode); //分账模式
|
model.setDivisionMode(divisionMode); //分账模式
|
||||||
|
|
||||||
@ -154,6 +156,8 @@ public class PayController extends BaseController {
|
|||||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||||
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("img.jpg", "UTF-8"));
|
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("img.jpg", "UTF-8"));
|
||||||
|
|
||||||
|
System.out.println("微信支付结束");
|
||||||
|
|
||||||
return AjaxResult.success(url);
|
return AjaxResult.success(url);
|
||||||
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
// ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
//
|
//
|
||||||
|
|||||||
@ -7,11 +7,11 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://localhost:3306/xingming?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://localhost:3306/xingming?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# url: jdbc:mysql://172.17.0.3:3306/xingming?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
url: jdbc:mysql://172.17.0.3:3306/xingming?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||||
username: root
|
username: root
|
||||||
# password: dnxxkj
|
password: dnxxkj
|
||||||
password: root
|
# password: root
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@ -19,6 +19,13 @@ ruoyi:
|
|||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为8080
|
# 服务器的HTTP端口,默认为8080
|
||||||
port: 8991
|
port: 8991
|
||||||
|
|
||||||
|
# ssl:
|
||||||
|
# enabled: true
|
||||||
|
# key-store-type: PEM
|
||||||
|
# key: classpath:a.key
|
||||||
|
# key-store: classpath:a.pem
|
||||||
|
# key-store-password: classpath:a.key
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
@ -70,8 +77,8 @@ spring:
|
|||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
# host: 172.17.0.4
|
host: 172.17.0.4
|
||||||
host: localhost
|
# host: localhost
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
@ -130,3 +137,17 @@ xss:
|
|||||||
excludes: /system/notice
|
excludes: /system/notice
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
wx:
|
||||||
|
|
||||||
|
# 微信小程序配置
|
||||||
|
|
||||||
|
appId: ${WX_APP_ID:wxa75198269cee70db} # 优先使用环境变量,否则使用默认值
|
||||||
|
|
||||||
|
appSecret: ${WX_APP_SECRET:09818c4e6489cc17228ee6b3e97523b9}
|
||||||
|
|
||||||
|
# redirectUri: ${WX_REDIRECT_URI:http://你的域名/api/wx/auth/callback}
|
||||||
|
#
|
||||||
|
# scope: snsapi_userinfo
|
||||||
|
|
||||||
|
apiUrl: https://api.weixin.qq.com
|
||||||
|
|||||||
@ -51,6 +51,9 @@ public class SysSignIn extends BaseEntity
|
|||||||
@Excel(name = "无限次数结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "无限次数结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date vipStopTime;
|
private Date vipStopTime;
|
||||||
|
|
||||||
|
// 是否绑定手机号
|
||||||
|
private int isBind;
|
||||||
|
|
||||||
public void setId(Long id)
|
public void setId(Long id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -124,6 +127,14 @@ public class SysSignIn extends BaseEntity
|
|||||||
return vipStopTime;
|
return vipStopTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIsBind() {
|
||||||
|
return isBind;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsBind(int isBind) {
|
||||||
|
this.isBind = isBind;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user