From 2f1ae9c10a1751438d09b3d848677deb883631aa Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期三, 14 一月 2026 11:28:16 +0800
Subject: [PATCH] 修改了对应代码

---
 archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java                  |   16 +
 ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java           |   58 +++++---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java               |   25 ++-
 archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoMid.java                |   81 +++++++++++
 archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java               |    7 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java    |   77 ++++++++++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java |   10 
 archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVo.java                   |    2 
 archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java                     |   85 ++++++++++-
 archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java       |   31 ++++
 10 files changed, 328 insertions(+), 64 deletions(-)

diff --git a/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVo.java b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVo.java
index d81dd38..a57d577 100644
--- a/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVo.java
+++ b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVo.java
@@ -44,6 +44,8 @@
     private String publicity;
 
 
+    private String fileStyle;
+    private String retentionPeriod;
 
 //    @Excel(name = "鍥剧墖", cellType = Excel.ColumnType.IMAGE)
 //    private String url;
diff --git a/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoMid.java b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoMid.java
new file mode 100644
index 0000000..226381e
--- /dev/null
+++ b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoMid.java
@@ -0,0 +1,81 @@
+package com.ruoyi.domain.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import org.apache.poi.ss.usermodel.IndexedColors;
+
+import java.util.Date;
+@Data
+public class DocumentMaterialsVoMid {
+
+
+    @Excel(name="搴忓彿", height = 10,width=8,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
+    private Long num;
+    @Excel(name = "鏂囦欢缂栧彿", height = 10, width=8,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String documentNumber;
+    @Excel(name = "璐d换鑰�", height = 10, width=8,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String creator;
+    @Excel(name = "鏂囦欢棰樺悕", height = 8,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
+
+    private String title;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+
+    @Excel(name = "鏃ユ湡", width = 10, dateFormat = "yyyy-MM-dd", height = 10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+
+    private Date date;
+    // 椤靛彿锛堝師濮嬫暟鍊硷紝鐢ㄤ簬璁$畻锛�
+    private Long pageNumber;
+
+
+    // 鏍煎紡鍖栧悗鐨勯〉鍙凤紝鐢ㄤ簬鏄剧ず鑼冨洿锛屽"38-38"鎴�"23-38"
+    @TableField(exist = false)
+    @Excel(name = "椤靛彿", height = 10,width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
+    private String pageNumberFormatted;
+
+
+
+    @Excel(name = "鏉愭枡绫诲瀷", width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
+
+    private String fileStyle;
+
+
+    /** $column.columnComment */
+    @Excel(name = "鎵�澶勯樁娈�", width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
+    private String stage;
+
+    /** $column.columnComment */
+    @Excel(name = "鍏紑灞炴��", height = 10,width=10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String publicity;
+
+
+    /** $column.columnComment */
+    @Excel(name = "鏄惁涓洪檮浠堕檮鍥�", width = 10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String isAttachment;
+
+    /** $column.columnComment */
+//    @Excel(name = "鏄惁涓洪檮鍥�")
+    private String isDiagram;
+
+    /** $column.columnComment */
+    @Excel(name = "淇濈鏈熼檺", width = 10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String retentionPeriod;
+
+    /** $column.columnComment */
+    @Excel(name = "瀵嗙骇", width = 10,headerColor = IndexedColors.BLACK,readConverterExp = "璇ラ〉鍙﹀瓨=鏅��,鏅��=鏅��,鍐呴儴鐢ㄥ浘=鍐呴儴鐢ㄥ浘,鍐呴儴鐢ㄩ��=鍐呴儴鐢ㄩ��,绉樺瘑=绉樺瘑", headerBackgroundColor = IndexedColors.WHITE)
+    private String securityLevel;
+
+    /** $column.columnComment */
+    @Excel(name = "鏄惁娑夊瘑鍙婃晱鎰熶俊鎭�",headerColor = IndexedColors.BLACK, width = 10, headerBackgroundColor = IndexedColors.WHITE)
+    private String isSensitive;
+
+    /** $column.columnComment */
+    @Excel(name = "鏄惁娉ㄩ攢" ,headerColor = IndexedColors.BLACK,width = 10, headerBackgroundColor = IndexedColors.WHITE)
+    private String isCanceled;
+
+    @Excel(name = "澶囨敞", height = 20,width=10,headerColor = IndexedColors.BLACK, headerBackgroundColor = IndexedColors.WHITE)
+    private String remarks;
+   // private String retentionPeriod;
+}
diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
index 25583c0..2e4fce8 100644
--- a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
+++ b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
@@ -2,10 +2,7 @@
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.domain.DocumentMaterials;
-import com.ruoyi.domain.vo.DocumentMaterialFileStyle;
-import com.ruoyi.domain.vo.DocumentMaterialsFileList;
-import com.ruoyi.domain.vo.DocumentMaterialsVo;
-import com.ruoyi.domain.vo.DocumentMaterialsVoLarge;
+import com.ruoyi.domain.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -37,13 +34,20 @@
 
     //鏌ヨ鍗峰唴鐩綍
     @Select(
-            "select ROW_NUMBER() OVER (ORDER BY page_number) AS num, document_number, creator,title, date, page_number,dm.remarks, ar.record_id, publicity from document_materials as dm, archive_records as ar \n" +
+            "select ROW_NUMBER() OVER (ORDER BY page_number) AS num, document_number, creator,title, date, page_number,dm.remarks, ar.record_id, publicity, file_style, dm.retention_period from document_materials as dm, archive_records as ar \n" +
             "            WHERE ar.id = dm.record_id and page_number  IN (\n" +
             "            SELECT MIN(page_number)\n" +
             "            FROM document_materials where record_id=#{recordId}\n" +
             "             GROUP BY stage, title) and ar.id =#{recordId} order by page_number ;")
     List<DocumentMaterialsVo> getArchiveMatInfo(@Param("recordId") int recordId);
-
+    //鏌ヨ鍗峰唴鐩綍鐨勮缁嗕俊鎭�
+    @Select(
+            "select ROW_NUMBER() OVER (ORDER BY page_number) AS num, document_number, creator,title, date, page_number, publicity, file_style, stage,is_attachment,is_diagram, dm.retention_period,is_sensitive,is_canceled,dm.remarks from document_materials as dm, archive_records as ar \n" +
+                    "            WHERE ar.id = dm.record_id and page_number  IN (\n" +
+                    "            SELECT MIN(page_number)\n" +
+                    "            FROM document_materials where record_id=#{recordId}\n" +
+                    "             GROUP BY stage, title) and ar.id =#{recordId} order by page_number ;")
+    List<DocumentMaterialsVoMid> getArchiveMatInfoAll(@Param("recordId") int recordId);
 
     @Select(  "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,ar.record_id, file_number, \n" +
             "            document_number, creator, title, date, page_number, page_order, \n" +
diff --git a/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java b/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java
index 246f914..8600714 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/IDocumentMaterialsService.java
@@ -4,10 +4,7 @@
 import com.ruoyi.domain.ArchiveRecords;
 import com.ruoyi.domain.Archiverecordstouser;
 import com.ruoyi.domain.DocumentMaterials;
-import com.ruoyi.domain.vo.DocumentMaterialFileStyle;
-import com.ruoyi.domain.vo.DocumentMaterialsFileList;
-import com.ruoyi.domain.vo.DocumentMaterialsVo;
-import com.ruoyi.domain.vo.DocumentMaterialsVoLarge;
+import com.ruoyi.domain.vo.*;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -78,7 +75,7 @@
     public int updateByPageNumber(Long pageNumber,String sizeType, Long fileNumber, int wid, int hei, int wdpi, int hdpi, double sz,String url,String format, Long recordId);
     public List<DocumentMaterialsVo> findArchMInfo(String recordId, long pageCount);
 
-
+    public List<DocumentMaterialsVoMid> findArchMInfoAll(String recordId, long pageCount);
     public List<DocumentMaterialFileStyle> findFileStyleInfo(@Param("recordId") int recordId);
 
 
diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java b/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java
index 46a774e..6332a9e 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java
@@ -1,34 +1,97 @@
 package com.ruoyi.service.impl;
 
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.WriterException;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.oned.Code128Writer;
+import com.google.zxing.oned.Code39Writer;
 import org.krysalis.barcode4j.impl.code128.Code128Bean;
 import org.krysalis.barcode4j.output.bitmap.BitmapCanvasProvider;
 import org.springframework.stereotype.Service;
 
+import javax.imageio.ImageIO;
+import java.awt.*;
 import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
 
 @Service
 
 public class BarcodeService {
     public byte[] generateBarcodeImage(String barcodeText) {
         try {
-            Code128Bean barcodeGenerator = new Code128Bean();
-            final int dpi = 160;
-            barcodeGenerator.setModuleWidth(0.58);
-            barcodeGenerator.setBarHeight(14.2); // 璁剧疆鏉″舰鐮侀珮搴︿负64
-            barcodeGenerator.doQuietZone(false);
+           // 浣跨敤 BitMatrix 鐢熸垚绾潯鐮侊紝涓嶅寘鍚换浣曟枃瀛�
+            BarcodeFormat format = BarcodeFormat.CODE_39; // 鏍规嵁鎮ㄧ殑鏉$爜绫诲瀷
 
-            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
-            BitmapCanvasProvider canvas = new BitmapCanvasProvider(
-                    outputStream, "image/png", dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0);
+            // 鍒涘缓缂栫爜鍣�
+            Code39Writer writer = new Code39Writer();
 
-            barcodeGenerator.generateBarcode(canvas, barcodeText);
-            canvas.finish();
+            // 缂栫爜鍙傛暟
+            Map<EncodeHintType, Object> hints = new HashMap<>();
+            hints.put(EncodeHintType.MARGIN, 0); // 鏃犺竟妗�
 
-            return outputStream.toByteArray();
+            // 鐢熸垚 BitMatrix锛堢函鏉$爜锛屾棤鏂囧瓧锛�
+            BitMatrix matrix = writer.encode(barcodeText, format, 0, 63, hints);
+
+            int width = matrix.getWidth();
+            int height = matrix.getHeight();
+
+            // 璁$畻鏂囧瓧鍖哄煙
+            int textAreaHeight = 30 + 10;
+
+            // 鍒涘缓鏈�缁堝浘鍍�
+            BufferedImage finalImage = new BufferedImage(
+                    width,
+                    height + textAreaHeight,
+                    BufferedImage.TYPE_BYTE_BINARY
+            );
+
+            Graphics2D g2d = finalImage.createGraphics();
+
+            // 鐧借壊鑳屾櫙
+            g2d.setColor(Color.WHITE);
+            g2d.fillRect(0, 0, width, height + textAreaHeight);
+
+            // 缁樺埗鏉$爜锛堜粠 BitMatrix锛�
+            g2d.setColor(Color.BLACK);
+            for (int x = 0; x < width; x++) {
+                for (int y = 0; y < height; y++) {
+                    if (matrix.get(x, y)) {
+                        g2d.fillRect(x, y, 1, 1);
+                    }
+                }
+            }
+
+            // 娣诲姞鑷畾涔夋枃瀛�
+            g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+                    RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
+
+            Font font = new Font("Tahoma", Font.BOLD, 18);
+            g2d.setFont(font);
+
+            FontMetrics fm = g2d.getFontMetrics();
+            int textWidth = fm.stringWidth(barcodeText);
+            int x = (width - textWidth) / 2;
+            int y = height + 30 - 5; // 璋冩暣鍨傜洿浣嶇疆
+
+            g2d.drawString(barcodeText, x, y);
+            g2d.dispose();
+
+            // 淇濆瓨
+            ByteArrayOutputStream resultStream = new ByteArrayOutputStream();
+            ImageIO.write(finalImage, "png", resultStream);
+
+            return resultStream.toByteArray();
+         //   return outputStream.toByteArray();
         } catch (IOException e) {
             throw new RuntimeException("Error generating barcode", e);
+        } catch (WriterException e) {
+            throw new RuntimeException(e);
         }
     }
 }
diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java
index 92d7bff..57a32ab 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java
@@ -333,6 +333,37 @@
     }
 
     @Override
+    public List<DocumentMaterialsVoMid> findArchMInfoAll(String recordId, long pageCount) {
+        // 鑾峰彇鍘熷鏁版嵁鍒楄〃
+        List<DocumentMaterialsVoMid> dataList = this.baseMapper.getArchiveMatInfoAll(Integer.parseInt(recordId));
+
+        // 鑾峰彇璇ユ鍗风殑鏈�澶ч〉鍙凤紙鎬婚〉鏁帮級
+        Long totalPages = (long) pageCount;
+        //this.baseMapper.getMaxPageNumber(Integer.parseInt(recordId));
+
+        // 濡傛灉鏁版嵁鍒楄〃涓嶄负绌�
+        if (dataList != null && !dataList.isEmpty() && totalPages != null) {
+            int size = dataList.size();
+
+            // 閬嶅巻鎵�鏈夋潯鐩紝璁剧疆pageNumberFormatted
+            for (int i = 0; i < size; i++) {
+                DocumentMaterialsVoMid item = dataList.get(i);
+                Long pageNumber = item.getPageNumber();
+
+                if (i == size - 1) {
+                    // 鏈�鍚庝竴琛岋細鏍煎紡鍖栭〉鍙蜂负"鏈�鍚庝竴椤甸〉鍙�-鎬婚〉鏁�"鐨勫舰寮�
+                    item.setPageNumberFormatted(pageNumber + "-" + totalPages);
+                } else {
+                    // 鍏朵粬琛岋細鐩存帴浣跨敤pageNumber鐨勫��
+                    item.setPageNumberFormatted(pageNumber != null ? pageNumber.toString() : "");
+                }
+            }
+        }
+
+        return dataList;
+    }
+
+    @Override
     public List<DocumentMaterialFileStyle> findFileStyleInfo(int recordId) {
         return this.baseMapper.getFileStyleInfo(recordId);
     }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
index 67debd9..ae9400b 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/ArchiveRecordsController.java
@@ -1,10 +1,10 @@
 package com.ruoyi.web.controller.archive;
 
+import java.io.File;
+import java.io.FileFilter;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 import javax.servlet.http.HttpServletResponse;
 
 import cn.hutool.core.bean.BeanUtil;
@@ -172,7 +172,64 @@
         System.out.println("090sdfsdf");
         return new AjaxResult(0, archiveRecordsService.updateStatusByIds(ids) + "");
     }
+    /**
+     *
+     */
+    @PreAuthorize("@ss.hasPermi('system:records:list')")
+    @Log(title = "妗f璁板綍", businessType = BusinessType.UPDATE)
+    @PostMapping(value = "/getAllFilesCounts")
 
+    public AjaxResult getAllFileCounts(@RequestBody Long[] ids) {
+
+
+
+
+// 1. 鍒濆鍖朚ap锛岀敤浜庡瓨鍌╮ecordId鍜屽搴旂殑鏂囦欢鏁�
+        Map<Long, Integer> recordFileCountMap = new HashMap<>();
+
+// 2. 鑾峰彇鍩虹涓婁紶璺緞
+        String filePath = RuoYiConfig.getUploadPath();
+
+// 3. 閬嶅巻姣忎釜recordId锛岃绠楁枃浠舵暟骞舵斁鍏ap
+        for (Long recordId : ids) {
+            // 鎷兼帴褰撳墠recordId鐨勭洰褰曡矾寰�
+            File desc = new File(filePath + File.separator + recordId);
+            int fileCount = 0;
+
+            try {
+                // 鍒ゆ柇鐩綍鏄惁瀛樺湪涓旀槸鐩綍
+                if (desc.exists() && desc.isDirectory()) {
+                    // 杩囨护鍑轰粎鏂囦欢锛堟帓闄ゅ瓙鐩綍锛�
+                    File[] files = desc.listFiles(new FileFilter() {
+                        @Override
+                        public boolean accept(File file) {
+                            return file.isFile(); // 鍙粺璁℃枃浠讹紝涓嶇粺璁$洰褰�
+                        }
+                    });
+
+                    // 閬垮厤绌烘寚閽堬紙绌虹洰褰曟椂listFiles杩斿洖null锛�
+                    if (files != null) {
+                        fileCount = files.length;
+                    }
+                } else {
+                    // 鐩綍涓嶅瓨鍦�/涓嶆槸鐩綍锛屾枃浠舵暟涓�0
+                    fileCount = 0;
+                    // 鍙�夛細鏃ュ織鎻愮ず
+                    // log.warn("鐩綍涓嶅瓨鍦ㄦ垨闈炵洰褰曪細{}", desc.getAbsolutePath());
+                }
+            } catch (SecurityException e) {
+                // 鏉冮檺涓嶈冻绛夊紓甯革紝鏂囦欢鏁扮疆0
+                fileCount = 0;
+                // 鍙�夛細鏃ュ織璁板綍寮傚父
+                // log.error("鑾峰彇鐩綍[{}]鏂囦欢鏁板け璐ワ細{}", recordId, e.getMessage(), e);
+            }
+
+            // 4. 灏唕ecordId鍜屽搴旂殑鏂囦欢鏁版斁鍏ap
+            recordFileCountMap.put(recordId, fileCount);
+        }
+        return new AjaxResult(200,"鎷垮埌鎵�鏈夊搴旂殑鏁版嵁", recordFileCountMap);
+
+    }
     /**
      * 鍒犻櫎妗f璁板綍
      */
@@ -259,11 +316,19 @@
         List<DocumentMaterialsFileList> arsi = new ArrayList<>();
 //        DocumentMaterials documentMaterials = new DocumentMaterials();
 //        documentMaterials.setRecordId(recordId);
-        List<DocumentMaterialsFileList> lst = iDocumentMaterialsService.selectDocumentMaterialsFileList(searSigAnn.getRecordId());
+
+                ArchiveRecords archiveRecords = archiveRecordsService.selectArchiveRecordsById(searSigAnn.getRecordId());
+        List<DocumentMaterialsVo> lst = iDocumentMaterialsService.findArchMInfo(searSigAnn.getRecordId().toString(), archiveRecords.getPageCount());
+       // List<DocumentMaterialsFileList> lst =
+        //鎷垮埌鍗峰唴鐩綍鐨別xcel
+//        List<DocumentMaterialsVoSmall> lst = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(),
+//                res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList());
+
+        //iDocumentMaterialsService.selectDocumentMaterialsFileList(searSigAnn.getRecordId());
 
 
         // 澶嶅埗灞炴�у埌SmallObject鍒楄〃
-        for (DocumentMaterialsFileList bigObject : lst) {
+        for (DocumentMaterialsVo bigObject : lst) {
             DocumentMaterialsFileList smallObject = new DocumentMaterialsFileList();
             BeanUtil.copyProperties(bigObject, smallObject); // 澶嶅埗灞炴��
             System.out.println(bigObject);
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java
index 1a51ccc..096deb8 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java
@@ -189,10 +189,10 @@
     public void exportDir(HttpServletResponse response, DocumentMaterials documentMaterials, @RequestParam(value = "ids", required = false) Long[] ids)
     {
         ArchiveRecords archiveRecords = iArchiveRecordsService.selectArchiveRecordsById(documentMaterials.getRecordId());
-        List<DocumentMaterialsVo> dsvs = documentMaterialsService.findArchMInfo(documentMaterials.getRecordId().toString(), archiveRecords.getPageCount());
+        List<DocumentMaterialsVoMid> dsvs = documentMaterialsService.findArchMInfoAll(documentMaterials.getRecordId().toString(), archiveRecords.getPageCount());
 
-        List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(),
-                res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList());
+//        List<DocumentMaterialsVoSmall> list2 = dsvs.stream().map(res1 -> new DocumentMaterialsVoSmall(res1.getNum(), res1.getDocumentNumber(),res1.getCreator(),
+//                res1.getTitle(), res1.getDate(), res1.getPageNumberFormatted(), res1.getRemarks())).collect(Collectors.toList());
 
 //        List<DocumentMaterials> list;
 //        System.out.println(ids);
@@ -227,8 +227,8 @@
 //            return vo;
 //        }).collect(Collectors.toList());
         
-        ExcelUtil<DocumentMaterialsVoSmall> util = new ExcelUtil<DocumentMaterialsVoSmall>(DocumentMaterialsVoSmall.class);
-        util.exportExcel(response, list2, "鍗峰唴鐩綍");
+        ExcelUtil<DocumentMaterialsVoMid> util = new ExcelUtil<DocumentMaterialsVoMid>(DocumentMaterialsVoMid.class);
+        util.exportExcel(response, dsvs, "鍗峰唴鐩綍");
     }
 
    // List<DocumentMaterialsVo> dsvs = documentMaterialsService.findArchMInfo(id.toString());
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java
index 3b53014..822c066 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java
@@ -336,17 +336,22 @@
                       //  if (Files.exists(Paths.get(imagePath))) {
                           //  byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath));
                             // 灏哹yte鏁扮粍杞崲鎴恑nputstream锛屼互渚挎彃鍏ュ埌Excel涓�
-                            ClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 100, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 5),
-                                    cell.getRow().getRowNum() + 1);
+                            ClientAnchor anchor = new HSSFClientAnchor(813, 0, 787, 71, (short) 2, 0, (short) 4,
+                                    1);
+
+
+
+//                    ClientAnchor anchor = new HSSFClientAnchor(813, 0, 787, 71, (short) 2, 0, (short) 4,
+//                            2);
                             // 璁剧疆閿氱偣绫诲瀷涓篗OVE_AND_RESIZE锛屼娇鍥剧墖鍙互闅忓崟鍏冩牸璋冩暣澶у皬
                             anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
                                     // 璁$畻灞呬腑浣嶇疆
-                    int col1 = 3; // 涓棿鍒�
-                    int col2 = col1 + 2;
-                    anchor.setCol1(col1);
-                    anchor.setCol2(col2);
-                    anchor.setRow1(0);
-                    anchor.setRow2(1);
+//                    int col1 = 3; // 涓棿鍒�
+//                    int col2 = col1 + 2;
+//                    anchor.setCol1(col1);
+//                    anchor.setCol2(col2);
+//                    anchor.setRow1(0);
+//                    anchor.setRow2(1);
 //                            anchor.set
 //                            anchor.setHorizontallyCenter(true);
 
@@ -1093,10 +1098,10 @@
             HSSFSheet hssfSheet = hssfWb.getSheetAt(index);
             HSSFHeader header = hssfSheet.getHeader();
             // 璁剧疆椤电湁瀛椾綋
-           // header.setFontName("瀹嬩綋");
+           // header.setFontName("瀹嬩綋");4
            // header.setFontSize((short) 10);
             // 璁剧疆椤电湁鍐呭
-            hssfSheet.setMargin(Sheet.HeaderMargin, 2.1);
+            hssfSheet.setMargin(Sheet.HeaderMargin, 1.34);
             header.setRight("&\"瀹嬩綋,Bold\"鍏� &N 椤�   绗� &P 椤�");
         }
         // 濡傛灉鏄痠ndex涓�1鐨剆heet锛岃缃《绔爣棰樿
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
index 6d3021f..99871c7 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java
@@ -307,7 +307,6 @@
                 int column = 0;
                 if(index == 0) {
                     // 鍚堝苟绗竴琛岀殑鍓�5涓崟鍏冩牸
-                    sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
 
                     // 蹇呴』鍏堣缃负true
                     // 椤甸潰甯冨眬璁剧疆
@@ -333,33 +332,49 @@
                     {
                         row.setHeight((short)(55.8 * 20));
 
-                        Cell cell = row.createCell(6);
+                        Cell cell = row.createCell(0);
+//                        for(int cl = 1 ; cl <=8; cl++)
+//                            cell = row.createCell(cl);
+//
+//
+//                        for (int col = 4; col <= 7; col++) {
+//                            row.getSheet().setColumnWidth(col, 15 * 256); // 姣忓垪15瀛楃瀹�
+                //        }
+
+                        int margin = -40* 9525;
+                        int mary = -11 * 9525;
+                        XSSFClientAnchor anchor = new XSSFClientAnchor(
+                                0,          // dx1
+                                0,          // dy1
+                                margin,     // dx2锛氬彸杈圭晫宸︾Щ10鍍忕礌
+                                mary,          // dy2
+                                (short)5,   // col1
+                                0,          // row1
+                                (short)9,   // col2
+                                1          // row2
+                        );
                         // 璁剧疆鍥剧墖澶у皬鍜屼綅缃�
-                        ClientAnchor anchor = new XSSFClientAnchor(0, 0, 0, 0, (short) (cell.getColumnIndex()+1), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() +2),
-                                cell.getRow().getRowNum() + 1);
+                     //   ClientAnchor anchor = new XSSFClientAnchor(0, 0, 600, 150, (short)0, 0, (short)6, 1);
+                    //   anchor.setDx2(488);
+                    //   anchor.setDy2(10);
+                   //     anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
                         // 璁$畻灞呬腑浣嶇疆
-//                    int col1 = 0; // 涓棿鍒�
-//                    int col2 = col1 + 2;
-//                    anchor.setCol1(col1);
-//                    anchor.setCol2(col2);
-//                    anchor.setDx1(100);
-//                    anchor.setDy1(0);
-//                    anchor.setDx2(255); // 瀹藉害
-//                    anchor.setDy2(255); // 楂樺害
-                        anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
+
+
                         // 璁$畻灞呬腑浣嶇疆
-                        int col1 = 4; // 涓棿鍒�
-                        int col2 = col1 + 3;
-                        anchor.setCol1(col1);
-                        anchor.setCol2(col2);
-                        anchor.setRow1(0);
-                        anchor.setRow2(1);
+//                        int col1 = 4; // 涓棿鍒�
+//                        int col2 = col1 + 3;
+//                        anchor.setCol1(col1);
+//                        anchor.setCol2(col2);
+//                        anchor.setRow1(0);
+//                        anchor.setRow2(1);
+
                         byte[] data = bt;
                  
                         // 鑾峰彇鍥剧墖鍘熷灏哄
                         BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
-                        double widthInEMU = image.getWidth() * 9525 * 0.2;
-                        double heightInEMU = image.getHeight() * 9525;
+//                        double widthInEMU = image.getWidth() * 9525 * 0.2;
+//                        double heightInEMU = image.getHeight() * 9525;
 
                         // 璁剧疆鍥剧墖鍘熷灏哄
                     //    anchor.setDx2(-100000); // 鍘熷瀹藉害
@@ -378,6 +393,7 @@
                     }
                     else
                         row.setHeight((short)(33 * 20));
+                  //  sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 8));
 
                     //  sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
                     if(firow==1)

--
Gitblit v1.9.1