|  |  |  | 
|---|
|  |  |  | import com.doumee.config.annotation.CloudRequiredPermission; | 
|---|
|  |  |  | import com.doumee.core.annotation.excel.ExcelExporter; | 
|---|
|  |  |  | import com.doumee.core.annotation.pr.PreventRepeat; | 
|---|
|  |  |  | import com.doumee.core.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.core.model.PageData; | 
|---|
|  |  |  | import com.doumee.core.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.ApiResponse; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | import com.doumee.core.utils.Constants; | 
|---|
|  |  |  | import com.doumee.dao.business.model.PlatformWaterGas; | 
|---|
|  |  |  | import com.doumee.dao.business.vo.PlatformWaterGasForExcelVO; | 
|---|
|  |  |  | 
|---|
|  |  |  | public void exportExcel (@RequestBody PageWrap<PlatformWaterGas> pageWrap, HttpServletResponse response,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { | 
|---|
|  |  |  | List<PlatformWaterGas>  waterGasPageData = platformWaterGasService.findPage(pageWrap).getRecords(); | 
|---|
|  |  |  | if(Objects.nonNull(pageWrap.getModel()) | 
|---|
|  |  |  | && Objects.nonNull(pageWrap.getModel().getType()) && !Constants.equalsInteger(pageWrap.getModel().getType(),Constants.TWO)){ | 
|---|
|  |  |  | && Objects.nonNull(pageWrap.getModel().getType()) && !Constants.equalsInteger(pageWrap.getModel().getType(),Constants.TWO)){ | 
|---|
|  |  |  | List<PlatformWaterGasForExcelVO> pageData = new ArrayList<>(); | 
|---|
|  |  |  | for (PlatformWaterGas platformWaterGas:waterGasPageData) { | 
|---|
|  |  |  | PlatformWaterGasForExcelVO platformWaterGasForExcelVO = new PlatformWaterGasForExcelVO(); | 
|---|
|  |  |  | BeanUtils.copyProperties(platformWaterGas,platformWaterGasForExcelVO); | 
|---|
|  |  |  | pageData.add(platformWaterGasForExcelVO); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(PlatformWaterGasForExcelVO.class).export(pageData, Constants.equalsInteger(pageWrap.getModel().getType(),Constants.ZERO)?"月台_用水信息记录表":"月台_用气信息记录表", response); | 
|---|
|  |  |  | String title = "月台_循环烟箱记录表"; | 
|---|
|  |  |  | if(Constants.equalsInteger(pageWrap.getModel().getType(),Constants.ZERO)){ | 
|---|
|  |  |  | title = "月台_用水信息记录表"; | 
|---|
|  |  |  | }else if(Constants.equalsInteger(pageWrap.getModel().getType(),Constants.ONE)){ | 
|---|
|  |  |  | title = "月台_用气信息记录表"; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ExcelExporter.build(PlatformWaterGasForExcelVO.class).export(pageData, title, response); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | ExcelExporter.build(PlatformWaterGas.class).export(waterGasPageData, "月台_油耗信息记录表", response); | 
|---|
|  |  |  | } | 
|---|