k94314517
2024-12-31 7522214e0575a64dde5a9e630cbe2cf510d9307d
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/admin/PlatformWaterGasCloudController.java
@@ -87,14 +87,20 @@
    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);
        }