From d8bc08083504bc5d8ba61513ac21ec0f26ba5c8d Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 30 十二月 2020 23:51:23 +0800
Subject: [PATCH] 优化代码
---
service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java b/service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
index 32354bb..0d87994 100644
--- a/service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
+++ b/service-front/src/main/java/com/java110/front/smo/assetExport/impl/ExportFeeManualCollectionSMOImpl.java
@@ -10,11 +10,7 @@
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.DateUtil;
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
@@ -30,7 +26,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.math.BigDecimal;
/**
* @ClassName AssetImportSmoImpl
@@ -142,7 +137,7 @@
//鏌ヨ妤兼爧淇℃伅
JSONArray rooms = this.getExistsRoomFee(pd, componentValidateResult);
if (rooms == null || rooms.size() < 1) {
- CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
+ CellRangeAddress region = new CellRangeAddress(0, 0, 0, 1);
sheet.addMergedRegion(region);
return;
}
@@ -156,7 +151,7 @@
}
dataKeyIndex++;
}
- row.createCell(dataKeyIndex+2).setCellValue("澶囨敞");
+ row.createCell(dataKeyIndex).setCellValue("澶囨敞");
for (int roomIndex = 0; roomIndex < rooms.size(); roomIndex++) {
@@ -168,10 +163,16 @@
row.createCell(dataKeyIndex).setCellValue(dataObj.getString(key));
dataKeyIndex++;
}
- row.createCell(dataKeyIndex+2).setCellValue("");
+ row.createCell(dataKeyIndex + 2).setCellValue("");
}
- CellRangeAddress region = new CellRangeAddress(0, 0, 0, 10);
+ row = sheet.createRow(rooms.size() + 2);
+ cell0 = row.createCell(0);
+ cell0.setCellValue("娉細姝ゃ�婃瑺璐圭粺璁¤〃銆嬩氦鐢卞帵闂ㄧ淮搴︽櫤涓寸鎶�鏈夐檺鍏徃杩涜鍌敹");
+
+ CellRangeAddress region = new CellRangeAddress(0, 0, 0, dataKeyIndex);
+ sheet.addMergedRegion(region);
+ region = new CellRangeAddress(rooms.size() + 2, rooms.size() + 2, 0, dataKeyIndex);
sheet.addMergedRegion(region);
}
--
Gitblit v1.8.0