buhuazhen
3 天以前 9050833f2096f16f1a0aa26341287c552af00739
fix(ProductionPrintOrderExcel):没有图片不进行处理
已修改1个文件
28 ■■■■■ 文件已修改
src/main/java/com/ruoyi/basic/excel/ProductionPrintOrderExcel.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/basic/excel/ProductionPrintOrderExcel.java
@@ -132,25 +132,29 @@
            Sheet sheet = workbook.getSheetAt(0);
            // ===== 插入图片 =====
            byte[] imageBytes = printOrderDto.getCuttingImage();
            if(printOrderDto.getCuttingImage() != null){
                byte[] imageBytes = printOrderDto.getCuttingImage();
            int pictureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE_JPEG);
            CreationHelper helper = workbook.getCreationHelper();
            Drawing<?> drawing = sheet.createDrawingPatriarch();
                int pictureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE_JPEG);
                CreationHelper helper = workbook.getCreationHelper();
                Drawing<?> drawing = sheet.createDrawingPatriarch();
            ClientAnchor anchor = helper.createClientAnchor();
            anchor.setCol1(6);  // 第7列(G列)
            anchor.setRow1(7);
            anchor.setDx1(142700); // 向右移动(约半格)
            anchor.setDy1(222700);
                ClientAnchor anchor = helper.createClientAnchor();
                anchor.setCol1(6);  // 第7列(G列)
                anchor.setRow1(7);
                anchor.setDx1(142700); // 向右移动(约半格)
                anchor.setDy1(222700);
            anchor.setCol2(8);  // 宽度终点
            anchor.setRow2(9);  // 高度终点
                anchor.setCol2(8);  // 宽度终点
                anchor.setRow2(9);  // 高度终点
            Picture picture = drawing.createPicture(anchor, pictureIdx);
                Picture picture = drawing.createPicture(anchor, pictureIdx);
//            picture.resize(0.5);
            }
            // 进行合并操作 切料示意图部分
            int startRow = 7;