|
|
@ -647,9 +647,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
private List<SystemLog> getModifyLogList(SysUser info, SignForm sign){ |
|
|
private List<SystemLog> getModifyLogList(SysUser info, SignForm sign){ |
|
|
SysUser old = selectUserById(info.getUserId()); |
|
|
SysUser old = selectUserById(info.getUserId()); |
|
|
List<Long> oldRoleIdList = roleMapper.selectRoleListByUserId(info.getUserId()); |
|
|
List<Long> oldRoleIdList = roleMapper.selectRoleListByUserId(info.getUserId()); |
|
|
|
|
|
|
|
|
List<SystemLog> list = new ArrayList<>(); |
|
|
List<SystemLog> list = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(old, info); |
|
|
List<ObjectCompareUtil.FieldChange> fieldChanges = ObjectCompareUtil.compareObjects(old, info); |
|
|
for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { |
|
|
for (ObjectCompareUtil.FieldChange fieldChange : fieldChanges) { |
|
|
SystemLog log = getLogInfo(old); |
|
|
SystemLog log = getLogInfo(old); |
|
|
@ -672,7 +670,6 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Department\"},{\"name\":\"Old Value\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"New Value\",\"value\":\""+newDept.getDeptName()+"\"}]"); |
|
|
log.setJcnrEn("[{\"name\":\"Field\",\"value\":\"Department\"},{\"name\":\"Old Value\",\"value\":\""+oldDept.getDeptName()+"\"},{\"name\":\"New Value\",\"value\":\""+newDept.getDeptName()+"\"}]"); |
|
|
list.add(log); |
|
|
list.add(log); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//判断菜单修改 |
|
|
//判断菜单修改 |
|
|
Boolean updateRole = false; |
|
|
Boolean updateRole = false; |
|
|
if(info.getRoleIds().length!=oldRoleIdList.size()){ |
|
|
if(info.getRoleIds().length!=oldRoleIdList.size()){ |
|
|
@ -687,9 +684,7 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
} |
|
|
} |
|
|
if(updateRole){ |
|
|
if(updateRole){ |
|
|
checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); |
|
|
checkPassword(SecurityUtils.getLoginUser().getSysUser(),sign.getQmrmm(),false); |
|
|
|
|
|
|
|
|
List<SysRole> allRoleList = roleMapper.selectRoleList(new SysRole()); |
|
|
List<SysRole> allRoleList = roleMapper.selectRoleList(new SysRole()); |
|
|
|
|
|
|
|
|
List<SysRole> oldRoleList = new ArrayList<>(); |
|
|
List<SysRole> oldRoleList = new ArrayList<>(); |
|
|
List<SysRole> newRoleList = new ArrayList<>(); |
|
|
List<SysRole> newRoleList = new ArrayList<>(); |
|
|
if(info.getRoleIds()!=null && info.getRoleIds().length>0){ |
|
|
if(info.getRoleIds()!=null && info.getRoleIds().length>0){ |
|
|
@ -702,10 +697,8 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
oldRoleList.add(allRoleList.stream().filter(o->o.getRoleId().equals(oldRoleId)).collect(Collectors.toList()).get(0)); |
|
|
oldRoleList.add(allRoleList.stream().filter(o->o.getRoleId().equals(oldRoleId)).collect(Collectors.toList()).get(0)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<String> oldRoleNameList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); |
|
|
List<String> oldRoleNameList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); |
|
|
List<String> bghList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); |
|
|
List<String> bghList = oldRoleList.stream().map(o->o.getRoleName()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
List<String> addNameList = new ArrayList<>(); |
|
|
List<String> addNameList = new ArrayList<>(); |
|
|
List<String> deleteNameList = new ArrayList<>(); |
|
|
List<String> deleteNameList = new ArrayList<>(); |
|
|
for(SysRole newRole : newRoleList){ |
|
|
for(SysRole newRole : newRoleList){ |
|
|
@ -714,7 +707,6 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
bghList.add(newRole.getRoleName()); |
|
|
bghList.add(newRole.getRoleName()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
List<Long> newMenuIdList = Arrays.asList(info.getRoleIds()); |
|
|
List<Long> newMenuIdList = Arrays.asList(info.getRoleIds()); |
|
|
for(SysRole oldRole : oldRoleList){ |
|
|
for(SysRole oldRole : oldRoleList){ |
|
|
if(!newMenuIdList.contains(oldRole.getRoleId())){ |
|
|
if(!newMenuIdList.contains(oldRole.getRoleId())){ |
|
|
@ -722,7 +714,6 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
bghList.remove(oldRole.getRoleName()); |
|
|
bghList.remove(oldRole.getRoleName()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(addNameList.size()>0 || deleteNameList.size()>0){ |
|
|
if(addNameList.size()>0 || deleteNameList.size()>0){ |
|
|
SystemLog log = getLogInfo(old); |
|
|
SystemLog log = getLogInfo(old); |
|
|
log.setJcnr((addNameList.size()>0?("新增角色:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";删除角色:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";备注:"+sign.getRemark())); |
|
|
log.setJcnr((addNameList.size()>0?("新增角色:"+String.join(",",addNameList)):"")+(deleteNameList.size()>0?(";删除角色:"+String.join(",",deleteNameList)):"")+(StringUtils.isBlank(sign.getRemark())?"":";备注:"+sign.getRemark())); |
|
|
@ -731,7 +722,6 @@ public class SysUserServiceImpl implements ISysUserService |
|
|
} |
|
|
} |
|
|
roleChangeService.saveInfo(info.getUserId(),String.join(",",oldRoleNameList),String.join(",",bghList),sign.getRemark()); |
|
|
roleChangeService.saveInfo(info.getUserId(),String.join(",",oldRoleNameList),String.join(",",bghList),sign.getRemark()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return list; |
|
|
return list; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|