whyclxw
2022-01-11 de1441bcd925e7a6272ee6d4d99cc890947b9849
在线监测-实时监控-导出图表
1个文件已修改
29 ■■■■ 已修改文件
src/main/java/com/whyc/service/EchartPictureDowloadService.java 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/EchartPictureDowloadService.java
@@ -29,6 +29,7 @@
    
    private List<byte[]> bytes;
    private String excelName = "Echarts";
    private int rowNumAdd=27;
    //文件导出
    public void exportExcel( HttpServletRequest req, HttpServletResponse resp) {
@@ -309,20 +310,20 @@
            sheet1.createRow(rownum);
            sheet1.getRow(rownum).createCell(1).setCellValue( "报告日期:");
            sheet1.getRow(rownum).createCell(2).setCellValue(formartDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
            rownum+=2;
            rownum+=4;
            int picnum = 0;
            String[] picName = new String[]{
                    "单体电压曲线图","端电压曲线图","单体电流曲线图","单体实际容量柱状图"
            };
            for(int i=0;i<picName.length;i++){
                sheet1.createRow(rownum);
                sheet1.getRow(rownum).createCell(1).setCellValue(picName[i]);
                sheet1.createRow(rownum-1);
                sheet1.getRow(rownum-1).createCell(1).setCellValue(picName[i]);
                //rownum++;
                HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 1, rownum, (short) 10, 25 * (picnum + 1));
                HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 1, rownum, (short) 10, rowNumAdd * (picnum + 1));
                anchor.setAnchorType(3);
                patriarch.createPicture(anchor,wb.addPicture(bytes.get(picnum),HSSFWorkbook.PICTURE_TYPE_PNG)).resize(1);
                picnum ++;rownum+=27;
                picnum ++;rownum+=rowNumAdd;
            }
            createNewLD9DataSheet(wb,montestdata);
@@ -877,18 +878,18 @@
            sheet1.createRow(rownum);
            sheet1.getRow(rownum).createCell(1).setCellValue( "报告日期:");
            sheet1.getRow(rownum).createCell(2).setCellValue(formartDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
            rownum+=2;
            rownum+=4;
            int picnum = 0;
            for(int i=0;i<picName.length;i++){
                sheet1.createRow(rownum);
                sheet1.getRow(rownum).createCell(1).setCellValue(picName[i]);
                sheet1.createRow(rownum-1);
                sheet1.getRow(rownum-1).createCell(1).setCellValue(picName[i]);
                //rownum++;
                HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 1, rownum, (short) 10, 25 * (picnum + 1));
                HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 1, rownum, (short) 10, rowNumAdd * (picnum + 1));
                anchor.setAnchorType(3);
                patriarch.createPicture(anchor,wb.addPicture(bytes.get(picnum),HSSFWorkbook.PICTURE_TYPE_PNG)).resize(1);
                picnum ++;rownum+=27;
                picnum ++;rownum+=rowNumAdd;
            }
            /*sheet1.createRow(rownum);
@@ -1140,13 +1141,13 @@
                "节约电费统计折线图","电价分布图"
        };
        for(int i=0;i<picName.length;i++){
            sheet.createRow(rowNum);
            sheet.getRow(rowNum).createCell(0).setCellValue(picName[i]);
            sheet.createRow(rowNum-1);
            sheet.getRow(rowNum-1).createCell(0).setCellValue(picName[i]);
            //rowNum++;
            HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 0, rowNum, (short) 10, rowNum+25);
            HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 0, rowNum, (short) 10, rowNum+rowNumAdd);
            anchor.setAnchorType(3);
            patriarch.createPicture(anchor,wb.addPicture(bytes.get(picNum),HSSFWorkbook.PICTURE_TYPE_PNG)).resize(1);
            picNum ++;rowNum+=27;
            picNum ++;rowNum+=rowNumAdd;
        }
        rowNum++;