Commit 231dcee3 authored by xc's avatar xc

登录bug修复,增加字段联合查询导致的

parent 7bafc6c6
......@@ -177,6 +177,5 @@
<orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-features:1.7.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -91,6 +91,7 @@
<where>
<if test="phone != null and phone !=''">and phone = #{phone}</if>
<if test="is_delete != null and is_delete !=''">and is_delete = #{is_delete}</if>
<if test="vip_mobile != null and vip_mobile !=''">and vip_mobile = #{vip_mobile}</if>
</where>
</select>
......
......@@ -178,6 +178,5 @@
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-features:1.7.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -176,6 +176,5 @@
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-features:1.7.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -84,7 +84,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
}
//1、根据userId获取用户信息
User user = usersMapper.selectById(queryVo.getUserId());
User user = usersMapper.getById(queryVo.getUserId());
if (null == user) {
return R.error("用户信息不存在!");
}
......@@ -405,7 +405,7 @@ public class SchemeServiceImpl extends ServiceImpl<SchemeMapper, SchemeInfo> imp
List<String> locals = StringUtil.strToArrayStr(schemeVo.getLocal());
//1、根据userId获取用户信息
User user = usersMapper.selectById(schemeVo.getUserId());
User user = usersMapper.getById(schemeVo.getUserId());
if (null == user) {
return R.error("请先添加vip客户信息!");
}
......
......@@ -272,7 +272,7 @@ public class StaffUserVipServiceImpl extends ServiceImpl<LocalMapper, Local> imp
user.setUpdateTime(new Date());
user.setUserName(staffAddDto.getUserName());
user.setVipMobile(staffAddDto.getVipMobile());
int addUser=usersMapper.insert(user);
int addUser=usersMapper.add(user);
if(addUser == 0){
return R.error("添加失败");
}
......@@ -335,9 +335,9 @@ public class StaffUserVipServiceImpl extends ServiceImpl<LocalMapper, Local> imp
public boolean getUserInfo(String vipMobile){
QueryWrapper<User> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("vip_mobile",vipMobile);
User user = usersMapper.selectOne(objectQueryWrapper);
Map<String, Object> map = new HashMap<>(16);
map.put("vip_mobile",vipMobile);
User user = usersMapper.selectOne(map);
if(null == user){
return true;
}
......
......@@ -201,10 +201,10 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
@Override
public R<UserInfoVo> loginTest(UserLoginVo userLoginVo, HttpServletRequest request) throws Exception {
//1、根据手机号,获取用户信息
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("phone", userLoginVo.getPhone());
queryWrapper.eq("is_delete", 0);
User user = usersMapper.selectOne(queryWrapper);
Map<String, Object> map = new HashMap<>(16);
map.put("phone", userLoginVo.getPhone());
map.put("is_delete", 0);
User user = usersMapper.selectOne(map);
Subject subject = SecurityUtils.getSubject();
String credentialsSalt = Md5Util.digestMD5(userLoginVo.getPassword() + userLoginVo.getPhone());
......@@ -258,7 +258,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
//1、获取用户信息
User user = usersMapper.selectById(updateVo.getUserId());
User user = usersMapper.getById(updateVo.getUserId());
if (null == user) {
return R.error("用户信息不存在,无法修改密码!");
}
......@@ -287,7 +287,7 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
}
//获取用户信息
User user = usersMapper.selectById(userId);
User user = usersMapper.getById(userId);
//加密重置密码
String password = Md5Util.digestMD5(Common.RESET_PASSWORD_VALUE + user.getPhone());
......@@ -360,10 +360,10 @@ public class UserLoginServiceImpl extends ServiceImpl<UsersMapper, User> impleme
//1、注册-新增
if (null == userId) {
//根据电话号码查询用户
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("phone", phone);
queryWrapper.eq("is_delete", 0);
User user = usersMapper.selectOne(queryWrapper);
Map<String, Object> map = new HashMap<>(16);
map.put("phone", phone);
map.put("is_delete", 0);
User user = usersMapper.selectOne(map);
if (null != user) {
return false;
}
......
......@@ -143,7 +143,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
userInfo.setUserName(userInfo.getUserName().replace(" ",""));
//1、根据用户id,获取用户信息
User user = usersMapper.selectById(userInfo.getUserId());
User user = usersMapper.getById(userInfo.getUserId());
if (null == user) {
return R.error("用户信息不存在!");
}
......@@ -201,7 +201,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
userDto.setUserName(userDto.getUserName().replace(" ",""));
//1、根据用户id,获取用户信息
User user = usersMapper.selectById(userDto.getUserId());
User user = usersMapper.getById(userDto.getUserId());
if (null == user) {
return R.error("用户信息不存在!");
}
......@@ -254,7 +254,7 @@ public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements U
}
//根据id,获取用户信息
User user = usersMapper.selectById(id);
User user = usersMapper.getById(id);
if (null == user) {
return R.error("用户信息不存在!");
}
......
......@@ -22,7 +22,9 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Component
......@@ -68,10 +70,10 @@ public class UserVipManager {
public User checkPhone(String phone) {
//根据电话号码查询用户
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("phone", phone);
queryWrapper.eq("is_delete", 0);
User user = usersMapper.selectOne(queryWrapper);
Map<String, Object> map = new HashMap<>(16);
map.put("phone", phone);
map.put("is_delete", 0);
User user = usersMapper.selectOne(map);
if (null != user) {
return user;
}
......
......@@ -214,6 +214,5 @@
<orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-features:1.7.1" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -216,6 +216,5 @@
<orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.6.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-features:1.7.1" level="project" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment