新增字段:累计登录次数loginNum
This commit is contained in:
@@ -61,6 +61,7 @@ public class MpController extends BaseController {
|
|||||||
public ApiResult<?> getMpInfo() {
|
public ApiResult<?> getMpInfo() {
|
||||||
final Integer tenantId = getTenantId();
|
final Integer tenantId = getTenantId();
|
||||||
String key = "MpInfo:" + tenantId;
|
String key = "MpInfo:" + tenantId;
|
||||||
|
System.out.println("key = " + key);
|
||||||
final String mpInfo = redisUtil.get(key);
|
final String mpInfo = redisUtil.get(key);
|
||||||
|
|
||||||
if (tenantId.equals(0)) {
|
if (tenantId.equals(0)) {
|
||||||
@@ -82,7 +83,7 @@ public class MpController extends BaseController {
|
|||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
// 获取小程序信息
|
// 获取小程序信息
|
||||||
final Mp mp = mpService.getOne(new LambdaQueryWrapper<Mp>().eq(Mp::getTenantId, tenantId).last("limit 1"));
|
final Mp mp = mpService.getOne(new LambdaQueryWrapper<Mp>().last("limit 1"));
|
||||||
mp.setAppSecret(null);
|
mp.setAppSecret(null);
|
||||||
map.put("mp", mp);
|
map.put("mp", mp);
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,31 @@ public class RequestUtil {
|
|||||||
ACCESS_TOKEN = token;
|
ACCESS_TOKEN = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新用户信息
|
||||||
|
public void updateUser(User user){
|
||||||
|
// 设置租户ID
|
||||||
|
setTenantId(user.getTenantId().toString());
|
||||||
|
// 设置token
|
||||||
|
setAccessToken(user.getAccessToken());
|
||||||
|
// 余额支付接口
|
||||||
|
String path = "/login/auth/user";
|
||||||
|
System.out.println("user2222 = " + user.getCreateTime());
|
||||||
|
try {
|
||||||
|
// 链式构建请求
|
||||||
|
final String body = HttpRequest.put(host.concat(path))
|
||||||
|
.header("Tenantid", TENANT_ID)
|
||||||
|
.header("Authorization", ACCESS_TOKEN)
|
||||||
|
.body(JSONUtil.toJSONString(user))//表单内容
|
||||||
|
.timeout(20000)//超时,毫秒
|
||||||
|
.execute().body();
|
||||||
|
|
||||||
|
System.out.println("body = " + body);
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 预付请求付款(余额支付)
|
// 预付请求付款(余额支付)
|
||||||
public Object balancePay(Order order){
|
public Object balancePay(Order order){
|
||||||
// 设置租户ID
|
// 设置租户ID
|
||||||
|
|||||||
@@ -252,6 +252,9 @@ public class User implements UserDetails {
|
|||||||
@ApiModelProperty("微信unionid")
|
@ApiModelProperty("微信unionid")
|
||||||
private String unionid;
|
private String unionid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "累计登录次数")
|
||||||
|
private Integer loginNum;;
|
||||||
|
|
||||||
@ApiModelProperty("ico文件")
|
@ApiModelProperty("ico文件")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String logo;
|
private String logo;
|
||||||
@@ -272,6 +275,10 @@ public class User implements UserDetails {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private MerchantAccount merchantAccount;
|
private MerchantAccount merchantAccount;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "登录令牌")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
// @ApiModelProperty("企业信息")
|
// @ApiModelProperty("企业信息")
|
||||||
// @TableField(exist = false)
|
// @TableField(exist = false)
|
||||||
// private Company companyInfo;
|
// private Company companyInfo;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@@ -201,8 +202,8 @@ public class CashierController extends BaseController {
|
|||||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||||
return success("请先登录",null);
|
return success("请先登录",null);
|
||||||
}
|
}
|
||||||
final int groupId = Integer.parseInt(getLoginUserId().toString() + RandomUtil.randomInt(1, 100));
|
final long timeMillis = System.currentTimeMillis();
|
||||||
final boolean update = cashierService.update(new LambdaUpdateWrapper<Cashier>().eq(Cashier::getGroupId, 0).eq(Cashier::getCashierId, getLoginUserId()).set(Cashier::getGroupId, groupId));
|
final boolean update = cashierService.update(new LambdaUpdateWrapper<Cashier>().eq(Cashier::getGroupId, 0).eq(Cashier::getCashierId, getLoginUserId()).set(Cashier::getGroupId, timeMillis/1000));
|
||||||
|
|
||||||
return success("操作成功",update);
|
return success("操作成功",update);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.service.UsersService;
|
import com.gxwebsoft.shop.service.UsersService;
|
||||||
import com.gxwebsoft.shop.entity.Users;
|
import com.gxwebsoft.shop.entity.Users;
|
||||||
@@ -20,7 +23,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -38,6 +43,8 @@ import java.util.Map;
|
|||||||
public class UsersController extends BaseController {
|
public class UsersController extends BaseController {
|
||||||
@Resource
|
@Resource
|
||||||
private UsersService usersService;
|
private UsersService usersService;
|
||||||
|
@Resource
|
||||||
|
private RequestUtil requestUtil;
|
||||||
|
|
||||||
@ApiOperation("分页查询")
|
@ApiOperation("分页查询")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@@ -64,11 +71,11 @@ public class UsersController extends BaseController {
|
|||||||
@PreAuthorize("hasAnyAuthority('sys:auth:user')")
|
@PreAuthorize("hasAnyAuthority('sys:auth:user')")
|
||||||
@ApiOperation("根据手机查询用户")
|
@ApiOperation("根据手机查询用户")
|
||||||
@GetMapping("/getByPhone")
|
@GetMapping("/getByPhone")
|
||||||
public ApiResult<Users> getByPhone(UsersParam param) {
|
public ApiResult<Users> getByPhone(UsersParam param, HttpServletRequest request) {
|
||||||
Users result;
|
Users result;
|
||||||
final List<Users> users = usersService.listRel(param);
|
final List<Users> users = usersService.listRel(param);
|
||||||
if (users.isEmpty()) {
|
if (users.isEmpty()) {
|
||||||
// 同步注册用户
|
// 新用户注册
|
||||||
final Users addUsers = new Users();
|
final Users addUsers = new Users();
|
||||||
addUsers.setPhone(param.getPhone());
|
addUsers.setPhone(param.getPhone());
|
||||||
addUsers.setUsername("微信用户");
|
addUsers.setUsername("微信用户");
|
||||||
@@ -79,7 +86,6 @@ public class UsersController extends BaseController {
|
|||||||
addUsers.setCountry("");
|
addUsers.setCountry("");
|
||||||
addUsers.setProvince("");
|
addUsers.setProvince("");
|
||||||
addUsers.setCity("");
|
addUsers.setCity("");
|
||||||
long longValue = System.currentTimeMillis() / 1000;
|
|
||||||
usersService.save(addUsers);
|
usersService.save(addUsers);
|
||||||
result = addUsers;
|
result = addUsers;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ public class Cashier implements Serializable {
|
|||||||
@ApiModelProperty(value = "商品ID")
|
@ApiModelProperty(value = "商品ID")
|
||||||
private Integer goodsId;
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品规格")
|
@ApiModelProperty(value = "商品规格")
|
||||||
private String spec;
|
private String spec;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ public class CashierParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "商品ID")
|
@ApiModelProperty(value = "商品ID")
|
||||||
private Integer goodsId;
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品规格")
|
@ApiModelProperty(value = "商品规格")
|
||||||
private String spec;
|
private String spec;
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class BookingGenerator {
|
|||||||
// 输出目录
|
// 输出目录
|
||||||
private static final String OUTPUT_DIR = "/src/main/java";
|
private static final String OUTPUT_DIR = "/src/main/java";
|
||||||
// Vue文件输出位置
|
// Vue文件输出位置
|
||||||
private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/com.gxwebsoft.core-web";
|
private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/gxtyzx-admin-vue";
|
||||||
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/nbg";
|
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/gxtyzx-uniapp-cli";
|
||||||
// Vue文件输出目录
|
// Vue文件输出目录
|
||||||
private static final String OUTPUT_DIR_VUE = "/src";
|
private static final String OUTPUT_DIR_VUE = "/src";
|
||||||
// 作者名称
|
// 作者名称
|
||||||
@@ -72,6 +72,7 @@ public class BookingGenerator {
|
|||||||
// "booking_match_order",
|
// "booking_match_order",
|
||||||
// "booking_coupon",
|
// "booking_coupon",
|
||||||
// "booking_user_coupon",
|
// "booking_user_coupon",
|
||||||
|
"booking_cart"
|
||||||
};
|
};
|
||||||
// 需要去除的表前缀
|
// 需要去除的表前缀
|
||||||
private static final String[] TABLE_PREFIX = new String[]{
|
private static final String[] TABLE_PREFIX = new String[]{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ShopGenerator {
|
|||||||
// Vue文件输出位置
|
// Vue文件输出位置
|
||||||
private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/gxtyzx-admin-vue";
|
private static final String OUTPUT_LOCATION_VUE = "/Users/gxwebsoft/VUE/gxtyzx-admin-vue";
|
||||||
// Vue文件输出目录
|
// Vue文件输出目录
|
||||||
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/nbg";
|
private static final String OUTPUT_LOCATION_UNIAPP = "/Users/gxwebsoft/VUE/gxtyzx-uniapp-cli";
|
||||||
// Vue文件输出目录
|
// Vue文件输出目录
|
||||||
private static final String OUTPUT_DIR_VUE = "/src";
|
private static final String OUTPUT_DIR_VUE = "/src";
|
||||||
// 作者名称
|
// 作者名称
|
||||||
|
|||||||
Reference in New Issue
Block a user