|
@@ -60,6 +60,7 @@ import org.springblade.core.log.exception.ServiceException;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
import java.awt.*;
|
|
@@ -1212,11 +1213,7 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
// 空是否等于值的个数
|
|
|
- if (null_count == val_count && width == maxCol) {
|
|
|
- istrue = true;
|
|
|
- } else {
|
|
|
- istrue = false;
|
|
|
- }
|
|
|
+ istrue = null_count == val_count && width == maxCol;
|
|
|
return xy_type + "," + index_state + "," + width + "," + istrue;
|
|
|
}
|
|
|
|
|
@@ -1311,7 +1308,7 @@ public class ExcelTabController extends BladeController {
|
|
|
String nodeName = wbsTreeContractList2.get(0).getNodeName();
|
|
|
|
|
|
if (nodeName.indexOf("__") >= 0) {
|
|
|
- String oldName[] = nodeName.split("__");
|
|
|
+ String[] oldName = nodeName.split("__");
|
|
|
nodeName = oldName[0] + "__" + (Integer.parseInt(oldName[1]) + 1);
|
|
|
} else {
|
|
|
nodeName = nodeName + "__" + 1;
|
|
@@ -1641,7 +1638,7 @@ public class ExcelTabController extends BladeController {
|
|
|
if (ObjectUtil.isNotEmpty(dataMap)) {
|
|
|
for (String val : dataMap.keySet()) {
|
|
|
if (val.indexOf("__") >= 0) {
|
|
|
- String DataVal[] = val.split("__");
|
|
|
+ String[] DataVal = val.split("__");
|
|
|
String[] xy = DataVal[1].split("_");
|
|
|
Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
|
|
|
|
|
@@ -1663,11 +1660,11 @@ public class ExcelTabController extends BladeController {
|
|
|
if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
|
|
|
myData = myData.replace("[", "").replace("]", "");
|
|
|
String[] dataVal = myData.split(",");
|
|
|
- String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
|
|
|
- String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
|
|
|
+ String[] Start_dataStr = dataVal[0].split("T")[0].split("-");
|
|
|
+ String StartDate = StringUtil.format("{}年{}月{}日", Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1);
|
|
|
|
|
|
- String end_dataStr[] = dataVal[1].split("T")[0].split("-");
|
|
|
- String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
|
|
|
+ String[] end_dataStr = dataVal[1].split("T")[0].split("-");
|
|
|
+ String endDate = StringUtil.format("{}年{}月{}日", end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1);
|
|
|
|
|
|
if (StartDate.equals(endDate)) {
|
|
|
myData = StartDate;
|
|
@@ -1675,14 +1672,14 @@ public class ExcelTabController extends BladeController {
|
|
|
myData = StartDate + "-" + endDate;
|
|
|
}
|
|
|
} else {
|
|
|
- String dataStr[] = myData.split("T")[0].split("-");
|
|
|
- myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
|
|
|
+ String[] dataStr = myData.split("T")[0].split("-");
|
|
|
+ myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
|
|
|
Element element = trs.get(y1).select("td").get(x1);
|
|
|
- String styles[] = element.attr("style").split(";");
|
|
|
+ String[] styles = element.attr("style").split(";");
|
|
|
int Height = 0;
|
|
|
for (String sty : styles) {
|
|
|
if (sty.indexOf("height:") >= 0) {
|
|
@@ -1713,7 +1710,7 @@ public class ExcelTabController extends BladeController {
|
|
|
if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
textdictInfos.forEach(e -> {
|
|
|
String key = e.getColKey();
|
|
|
- String keys[] = key.split("__");
|
|
|
+ String[] keys = key.split("__");
|
|
|
String[] trtd = keys[1].split("_");
|
|
|
Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
@@ -1827,7 +1824,7 @@ public class ExcelTabController extends BladeController {
|
|
|
// 时间段处理
|
|
|
if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
|
|
|
if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
|
|
|
if (reData.containsKey("pickerKey")) {
|
|
|
String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
|
|
@@ -1838,24 +1835,24 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
String sql = tabData[0];
|
|
|
sql = sql.replaceAll("\\[", "['");
|
|
|
- sql = sql.replaceAll("]", "\']");
|
|
|
- sql = sql.replaceAll("000Z,", "000Z\',");
|
|
|
- sql = sql.replaceAll(", 20", ", \'20");
|
|
|
+ sql = sql.replaceAll("]", "']");
|
|
|
+ sql = sql.replaceAll("000Z,", "000Z',");
|
|
|
+ sql = sql.replaceAll(", 20", ", '20");
|
|
|
sql = sql.replaceAll("'", "");
|
|
|
reData.put(key + "__" + tabData[1], sql);
|
|
|
} else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
|
|
|
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
|
|
|
} else if (tabVal.indexOf("☆") >= 0) {
|
|
|
- String mysql[] = tabVal.split("☆");
|
|
|
+ String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
- String tabData[] = data.split("_\\^_");
|
|
|
+ String[] tabData = data.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
} else if (tabVal.indexOf("_^_") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
} else {
|
|
|
reData.put(key, tabVal);
|
|
@@ -1960,8 +1957,8 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
}
|
|
|
//组装SQL
|
|
|
- insertSql.append(" (").append(keySql.toString().substring(1)).append(") ");
|
|
|
- insertSql.append(" VALUES(").append(valueSql.toString().substring(1)).append(")");
|
|
|
+ insertSql.append(" (").append(keySql.substring(1)).append(") ");
|
|
|
+ insertSql.append(" VALUES(").append(valueSql.substring(1)).append(")");
|
|
|
|
|
|
insertSqlList.add(insertSql.toString());
|
|
|
}
|
|
@@ -2020,7 +2017,7 @@ public class ExcelTabController extends BladeController {
|
|
|
// 时间段处理
|
|
|
if (StringUtils.isNotEmpty(tabVal) && !tabVal.equals("null")) {
|
|
|
if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z]") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
|
|
|
if (reData.containsKey("pickerKey")) {
|
|
|
String pickerKey = reData.get("pickerKey") + "," + key + "__" + tabData[1];
|
|
@@ -2031,24 +2028,24 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
String sql = tabData[0];
|
|
|
sql = sql.replaceAll("\\[", "['");
|
|
|
- sql = sql.replaceAll("]", "\']");
|
|
|
- sql = sql.replaceAll("000Z,", "000Z\',");
|
|
|
- sql = sql.replaceAll(", 20", ", \'20");
|
|
|
+ sql = sql.replaceAll("]", "']");
|
|
|
+ sql = sql.replaceAll("000Z,", "000Z',");
|
|
|
+ sql = sql.replaceAll(", 20", ", '20");
|
|
|
sql = sql.replaceAll("'", "");
|
|
|
reData.put(key + "__" + tabData[1], sql);
|
|
|
} else if (tabVal.indexOf("T") >= 0 && tabVal.indexOf(".000Z") >= 0) { //时间
|
|
|
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
|
|
|
} else if (tabVal.indexOf("☆") >= 0) {
|
|
|
- String mysql[] = tabVal.split("☆");
|
|
|
+ String[] mysql = tabVal.split("☆");
|
|
|
for (String data : mysql) {
|
|
|
- String tabData[] = data.split("_\\^_");
|
|
|
+ String[] tabData = data.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
}
|
|
|
} else if (tabVal.indexOf("_^_") >= 0) {
|
|
|
- String tabData[] = tabVal.split("_\\^_");
|
|
|
+ String[] tabData = tabVal.split("_\\^_");
|
|
|
reData.put(key + "__" + tabData[1], tabData[0]);
|
|
|
} else {
|
|
|
reData.put(key, tabVal);
|
|
@@ -2135,7 +2132,7 @@ public class ExcelTabController extends BladeController {
|
|
|
if (ObjectUtil.isNotEmpty(dataMap)) {
|
|
|
for (String val : dataMap.keySet()) {
|
|
|
if (val.indexOf("__") >= 0) {
|
|
|
- String DataVal[] = val.split("__");
|
|
|
+ String[] DataVal = val.split("__");
|
|
|
String[] xy = DataVal[1].split("_");
|
|
|
Element data = trs.get(Integer.parseInt(xy[0])).select("td").get(Integer.parseInt(xy[1]));
|
|
|
|
|
@@ -2157,11 +2154,11 @@ public class ExcelTabController extends BladeController {
|
|
|
if (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) {
|
|
|
myData = myData.replace("[", "").replace("]", "");
|
|
|
String[] dataVal = myData.split(",");
|
|
|
- String Start_dataStr[] = dataVal[0].split("T")[0].split("-");
|
|
|
- String StartDate = StringUtil.format("{}年{}月{}日", new Object[]{Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1});
|
|
|
+ String[] Start_dataStr = dataVal[0].split("T")[0].split("-");
|
|
|
+ String StartDate = StringUtil.format("{}年{}月{}日", Start_dataStr[0], Start_dataStr[1], Integer.parseInt(Start_dataStr[2]) + 1);
|
|
|
|
|
|
- String end_dataStr[] = dataVal[1].split("T")[0].split("-");
|
|
|
- String endDate = StringUtil.format("{}年{}月{}日", new Object[]{end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1});
|
|
|
+ String[] end_dataStr = dataVal[1].split("T")[0].split("-");
|
|
|
+ String endDate = StringUtil.format("{}年{}月{}日", end_dataStr[0], end_dataStr[1], Integer.parseInt(end_dataStr[2]) + 1);
|
|
|
|
|
|
if (StartDate.equals(endDate)) {
|
|
|
myData = StartDate;
|
|
@@ -2169,14 +2166,14 @@ public class ExcelTabController extends BladeController {
|
|
|
myData = StartDate + "-" + endDate;
|
|
|
}
|
|
|
} else {
|
|
|
- String dataStr[] = myData.split("T")[0].split("-");
|
|
|
- myData = StringUtil.format("{}年{}月{}日", new Object[]{dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1});
|
|
|
+ String[] dataStr = myData.split("T")[0].split("-");
|
|
|
+ myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]) + 1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (myData.indexOf("https") >= 0 && myData.indexOf("aliyuncs") >= 0) {
|
|
|
Element element = trs.get(y1).select("td").get(x1);
|
|
|
- String styles[] = element.attr("style").split(";");
|
|
|
+ String[] styles = element.attr("style").split(";");
|
|
|
int Height = 0;
|
|
|
for (String sty : styles) {
|
|
|
if (sty.indexOf("height:") >= 0) {
|
|
@@ -2207,7 +2204,7 @@ public class ExcelTabController extends BladeController {
|
|
|
if (textdictInfos != null && !textdictInfos.isEmpty()) {
|
|
|
textdictInfos.forEach(e -> {
|
|
|
String key = e.getColKey();
|
|
|
- String keys[] = key.split("__");
|
|
|
+ String[] keys = key.split("__");
|
|
|
String[] trtd = keys[1].split("_");
|
|
|
Element data = trs.get(Integer.parseInt(trtd[0])).select("td").get(Integer.parseInt(trtd[1]));
|
|
|
int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
|
|
@@ -2455,7 +2452,7 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
if (first.indexOf("质量等级评定为") >= 0 && end.indexOf("。") >= 0) {
|
|
|
if (first.indexOf("。") >= 0) {
|
|
|
- first = first.substring(first.indexOf("。") + 1, first.length());
|
|
|
+ first = first.substring(first.indexOf("。") + 1);
|
|
|
}
|
|
|
trTitleName = titt + "_" + first.substring(0, first.length() - 2);
|
|
|
}
|
|
@@ -2616,4 +2613,18 @@ public class ExcelTabController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 在线excel 修改回调
|
|
|
+ * @param request
|
|
|
+ * @param response
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/callbackSave", produces = "application/json;charset=UTF-8")
|
|
|
+ @ApiOperation(value = "onlyOffice保存回调", notes = "onlyOffice保存回调")
|
|
|
+ @ApiOperationSupport(order = 35)
|
|
|
+ @ResponseBody
|
|
|
+ public void saveWord(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
|
|
+ excelTabService.callbackSave(request, response);
|
|
|
+ }
|
|
|
+
|
|
|
}
|