提交 3d2cf179 authored 作者: gongwenjie's avatar gongwenjie

考勤

上级 661bce4b
......@@ -127,5 +127,16 @@ public class UserController {
return ok(iUserService.deleteRoot());
}
@ApiOperation(value = "重置密码")
@GetMapping("/replacePass/{id}")
public ResponseEntity replacePass(@PathVariable String id) {
boolean flag = iUserService.replacePass(id);
if(flag){
return ok("重置密码成功");
}
return ok("重置密码失败");
}
}
......@@ -146,4 +146,11 @@ public interface IUserService {
* @return
*/
boolean findUsersByDepartmentAndAuthority(String userId, String departmentId);
/**
* 重置密码
* @param id
* @return
*/
boolean replacePass(String id);
}
......@@ -550,6 +550,23 @@ public class UserServiceImpl implements IUserService {
return false;
}
/**
* 重置密码
* @param id
* @return
*/
@Override
@Transactional
public boolean replacePass(String id) {
Optional<User> optional = pasUserDao.findById(id);
if(optional.isPresent()){
User user = optional.get();
user.setPassword(bCryptPasswordEncoder.encode("qwer1234"));
return true;
}
return false;
}
/**
* 查询所有上级部门
* @param departIds 需要传入的用户部门集合
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论