/** * 导出Excle格式的数据 * * @param request * @param response * @param model * @param auditlog * @throws Exception */ @RequestMapping("/list/export") public void listexport( HttpServletRequest request, HttpServletResponse response, Model model, AuditLog auditlog) throws Exception { // ==构造分页请求 Page page = newPage(request); File file = auditlogService.findDataExportExcel(null, listurl, page, AuditLog.class, auditlog); String fileName = "auditlog" + GlobalStatic.excelext; downFile(response, file, fileName, true); return; }
/** 查看的Json格式数据,为APP端提供数据 */ @RequestMapping(value = "/look/json") public @ResponseBody ReturnDatas lookjson( Model model, HttpServletRequest request, HttpServletResponse response) throws Exception { ReturnDatas returnObject = ReturnDatas.getSuccessReturnDatas(); String id = request.getParameter("id"); if (StringUtils.isNotBlank(id)) { AuditLog auditlog = auditlogService.findAuditlogById(id); returnObject.setData(auditlog); } else { returnObject.setStatus(ReturnDatas.ERROR); } return returnObject; }
/** * json数据,为APP提供数据 * * @param request * @param model * @param auditlog * @return * @throws Exception */ @RequestMapping("/list/json") public @ResponseBody ReturnDatas listjson( HttpServletRequest request, Model model, AuditLog auditlog) throws Exception { ReturnDatas returnObject = ReturnDatas.getSuccessReturnDatas(); Page page = newPage(request); page.setOrder("operationTime"); page.setSort("desc"); List<AuditLog> datas = auditlogService.findListDataByFinder(null, page, AuditLog.class, auditlog); returnObject.setQueryBean(auditlog); returnObject.setPage(page); returnObject.setData(datas); return returnObject; }