|
@@ -240,7 +240,10 @@ public class AppInstructorController extends JeecgController<AppInstructor, IApp
|
|
|
if (departById==null){
|
|
|
return Result.error("未查询到部门信息");
|
|
|
}
|
|
|
- SysUser sysUserByid = sysUserService.findById(staffVO.getStaffId());
|
|
|
+ SysUser sysUserById = sysUserService.findById(staffVO.getStaffId());
|
|
|
+ if (sysUserById==null){
|
|
|
+ return Result.error("编辑失败!未查询到需要编辑的员工信息。");
|
|
|
+ }
|
|
|
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
SysUser sysUser = new SysUser();
|
|
|
BeanUtils.copyProperties(staffSaveVO,sysUser);
|
|
@@ -248,7 +251,10 @@ public class AppInstructorController extends JeecgController<AppInstructor, IApp
|
|
|
sysUser.setOrgCode(departById.getOrgCode());
|
|
|
sysUser.setUpdateBy(loginUser.getUsername());
|
|
|
sysUser.setUpdateTime(new Date());
|
|
|
- String passwordEncode = PasswordUtil.encrypt(sysUserByid.getUsername(), staffSaveVO.getPassword(), sysUserByid.getSalt());
|
|
|
+ String passwordEncode =sysUserById.getPassword();
|
|
|
+ if (StringUtils.isNotEmpty(staffSaveVO.getPassword())){
|
|
|
+ passwordEncode = PasswordUtil.encrypt(sysUserById.getUsername(), staffSaveVO.getPassword(), sysUserById.getSalt());
|
|
|
+ }
|
|
|
sysUser.setPassword(passwordEncode);
|
|
|
sysUserService.editUser(sysUser, staffSaveVO.getSelectedroles(), staffSaveVO.getSelecteddeparts(), null, null);
|
|
|
boolean fal=StringUtils.isNotEmpty(staffVO.getInstructorId());
|