|
@@ -32,6 +32,7 @@ import shop.alien.storeplatform.dto.UpdateRoleDto;
|
|
|
import shop.alien.storeplatform.service.PlatformOperationLogService;
|
|
import shop.alien.storeplatform.service.PlatformOperationLogService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import shop.alien.storeplatform.service.StorePlatformRoleMenuService;
|
|
import shop.alien.storeplatform.service.StorePlatformRoleMenuService;
|
|
|
|
|
+import shop.alien.storeplatform.service.StorePlatformRoleQueryService;
|
|
|
import shop.alien.storeplatform.service.StorePlatformRoleService;
|
|
import shop.alien.storeplatform.service.StorePlatformRoleService;
|
|
|
import shop.alien.storeplatform.util.LoginUserUtil;
|
|
import shop.alien.storeplatform.util.LoginUserUtil;
|
|
|
|
|
|
|
@@ -60,6 +61,7 @@ public class PlatformOperationLogAspect {
|
|
|
private final StorePlatformRoleMenuService storePlatformRoleMenuService;
|
|
private final StorePlatformRoleMenuService storePlatformRoleMenuService;
|
|
|
private final StorePlatformMenuMapper storePlatformMenuMapper;
|
|
private final StorePlatformMenuMapper storePlatformMenuMapper;
|
|
|
private final StoreUserMapper storeUserMapper;
|
|
private final StoreUserMapper storeUserMapper;
|
|
|
|
|
+ private final StorePlatformRoleQueryService storePlatformRoleQueryService;
|
|
|
private final SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
|
|
private final SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
|
|
|
private final DefaultParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
|
|
private final DefaultParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();
|
|
|
private final TemplateParserContext templateParserContext = new TemplateParserContext("#{", "}");
|
|
private final TemplateParserContext templateParserContext = new TemplateParserContext("#{", "}");
|
|
@@ -227,7 +229,7 @@ public class PlatformOperationLogAspect {
|
|
|
|
|
|
|
|
String accountName = resolveAccountName(userId);
|
|
String accountName = resolveAccountName(userId);
|
|
|
String roleName = resolveRoleName(roleId);
|
|
String roleName = resolveRoleName(roleId);
|
|
|
- return String.format("移除用户%s的角色%s", accountName, roleName);
|
|
|
|
|
|
|
+ return String.format("移除用户%s的%s角色", accountName, roleName);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String resolveAccountName(Integer userId) {
|
|
private String resolveAccountName(Integer userId) {
|
|
@@ -246,11 +248,11 @@ public class PlatformOperationLogAspect {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String resolveRoleName(Long roleId) {
|
|
private String resolveRoleName(Long roleId) {
|
|
|
- StorePlatformRole role = storePlatformRoleService.getRoleById(roleId);
|
|
|
|
|
- if (role == null || !StringUtils.hasText(role.getRoleName())) {
|
|
|
|
|
|
|
+ String roleName = storePlatformRoleQueryService.getRoleNameById(roleId);
|
|
|
|
|
+ if (!StringUtils.hasText(roleName)) {
|
|
|
return "未知";
|
|
return "未知";
|
|
|
}
|
|
}
|
|
|
- return role.getRoleName();
|
|
|
|
|
|
|
+ return roleName;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String buildParamsJson(String[] parameterNames, Object[] args) {
|
|
private String buildParamsJson(String[] parameterNames, Object[] args) {
|
|
@@ -298,10 +300,7 @@ public class PlatformOperationLogAspect {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ((roleName == null || roleName.trim().isEmpty()) && roleId != null) {
|
|
if ((roleName == null || roleName.trim().isEmpty()) && roleId != null) {
|
|
|
- StorePlatformRole role = storePlatformRoleService.getRoleById(roleId);
|
|
|
|
|
- if (role != null) {
|
|
|
|
|
- roleName = role.getRoleName();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ roleName = resolveRoleName(roleId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ((menuIds == null || menuIds.isEmpty()) && roleId != null) {
|
|
if ((menuIds == null || menuIds.isEmpty()) && roleId != null) {
|