|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
package com.elink.esua.epdc.user.service.impl; |
|
|
package com.elink.esua.epdc.user.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
@ -283,7 +284,7 @@ public class UserDjylServiceImpl extends BaseServiceImpl<UserDjylDao, UserDjylEn |
|
|
if (null != entity) { |
|
|
if (null != entity) { |
|
|
if (!PasswordUtils.matches(userDTO.getOldPassword(), entity.getPassword())) { |
|
|
if (!PasswordUtils.matches(userDTO.getOldPassword(), entity.getPassword())) { |
|
|
return new Result<>().error(-1, "请确认旧密码是否正确!"); |
|
|
return new Result<>().error(-1, "请确认旧密码是否正确!"); |
|
|
}else { |
|
|
} else { |
|
|
entity.setPassword(PasswordUtils.encode(userDTO.getNewPassword())); |
|
|
entity.setPassword(PasswordUtils.encode(userDTO.getNewPassword())); |
|
|
baseDao.updateById(entity); |
|
|
baseDao.updateById(entity); |
|
|
return new Result().ok("密码修改成功!"); |
|
|
return new Result().ok("密码修改成功!"); |
|
@ -295,6 +296,24 @@ public class UserDjylServiceImpl extends BaseServiceImpl<UserDjylDao, UserDjylEn |
|
|
return new Result().error(-1, "请确认参数是否正确,或重新登陆后修改"); |
|
|
return new Result().error(-1, "请确认参数是否正确,或重新登陆后修改"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result forgotPwd(UserDTO userDTO) { |
|
|
|
|
|
if (StringUtils.isNotEmpty(userDTO.getIdentityNo()) && StringUtils.isNotEmpty(userDTO.getMobile())) { |
|
|
|
|
|
List<UserDTO> dtoList = baseDao.selectByMobileAndIdentityNo(userDTO.getMobile(), userDTO.getIdentityNo()); |
|
|
|
|
|
UserDjylEntity entity = null; |
|
|
|
|
|
if (CollectionUtil.isNotEmpty(dtoList)) { |
|
|
|
|
|
entity = ConvertUtils.sourceToTarget(dtoList.get(0), UserDjylEntity.class); |
|
|
|
|
|
} |
|
|
|
|
|
if (null != entity) { |
|
|
|
|
|
entity.setPassword(PasswordUtils.encode(userDTO.getNewPassword())); |
|
|
|
|
|
baseDao.updateById(entity); |
|
|
|
|
|
} else { |
|
|
|
|
|
return new Result().error(-1, "请确认是否注册过该账号,或联系管理员!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return new Result().ok("密码已修改,请重新登陆!"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用户网格关系表,更新最后访问网格的时间 |
|
|
* 用户网格关系表,更新最后访问网格的时间 |
|
|
* |
|
|
* |
|
|