测试 用electron + springboot 构建桌面应用
whyczh
2022-04-02 0d2aa00acd554fc657eae6056a4ffb206699f4e3
更新
1个文件已修改
11 ■■■■■ 已修改文件
src/main/java/testElectronJ/TestController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/testElectronJ/TestController.java
@@ -2,10 +2,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFDrawing;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.*;
import org.springframework.web.bind.annotation.*;
import sun.misc.BASE64Decoder;
import testElectronJ.util.ServletUtils;
@@ -156,9 +153,9 @@
                sheet.createRow(rowNumSheet-1);
                sheet.getRow(rowNumSheet-1).createCell(0).setCellValue(picName[i]);
                //rowNum++;
                HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0, 512, 255,(short) 0, rowNumSheet, (short) 10, rowNumSheet+27);
                XSSFClientAnchor anchor = new XSSFClientAnchor(0, 0, 512, 255,(short) 0, rowNumSheet, (short) 10, rowNumSheet+27);
                anchor.setAnchorType(3);
                patriarch.createPicture(anchor,wb.addPicture(bytes.get(picNum),HSSFWorkbook.PICTURE_TYPE_PNG)).resize(1);
                patriarch.createPicture(anchor,wb.addPicture(bytes.get(picNum),XSSFWorkbook.PICTURE_TYPE_PNG)).resize(1);
                picNum ++;
                rowNumSheet+=27;
            }
@@ -209,7 +206,7 @@
            // 转码防止乱码
            resp.addHeader("Content-Disposition", "attachment;filename="
                    + new String(excelName.getBytes("UTF-8"), "ISO8859-1")
                    + ".xls");
                    + ".xlsx");
            OutputStream out = resp.getOutputStream();
            wb.write(out);
            out.close();