空指针
This commit is contained in:
+54
-50
@@ -314,36 +314,38 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
||||
row.createCell(1).setCellValue(itemLeft.getItemsNum());
|
||||
row.createCell(2).setCellValue(itemLeft.getItemsName());
|
||||
String text = itemLeft.getItemsText();
|
||||
log.info("-------------- 开始开始拆分左侧图片、文字、表格 :" + text + "-----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 左侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +"-----------------");
|
||||
leftSplit = rowDataAndPath.split("---");
|
||||
if (leftSplit.length > 1) {
|
||||
for (int j = 0; j < leftSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(leftSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
if (StringUtils.isNotEmpty(text)){
|
||||
log.info("-------------- 开始开始拆分左侧图片、文字、表格 :" + text + "-----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 左侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +"-----------------");
|
||||
leftSplit = rowDataAndPath.split("---");
|
||||
if (leftSplit.length > 1) {
|
||||
for (int j = 0; j < leftSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(leftSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
}
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始开始处理左侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, leftSplit[j], 3);
|
||||
log.info("-------------- 左侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setLeftStart(i);
|
||||
sarFileCompareExcelMergeCell.setLeftEnd(i + leftSplit.length - 1);
|
||||
sarFileCompareExcelMergeCell.setRightStart(0);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(0);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(3).setCellValue(rowDataAndPath);
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setLeftStart(i);
|
||||
sarFileCompareExcelMergeCell.setLeftEnd(i + leftSplit.length - 1);
|
||||
sarFileCompareExcelMergeCell.setRightStart(0);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(0);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(3).setCellValue(rowDataAndPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,34 +356,36 @@ public class SarFileCompareItemCommentServiceImpl extends ServiceImpl<SarFileCom
|
||||
row.createCell(5).setCellValue(itemRight.getItemsNum());
|
||||
row.createCell(6).setCellValue(itemRight.getItemsName());
|
||||
String text = itemRight.getItemsText();
|
||||
log.info("-------------- 开始开始拆分右侧图片、文字、表格 :"+ text +" -----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 右侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +" -----------------");
|
||||
rightSplit = rowDataAndPath.split("---");
|
||||
if (rightSplit.length > 1) {
|
||||
for (int j = 0; j < rightSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(rightSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
if (StringUtils.isNotEmpty(text)) {
|
||||
log.info("-------------- 开始开始拆分右侧图片、文字、表格 :"+ text +" -----------------");
|
||||
String rowDataAndPath = getSplitContent(request, text);
|
||||
log.info("-------------- 右侧图片、文字、表格 拆分成功 :"+ rowDataAndPath +" -----------------");
|
||||
rightSplit = rowDataAndPath.split("---");
|
||||
if (rightSplit.length > 1) {
|
||||
for (int j = 0; j < rightSplit.length; j++) {
|
||||
if (ObjectUtils.isNotEmpty(rightSplit[j])) {
|
||||
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
|
||||
if (j > 0) {
|
||||
Row row2 = sheet.getRow(j + i);
|
||||
if (ObjectUtils.isEmpty(row2)) {
|
||||
row2 = sheet.createRow(j + i);
|
||||
}
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row2, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
} else {
|
||||
log.info("-------------- 开始处理右侧图片、表格 -----------------");
|
||||
handleSpecificData(workbook, dir, patriarch, cellStyleLink, byteArrayOut, row, i, j, rightSplit[j], 7);
|
||||
log.info("-------------- 右侧图片、表格 处理成功 -----------------");
|
||||
}
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setRightStart(i);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(i + rightSplit.length - 1);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(7).setCellValue(rowDataAndPath);
|
||||
}
|
||||
sarFileCompareExcelMergeCell.setRightStart(i);
|
||||
sarFileCompareExcelMergeCell.setRightEnd(i + rightSplit.length - 1);
|
||||
mergeCells.add(sarFileCompareExcelMergeCell);
|
||||
} else {
|
||||
row.createCell(7).setCellValue(rowDataAndPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user