|
@@ -356,6 +356,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|
|
public HttpRespMsg savePermission(Integer role, String moduleList) {
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
HttpRespMsg authority = getAuthority(role,user.getCompanyId(), request);
|
|
|
+ SysRole sysRole = sysRoleMapper.selectById(role);
|
|
|
List<SysModule> sysModuleList= (List<SysModule>) authority.data;
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
JSONArray array = JSONArray.parseArray(moduleList);
|
|
@@ -400,12 +401,12 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|
|
sysRoleFunctions.add(fun);
|
|
|
}
|
|
|
sysRoleFunctionService.saveBatch(sysRoleFunctions);
|
|
|
- permissionModificationRecord(sysModuleList,moduleList,user);
|
|
|
+ permissionModificationRecord(sysModuleList,moduleList,user,sysRole);
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
@Async("taskExecutor")
|
|
|
- public void permissionModificationRecord(List<SysModule> oldSysModuleList,String newModuleList,User user){
|
|
|
+ public void permissionModificationRecord(List<SysModule> oldSysModuleList,String newModuleList,User user,SysRole sysRole){
|
|
|
JSONArray array = JSONArray.parseArray(newModuleList);
|
|
|
StringBuilder message=new StringBuilder();
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
@@ -444,6 +445,7 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
|
|
|
}
|
|
|
System.out.println(message.toString());
|
|
|
if(message.length()>0){
|
|
|
+ message.insert(0,"针对角色["+sysRole.getRolename()+"]的权限做了以下操作\n");
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setOperationTime(LocalDateTime.now());
|
|
|
operationRecord.setContent(message.toString());
|