From 5de5db24efe1b25896c37f395124a207584bcb38 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期四, 01 一月 2026 21:25:54 +0800
Subject: [PATCH] 修改了对应代码
---
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetFour.java | 16
archiveManager/src/main/java/com/ruoyi/service/impl/pdfGenerateService.java | 47 +++
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheet.java | 148 ++++++++++-
archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoSmall.java | 12
archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java | 182 +++++++-------
ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java | 80 +++++
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetSecond.java | 116 ++++++--
archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java | 5
archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java | 20 +
archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java | 31 ++
ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/DocumentMaterialsController.java | 34 ++
archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java | 9
archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java | 4
archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java | 19 +
14 files changed, 551 insertions(+), 172 deletions(-)
diff --git a/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java
index 4537845..852cca1 100644
--- a/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java
+++ b/archiveManager/src/main/java/com/ruoyi/domain/ArchiveRecords.java
@@ -117,6 +117,26 @@
/** 澶囨敞 */
@Excel(name = "澶囨敞", headerColor = IndexedColors.BLACK, width = 8)
private String remarks;
+ @TableField(exist = false)
+ private String orderByColumn;
+ @TableField(exist = false)
+ private String isAsc;
+
+ public String getIsAsc() {
+ return isAsc;
+ }
+
+ public void setIsAsc(String isAsc) {
+ this.isAsc = isAsc;
+ }
+
+ public String getOrderByColumn() {
+ return orderByColumn;
+ }
+
+ public void setOrderByColumn(String orderByColumn) {
+ this.orderByColumn = orderByColumn;
+ }
@TableField(exist = false)
private String categoryNumberStart;
diff --git a/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java b/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java
index c30de29..b31ee13 100644
--- a/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java
+++ b/archiveManager/src/main/java/com/ruoyi/domain/DocumentMaterials.java
@@ -61,6 +61,15 @@
/** $column.columnComment */
// @Excel(name = "椤靛彿", handler = NumberFormatHandler.class, headerColor = IndexedColors.BLACK)
private Long pageNumber;
+
+ public String getPageNumberFormatted() {
+ return pageNumberFormatted;
+ }
+
+ public void setPageNumberFormatted(String pageNumberFormatted) {
+ this.pageNumberFormatted = pageNumberFormatted;
+ }
+
@TableField(exist = false)
@Excel(name = "椤靛彿", height = 10,width = 10,headerColor = IndexedColors.RED, headerBackgroundColor = IndexedColors.WHITE)
private String pageNumberFormatted;
diff --git a/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoSmall.java b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoSmall.java
index 3506c27..031daa8 100644
--- a/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoSmall.java
+++ b/archiveManager/src/main/java/com/ruoyi/domain/vo/DocumentMaterialsVoSmall.java
@@ -11,25 +11,25 @@
public class DocumentMaterialsVoSmall {
- @Excel(name="搴忓彿",width = 5, headerFontSize=12, headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name="搴忓彿",width = 4.86, headerFontSize=12, headerColor = IndexedColors.BLACK, headerFontBold = true)
private Long num;
@Excel(name = "鏂囦欢缂栧彿",width = 10, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
private String documentNumber;
- @Excel(name = "璐d换鑰�",width = 10, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name = "璐d换鑰�",width = 10.67, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
private String creator;
- @Excel(name = "鏂囦欢棰樺悕",width = 30, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name = "鏂囦欢棰樺悕",width = 36.29, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
private String title;
@JsonFormat(pattern = "yyyy-MM-dd")
- @Excel(name = "鏃ユ湡", width = 10, headerFontSize=12,dateFormat = "yyyy-MM-dd", headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name = "鏃ユ湡", width = 11.57, headerFontSize=12,dateFormat = "yyyy-MM-dd", headerColor = IndexedColors.BLACK, headerFontBold = true)
private Date date;
- @Excel(name = "椤靛彿",width = 10, headerFontSize=12, headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name = "椤靛彿",width = 10.14, headerFontSize=12, headerColor = IndexedColors.BLACK, headerFontBold = true)
private String pageNumberFormatted;
private Long pageNumber;
- @Excel(name = "澶囨敞",width = 8, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
+ @Excel(name = "澶囨敞",width = 10.14, headerFontSize=12,headerColor = IndexedColors.BLACK, headerFontBold = true)
private String remarks;
public DocumentMaterialsVoSmall(Long num, String documentNumber, String creator, String title, Date date, String pageNumberFormatted, String remarks) {
diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
index 36eb677..38b4fa3 100644
--- a/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
+++ b/archiveManager/src/main/java/com/ruoyi/mapper/ArchiveRecordsMapper.java
@@ -12,6 +12,7 @@
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
+import java.util.Date;
import java.util.List;
@Mapper
@@ -56,8 +57,8 @@
List<AnalysisResult> statisticAyasis();
- @Select("update archive_records set record_status=#{status} where id=#{id}")
- public void updateStatusById(@Param("status") String status, @Param("id")Long id);
+ @Select("update archive_records set record_status=#{status}, create_time=#{date} where id=#{id}")
+ public void updateStatusById(@Param("status") String status, @Param("id")Long id ,@Param("date") Date date);
@Select("select ROW_NUMBER() OVER (ORDER BY record_id) AS num, filing_number, concat_ws(\" \", inquiry_number,record_id) as inqrid, case_title, public_attribute, (select count(*) as cnt from document_materials where record_id=ar.id) as cnt, remarks from archive_records as ar \n" +
"${ew.customSqlSegment}")
diff --git a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
index ef37016..25583c0 100644
--- a/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
+++ b/archiveManager/src/main/java/com/ruoyi/mapper/DocumentMaterialsMapper.java
@@ -1,91 +1,91 @@
-package com.ruoyi.mapper;
-
-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 org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-/**
- * 銆愭枃浠舵潗鏂欑患鍚堜俊鎭�慚apper鎺ュ彛
- *
- * @author ruoyi
- * @date 2025-07-26
- */
-@Mapper
-public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> {
-
- @Select("update document_materials SET url = #{url},size_type=#{sizeType}, file_number=#{fileNumber},page_order=#{pageOrder},width=#{width},height=#{height},horizontal_resolution=#{horizontalResolution},vertical_resolution=#{verticalResolution},file_size=#{fileSize}, format=#{format} where page_number = #{pageNumber} and record_id=#{recordId}")
- Long updateInfoByPageNumber(@Param("pageNumber") Long pageNumber,@Param("sizeType") String sizeType, @Param("fileNumber") Long fileNumber,@Param("pageOrder") Long pageOrder,@Param("width") int width, @Param("height") int height, @Param("horizontalResolution") int horizontalResolution, @Param("verticalResolution") int verticalResolution, @Param("fileSize") Double fileSize,@Param("url") String url,@Param("format") String format, @Param("recordId") Long recordId);
-
-
- //鏍规嵁棰樺悕鎷垮埌鏈�澶х殑pageOrder
- @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage} and record_id=#{recordId}")
- Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage, @Param("recordId") Long recordId);
-
- //璁$畻鏂囦欢鐨勫簭鍙凤紝title鏈夊彲鑳介噸澶�
- @Select("select count(distinct(concat_ws(',', title, stage)))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}")
- Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId);
-
-
-
-
- //鏌ヨ鍗峰唴鐩綍
- @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" +
- " 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,ar.record_id, file_number, \n" +
- " document_number, creator, title, date, page_number, page_order, \n" +
- " stage, publicity, is_attachment, dm.retention_period, security_level, is_sensitive,\n" +
- " is_canceled, format, size_type, horizontal_resolution, vertical_resolution, width,\n" +
- " height, file_size, attachment_history_numbers,url, dm.remarks\n" +
- " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
- "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
- List<DocumentMaterialsVoLarge> getDocumentMaterialsvoLarge(@Param("recordId") int recordId);
- @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,file_style, ar.record_id, ar.inquiry_number, ar.case_title, " +
- " document_number, title, page_number, \n" +
- " publicity, dm.retention_period, dm.remarks\n" +
- " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
- "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
- List<DocumentMaterialsFileList> getDocumentMaterialsFileList(@Param("recordId") int recordId);
- @Select("select count(*) as cnt, file_style from document_materials " +
- "where record_id=#{recordId} GROUP BY file_style")
-
- List<DocumentMaterialFileStyle> getFileStyleInfo(@Param("recordId") int recordId);
-
- @Select("select if(count(*) < max(page_number), false, true) as res from document_materials where record_id=#{recordId}")
- boolean isPageNumberLegal(@Param("recordId") int recordId);
-
-
- //鎷垮埌闄ゅ叾瀹冩潗鏂欎箣澶栫殑鍏ㄩ儴鏁版嵁鐨勪釜鏁�
- @Select("select count(*) FROM document_materials where file_style!='鍏朵粬鏉愭枡' and record_id=#{recordId}")
- int getCount(@Param("recordId") int recordId);
-
- //鑾峰彇鎸囧畾妗堝嵎鐨勬渶澶ч〉鍙�
- @Select("select max(page_number) FROM document_materials where record_id=#{recordId}")
- Long getMaxPageNumber(@Param("recordId") int recordId);
-
-
- //鍒ゆ柇鍗峰唴鐩綍鏄惁鍏ㄩ儴涓婁紶浜嗛檮浠�
- @Select("select if(num=total_count, true, false) as res from (\n" +
- "SELECT\n" +
- " ROW_NUMBER() OVER (ORDER BY page_number) AS num, SUM(CASE WHEN dm.url IS NOT NULL THEN 1 ELSE 0 END) OVER() AS total_count\n" +
- " from document_materials as dm, archive_records as ar \n" +
- " WHERE ar.id = dm.record_id and page_number IN (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 desc limit 1) as res ")
- Boolean judgeArchiveInfo( @Param("recordId") int recordId);
-
-}
-
\ No newline at end of file
+package com.ruoyi.mapper;
+
+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 org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+/**
+ * 銆愭枃浠舵潗鏂欑患鍚堜俊鎭�慚apper鎺ュ彛
+ *
+ * @author ruoyi
+ * @date 2025-07-26
+ */
+@Mapper
+public interface DocumentMaterialsMapper extends BaseMapper<DocumentMaterials> {
+
+ @Select("update document_materials SET url = #{url},size_type=#{sizeType}, file_number=#{fileNumber},page_order=#{pageOrder},width=#{width},height=#{height},horizontal_resolution=#{horizontalResolution},vertical_resolution=#{verticalResolution},file_size=#{fileSize}, format=#{format} where page_number = #{pageNumber} and record_id=#{recordId}")
+ Long updateInfoByPageNumber(@Param("pageNumber") Long pageNumber,@Param("sizeType") String sizeType, @Param("fileNumber") Long fileNumber,@Param("pageOrder") Long pageOrder,@Param("width") int width, @Param("height") int height, @Param("horizontalResolution") int horizontalResolution, @Param("verticalResolution") int verticalResolution, @Param("fileSize") Double fileSize,@Param("url") String url,@Param("format") String format, @Param("recordId") Long recordId);
+
+
+ //鏍规嵁棰樺悕鎷垮埌鏈�澶х殑pageOrder
+ @Select("select count(*) from document_materials where title=#{title} and page_number<#{pageNumber} and stage=#{stage} and record_id=#{recordId}")
+ Long getMaxPageOrder(@Param("title")String title,@Param("pageNumber") Long pageNumber,@Param("stage") String stage, @Param("recordId") Long recordId);
+
+ //璁$畻鏂囦欢鐨勫簭鍙凤紝title鏈夊彲鑳介噸澶�
+ @Select("select count(distinct(concat_ws(',', title, stage)))-1 from document_materials where page_number<=#{pageNumber} and record_id=#{recordId}")
+ Long getFileNumber(@Param("pageNumber") Long pageNumber, @Param("recordId") Long recordId);
+
+
+
+
+ //鏌ヨ鍗峰唴鐩綍
+ @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" +
+ " 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,ar.record_id, file_number, \n" +
+ " document_number, creator, title, date, page_number, page_order, \n" +
+ " stage, publicity, is_attachment, dm.retention_period, security_level, is_sensitive,\n" +
+ " is_canceled, format, size_type, horizontal_resolution, vertical_resolution, width,\n" +
+ " height, file_size, attachment_history_numbers,url, dm.remarks\n" +
+ " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
+ "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
+ List<DocumentMaterialsVoLarge> getDocumentMaterialsvoLarge(@Param("recordId") int recordId);
+ @Select( "select ROW_NUMBER() OVER (ORDER BY page_number) AS num,file_style, ar.record_id, ar.inquiry_number, ar.case_title, " +
+ " document_number, title, page_number, \n" +
+ " publicity, dm.retention_period, dm.remarks\n" +
+ " from document_materials as dm, archive_records as ar WHERE dm.record_id=ar.id \n" +
+ "and dm.record_id=#{recordId} and file_style!='鍏跺畠鏉愭枡' ")
+ List<DocumentMaterialsFileList> getDocumentMaterialsFileList(@Param("recordId") int recordId);
+ @Select("select count(*) as cnt, file_style from document_materials " +
+ "where record_id=#{recordId} GROUP BY file_style")
+
+ List<DocumentMaterialFileStyle> getFileStyleInfo(@Param("recordId") int recordId);
+
+ @Select("select if(count(*) < max(page_number), false, true) as res from document_materials where record_id=#{recordId}")
+ boolean isPageNumberLegal(@Param("recordId") int recordId);
+
+
+ //鎷垮埌闄ゅ叾瀹冩潗鏂欎箣澶栫殑鍏ㄩ儴鏁版嵁鐨勪釜鏁�
+ @Select("select count(*) FROM document_materials where file_style!='鍏朵粬鏉愭枡' and record_id=#{recordId}")
+ int getCount(@Param("recordId") int recordId);
+
+ //鑾峰彇鎸囧畾妗堝嵎鐨勬渶澶ч〉鍙�
+ @Select("select max(page_number) FROM document_materials where record_id=#{recordId}")
+ Long getMaxPageNumber(@Param("recordId") int recordId);
+
+
+ //鍒ゆ柇鍗峰唴鐩綍鏄惁鍏ㄩ儴涓婁紶浜嗛檮浠�
+ @Select("select if(num=total_count, true, false) as res from (\n" +
+ "SELECT\n" +
+ " ROW_NUMBER() OVER (ORDER BY page_number) AS num, SUM(CASE WHEN dm.url IS NOT NULL THEN 1 ELSE 0 END) OVER() AS total_count\n" +
+ " from document_materials as dm, archive_records as ar \n" +
+ " WHERE ar.id = dm.record_id and page_number IN (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 desc limit 1) as res ")
+ Boolean judgeArchiveInfo( @Param("recordId") int recordId);
+
+}
+
diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
index b423bbc..db56713 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/ArchiveRecordsServiceImpl.java
@@ -133,9 +133,27 @@
// .eq(zfProperty.getHappenTime()!=null,ZfProperty::getHappenTime,zfProperty.getHappenTime())
// .between(zfProperty.getHappenStartTime() != null && zfProperty.getHappenEndTime() != null, ZfProperty::getHappenTime, zfProperty.getHappenStartTime(), zfProperty.getHappenEndTime());
// lqw.orderByDesc(ZfProperty::getCreateTime);
- if(userId==1)
+ if(archiveRecords.getOrderByColumn()==null) {
+ if (userId == 1)
- lqw.orderByDesc(ArchiveRecords::getCreateTime);
+ lqw.orderByDesc(ArchiveRecords::getCreateTime);
+ }else
+ {
+ System.out.println(archiveRecords.getOrderByColumn());
+ if("recordId".equals(archiveRecords.getOrderByColumn())) {
+ if (archiveRecords.getIsAsc().equals("asc"))
+ lqw.orderByAsc(ArchiveRecords::getRecordId);
+ else
+ lqw.orderByDesc(ArchiveRecords::getRecordId);
+ }
+ if("recordStatus".equals(archiveRecords.getOrderByColumn()))
+ {
+ if (archiveRecords.getIsAsc().equals("asc"))
+ lqw.orderByAsc(ArchiveRecords::getRecordStatus);
+ else
+ lqw.orderByDesc(ArchiveRecords::getRecordStatus);
+ }
+ }
// else
// lqw.eq(userId!=null, ArchiveRecords::getUserId, userId);
System.out.println("ssssssssssssddd0000000000000000");
@@ -386,19 +404,24 @@
@Override
public int updateArchiveById(String status, Long id) {
+ LocalDateTime time = LocalDateTime.now();
+ Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
// 鑾峰彇褰撳墠鐢ㄦ埛ID
Long userId = SecurityUtils.getUserId();
// 鍙互鍦ㄨ繖閲屼娇鐢╱serId杩涜鎺堟潈鎿嶄綔
archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId);
- this.baseMapper.updateStatusById(status, id);
+ this.baseMapper.updateStatusById(status, id, date);
return 0;
}
@Override
public int updateStatusByIds(Long[] ids) {
+ LocalDateTime time = LocalDateTime.now();
+
+ Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant());
for(Long id : ids)
- this.baseMapper.updateStatusById("褰曞叆瀹屾垚",id);
+ this.baseMapper.updateStatusById("褰曞叆瀹屾垚",id, date);
return 0;
}
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 cf7f999..46a774e 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/BarcodeService.java
@@ -15,8 +15,8 @@
try {
Code128Bean barcodeGenerator = new Code128Bean();
final int dpi = 160;
- barcodeGenerator.setModuleWidth(0.21);
- barcodeGenerator.setBarHeight(8.0); // 璁剧疆鏉″舰鐮侀珮搴︿负64
+ barcodeGenerator.setModuleWidth(0.58);
+ barcodeGenerator.setBarHeight(14.2); // 璁剧疆鏉″舰鐮侀珮搴︿负64
barcodeGenerator.doQuietZone(false);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
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 a483197..4a1b581 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/DocumentMaterialsServiceImpl.java
@@ -73,7 +73,7 @@
public AjaxResult selectDataList(DocumentMaterials documentMaterials, Integer pageNum, Integer pageSize) {
LambdaQueryWrapper<DocumentMaterials> lqw = buildCondition(documentMaterials);
-
+ lqw.eq(true, DocumentMaterials::getVisible, 1);
Page<DocumentMaterials> zfClanPage = new Page<>(pageNum, pageSize);
Page<DocumentMaterials> pageResult = page(zfClanPage, lqw);
@@ -113,6 +113,23 @@
public List<DocumentMaterials> selectDocumentMaterialsList(DocumentMaterials documentMaterials) {
LambdaQueryWrapper<DocumentMaterials> lambdaQueryWrapper = buildCondition(documentMaterials);
List<DocumentMaterials> beanRecords = list(lambdaQueryWrapper);
+ int size = beanRecords.size();
+ // 鑾峰彇璇ユ鍗风殑鏈�澶ч〉鍙凤紙鎬婚〉鏁帮級
+ Long totalPages = this.baseMapper.getMaxPageNumber(documentMaterials.getRecordId().intValue());
+
+ // 閬嶅巻鎵�鏈夋潯鐩紝璁剧疆pageNumberFormatted
+ for (int i = 0; i < size; i++) {
+ DocumentMaterials item = beanRecords.get(i);
+ Long pageNumber = item.getPageNumber();
+
+ if (i == size - 1) {
+ // 鏈�鍚庝竴琛岋細鏍煎紡鍖栭〉鍙蜂负"鏈�鍚庝竴椤甸〉鍙�-鎬婚〉鏁�"鐨勫舰寮�
+ item.setPageNumberFormatted(pageNumber + "-" + totalPages);
+ } else {
+ // 鍏朵粬琛岋細鐩存帴浣跨敤pageNumber鐨勫��
+ item.setPageNumberFormatted(pageNumber != null ? pageNumber.toString() : "");
+ }
+ }
return beanRecords;
}
diff --git a/archiveManager/src/main/java/com/ruoyi/service/impl/pdfGenerateService.java b/archiveManager/src/main/java/com/ruoyi/service/impl/pdfGenerateService.java
index 41e1fe2..46f710a 100644
--- a/archiveManager/src/main/java/com/ruoyi/service/impl/pdfGenerateService.java
+++ b/archiveManager/src/main/java/com/ruoyi/service/impl/pdfGenerateService.java
@@ -43,23 +43,62 @@
@Autowired
private IArchiveRecordsService iArchiveRecordsService;
+ private static BufferedImage trimWhiteBorder(BufferedImage img) {
+ int width = img.getWidth();
+ int height = img.getHeight();
+
+ int minX = width, minY = height, maxX = 0, maxY = 0;
+
+ // 鏌ユ壘闈炵櫧鑹插儚绱犵殑杈圭晫
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
+ int rgb = img.getRGB(x, y);
+ // 濡傛灉涓嶆槸鐧借壊
+ if ((rgb & 0x00FFFFFF) != 0x00FFFFFF) {
+ if (x < minX) minX = x;
+ if (x > maxX) maxX = x;
+ if (y < minY) minY = y;
+ if (y > maxY) maxY = y;
+ }
+ }
+ }
+
+ // 濡傛灉鍏ㄦ槸鐧借壊锛岃繑鍥炲師鍥�
+ if (minX > maxX || minY > maxY) {
+ return img;
+ }
+
+ // 瑁佸壀
+ int newWidth = maxX - minX + 1;
+ int newHeight = maxY - minY + 1;
+
+ // 娣诲姞1鍍忕礌瀹夊叏杈硅窛锛堝彲閫夛級
+ minX = Math.max(0, minX - 1);
+ minY = Math.max(0, minY - 1);
+ newWidth = Math.min(width - minX, newWidth + 2);
+ newHeight = Math.min(height - minY, newHeight + 2);
+
+ return img.getSubimage(minX, minY, newWidth, newHeight);
+ }
//鐢熶骇浜岀淮鐮�
public byte[] createQrCodeN(String content, int width, int height) throws IOException {
QrConfig config = new QrConfig(width, height);
- config.setMargin(0);
+ config.setMargin(2);
// 楂樼籂閿欑骇鍒�
config.setErrorCorrection(ErrorCorrectionLevel.H);
// 璁剧疆鍓嶆櫙鑹诧紝鏃簩缁寸爜棰滆壊锛堣嚜琛岄�夋嫨棰滆壊淇敼锛�
- config.setForeColor(new Color(11, 11, 11).getRGB());
-// 璁剧疆鑳屾櫙鑹诧紙鐏拌壊锛夐渶瑕佽儗鏅壊鏃跺�欐墦寮�閾炬帴
- config.setBackColor(new Color(242,242,242).getRGB());
+ config.setForeColor(java.awt.Color.BLACK);
+ config.setBackColor(java.awt.Color.WHITE);
BufferedImage bufferedImage = QrCodeUtil.generate(//
content, //浜岀淮鐮佸唴瀹�
config
);
+
+ // 姝ラ2锛氭墜鍔ㄨ鍓櫧杈�
+ bufferedImage = trimWhiteBorder(bufferedImage);
System.out.println(bufferedImage);
System.out.println("---02340230949394");
ByteArrayOutputStream os = new ByteArrayOutputStream();
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 38dc7c7..6adca94 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
@@ -8,6 +8,8 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.List;
@@ -17,6 +19,8 @@
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
import com.aspose.words.License;
import com.deepoove.poi.XWPFTemplate;
import com.drew.imaging.ImageMetadataReader;
@@ -201,7 +205,7 @@
vo.setCreator(doc.getCreator());
vo.setTitle(doc.getTitle());
vo.setDate(doc.getDate());
- vo.setPageNumber(doc.getPageNumber());
+ vo.setPageNumberFormatted(doc.getPageNumber().toString());
vo.setRemarks(doc.getRemarks());
// vo.setRecordId(doc.getRecordId() != null ? doc.getRecordId().toString() : null);
// vo.setPublicity(doc.getPublicity());
@@ -602,7 +606,7 @@
//瀵煎嚭妗堝嵎灏侀潰
@PostMapping("/exportPageInfo/{id}/{recordId}")
- public void exportPageInfo(HttpServletResponse response, @PathVariable Long id, @PathVariable String recordId) throws IOException {
+ public void exportPageInfo(HttpServletResponse response, @PathVariable Long id, @PathVariable String recordId) throws IOException, ParseException {
ArchiveInfoVo aIV = iArchiveRecordsService.selectByRecordId(id);
@@ -610,8 +614,31 @@
arsi.add(aIV);
String recordId1 = recordId;
+ if(aIV!=null)
+ {
+ String date = "";
+ if(arsi.get(0).getPreparationDate()!=null) {
+ System.out.println(arsi.get(0).getPreparationDate().toString() + "]]]]]]]]");
+
+ System.out.println(DateUtil.parseCST(arsi.get(0).getPreparationDate().toString()));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ DateTime dat = DateUtil.parseCST(arsi.get(0).getPreparationDate().toString());
+ date = new SimpleDateFormat("yyyy-MM-dd").format(dat);
+ }
+
+
+ String tmp = "妗e彿:" +
+ arsi.get(0).getRecordId() +
+ ";妗f棣嗭紙瀹わ級鍙�:" + arsi.get(0).getArchiveRoomNumber()+
+ ";缂╁井鍙�:" + arsi.get(0).getMicrofilmNumber()+
+ ";鍙戞枃鍙�:" + arsi.get(0).getInquiryNumber()+
+ ";妗堝嵎棰樺悕:" + arsi.get(0).getCaseTitle() +
+ ";缂栧埗鏃ユ湡:" + date +
+ ";缂栧埗鍗曚綅:" + arsi.get(0).getPreparationUnit() +
+ ";淇濈鏈熼檺:" + arsi.get(0).getRetentionPeriod() +
+ ";瀵嗙骇:" + arsi.get(0).getSecurityClassification();
byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1);
- byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200);
+ byte[] sedcode = pdfGenerateService.createQrCodeN(tmp, 210, 210);
ExcelExp e3 = new ExcelExp("妗堝嵎灏侀潰鏁版嵁",arsi, ArchiveInfoVo.class);
ExcelExp e4 = new ExcelExp("妗堝嵎灏侀潰", arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
@@ -624,6 +651,7 @@
// System.out.println(bos2);
bos2.writeTo(response.getOutputStream());
+ }
}
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java
index 3c6ef8e..1c42d4a 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/archive/archiveAllExportController.java
@@ -1,5 +1,7 @@
package com.ruoyi.web.controller.archive;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
import com.aspose.cells.PdfCompliance;
import com.aspose.words.License;
import com.deepoove.poi.XWPFTemplate;
@@ -332,9 +334,33 @@
List<ArchiveInfoVo> arsi = new ArrayList<>();
arsi.add(aIV);
+
+
+ String date = "";
+ if(arsi.get(0).getPreparationDate()!=null) {
+ System.out.println(arsi.get(0).getPreparationDate().toString() + "]]]]]]]]");
+
+ System.out.println(DateUtil.parseCST(arsi.get(0).getPreparationDate().toString()));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ DateTime dat = DateUtil.parseCST(arsi.get(0).getPreparationDate().toString());
+ date = new SimpleDateFormat("yyyy-MM-dd").format(dat);
+ }
+
+
+ String tmpSec = "妗e彿:" +
+ arsi.get(0).getRecordId() +
+ ";妗f棣嗭紙瀹わ級鍙�:" + arsi.get(0).getArchiveRoomNumber()+
+ ";缂╁井鍙�:" + arsi.get(0).getMicrofilmNumber()+
+ ";鍙戞枃鍙�:" + arsi.get(0).getInquiryNumber()+
+ ";妗堝嵎棰樺悕:" + arsi.get(0).getCaseTitle() +
+ ";缂栧埗鏃ユ湡:" + date +
+ ";缂栧埗鍗曚綅:" + arsi.get(0).getPreparationUnit() +
+ ";淇濈鏈熼檺:" + arsi.get(0).getRetentionPeriod() +
+ ";瀵嗙骇:" + arsi.get(0).getSecurityClassification();
+
String recordId = aIV.getRecordId();
byte[] imgr = barcodeService.generateBarcodeImage(recordId);
- byte[] sedcode = pdfGenerateService.createQrCodeN(recordId, 100, 100);
+ byte[] sedcode = pdfGenerateService.createQrCodeN(tmpSec, 100, 100);
ExcelExp e1 = new ExcelExp("妗堝嵎灏侀潰鏁版嵁",arsi, ArchiveInfoVo.class);
ExcelExp e2 = new ExcelExp("妗堝嵎灏侀潰", arsi, recordId, imgr,sedcode, ArchiveInfoVo.class);
List<ExcelExp> mysheet = new ArrayList<ExcelExp>();
@@ -660,9 +686,33 @@
List<ArchiveInfoVo> arsi = new ArrayList<>();
arsi.add(aIV);
+ String dates = "";
+ if(arsi.get(0).getPreparationDate()!=null) {
+ System.out.println(arsi.get(0).getPreparationDate().toString() + "]]]]]]]]");
+
+ System.out.println(DateUtil.parseCST(arsi.get(0).getPreparationDate().toString()));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ DateTime dat = DateUtil.parseCST(arsi.get(0).getPreparationDate().toString());
+ dates = new SimpleDateFormat("yyyy-MM-dd").format(dat);
+ }
+
+
+ String tmpSec = "妗e彿:" +
+ arsi.get(0).getRecordId() +
+ ";妗f棣嗭紙瀹わ級鍙�:" + arsi.get(0).getArchiveRoomNumber()+
+ ";缂╁井鍙�:" + arsi.get(0).getMicrofilmNumber()+
+ ";鍙戞枃鍙�:" + arsi.get(0).getInquiryNumber()+
+ ";妗堝嵎棰樺悕:" + arsi.get(0).getCaseTitle() +
+ ";缂栧埗鏃ユ湡:" + dates +
+ ";缂栧埗鍗曚綅:" + arsi.get(0).getPreparationUnit() +
+ ";淇濈鏈熼檺:" + arsi.get(0).getRetentionPeriod() +
+ ";瀵嗙骇:" + arsi.get(0).getSecurityClassification();
+
+
+
String recordId1 = aIV.getRecordId();
byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1);
- byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200);
+ byte[] sedcode = pdfGenerateService.createQrCodeN(tmpSec, 200, 200);
ExcelExp e3 = new ExcelExp("妗堝嵎灏侀潰鏁版嵁",arsi, ArchiveInfoVo.class);
ExcelExp e4 = new ExcelExp("妗堝嵎灏侀潰", arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
@@ -1241,9 +1291,33 @@
List<ArchiveInfoVo> arsi = new ArrayList<>();
arsi.add(aIV);
+
+ String date = "";
+ if(arsi.get(0).getPreparationDate()!=null) {
+ System.out.println(arsi.get(0).getPreparationDate().toString() + "]]]]]]]]");
+
+ System.out.println(DateUtil.parseCST(arsi.get(0).getPreparationDate().toString()));
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ DateTime dat = DateUtil.parseCST(arsi.get(0).getPreparationDate().toString());
+ date = new SimpleDateFormat("yyyy-MM-dd").format(dat);
+ }
+
+
+ String tmpSec = "妗e彿:" +
+ arsi.get(0).getRecordId() +
+ ";妗f棣嗭紙瀹わ級鍙�:" + arsi.get(0).getArchiveRoomNumber()+
+ ";缂╁井鍙�:" + arsi.get(0).getMicrofilmNumber()+
+ ";鍙戞枃鍙�:" + arsi.get(0).getInquiryNumber()+
+ ";妗堝嵎棰樺悕:" + arsi.get(0).getCaseTitle() +
+ ";缂栧埗鏃ユ湡:" + date +
+ ";缂栧埗鍗曚綅:" + arsi.get(0).getPreparationUnit() +
+ ";淇濈鏈熼檺:" + arsi.get(0).getRetentionPeriod() +
+ ";瀵嗙骇:" + arsi.get(0).getSecurityClassification();
+
+
String recordId1 = aIV.getRecordId();
byte[] imgr1 = barcodeService.generateBarcodeImage(recordId1);
- byte[] sedcode = pdfGenerateService.createQrCodeN(recordId1, 200, 200);
+ byte[] sedcode = pdfGenerateService.createQrCodeN(tmpSec, 200, 200);
ExcelExp e3 = new ExcelExp("妗堝嵎灏侀潰鏁版嵁",arsi, ArchiveInfoVo.class);
ExcelExp e4 = new ExcelExp("妗堝嵎灏侀潰", arsi, recordId1, imgr1,sedcode, ArchiveInfoVo.class);
List<ExcelExp> mysheet1 = new ArrayList<ExcelExp>();
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 cf5d9cb..4631cea 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
@@ -14,12 +14,10 @@
import com.ruoyi.common.utils.file.ImageUtils;
import com.ruoyi.common.utils.reflect.ReflectUtils;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
+import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
-import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
-import org.apache.poi.hssf.usermodel.HSSFDataValidation;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
import org.apache.poi.hssf.usermodel.HSSFDataValidation;
@@ -300,10 +298,34 @@
if(index == 1) {
// 鍚堝苟绗竴琛岀殑鍓�5涓崟鍏冩牸
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 6));
+ // 鑾峰彇椤甸潰璁剧疆
+ // 蹇呴』鍏堣缃负true
+ // 椤甸潰甯冨眬璁剧疆
+ sheet.setAutobreaks(true);
+ sheet.setFitToPage(true);
- // 鍒涘缓琛屽苟璁剧疆楂樺害
+ // 鑾峰彇鎵撳嵃璁剧疆
+ PrintSetup printSetup = sheet.getPrintSetup();
+
+ // 璁剧疆涓�1椤靛搴�
+ printSetup.setFitWidth((short) 1); // 瀹藉害璋冩暣涓�1椤�
+ printSetup.setFitHeight((short) 0); // 楂樺害涓嶉檺鍒�
+
+ // 鍏朵粬鎵撳嵃璁剧疆
+ printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE); // A4绾�
+ printSetup.setLandscape(false); // 绾靛悜鎵撳嵃
+
+ // 璁剧疆椤佃竟璺�
+ sheet.setMargin(Sheet.LeftMargin, 0.5);
+ sheet.setMargin(Sheet.RightMargin, 0.5);
+ // 璁剧疆鎵撳嵃鍖哄煙锛屼粠绗�0琛屽埌绗�1000琛岋紝绗�0鍒楀埌绗�20鍒楋紙鏍规嵁瀹為檯鎯呭喌璋冩暣锛�
+ // sheet.setPrintArea(0, 0, 20, 0, 1000);
+ // 濡傛灉鏄痠ndex涓�1鐨剆heet锛岃缃《绔爣棰樿
+
+ // 灏嗙1琛岋紙绱㈠紩涓�0锛夎缃负姣忛〉閲嶅鐨勬爣棰樿
+ sheet.setRepeatingRows(CellRangeAddress.valueOf("$1:$4"));
row = sheet.createRow(0);
- row.setHeight((short)(30 *30));
+ row.setHeight((short) (37*20));
// 鍒涘缓鍗曞厓鏍煎苟娣诲姞鍥剧墖
Cell cell = row.createCell(0);
@@ -312,8 +334,10 @@
// if (Files.exists(Paths.get(imagePath))) {
// byte[] imageBytes = Files.readAllBytes(Paths.get(imagePath));
// 灏哹yte鏁扮粍杞崲鎴恑nputstream锛屼互渚挎彃鍏ュ埌Excel涓�
- ClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 5),
+ ClientAnchor anchor = new HSSFClientAnchor(0, 0, 0, 100, (short) cell.getColumnIndex(), cell.getRow().getRowNum(), (short) (cell.getColumnIndex() + 5),
cell.getRow().getRowNum() + 1);
+ // 璁剧疆閿氱偣绫诲瀷涓篗OVE_AND_RESIZE锛屼娇鍥剧墖鍙互闅忓崟鍏冩牸璋冩暣澶у皬
+ anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
// 璁$畻灞呬腑浣嶇疆
int col1 = 3; // 涓棿鍒�
int col2 = col1 + 2;
@@ -321,7 +345,6 @@
anchor.setCol2(col2);
anchor.setRow1(0);
anchor.setRow2(1);
- // anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
// anchor.set
// anchor.setHorizontallyCenter(true);
@@ -341,9 +364,10 @@
// log.error("娣诲姞鍥剧墖澶辫触: {}", e.getMessage());
// }
row = sheet.createRow(1);
+ row.setHeight((short) (32.5*20));
sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 6));
Cell titleCell = row.createCell(0);
- titleCell.setCellValue("鍗� 鍐� 鐩� 褰�");
+ titleCell.setCellValue("鍗� 鍐� 鐩� 褰�");
// 璁剧疆鍔犵矖銆佸畫浣撱��18鍙峰瓧浣撳拰灞呬腑鏍峰紡
CellStyle style = wb.createCellStyle();
Font font = wb.createFont();
@@ -354,14 +378,36 @@
style.setAlignment(HorizontalAlignment.CENTER);
titleCell.setCellStyle(style);
row = sheet.createRow(2);
+ row.setHeight((short) (20*20));
//
- row.createCell(4).setCellValue("妗e彿:");
+ Cell dnumCell = row.createCell(4);
+ dnumCell.setCellValue("妗e彿:");
+ // 璁剧疆鍔犵矖銆佸畫浣撱��18鍙峰瓧浣撳拰灞呬腑鏍峰紡
+ CellStyle style1 = wb.createCellStyle();
+ Font font1 = wb.createFont();
+ font1.setBold(true);
+ font1.setFontName("瀹嬩綋");
+ font1.setFontHeightInPoints((short) 12);
+ style1.setFont(font1);
+ style1.setAlignment(HorizontalAlignment.RIGHT);
+ dnumCell.setCellStyle(style1);
// row.createCell(4).setCellValue("妗e彿:");
//鎷垮埌妗e彿
String recordId = list.get(index).getRecordId();
- row.createCell(5).setCellValue(recordId);
+ // 鍒涘缓甯︽湁涓嬪垝绾挎牱寮忕殑鍗曞厓鏍�
+ Cell recordIdCell = row.createCell(5);
+ recordIdCell.setCellValue(recordId);
+ // 鍒涘缓涓嬪垝绾挎牱寮�
+ CellStyle underlineStyle = wb.createCellStyle();
+ Font underlineFont = wb.createFont();
+ underlineFont.setFontName("瀹嬩綋");
+ underlineFont.setFontHeightInPoints((short) 11);
+ underlineFont.setUnderline(Font.U_SINGLE); // 璁剧疆涓嬪垝绾�
+ underlineStyle.setFont(underlineFont);
+ recordIdCell.setCellStyle(underlineStyle);
row = sheet.createRow(3);
-
+ row.setHeight((short) (17.5*20));
+ row = sheet.createRow(4);
// // 娣诲姞鎬婚〉鏁板拰褰撳墠椤电爜淇℃伅
// row.createCell(5).setCellValue("鎬婚〉鏁�: " + list.size() + ", 褰撳墠椤�: " + (index + 1));
// row = sheet.createRow(4);
@@ -476,7 +522,7 @@
// int endNo = Math.min(startNo + sheetSize, list.size());
for (int i = 0; i < list.size(); i++) {
if(index==1)
- row = sheet.createRow(i + 4 );
+ row = sheet.createRow(i + 5 );
else
row = sheet.createRow(i + 1 );
// 寰楀埌瀵煎嚭瀵硅薄.
@@ -516,7 +562,7 @@
style.setWrapText(true);
Font dataFont = wb.createFont();
dataFont.setFontName("Arial");
- dataFont.setFontHeightInPoints((short) 10);
+ dataFont.setFontHeightInPoints((short) 12);
style.setFont(dataFont);
styles.put("data", style);
@@ -541,7 +587,7 @@
style.setWrapText(true);
Font headerFont = wb.createFont();
headerFont.setFontName(excel.headerFontName());
- headerFont.setFontHeightInPoints((short) 10);
+ headerFont.setFontHeightInPoints((short) 12);
headerFont.setBold(excel.headerFontBold());
headerFont.setColor(excel.headerColor().index);
style.setFont(headerFont);
@@ -555,7 +601,7 @@
style.setVerticalAlignment(VerticalAlignment.CENTER);
Font totalFont = wb.createFont();
totalFont.setFontName("Arial");
- totalFont.setFontHeightInPoints((short) 10);
+ totalFont.setFontHeightInPoints((short) 12);
style.setFont(totalFont);
// 鎬昏琛屼篃璁剧疆鑷姩鎹㈣
style.setWrapText(true);
@@ -975,6 +1021,42 @@
} else {
wb.setSheetName(index, sheetName + index);
}
+ // 璁剧疆椤甸潰灞炴��
+ sheet.setFitToPage(true);
+ PrintSetup printSetup = sheet.getPrintSetup();
+ printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE); // 璁剧疆涓篈4绾稿紶
+ printSetup.setLandscape(false); // 绾靛悜鎵撳嵃
+ printSetup.setFitWidth((short) 1); // 瀹藉害璋冩暣涓�1椤�
+ printSetup.setFitHeight((short) 0); // 0琛ㄧず楂樺害涓嶉檺鍒堕〉鏁帮紙鑷姩锛�
+ // 璁剧疆椤佃竟璺�
+ sheet.setMargin(Sheet.TopMargin, 1.0); // 澧炲姞椤堕儴杈硅窛浠ュ绾抽〉鐪�
+ sheet.setMargin(Sheet.BottomMargin, 0.5);
+ sheet.setMargin(Sheet.LeftMargin, 0.5);
+ sheet.setMargin(Sheet.RightMargin, 0.5);
+ sheet.setMargin(Sheet.HeaderMargin, 0.5); // 璁剧疆椤电湁杈硅窛
+ sheet.setMargin(Sheet.FooterMargin, 0.5); // 璁剧疆椤佃剼杈硅窛
+ // 璁剧疆鎵撳嵃鍖哄煙锛屼粠绗�0琛屽埌绗�1000琛岋紝绗�0鍒楀埌绗�20鍒楋紙鏍规嵁瀹為檯鎯呭喌璋冩暣锛�
+ //sheet.setPrintArea(0, 0, 20, 0, 1000);
+ // 璁剧疆椤电湁锛屾樉绀烘�婚〉鏁板拰褰撳墠椤电爜
+ if (wb instanceof HSSFWorkbook) {
+ HSSFWorkbook hssfWb = (HSSFWorkbook) wb;
+ HSSFSheet hssfSheet = hssfWb.getSheetAt(index);
+ HSSFHeader header = hssfSheet.getHeader();
+ // 璁剧疆椤电湁瀛椾綋
+ // header.setFontName("瀹嬩綋");
+ // header.setFontSize((short) 10);
+ // 璁剧疆椤电湁鍐呭
+ hssfSheet.setMargin(Sheet.HeaderMargin, 0.5);
+ header.setRight("鎬婚〉鏁�: &P, 褰撳墠椤�: &N");
+ // 璁剧疆椤电湁宸﹀榻愬拰鍙冲榻愬唴瀹癸紙鍙�夛級
+ header.setLeft("鏂囨。鏍囬");
+ header.setRight("&D &T"); // 鏃ユ湡鍜屾椂闂�
+ }
+ // 濡傛灉鏄痠ndex涓�1鐨剆heet锛岃缃《绔爣棰樿
+ if (index == 1) {
+ // 灏嗙1琛岋紙绱㈠紩涓�0锛夎缃负姣忛〉閲嶅鐨勬爣棰樿
+ sheet.setRepeatingRows(CellRangeAddress.valueOf("$1:$4"));
+ }
}
/**
* 鍒涘缓宸ヤ綔琛�
@@ -985,6 +1067,40 @@
this.sheet = wb.createSheet();
this.styles = createStyles(wb);
wb.setSheetName(index, sheetName);
+ // 鑾峰彇椤甸潰璁剧疆
+ // 蹇呴』鍏堣缃负true
+ sheet.setFitToPage(true);
+ PrintSetup printSetup = sheet.getPrintSetup();
+ printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE); // 璁剧疆涓篈4绾稿紶
+ printSetup.setLandscape(false); // 绾靛悜鎵撳嵃
+ printSetup.setFitWidth((short) 1); // 瀹藉害璋冩暣涓�1椤�
+ printSetup.setFitHeight((short) 0); // 0琛ㄧず楂樺害涓嶉檺鍒堕〉鏁帮紙鑷姩锛�
+ // 璁剧疆椤佃竟璺�
+ sheet.setMargin(Sheet.TopMargin, 1.0); // 澧炲姞椤堕儴杈硅窛浠ュ绾抽〉鐪�
+ sheet.setMargin(Sheet.BottomMargin, 0.5);
+ sheet.setMargin(Sheet.LeftMargin, 0.5);
+ sheet.setMargin(Sheet.RightMargin, 0.5);
+ sheet.setMargin(Sheet.HeaderMargin, 0.5); // 璁剧疆椤电湁杈硅窛
+ sheet.setMargin(Sheet.FooterMargin, 0.5); // 璁剧疆椤佃剼杈硅窛
+ // 璁剧疆鎵撳嵃鍖哄煙锛屼粠绗�0琛屽埌绗�1000琛岋紝绗�0鍒楀埌绗�20鍒楋紙鏍规嵁瀹為檯鎯呭喌璋冩暣锛�
+ // sheet.setPrintArea(0, 0, 20, 0, 1000);
+ // 璁剧疆椤电湁锛屾樉绀烘�婚〉鏁板拰褰撳墠椤电爜
+ if (wb instanceof HSSFWorkbook) {
+ HSSFWorkbook hssfWb = (HSSFWorkbook) wb;
+ HSSFSheet hssfSheet = hssfWb.getSheetAt(index);
+ HSSFHeader header = hssfSheet.getHeader();
+ // 璁剧疆椤电湁瀛椾綋
+ // header.setFontName("瀹嬩綋");
+ // header.setFontSize((short) 10);
+ // 璁剧疆椤电湁鍐呭
+ hssfSheet.setMargin(Sheet.HeaderMargin, 2.1);
+ header.setRight("鍏� &N 椤� 绗� &P椤�");
+ }
+ // 濡傛灉鏄痠ndex涓�1鐨剆heet锛岃缃《绔爣棰樿
+ if (index == 1) {
+ // 灏嗙1琛岋紙绱㈠紩涓�0锛夎缃负姣忛〉閲嶅鐨勬爣棰樿
+ sheet.setRepeatingRows(CellRangeAddress.valueOf("$1:$3"));
+ }
}
/**
* 鑾峰彇鍗曞厓鏍煎��
@@ -1026,4 +1142,4 @@
}
return val;
}
-}
+}
\ No newline at end of file
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 eb1d918..6ca9169 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
@@ -276,8 +276,8 @@
*/
public void exportExcelManySheet(HttpServletResponse response, List<ExcelExp> list, boolean includeQrCode, byte[] bt,
List<String> sigArr, List<String> arrAn, String inquiryNumber, String caseTitle) throws IOException {
- // response.setContentType("application/vnd.ms-excel");
- // response.setCharacterEncoding("utf-8");
+ // response.setContentType("application/vnd.ms-excel");
+ // response.setCharacterEncoding("utf-8");
try {
createWorkbook();
@@ -299,7 +299,7 @@
// 鍒涘缓琛屽苟璁剧疆楂樺害
- row = sheet.createRow(firow);
+ row = sheet.createRow(firow);
row.setHeight((short)(40 * 40));
//鐢熸垚浜岀淮鐮�
if(includeQrCode)
@@ -345,7 +345,7 @@
firow = firow + 1;
row = sheet.createRow(firow);
}
- // sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
+ // sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
if(firow==1)
{
sheet.addMergedRegion(new CellRangeAddress(firow, firow, 0, 8));
@@ -364,7 +364,7 @@
titleCell.setCellStyle(style);
firow = firow + 1;
row = sheet.createRow(firow);
- //
+ //
row.createCell(0).setCellValue("鍙戞枃鍙�:");
sheet.addMergedRegion(new CellRangeAddress(firow, firow, 1, 3));
row.createCell(1).setCellValue(inquiryNumber);
@@ -383,7 +383,7 @@
column = 0;
} else {
// 鏅�歴heet澶勭悊
- // recordId = (DocumentMaterialsVo)list.get(0)
+ // recordId = (DocumentMaterialsVo)list.get(0)
row = sheet.createRow(0);
column = 0;
}
@@ -562,7 +562,7 @@
String key = StringUtils.format("header_{}_{}", excel.headerColor(), excel.headerBackgroundColor());
if (!headerStyles.containsKey(key))
{
- style = wb.createCellStyle();
+ style = wb.createCellStyle();
style.cloneStyleFrom(styles.get("data"));
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
@@ -1060,4 +1060,4 @@
}
return val;
}
-}
+}
\ No newline at end of file
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetSecond.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetSecond.java
index 287e7b0..e18f2be 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetSecond.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtilManySheetSecond.java
@@ -14,7 +14,6 @@
import com.ruoyi.common.utils.reflect.ReflectUtils;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import org.apache.poi.ss.usermodel.*;
-import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
@@ -294,13 +293,37 @@
if(index==1)
{
Row row = sheet.createRow(0);
- row.setHeightInPoints(20); // 璁剧疆琛岄珮涓�20纾�
+ // row.setHeightInPoints(20); // 璁剧疆琛岄珮涓�20纾�
+ row.setHeight((short) (12.75*20));
int column = 0;
- row = sheet.createRow(0);
+ row = sheet.createRow(1);
+ row.setHeight((short) (12.75*20));
sheet.addMergedRegion(new CellRangeAddress(2, 3, 0, 1));
row = sheet.createRow(2);
- row.setHeightInPoints(100); // 璁剧疆琛岄珮涓�20纾�
+ row.setHeight((short) (77.5*20));
+ row = sheet.createRow(3);
+ row.setHeight((short) (35*20));
+ // row.setHeightInPoints(100); // 璁剧疆琛岄珮涓�20纾�
+
+ // 椤甸潰甯冨眬璁剧疆
+ sheet.setAutobreaks(true);
+ sheet.setFitToPage(true);
+
+ // 鑾峰彇鎵撳嵃璁剧疆
+ PrintSetup printSetup = sheet.getPrintSetup();
+
+ // 璁剧疆涓�1椤靛搴�
+ printSetup.setFitWidth((short) 1); // 瀹藉害璋冩暣涓�1椤�
+ printSetup.setFitHeight((short) 0); // 楂樺害涓嶉檺鍒�
+
+ // 鍏朵粬鎵撳嵃璁剧疆
+ printSetup.setPaperSize(PrintSetup.A4_PAPERSIZE); // A4绾�
+ printSetup.setLandscape(false); // 绾靛悜鎵撳嵃
+ sheet.setMargin(Sheet.LeftMargin, 1.04);
+ sheet.setMargin(Sheet.RightMargin, 1.04);
+ sheet.setMargin(Sheet.TopMargin, 0.97);
+ sheet.setMargin(Sheet.BottomMargin, 0.97);
//鎷垮埌鍥剧墖
// 鍒涘缓鍗曞厓鏍煎苟娣诲姞鍥剧墖
Cell cell = row.createCell(0);
@@ -314,7 +337,9 @@
// 鍒涘缓鍗曞厓鏍�
Cell qrCell = sheet.createRow(2).createCell(1);
// 璁剧疆琛岄珮瓒冲楂樹互鏄剧ず浜岀淮鐮�
- sheet.getRow(2).setHeightInPoints(100);
+ sheet.getRow(2).setHeight((short) (77.5*20));
+ // sheet.getRow(3).setHeight((short) (35*20));
+ // sheet.getRow(2).setHeightInPoints(100);
// 浜岀淮鐮侀渶瑕佽緝澶х殑鍒楀鏉ユ樉绀猴紝璁剧疆涔嬪墠鍏堜繚瀛樺綋鍓嶅垪瀹�
int currentColumnWidth = sheet.getColumnWidth(1);
// 璁剧疆瓒冲瀹界殑鍒楀浠ユ樉绀轰簩缁寸爜
@@ -323,7 +348,7 @@
// 鍒涘缓鍥剧墖閿氱偣锛岃缃湪绗�2琛岀2鍒�
// 浜岀淮鐮佹樉绀哄湪鍙充笂瑙掍笖涓嶅~婊℃暣涓牸瀛�
// 缂╁皬鍥剧墖鑼冨洿锛氬彧鍗犵敤閮ㄥ垎鍗曞厓鏍肩┖闂�
- ClientAnchor anchor = new HSSFClientAnchor(700, 20, 1000, 220, (short) 1, 2, (short) 1, 2);
+ ClientAnchor anchor = new HSSFClientAnchor(680, 0, 1000, 250, (short) 1, 2, (short) 1, 2);
// 璁剧疆鍥剧墖浣嶇疆鍜屽ぇ灏�
anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_DONT_RESIZE);
@@ -336,12 +361,13 @@
+
// 浠�"妗f棣� (瀹�) 鍙�:"涓哄熀鍑嗭紝缁熶竴鎵�鏈夋爣棰樼殑闀垮害鍜屾牸寮�
String [] tits = {
- "妗� 鍙�:",
- "妗f棣� (瀹�) 鍙�:",
- "缂� 寰� 鍙�:",
- "鍙� 鏂� 鍙�:",
+ "妗� 鍙�:",
+ "妗f棣� 锛堝锛� 鍙�:",
+ "缂� 寰� 鍙�:",
+ "鍙� 鏂� 鍙�:",
"妗� 鍗� 棰� 鍚�:",
"缂� 鍒� 鏃� 鏈�:",
"缂� 鍒� 鍗� 浣�:",
@@ -366,10 +392,13 @@
Object fieldValue = field1.get(obj);
if(fieldValue==null)
fieldValue="";
+
if(i <= 3)
row = sheet.createRow(i+4);
if(i > 3)
row = sheet.createRow(i+7);
+ if(i != 4)
+ row.setHeight((short) (35*20));
// row.setHeight((short) 30);
// 涓嶈缃浐瀹氳楂橈紝鍚庣画浣跨敤autoSizeRow鑷姩璋冩暣
cell = row.createCell(0);
@@ -377,8 +406,8 @@
// 绗竴鍒楀搴﹁缃负27
// 绗簩鍒楀搴﹁缃负51
// 浣跨敤涓巃ddCell鏂规硶鐩稿悓鐨勮绠楀叕寮忚缃垪瀹�
- sheet.setColumnWidth(0, (int) ((29 + 0.72) * 256)); // 绗竴鍒楋細瀹藉害27
- sheet.setColumnWidth(1, (int) ((52 + 0.72) * 256)); // 绗簩鍒楋細瀹藉害51
+ sheet.setColumnWidth(0, (int) ((27.86 + 0.72) * 256)); // 绗竴鍒楋細瀹藉害27
+ sheet.setColumnWidth(1, (int) ((51.57 + 0.72) * 256)); // 绗簩鍒楋細瀹藉害51
CellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.RIGHT);
@@ -392,11 +421,20 @@
font.setFontHeightInPoints((short) 18);
style.setFont(font);
style.setWrapText(true); // 璁剧疆鑷姩鎹㈣
+
+ if(i==4)
+ {
+ style.setVerticalAlignment(VerticalAlignment.TOP); // 璁剧疆鍨傜洿涓嬪榻�
+
+ }
cell.setCellStyle(style);
cell.setCellValue(tits[i]);
+
+
Cell cel = row.createCell(1);
CellStyle style1 = wb.createCellStyle();
- style1.setBorderBottom(BorderStyle.THIN); // 娣诲姞涓嬪垝绾�
+ if(i!=4)
+ style1.setBorderBottom(BorderStyle.THIN); // 娣诲姞涓嬪垝绾�
style1.setWrapText(true); // 璁剧疆鑷姩鎹㈣
style1.setVerticalAlignment(VerticalAlignment.BOTTOM); // 璁剧疆鍨傜洿涓嬪榻�
@@ -416,8 +454,16 @@
{
// 纭繚妗� 鍗� 棰� 鍚�:杩欎竴琛岃兘鏍规嵁鍐呭闀垮害鑷姩鎹㈣
style1.setWrapText(true); // 鏄庣‘璁剧疆鑷姩鎹㈣
+ style1.setVerticalAlignment(VerticalAlignment.TOP); // 璁剧疆鍨傜洿涓嬪榻�
+
cel.setCellStyle(style1);
+ row.setHeight((short) (110*20));
+
+
+
+
}
+
// 澶勭悊鏃ユ湡鏍煎紡鍖栵紝鐗瑰埆鏄�"缂� 鍒� 鏃� 鏈�:"杩欎竴琛�
if (i == 5 && fieldValue instanceof Date) {
// 璁剧疆鏃ユ湡鏍煎紡涓簓yyy-MM-dd
@@ -428,29 +474,32 @@
}
// 瀵逛簬i==4鐨勬儏鍐碉紝纭繚琛岄珮鑳芥牴鎹唴瀹硅嚜鍔ㄨ皟鏁�
- if(i==4)
- {
- // 璁剧疆琛岄珮涓鸿嚜鍔ㄨ皟鏁达紙-1琛ㄧず鑷姩楂樺害锛�
- row.setHeight((short) -1);
- // 涓嶉檺鍒舵渶澶ц楂橈紝鍏佽鏍规嵁鍐呭鑷姩璋冩暣
- } else {
- // 浣跨敤setHeight鏂规硶璁剧疆琛岄珮涓鸿嚜鍔ㄨ皟鏁达紙-1琛ㄧず鑷姩楂樺害锛�
- row.setHeight((short) -1);
- // 纭繚琛岄珮鑷冲皯涓�40纾咃紝浣嗕笉闄愬埗鏈�澶ц楂�
- if (row.getHeightInPoints() < 40) {
- row.setHeightInPoints(40);
- }
- }
+// if(i==4)
+// {
+// // 璁剧疆琛岄珮涓鸿嚜鍔ㄨ皟鏁达紙-1琛ㄧず鑷姩楂樺害锛�
+// // row.setHeight((short) -1);
+// // 涓嶉檺鍒舵渶澶ц楂橈紝鍏佽鏍规嵁鍐呭鑷姩璋冩暣
+// } else if (i > 4) { // 鍙i>1鐨勮搴旂敤杩欎簺璁剧疆锛屼繚鐣檌<=1鐨勮楂樿缃�
+// // 浣跨敤setHeight鏂规硶璁剧疆琛岄珮涓鸿嚜鍔ㄨ皟鏁达紙-1琛ㄧず鑷姩楂樺害锛�
+// row.setHeight((short) -1);
+// // 纭繚琛岄珮鑷冲皯涓�40纾咃紝浣嗕笉闄愬埗鏈�澶ц楂�
+// if (row.getHeightInPoints() < 40) {
+// row.setHeightInPoints(40);
+// }
+// }
// sheet.setColumnWidth(0, 60 * 256);
i++;
if(i==3)
{
row = sheet.createRow(8);
+ row.setHeight((short) (35*20));
// 璁剧疆琛岄珮涓鸿嚜鍔ㄨ皟鏁�
- row.setHeight((short) -1);
+ // row.setHeight((short) -1);
// row.setHeight((short) 30);
- row.setHeightInPoints(20); // 璁剧疆琛岄珮涓�20纾�
+ // row.setHeightInPoints(20); // 璁剧疆琛岄珮涓�20纾�
row = sheet.createRow(9);
+ row.setHeight((short) (50*20));
+
//璁剧疆鏉″舰鐮�
// 璁剧疆鏉″舰鐮�
byte[] dat = list.get(index).getImgr();
@@ -458,7 +507,8 @@
// 鍒涘缓鍗曞厓鏍�
Cell barcodeCell = sheet.createRow(9).createCell(0);
// 璁剧疆琛岄珮瓒冲楂樹互鏄剧ず鏉″舰鐮�
- sheet.getRow(9).setHeightInPoints(40);
+ // sheet.getRow(9).setHeightInPoints(40);
+ sheet.getRow(9).setHeight((short) (50*20));
// 璁剧疆鍒楀瓒冲瀹戒互鏄剧ず鏉″舰鐮侊紝鍏堜繚瀛樺綋鍓嶅垪瀹�
int currentColumnWidth0 = sheet.getColumnWidth(0);
sheet.setColumnWidth(0, 40 * 256);
@@ -467,7 +517,7 @@
// 鏉″舰鐮佸眳涓笖涓嶈秴鍑虹浜屼釜鏍煎瓙
// 璋冩暣缁撴潫鍒楃储寮曞拰浣嶇疆鍙傛暟
// 澧炲姞dx1鍊硷紝浣挎潯褰㈢爜鏁翠綋鍚戝彸绉诲姩
- ClientAnchor anchor1 = new HSSFClientAnchor(660, 50, 900, 200, (short) 0, 9, (short) 1, 10);
+ ClientAnchor anchor1 = new HSSFClientAnchor(660, 0, 900, 60, (short) 0, 9, (short) 1, 10);
// 璁剧疆鍥剧墖浣嶇疆鍜屽ぇ灏�
anchor1.setAnchorType(ClientAnchor.AnchorType.MOVE_DONT_RESIZE);
@@ -482,9 +532,9 @@
- row.setHeightInPoints(70); // 璁剧疆琛岄珮涓�20纾�
+ //row.setHeightInPoints(70); // 璁剧疆琛岄珮涓�20纾�
row = sheet.createRow(10);
- row.setHeightInPoints(40); // 璁剧疆琛岄珮涓�20纾�
+ row.setHeight((short) (35*20));
}
// 鎵撳嵃瀛楁鍚嶇О鍜屽��
System.out.println(fieldName + ": " + fieldValue);
@@ -1197,3 +1247,5 @@
+
+
--
Gitblit v1.9.1