Przeglądaj źródła

本地和测试环境也能关联清表(勿更正式)

cr 3 tygodni temu
rodzic
commit
a65bd5b9b9

+ 1 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java

@@ -95,7 +95,7 @@ public interface ExcelTabClient {
     void excelInfo(@RequestPart("file") MultipartFile file, @RequestParam String exceUrl, @RequestParam String thmlUrl, @RequestParam String number) throws IOException;
 
     @PostMapping(API_PREFIX + "/saveLinkTab")
-    void saveLinkTab(@RequestParam Long excelId,@RequestParam Long pKeyId) throws IOException;
+    void saveLinkTab(@RequestParam Long excelId,@RequestParam Long pKeyId) throws Exception;
 
     @PostMapping(API_PREFIX + "/getTheLogPdInfo")
     void getTheLogPdInfo(@RequestParam String logPkeyId,  @RequestParam String nodePrimaryKeyId, @RequestParam String recordTime, @RequestParam String contractId,@RequestParam Long createUser) throws Exception;

+ 6 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -462,7 +462,7 @@ public class ExcelTabController extends BladeController {
     @PostMapping("/sava-dataInfo")
     @ApiOperationSupport(order = 13)
     @ApiOperation(value = "编辑-保存", notes = "编辑-保存")
-    public R<List<WbsTreeVO>> savaDataInfo(@Valid @RequestBody WbsExclTabParmVO wbsExclTabParmVO, BladeUser bladeUser) throws IOException {
+    public R<List<WbsTreeVO>> savaDataInfo(@Valid @RequestBody WbsExclTabParmVO wbsExclTabParmVO, BladeUser bladeUser) throws Exception {
         // 保存节点信息
         ExcelTab excelTab = new ExcelTab();
         if (wbsExclTabParmVO.getId() != null) {// 修改
@@ -533,7 +533,7 @@ public class ExcelTabController extends BladeController {
             @ApiImplicitParam(name = "exceTabId", value = "清表id", required = true),
             @ApiImplicitParam(name = "tabId", value = "表Id", required = true),
     })
-    public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws IOException {
+    public R<List<ExceTabTreVO>> saveLinkeTab(Long exceTabId, Long tabId) throws Exception {
         String file_path = FileUtils.getSysLocalFileUrl();
         // 关联 私有项目 wbs 数据信息
         WbsTreePrivate wbsTree = new WbsTreePrivate();
@@ -551,6 +551,10 @@ public class ExcelTabController extends BladeController {
 
         // 复制模版htmlURL
         File file_in = ResourceUtil.getFile(excelTab.getHtmlUrl());
+        Path path = file_in.toPath();
+        String fileUrl = aPrivate.getHtmlUrl();
+        InputStream fileInputStream = FileUtils.getInputStreamByUrl(fileUrl);
+        Files.copy(fileInputStream, path, StandardCopyOption.REPLACE_EXISTING);
         String filecode = SnowFlakeUtil.getId() + "";
         String thmlUrl = file_path + "privateUrlCopy/" + aPrivate.getProjectId()+"/"+filecode + ".html";
         File file_out = ResourceUtil.getFile(thmlUrl);

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -507,7 +507,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     }
 
     @Override
-    public void saveLinkTab(Long excelId, Long pKeyId) throws IOException {
+    public void saveLinkTab(Long excelId, Long pKeyId) throws Exception {
         excelTabController.saveLinkeTab(excelId,pKeyId);
     }