update 修改 操作日志导出 适配easyexcel工具

This commit is contained in:
疯狂的狮子li
2021-08-03 19:29:59 +08:00
parent 89cca8af07
commit da4e080656
4 changed files with 37 additions and 40 deletions

View File

@ -5,18 +5,19 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.poi.ExcelUtils;
import com.ruoyi.system.domain.SysOperLog;
import com.ruoyi.system.service.ISysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 操作日志记录
*
*
* @author ruoyi
*/
@RestController
@ -36,11 +37,12 @@ public class SysOperlogController extends BaseController
@Log(title = "操作日志", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
@GetMapping("/export")
public AjaxResult export(SysOperLog operLog)
public void export(SysOperLog operLog, HttpServletResponse response)
{
List<SysOperLog> list = operLogService.selectOperLogList(operLog);
ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
return util.exportExcel(list, "操作日志");
ExcelUtils.exportExcel(list, "操作日志", SysOperLog.class, response);
// ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
// return util.exportEasyExcel(list, "操作日志");
}
@Log(title = "操作日志", businessType = BusinessType.DELETE)