| | |
| | | package org.jeecg.modules.mdc.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.mdc.dto.MdcEquipmentDto; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipmentMonitor; |
| | |
| | | import org.jeecg.modules.mdc.vo.MdcEquipmentVo; |
| | | import org.jeecg.modules.system.model.DepartIdModel; |
| | | import org.jeecg.modules.system.model.ProductionIdModel; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MdcEquipment mdcEquipment) { |
| | | return super.exportXls(request, mdcEquipment, MdcEquipment.class, "设备表"); |
| | | // Step.1 组装查询条件 |
| | | QueryWrapper<MdcEquipment> queryWrapper = QueryGenerator.initQueryWrapper(mdcEquipment, request.getParameterMap()); |
| | | //Step.2 AutoPoi 导出Excel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | String selections = request.getParameter("selections"); |
| | | if (!oConvertUtils.isEmpty(selections)) { |
| | | queryWrapper.in("id", selections.split(",")); |
| | | } |
| | | List<MdcEquipment> pageList = mdcEquipmentService.list(queryWrapper); |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, "设备列表"); |
| | | mv.addObject(NormalExcelConstants.CLASS, MdcEquipment.class); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | ExportParams exportParams = new ExportParams("设备列表数据", "导出人:" + user.getRealname(), "导出信息"); |
| | | // exportParams.setImageBasePath(upLoadPath); |
| | | mv.addObject(NormalExcelConstants.PARAMS, exportParams); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, pageList); |
| | | return mv; |
| | | } |
| | | |
| | | /** |