|
@@ -1,12 +1,15 @@
|
|
|
package com.fdkankan.manage.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.fdkankan.manage.common.PageInfo;
|
|
|
import com.fdkankan.manage.common.ResultData;
|
|
|
-import com.fdkankan.manage.service.OperLogService;
|
|
|
+import com.fdkankan.manage.entity.SysLog;
|
|
|
+import com.fdkankan.manage.service.ISysLogService;
|
|
|
import com.fdkankan.manage.vo.OperLogPageParamVO;
|
|
|
-import com.fdkankan.mongodb.base.MongoPageResult;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -19,14 +22,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/service/manage/operLog")
|
|
|
public class OperLogController {
|
|
|
|
|
|
- @Autowired
|
|
|
- MongoTemplate mongoTemplate;
|
|
|
|
|
|
@Autowired
|
|
|
RedisUtil redisUtil;
|
|
|
|
|
|
@Autowired
|
|
|
- private OperLogService operLogService;
|
|
|
+ private ISysLogService sysLogService;
|
|
|
|
|
|
/**
|
|
|
* 操作日志列表
|
|
@@ -36,9 +37,20 @@ public class OperLogController {
|
|
|
@PostMapping("/pageOperLog")
|
|
|
public ResultData pageOperLog(@RequestBody OperLogPageParamVO param){
|
|
|
|
|
|
- MongoPageResult mongoPageResult = operLogService.pageOperLog(param);
|
|
|
-
|
|
|
- return ResultData.ok(mongoPageResult);
|
|
|
+ LambdaQueryWrapper<SysLog> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ if(StringUtils.isNotBlank(param.getNickName())){
|
|
|
+ wrapper.like(SysLog::getNickName,param.getNickName());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(param.getUserName())){
|
|
|
+ wrapper.like(SysLog::getUserName,param.getUserName());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotBlank(param.getStartTime())){
|
|
|
+ wrapper.between(SysLog::getCreateTime,param.getStartTime(),param.getEndTime());
|
|
|
+ }
|
|
|
+ wrapper.orderByDesc(SysLog::getCreateTime);
|
|
|
+ Page<SysLog> page = sysLogService.page(new Page<>(param.getPageNum(), param.getPageSize()), wrapper);
|
|
|
+
|
|
|
+ return ResultData.ok(PageInfo.PageInfo(page));
|
|
|
|
|
|
}
|
|
|
|