Browse Source

fix:fta:Windows计算程序有概率不产生输出文件的bug适配;分析树父子关系展示的bug

张元铭 3 months ago
parent
commit
f009a07b7b

+ 4 - 4
nationrel-module-fta-biz/src/main/java/com/nationrel/modules/fta/service/FtaDiagramDataService.java

@@ -2236,8 +2236,8 @@ public class FtaDiagramDataService {
                     } catch (DescribeException e) {
                         throw e;
                     } catch (Exception e) {
-                        e.printStackTrace();
-                        throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.计算失败请联系管理员, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
+                        log.error(e.getMessage());
+//                        throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.计算失败请联系管理员, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
                     }
                     // .dat文件:重要度
                     try (FileReader reader = new FileReader(outPathName + name + ".dat");
@@ -2275,8 +2275,8 @@ public class FtaDiagramDataService {
                             }
                         }
                     } catch (Exception e) {
-                        e.printStackTrace();
-                        throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.计算失败请联系管理员, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
+                        log.error(e.getMessage());
+//                        throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.计算失败请联系管理员, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
                     }
                     names.add(name);
                 }

+ 4 - 4
nationrel-module-fta-biz/src/main/java/com/nationrel/modules/fta/service/impl/FtaAnalysisServiceImpl.java

@@ -77,7 +77,7 @@ public class FtaAnalysisServiceImpl extends ServiceImpl<FtaAnalysisMapper, FtaAn
                 analysisTree.setId(analysis.getAnalysisId());
                 analysisTree.setLabel(analysis.getAnalysisName());
                 analysisTree.setShowInput(false);
-                getFtaAnalysisTree(analysisTree, analysisList, analysisTree.getId());
+                getFtaAnalysisTree(analysisTree, analysisList);
                 result.add(analysisTree);
             }
         });
@@ -85,15 +85,15 @@ public class FtaAnalysisServiceImpl extends ServiceImpl<FtaAnalysisMapper, FtaAn
         return ServerResponse.createBySuccess(vos);
     }
 
-    public FtaAnalysisTreeVo getFtaAnalysisTree(FtaAnalysisTreeVo ftaAnalysisTreeVo, List<FtaAnalysisTreeVo> allAnalysis, String fatherId) {
+    public FtaAnalysisTreeVo getFtaAnalysisTree(FtaAnalysisTreeVo ftaAnalysisTreeVo, List<FtaAnalysisTreeVo> allAnalysis) {
         ArrayList<FtaAnalysisTreeVo> analysisTrees = new ArrayList<>();
         allAnalysis.forEach(analysis -> {
-            if (StringUtils.isNotBlank(analysis.getFatherId()) && analysis.getFatherId().equals(fatherId)) {
+            if (StringUtils.isNotBlank(analysis.getFatherId()) && analysis.getFatherId().equals(ftaAnalysisTreeVo.getAnalysisId())) {
                 FtaAnalysisTreeVo analysisTree = new FtaAnalysisTreeVo();
                 BeanUtils.copyProperties(analysis, analysisTree);
                 analysisTree.setLabel(analysis.getAnalysisName());
                 analysisTree.setShowInput(false);
-                getFtaAnalysisTree(analysisTree, allAnalysis, analysisTree.getId());
+                getFtaAnalysisTree(analysisTree, allAnalysis);
                 analysisTrees.add(analysisTree);
             }
         });