20240419lidy代码上传

master
李冬阳 1 year ago
parent 49672d3fa1
commit ca69b8f9af

@ -42,10 +42,10 @@ public class BoxReportOperation extends AbstractAIFOperation {
private LinkedList<String[]> datas; private LinkedList<String[]> datas;
private HashMap<String, Integer> boxMap; private HashMap<String, Integer> boxMap;
private final int PAGE_CNT = 23;// private final int PAGE_CNT = 23;//每页内容行数
private final int TITLE_CNT = 4; private final int TITLE_CNT = 4;//每页表头行数
private final int PAGE = PAGE_CNT + TITLE_CNT; private final int PAGE = PAGE_CNT + TITLE_CNT;//每页总行数
private final int COL_CNT = 9; private final int COL_CNT = 9;//每页最大列号
/** /**
* ×°Ïäµ¥±¨±í * ×°Ïäµ¥±¨±í
* @param session TCSession * @param session TCSession
@ -114,10 +114,11 @@ public class BoxReportOperation extends AbstractAIFOperation {
if(b % PAGE_CNT > 0) if(b % PAGE_CNT > 0)
pageCnt ++; pageCnt ++;
} }
for(int i=1; i<=pageCnt; i++) { // for(int i=1; i<=pageCnt; i++) {
// sheet.copyRows(0, PAGE, i*PAGE, null); //// sheet.copyRows(0, PAGE, i*PAGE, null);
POIUtil.copyRows(workbook, sheet, 0, PAGE-1, i*PAGE, COL_CNT, 1); // POIUtil.copyRows(workbook, sheet, 0, PAGE-1, i*PAGE, COL_CNT, 1);
} // }
POIUtil.copyRows(workbook, sheet, 0, PAGE-1, PAGE, COL_CNT, pageCnt - 1);
int row = 0, rbox = 0, pbox = 0; int row = 0, rbox = 0, pbox = 0;
for(String[] data : datas) { for(String[] data : datas) {
int box = Integer.parseInt(data[COL_CNT]); int box = Integer.parseInt(data[COL_CNT]);
@ -131,7 +132,7 @@ public class BoxReportOperation extends AbstractAIFOperation {
rbox = 1; rbox = 1;
pbox = box; pbox = box;
xssfrow = TCUtil.getRow(sheet, page * PAGE + 1); xssfrow = TCUtil.getRow(sheet, page * PAGE);
cell = TCUtil.getCell(xssfrow, 5); cell = TCUtil.getCell(xssfrow, 5);
String[] boxno = PlmLocale.getString("boxno").split(";"); String[] boxno = PlmLocale.getString("boxno").split(";");
cell.setCellValue(boxno[0] + getNumStr(box) + boxno[1]); cell.setCellValue(boxno[0] + getNumStr(box) + boxno[1]);

@ -506,9 +506,11 @@ public class POIUtil {
XSSFCell targetCell = null; XSSFCell targetCell = null;
short m; short m;
sourceRow = getRow(sheet, i); sourceRow = getRow(sheet, i);
for (int j = 1; j <= copyCount; j++) { for (int j = 0; j < copyCount; j++) {
int space = (endRow - startRow + 1 + margin) * j; // int space = (endRow - startRow + 1 + margin) * j;
targetRow = sheet.createRow(i + space); // targetRow = sheet.createRow(i + space);
int space = (endRow - startRow + 1) * j + margin;
targetRow = getRow(sheet, i - startRow + space);
targetRow.setHeight(sourceRow.getHeight()); targetRow.setHeight(sourceRow.getHeight());
for (m = sourceRow.getFirstCellNum(); m <= endCol; m++) { for (m = sourceRow.getFirstCellNum(); m <= endCol; m++) {
if(m < 0) if(m < 0)
@ -548,8 +550,8 @@ public class POIUtil {
} }
} }
for (int j = 1; j <= copyCount; j++) { for (int j = 0; j < copyCount; j++) {
int space = (endRow - startRow + 1 + margin) * j; int space = margin + (endRow - startRow + 1) * j - startRow;
for (int n = 0; n < regionCnt; n++) { for (int n = 0; n < regionCnt; n++) {
region = sheet.getMergedRegion(n); region = sheet.getMergedRegion(n);
if ((region.getFirstColumn() >= startRow) && (region.getLastRow() <= endRow) && (region.getLastColumn() <= endCol)) { if ((region.getFirstColumn() >= startRow) && (region.getLastRow() <= endRow) && (region.getLastColumn() <= endCol)) {

Loading…
Cancel
Save