|
@@ -640,11 +640,11 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-/* public static void main(String[] args) throws FileNotFoundException {
|
|
|
|
|
|
+ public static void main(String[] args) throws FileNotFoundException {
|
|
|
|
|
|
String thmlUrl = "/Users/hongchuangyanfa/Desktop/1234567890.html";
|
|
String thmlUrl = "/Users/hongchuangyanfa/Desktop/1234567890.html";
|
|
|
|
|
|
- File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/D9.11表-顶进施工的涵洞质量检验单.xlsx");
|
|
|
|
|
|
+ File file1 = ResourceUtil.getFile("/Users/hongchuangyanfa/Downloads/G4.xlsx");
|
|
|
|
|
|
Workbook wb = new Workbook();
|
|
Workbook wb = new Workbook();
|
|
wb.loadFromMHtml(new FileInputStream(file1));
|
|
wb.loadFromMHtml(new FileInputStream(file1));
|
|
@@ -653,7 +653,7 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
sheet.saveToHtml(thmlUrl);
|
|
sheet.saveToHtml(thmlUrl);
|
|
expailHtmlInfo(thmlUrl,1L);
|
|
expailHtmlInfo(thmlUrl,1L);
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
// 上传解析 html
|
|
// 上传解析 html
|
|
@@ -737,15 +737,21 @@ public class ExcelTabController extends BladeController {
|
|
int y2 = 0;
|
|
int y2 = 0;
|
|
|
|
|
|
String textInfo = data.text().trim().replaceAll(" ", "");
|
|
String textInfo = data.text().trim().replaceAll(" ", "");
|
|
- System.out.println(textInfo);
|
|
|
|
|
|
+
|
|
y1 = i + 1;
|
|
y1 = i + 1;
|
|
//x 移位 算法
|
|
//x 移位 算法
|
|
String getRowInfo = rowData[y1];
|
|
String getRowInfo = rowData[y1];
|
|
|
|
+
|
|
|
|
+ if(i==10){
|
|
|
|
+
|
|
|
|
+ System.out.println("");
|
|
|
|
+ }
|
|
|
|
+
|
|
if (getRowInfo != null) {
|
|
if (getRowInfo != null) {
|
|
String[] dataInfo2 = getRowInfo.split(",");
|
|
String[] dataInfo2 = getRowInfo.split(",");
|
|
- // 先逻辑处理 连续时,归一
|
|
|
|
|
|
|
|
- if (getRowInfo.indexOf("1") >= 0 && j == 0) {
|
|
|
|
|
|
+ // 先逻辑处理 连续时,归一
|
|
|
|
+ if ((dataInfo2[0].split(":")[0]).equals("1") && j == 0) {
|
|
x = Integer.parseInt(dataInfo2[0].split(":")[1]);
|
|
x = Integer.parseInt(dataInfo2[0].split(":")[1]);
|
|
} else {
|
|
} else {
|
|
for (int m = 0; m < dataInfo2.length; m++) {
|
|
for (int m = 0; m < dataInfo2.length; m++) {
|
|
@@ -760,8 +766,14 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
// X 坐标
|
|
// X 坐标
|
|
if (tds.size() == 1) {
|
|
if (tds.size() == 1) {
|
|
- x1 = 1;
|
|
|
|
- x2 = colspan;
|
|
|
|
|
|
+ if (colspan == 0) {
|
|
|
|
+ x1 =x+1;
|
|
|
|
+ x2 = x+1;
|
|
|
|
+ }else{
|
|
|
|
+ x1 = 1;
|
|
|
|
+ x2 = colspan;
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
if (colspan == 0) {
|
|
if (colspan == 0) {
|
|
x1 = x + 1;
|
|
x1 = x + 1;
|
|
@@ -879,6 +891,11 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(i==9){
|
|
|
|
+ System.out.println();
|
|
|
|
+ System.out.println(zikey);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
|
|
if (inputText != null && inputText != "" && inputText.indexOf("_") >= 0) {
|
|
inputText = inputText.substring(0, inputText.lastIndexOf("_"));
|
|
inputText = inputText.substring(0, inputText.lastIndexOf("_"));
|
|
}
|
|
}
|
|
@@ -938,9 +955,8 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
System.out.println(zikey);
|
|
System.out.println(zikey);
|
|
- // 去掉重复的数据
|
|
|
|
-
|
|
|
|
-/* Map<String, String> groupMap2 = colTitle.stream()
|
|
|
|
|
|
+ // 去掉重复的数
|
|
|
|
+/* Map<String, String> groupMap2 = colTitle.stream()
|
|
.collect(Collectors.groupingBy(ExctabCell::getTextInfo, Collectors.mapping(ExctabCell::getXys, Collectors.joining(","))));
|
|
.collect(Collectors.groupingBy(ExctabCell::getTextInfo, Collectors.mapping(ExctabCell::getXys, Collectors.joining(","))));
|
|
|
|
|
|
exctabCellService.DeletExcelByTableId(excelId + "");
|
|
exctabCellService.DeletExcelByTableId(excelId + "");
|
|
@@ -1001,7 +1017,7 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 计算线开始
|
|
// 计算线开始
|
|
- if (classInfo.indexOf("border-left-style") >= 0 && classInfo.indexOf("border-top-style") >= 0 && classInfo.indexOf("border-bottom-style") >= 0 && classInfo.indexOf("border-right-style") >= 0) {
|
|
|
|
|
|
+ if (classInfo.indexOf("border-left-style") >= 0 && classInfo.indexOf("border-top-style") >= 0 && classInfo.indexOf("border-right-style") >= 0) {
|
|
x_width += colspan;
|
|
x_width += colspan;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1010,7 +1026,7 @@ public class ExcelTabController extends BladeController {
|
|
y_width += colspan;
|
|
y_width += colspan;
|
|
}
|
|
}
|
|
|
|
|
|
- String name = data.text().replaceAll("[^\u4E00-\u9FA5]", "");
|
|
|
|
|
|
+ String name = data.text();
|
|
if (!name.isEmpty()) {
|
|
if (!name.isEmpty()) {
|
|
text_width += colspan;
|
|
text_width += colspan;
|
|
}
|
|
}
|
|
@@ -1024,19 +1040,16 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
|
|
|
|
// 在区域内
|
|
// 在区域内
|
|
|
|
+ // System.out.println(index_state+"——"+y+"__"+x_width);
|
|
|
|
+
|
|
if (index_state) {
|
|
if (index_state) {
|
|
//是否需要改变
|
|
//是否需要改变
|
|
- if (maxCol == y_width) {
|
|
|
|
|
|
+ if (maxCol == y_width) { // 是否结束区域值
|
|
index_state = false;
|
|
index_state = false;
|
|
- if (maxCol != top1_max) {
|
|
|
|
- xy_type += 1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ xy_type += 1;
|
|
}
|
|
}
|
|
- if (maxCol == text_width) {
|
|
|
|
- if (maxCol != top1_max) {
|
|
|
|
- xy_type += 1;
|
|
|
|
- }
|
|
|
|
|
|
+ if (maxCol == text_width && top1_max !=text_width) { // 是否区域开始时
|
|
|
|
+ xy_type += 1;
|
|
}
|
|
}
|
|
} else { // 区域外
|
|
} else { // 区域外
|
|
if (maxCol == x_width) {
|
|
if (maxCol == x_width) {
|
|
@@ -1045,6 +1058,7 @@ public class ExcelTabController extends BladeController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 空是否等于值的个数
|
|
if (null_count == val_count) {
|
|
if (null_count == val_count) {
|
|
istrue = true;
|
|
istrue = true;
|
|
} else {
|
|
} else {
|