| | |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.tms.entity.OutStoreDetail; |
| | | import org.jeecg.modules.tms.entity.vo.OutStoreDetailVo; |
| | |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param outStoreDetail |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:tms_out_store_detail:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, OutStoreDetail outStoreDetail) { |
| | | return super.exportXls(request, outStoreDetail, OutStoreDetail.class, "工具出库流水"); |
| | | public ModelAndView exportXls(HttpServletRequest request) { |
| | | // Step.1 组装查询条件 |
| | | Map<String, String[]> parameterMap = request.getParameterMap(); |
| | | Page<OutStoreDetailVo> page = new Page<>(1, 1000000); |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | // Step.2 获取导出数据 |
| | | IPage<OutStoreDetailVo> pageList = outStoreDetailService.queryPageList(page, parameterMap); |
| | | List<OutStoreDetailVo> exportList = pageList.getRecords(); |
| | | |
| | | // Step.3 AutoPoi 导出Excel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | //此处设置的filename无效 ,前端会重更新设置一下 |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "工具出库流水"); |
| | | mv.addObject(NormalExcelConstants.CLASS, OutStoreDetailVo.class); |
| | | //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- |
| | | ExportParams exportParams=new ExportParams("工具出库流水" + "报表", "导出人:" + sysUser.getRealname(), "工具出库流水"); |
| | | //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- |
| | | mv.addObject(NormalExcelConstants.PARAMS,exportParams); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
| | | return mv; |
| | | } |
| | | |
| | | /** |