|
@@ -415,21 +415,22 @@ public class FileUtils {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static void main123(String[] args) throws Exception {
|
|
|
- String excelUrl = "/Users/hongchuangyanfa/Downloads/C4.13路基压实度汇总表.xlsx";
|
|
|
+ public static void main(String[] args) throws Exception {
|
|
|
+ String excelUrl = "/Users/hongchuangyanfa/Downloads/C10.28隧道注浆施工记录表.xlsx";
|
|
|
String old_html = "/Users/hongchuangyanfa/Desktop/pdf/old_html.html";
|
|
|
String old_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/old_html.xlsx";
|
|
|
|
|
|
- // File data = new File(excelUrl);
|
|
|
- // InputStream inputStream = new FileInputStream(data);
|
|
|
- // excelInfo(inputStream,old_xlsx,old_html,"1");
|
|
|
+ File data = new File(excelUrl);
|
|
|
+ InputStream inputStream = new FileInputStream(data);
|
|
|
+ excelInfo(inputStream,old_xlsx,old_html,"1");
|
|
|
+
|
|
|
|
|
|
- String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
|
|
|
+/* String new_html = "/Users/hongchuangyanfa/Desktop/pdf/new_html.html";
|
|
|
String new_xlsx = "/Users/hongchuangyanfa/Desktop/pdf/new_html.xlsx";
|
|
|
|
|
|
File data = new File(old_xlsx);
|
|
|
InputStream inputStream = new FileInputStream(data);
|
|
|
- excelInfo(inputStream,new_xlsx,new_html,"2");
|
|
|
+ excelInfo(inputStream,new_xlsx,new_html,"2");*/
|
|
|
}
|
|
|
|
|
|
|
|
@@ -489,7 +490,6 @@ public class FileUtils {
|
|
|
CellRange oldcell = mergedCells[i];
|
|
|
CellRange mergedCell = sheet.getCellRange(oldcell.getRow(), oldcell.getColumn());
|
|
|
String data = mergedCell.getDataValidation().getErrorMessage();
|
|
|
- System.out.println(mergedCell.getValue()+"---"+data);
|
|
|
if (StringUtils.isEmpty(data)) {
|
|
|
if(maxVal<=0){
|
|
|
j = j + 1;
|
|
@@ -507,7 +507,7 @@ public class FileUtils {
|
|
|
// 目标表添加备注信息
|
|
|
sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
|
|
|
mergedCell.getDataValidation().setErrorMessage(j+"");
|
|
|
- mergedCell.setValue(j + "");
|
|
|
+ mergedCell.setText(j + "");
|
|
|
dataMap.put("x1", mergedCell.getRow());
|
|
|
dataMap.put("x2", mergedCell.getLastRow());
|
|
|
dataMap.put("y1", mergedCell.getColumn());
|
|
@@ -537,7 +537,7 @@ public class FileUtils {
|
|
|
}
|
|
|
sheet2.getCellRange(oldcell.getRow(), oldcell.getColumn()).getDataValidation().setErrorMessage(j+"");
|
|
|
oldcell.getComment().getRichText().setText(j + "");
|
|
|
- mergedCell.setValue(j + "");
|
|
|
+ mergedCell.setText(j + "");
|
|
|
dataMap.put("x1", mergedCell.getRow());
|
|
|
dataMap.put("x2", mergedCell.getLastRow());
|
|
|
dataMap.put("y1", mergedCell.getColumn());
|
|
@@ -569,9 +569,11 @@ public class FileUtils {
|
|
|
Elements td2 = trs2.get(i).select("td");
|
|
|
for (int x = 0; x < td1.size(); x++) {
|
|
|
Element cell1 = td1.get(x);
|
|
|
- if (cell1.children().size() >= 1) {
|
|
|
+ /*if (cell1.children().size() >= 1) {
|
|
|
+ String data = cell1.text();
|
|
|
cell1.empty();
|
|
|
- }
|
|
|
+ cell1.text(data);
|
|
|
+ }*/
|
|
|
Element cell2 = td2.get(x);
|
|
|
String html = cell2.text();
|
|
|
Map<String, Integer> xyMap = xyList.get(html);
|
|
@@ -588,7 +590,7 @@ public class FileUtils {
|
|
|
File writeFile = new File(htmlUrl);
|
|
|
FileUtil.writeToFile(writeFile, doc1.html(), Boolean.parseBoolean("UTF-8"));
|
|
|
if (html2.exists()) {
|
|
|
- html2.delete();
|
|
|
+ // html2.delete();
|
|
|
}
|
|
|
fileInputStream.close();
|
|
|
wb2.dispose();
|