Merge branch 'master' of https://gitee.com/wjl2008_admin/nuttyreading-java into zcc
This commit is contained in:
@@ -80,7 +80,6 @@ public class MyUserController {
|
||||
wrapper.and(p.getKey()!="",k->k.like(MyUserEntity::getName,p.getKey()).or().like(MyUserEntity::getTel,p.getKey()));
|
||||
wrapper.orderByDesc(MyUserEntity::getCreateTime);
|
||||
Page<MyUserEntity> myUserEntityPage = userService.getBaseMapper().selectPage(new Page<MyUserEntity>(p.getPage(), p.getLimit()), wrapper);
|
||||
|
||||
return R.ok().put("user",myUserEntityPage);
|
||||
}
|
||||
|
||||
@@ -93,7 +92,6 @@ public class MyUserController {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@@ -101,10 +99,6 @@ public class MyUserController {
|
||||
// @RequiresPermissions("book:user:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
MyUserEntity user = userService.getById(id);
|
||||
// List<CouponHistoryEntity> list = couponHistoryService.getBaseMapper().selectList(new QueryWrapper<CouponHistoryEntity>().eq("member_id", id)
|
||||
// .eq("use_status", 0));
|
||||
// user.setConponsCount(list.size());
|
||||
|
||||
return R.ok().put("user", user);
|
||||
}
|
||||
|
||||
@@ -117,7 +111,6 @@ public class MyUserController {
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
user.setPassword(saltMD5);
|
||||
userService.save(user);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -164,15 +157,12 @@ public class MyUserController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
// @RequiresPermissions("book:user:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
userService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -245,19 +235,13 @@ public class MyUserController {
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("password") String password){
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
}
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel));
|
||||
if(!ObjectUtil.isEmpty(user)){
|
||||
return R.error(500,"该手机号已经注册!");
|
||||
@@ -269,7 +253,6 @@ public class MyUserController {
|
||||
userService.save(myUserEntity);
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
|
||||
}
|
||||
/**
|
||||
* 常规注册 / 验证码 登录
|
||||
@@ -318,7 +301,6 @@ public class MyUserController {
|
||||
@RequestMapping("/login")
|
||||
public R login(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password) {
|
||||
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper();
|
||||
if (phone.contains("@")) {
|
||||
wrapper.eq(MyUserEntity::getEmail,phone);
|
||||
@@ -389,70 +371,40 @@ public class MyUserController {
|
||||
public R getEverhealthInfo(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password,
|
||||
@RequestParam(value = "hsuserId", required = false) Integer hsuserId) {
|
||||
|
||||
String s = HttpUtil.get("http://101.201.146.165:8088/App-EH/app/phone.do?login&loginName="+ phone +"&loginPwd="+ password +"");
|
||||
|
||||
System.out.println(s);
|
||||
|
||||
|
||||
|
||||
//将结果转成json 取值
|
||||
JSONObject jsonObject = JSON.parseObject(s);
|
||||
|
||||
if (jsonObject.getString("msg").equals("登录名或密码错误!")) {
|
||||
|
||||
return R.error(404,jsonObject.getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
String yljkOid = jsonObject.getJSONObject("obj").getString("customerOid");
|
||||
String cellPhone = jsonObject.getJSONObject("obj").getString("cellPhone");
|
||||
String customerIcons = jsonObject.getJSONObject("obj").getString("customerIcons");
|
||||
String nameCN = jsonObject.getJSONObject("obj").getString("nameCN");
|
||||
// String password = jsonObject.getJSONObject("obj").getString("pass");
|
||||
|
||||
System.out.println("=====================yljkOid=============================="+yljkOid);
|
||||
|
||||
|
||||
//查询 当前 花生账号 和 当前绑定的 一路健康账号是否有绑定 关系
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("yljk_oid", yljkOid));
|
||||
|
||||
if (user != null ) {
|
||||
|
||||
// 判断 hsuserId 是否为空 查询 传入的 花生id 和 查询的花生 id 是否一致
|
||||
if (hsuserId != null && user.getId() == hsuserId){
|
||||
|
||||
MyUserEntity myUserEntity = userService.getBaseMapper().selectById(hsuserId);
|
||||
//绑定
|
||||
myUserEntity.setYljkOid(yljkOid);
|
||||
userService.updateById(myUserEntity);
|
||||
|
||||
return R.ok("绑定成功!");
|
||||
|
||||
}
|
||||
|
||||
//如果系统存在该用户 并且绑定关系 成立 登录成功 ,返回用户信息
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
|
||||
return R.ok("登陆成功").put("userInfo",user).put("token",r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//不存在 返回 手机号 oid 姓名 头像
|
||||
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("cellPhone",cellPhone);
|
||||
map.put("customerIcons",customerIcons);
|
||||
map.put("yljkOid",yljkOid);
|
||||
map.put("nameCN",nameCN);
|
||||
|
||||
return R.ok("绑定信息").put("everhealthInfo",map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 一路健康账号注册花生
|
||||
*/
|
||||
@@ -462,22 +414,14 @@ public class MyUserController {
|
||||
@RequestParam("yljkOid") String yljkOid,
|
||||
@RequestParam("userName") String userName,
|
||||
@RequestParam("customerIcons") String customerIcons) {
|
||||
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
}
|
||||
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (userEntity == null) {
|
||||
@@ -503,7 +447,6 @@ public class MyUserController {
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
// todo 为什么验证成功以后不能实现页面跳转登录 R返回更新生成的token和电话
|
||||
return R.ok().put("userInfo",userEntity).put("token",r);
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/test")
|
||||
@@ -531,7 +474,6 @@ public class MyUserController {
|
||||
}
|
||||
}
|
||||
msg = userService.buyEbook(userId, bookId,couponId);
|
||||
|
||||
if (msg.equals("当前书籍以购买,请勿重复购买!")) {
|
||||
return R.ok().put("msg",msg).put("status","error");
|
||||
}else if (msg.equals("余额不足,请充值!")) {
|
||||
@@ -562,9 +504,7 @@ public class MyUserController {
|
||||
}else {
|
||||
return R.error("余额不足!扣除失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
|
||||
transactionDetailsEntity.setUserId(Integer.valueOf(id));
|
||||
transactionDetailsEntity.setOrderType("后台充扣操作");
|
||||
@@ -581,8 +521,6 @@ public class MyUserController {
|
||||
BigDecimal balance = new BigDecimal(i);
|
||||
transactionDetailsEntity.setUserBalance(balance);
|
||||
transactionDetailsService.save(transactionDetailsEntity);
|
||||
|
||||
|
||||
// 插入 花生币 充值记录
|
||||
// IosPayOrderEntity payPaymentOrderEntity = new IosPayOrderEntity();
|
||||
// payPaymentOrderEntity.setUserId(Integer.valueOf(id));
|
||||
@@ -592,7 +530,6 @@ public class MyUserController {
|
||||
// payPaymentOrderEntity.setRechargeStatus("success");
|
||||
// payPaymentOrderEntity.setSuccessTime(new Date());
|
||||
// payPaymentOrderService.save(payPaymentOrderEntity);
|
||||
|
||||
userService.updateById(byId);
|
||||
return R.ok();
|
||||
}
|
||||
@@ -604,7 +541,6 @@ public class MyUserController {
|
||||
*/
|
||||
@RequestMapping("/openVipByVirtualCoin")
|
||||
public R openVipByVirtualCoin(@RequestParam Map<String,Object> params){
|
||||
|
||||
Integer configId = Integer.valueOf(params.get("configId").toString());
|
||||
String orderSn = params.get("orderSn").toString();
|
||||
Integer userId = Integer.valueOf(params.get("userId").toString());
|
||||
@@ -613,14 +549,8 @@ public class MyUserController {
|
||||
BookBuyConfigEntity bookBuyConfigEntity = bookBuyConfigService.getById(configId);
|
||||
String month = bookBuyConfigEntity.getMonth();
|
||||
BigDecimal amount = new BigDecimal(bookBuyConfigEntity.getRealMoney());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(user.getPeanutCoin().compareTo(amount) >= 0){
|
||||
user.setPeanutCoin(user.getPeanutCoin().subtract(amount));
|
||||
|
||||
this.userService.updateById(user);
|
||||
// 添加消费信息
|
||||
TransactionDetailsEntity transactionDetailsEntity = new TransactionDetailsEntity();
|
||||
@@ -638,14 +568,9 @@ public class MyUserController {
|
||||
}else{
|
||||
return R.error(500,"余额不足,请检查后操作!");
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// /**
|
||||
// * @Description: app微信登陆
|
||||
|
||||
Reference in New Issue
Block a user