|
@@ -16,6 +16,9 @@
|
|
*/
|
|
*/
|
|
package org.springblade.manager.controller;
|
|
package org.springblade.manager.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.spire.xls.Workbook;
|
|
|
|
+import com.spire.xls.Worksheet;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
@@ -26,6 +29,7 @@ import lombok.SneakyThrows;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
|
|
|
|
|
+import org.springblade.core.oss.model.BladeFile;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.secure.BladeUser;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
@@ -172,17 +176,10 @@ public class ExcelTabController extends BladeController {
|
|
|
|
|
|
ExcelTab detail = excelTabService.getById(nodeId);
|
|
ExcelTab detail = excelTabService.getById(nodeId);
|
|
// 删除excel文件
|
|
// 删除excel文件
|
|
- //R bladeFile = iossClient.addFileInfo(file);
|
|
|
|
-
|
|
|
|
- R bladeFile = iossClient.addFileInfo(file);
|
|
|
|
-
|
|
|
|
- System.out.println(bladeFile);
|
|
|
|
-
|
|
|
|
- /*detail.setExtension(bladeFile.getOriginalName());
|
|
|
|
- detail.setFileUrl(bladeFile.getLink());
|
|
|
|
- detail.setFileType(3); // 表示为清表信息 1 表示祖节点 2 表示为节点信息 3 表示清表
|
|
|
|
- excelTabService.saveOrUpdate(detail);
|
|
|
|
|
|
+ R<BladeFile> bladeFile = iossClient.addFileInfo(file);
|
|
|
|
+ BladeFile bladeFile1 = bladeFile.getData();
|
|
|
|
|
|
|
|
+ System.out.println(bladeFile1.getLink());
|
|
String thmlUrl = "/Users/hongchuangyanfa/Desktop/ToHtml.html";
|
|
String thmlUrl = "/Users/hongchuangyanfa/Desktop/ToHtml.html";
|
|
// 解析excel
|
|
// 解析excel
|
|
Workbook wb = new Workbook();
|
|
Workbook wb = new Workbook();
|
|
@@ -193,6 +190,16 @@ public class ExcelTabController extends BladeController {
|
|
Worksheet sheet = wb.getWorksheets().get(0);
|
|
Worksheet sheet = wb.getWorksheets().get(0);
|
|
sheet.saveToHtml(thmlUrl);
|
|
sheet.saveToHtml(thmlUrl);
|
|
|
|
|
|
|
|
+ detail.setExtension(bladeFile1.getOriginalName());
|
|
|
|
+ detail.setFileUrl(bladeFile1.getLink());
|
|
|
|
+ detail.setFileType(3); // 表示为清表信息 1 表示祖节点 2 表示为节点信息 3 表示清表
|
|
|
|
+ detail.setHtmlUrl(thmlUrl);
|
|
|
|
+
|
|
|
|
+ excelTabService.saveOrUpdate(detail);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/*
|
|
//解析数据
|
|
//解析数据
|
|
Thread.sleep(200);
|
|
Thread.sleep(200);
|
|
String htmlString = readfile(thmlUrl);
|
|
String htmlString = readfile(thmlUrl);
|
|
@@ -334,4 +341,33 @@ public class ExcelTabController extends BladeController {
|
|
int e = val.indexOf(end);
|
|
int e = val.indexOf(end);
|
|
return val.substring(s, e);
|
|
return val.substring(s, e);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 关联清表树
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/tab-lazytree-all")
|
|
|
|
+ @ApiOperationSupport(order = 14)
|
|
|
|
+ @ApiOperation(value = "关联清表树all", notes = "关联清表树all")
|
|
|
|
+ public R<List<ExceTabTreVO>> tabLazyTreeall(Long modeId,String name, BladeUser bladeUser) {
|
|
|
|
+ List<ExceTabTreVO> tree = excelTabService.tabLazyTreeAll( bladeUser.getTenantId(), modeId, name);
|
|
|
|
+ return R.data(tree);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 关联清表-保存
|
|
|
|
+ */
|
|
|
|
+ @GetMapping("/save-linkTab")
|
|
|
|
+ @ApiOperationSupport(order = 14)
|
|
|
|
+ @ApiOperation(value = "关联清表-保存", notes = "关联清表-保存")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "exceTabId", value = "清表id", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "tabId", value = "表Id", required = true)
|
|
|
|
+ })
|
|
|
|
+ public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId,Long tabId, BladeUser bladeUser) {
|
|
|
|
+
|
|
|
|
+ return R.success("关联成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|