| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.dto.message.MessageDTO; |
| | | import org.jeecg.common.api.vo.Result; |
| | |
| | | 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.eam.entity.*; |
| | | import org.jeecg.modules.eam.service.*; |
| | | import org.jeecg.modules.eam.vo.RepairReportExportVo; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | private IdentityService sysIdentityService; |
| | | @Autowired |
| | | private IFaultInfoService faultInfoService; |
| | | @Value("${jeecg.path.upload}") |
| | | private String upLoadPath; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return Result.OK("验收成功"); |
| | | } |
| | | /** |
| | | * 导出excel |
| | | * |
| | | * @param request |
| | | * @param equipmentReportRepair |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, RepairReportExportVo equipmentReportRepair) { |
| | | // Step.1 组装查询条件 |
| | | String title = "故障报修导出"; |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | // Step.2 获取导出数据 |
| | | List<RepairReportExportVo> exportList = equipmentReportRepairService.exportList(equipmentReportRepair); |
| | | |
| | | // Step.3 AutoPoi 导出Excel |
| | | ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); |
| | | //此处设置的filename无效 ,前端会重更新设置一下 |
| | | mv.addObject(NormalExcelConstants.FILE_NAME, title); |
| | | mv.addObject(NormalExcelConstants.CLASS, RepairReportExportVo.class); |
| | | //update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置-------------------- |
| | | ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title); |
| | | exportParams.setImageBasePath(upLoadPath); |
| | | //update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置---------------------- |
| | | mv.addObject(NormalExcelConstants.PARAMS,exportParams); |
| | | mv.addObject(NormalExcelConstants.DATA_LIST, exportList); |
| | | return mv; |
| | | } |
| | | } |