|
@@ -28,6 +28,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
import org.springblade.business.wrapper.OperationLogWrapper;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
+import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
@@ -59,6 +60,8 @@ public class OperationLogController extends BladeController {
|
|
|
|
|
|
private final IDictBizClient dictBizClient;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 获取操作类型
|
|
|
*/
|
|
@@ -123,7 +126,21 @@ public class OperationLogController extends BladeController {
|
|
|
if ("".equals(operationLog.getOperationMedium())) {
|
|
|
operationLog.setOperationMedium(null);
|
|
|
}
|
|
|
- operationLog.setCreateUser(AuthUtil.getUserId());
|
|
|
+ //判断当前用户是否是超级管理员
|
|
|
+ Long adminId = operationLogService.getAdminId();
|
|
|
+ BladeUser user = AuthUtil.getUser();
|
|
|
+ if (user.getRoleId().contains(adminId+"")){
|
|
|
+// //超级管理员
|
|
|
+// if (operationLog.getCreateUser() == null){
|
|
|
+// operationLog.setCreateUser(AuthUtil.getUserId());
|
|
|
+// }
|
|
|
+ }else {
|
|
|
+ if (operationLog.getCreateUser() != null){
|
|
|
+ return R.fail("只有超级管理员才能搜索用户操作日志");
|
|
|
+ }
|
|
|
+ operationLog.setCreateUser(AuthUtil.getUserId());
|
|
|
+ }
|
|
|
+
|
|
|
QueryWrapper<OperationLog> wrapper = Condition.getQueryWrapper(operationLog);
|
|
|
if (StringUtils.isNotEmpty(operationLog.getStartTime()) && StringUtils.isNotEmpty(operationLog.getEndTime())) {
|
|
|
String endTime = operationLog.getEndTime();
|
|
@@ -138,6 +155,8 @@ public class OperationLogController extends BladeController {
|
|
|
wrapper.lambda().like(OperationLog::getOperationContent, operationLog.getQueryValue());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
IPage<OperationLog> pages = operationLogService.page(Condition.getPage(query), wrapper.lambda().orderBy(true, false, OperationLog::getCreateTime));
|
|
|
|
|
|
//获取业务字典
|