|
@@ -82,6 +82,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.support.DefaultTransactionDefinition;
|
|
|
|
|
|
import java.io.*;
|
|
|
+import java.nio.file.Files;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@@ -3062,6 +3063,29 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ private void tableContextReplace(org.apache.poi.ss.usermodel.Workbook workbook, String oldContext, String newContext){
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ sheet.setForceFormulaRecalculation(true);
|
|
|
+ int rowNum = sheet.getLastRowNum();
|
|
|
+ for (int i = 0; i < rowNum; i++) {
|
|
|
+ Row row = sheet.getRow(i);
|
|
|
+ if (row != null) {
|
|
|
+ short cellNum = row.getLastCellNum();
|
|
|
+ for (int j = 0; j < cellNum; j++) {
|
|
|
+ Cell cell = row.getCell(j);
|
|
|
+ if (cell != null) {
|
|
|
+ String cellValue = cell.getStringCellValue();
|
|
|
+ if (cellValue != null && !cellValue.isEmpty()) {
|
|
|
+ if (cellValue.equals(oldContext)) {
|
|
|
+ cell.setCellValue(newContext);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 试验 单pdf
|
|
@@ -3111,6 +3135,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (pageNumber != 0 && pageNumberCount != 0) {
|
|
|
header.setRight("第" + pageNumber + "页,共" + pageNumberCount + "页");
|
|
|
}
|
|
|
+ // 处理重庆乌江白马航电枢纽工程第三方试验检测项目部 受控号
|
|
|
+ if (contractId.equals("1815659357889708033")) {
|
|
|
+ tableContextReplace(workbook, "受控号:TDJL2704", "受控号:ZNJC/QR34-07-2024");
|
|
|
+ }
|
|
|
|
|
|
//标题Title
|
|
|
ProjectInfo projectInfo = projectInfoService.getById(wbsTreePrivate.getProjectId());
|