|
@ -3,6 +3,7 @@ package org.jeecg.modules.alUser.service.impl; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
import org.hibernate.cache.spi.support.CollectionNonStrictReadWriteAccess; |
|
|
import org.jeecg.common.api.vo.Result; |
|
|
import org.jeecg.common.api.vo.Result; |
|
|
import org.jeecg.common.constant.CommonConstant; |
|
|
import org.jeecg.common.constant.CommonConstant; |
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
@ -80,7 +81,7 @@ public class UserServiceImpl implements UserService { |
|
|
result.error500("手机验证码错误"); |
|
|
result.error500("手机验证码错误"); |
|
|
} |
|
|
} |
|
|
if (!smscode.equals(code)) { |
|
|
if (!smscode.equals(code)) { |
|
|
result.setMessage("手机验证码错误"); |
|
|
|
|
|
|
|
|
result.error500("手机验证码错误"); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
redisUtil.del(CommonConstant.PHONE_CODE + username); |
|
|
redisUtil.del(CommonConstant.PHONE_CODE + username); |
|
@ -97,7 +98,20 @@ public class UserServiceImpl implements UserService { |
|
|
JSONObject obj = new JSONObject(); |
|
|
JSONObject obj = new JSONObject(); |
|
|
obj.put("token", token); |
|
|
obj.put("token", token); |
|
|
obj.put("userInfo", one); |
|
|
obj.put("userInfo", one); |
|
|
|
|
|
LambdaQueryWrapper<TbUserRole> objectLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
objectLambdaQueryWrapper.eq(TbUserRole::getUserId,one.getId()). |
|
|
|
|
|
eq(TbUserRole::getRole,0).eq(TbUserRole::getAuditStatus,1); |
|
|
|
|
|
TbUserRole cg= tbUserRoleService.getOne(objectLambdaQueryWrapper); |
|
|
|
|
|
LambdaQueryWrapper<TbUserRole> queryWrapper1 = new LambdaQueryWrapper<>(); |
|
|
|
|
|
queryWrapper1.eq(TbUserRole::getUserId,one.getId()). |
|
|
|
|
|
eq(TbUserRole::getRole,1).eq(TbUserRole::getAuditStatus,1); |
|
|
|
|
|
TbUserRole shop= tbUserRoleService.getOne(queryWrapper1); |
|
|
|
|
|
// 返回采购商身份信息 |
|
|
|
|
|
obj.put("buy", cg); |
|
|
|
|
|
// 返回供应商身份信息 |
|
|
|
|
|
obj.put("shop", shop); |
|
|
result.setResult(obj); |
|
|
result.setResult(obj); |
|
|
|
|
|
result.setCode(CommonConstant.SC_OK_200); |
|
|
result.success("登录成功"); |
|
|
result.success("登录成功"); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
@ -133,6 +147,7 @@ public class UserServiceImpl implements UserService { |
|
|
obj.put("token", token); |
|
|
obj.put("token", token); |
|
|
obj.put("userInfo", newUser); |
|
|
obj.put("userInfo", newUser); |
|
|
result.setResult(obj); |
|
|
result.setResult(obj); |
|
|
|
|
|
result.setCode(CommonConstant.SC_OK_200); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -155,6 +170,8 @@ public class UserServiceImpl implements UserService { |
|
|
result.error500("用户名或密码错误"); |
|
|
result.error500("用户名或密码错误"); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
//getAuditStatus 0审核中 1 审核通过 2审核未通过 |
|
|
|
|
|
|
|
|
LambdaQueryWrapper<TbUserRole> objectLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<TbUserRole> objectLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
objectLambdaQueryWrapper.eq(TbUserRole::getUserName,reqUserRole.getUserName()). |
|
|
objectLambdaQueryWrapper.eq(TbUserRole::getUserName,reqUserRole.getUserName()). |
|
|
eq(TbUserRole::getRole,reqUserRole.getRole()).in(TbUserRole::getAuditStatus,1,0); |
|
|
eq(TbUserRole::getRole,reqUserRole.getRole()).in(TbUserRole::getAuditStatus,1,0); |
|
@ -173,6 +190,7 @@ public class UserServiceImpl implements UserService { |
|
|
JSONObject obj = new JSONObject(); |
|
|
JSONObject obj = new JSONObject(); |
|
|
obj.put("role", tbUserRole); |
|
|
obj.put("role", tbUserRole); |
|
|
result.setResult(obj); |
|
|
result.setResult(obj); |
|
|
|
|
|
result.setCode(CommonConstant.SC_OK_200); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|