Просмотр исходного кода

同步公共-修复excel、实体表字段、html添加判断

LHB 2 месяцев назад
Родитель
Сommit
b4f2cf3fe4

+ 15 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsSynchronousServiceImpl.java

@@ -311,7 +311,7 @@ public class WbsSynchronousServiceImpl {
                         if (templateNode.getExcelId() != null) {
                             ExcelTab excelTab = excelTabMapper.selectOne(Wrappers.<ExcelTab>lambdaQuery()
                                     .select(ExcelTab::getTabId)
-                                    .eq(ExcelTab::getTabId, templateNode.getExcelId()));
+                                    .eq(ExcelTab::getId, templateNode.getExcelId()));
                             if (excelTab == null) {
                                 throw new ServerException(templateNode.getNodeName() + " excel未知");
                             }
@@ -319,6 +319,9 @@ public class WbsSynchronousServiceImpl {
                                 TableInfo tableInfo = tableInfoMapper.selectOne(Wrappers.<TableInfo>lambdaQuery()
                                         .select(TableInfo::getId)
                                         .eq(TableInfo::getId, excelTab.getTabId()));
+                                if (tableInfo == null) {
+                                    throw new ServerException(templateNode.getNodeName() + " 实体表未知");
+                                }
                                 templateNode.setInitTableName(tableInfo.getTabEnName());
                                 isUpdate = true;
                             }
@@ -330,6 +333,8 @@ public class WbsSynchronousServiceImpl {
                                 if (CollectionUtil.isNotEmpty(list)) {
                                     templateNode.setHtmlUrl(list.get(0).getHtmlUrl());
                                     isUpdate = true;
+                                } else {
+                                    throw new ServerException(templateNode.getNodeName() + " html不存在");
                                 }
                             }
                         } else if (StringUtil.isNotBlank(templateNode.getInitTableName())) {
@@ -343,10 +348,11 @@ public class WbsSynchronousServiceImpl {
                                 ExcelTab excelTab = excelTabMapper.selectOne(Wrappers.<ExcelTab>lambdaQuery()
                                         .select(ExcelTab::getId)
                                         .eq(ExcelTab::getTabId, tableInfo.getId()));
-                                if (excelTab != null) {
-                                    templateNode.setExcelId(excelTab.getId());
-                                    isUpdate = true;
+                                if (excelTab == null) {
+                                    throw new ServerException(templateNode.getNodeName() + " excel未知");
                                 }
+                                templateNode.setExcelId(excelTab.getId());
+                                isUpdate = true;
                             }
                             if (StringUtil.isBlank(templateNode.getHtmlUrl())) {
                                 List<WbsTreePrivate> list = wbsTreePrivateMapper.selectList(Wrappers.<WbsTreePrivate>lambdaQuery()
@@ -356,6 +362,8 @@ public class WbsSynchronousServiceImpl {
                                 if (CollectionUtil.isNotEmpty(list)) {
                                     templateNode.setHtmlUrl(list.get(0).getHtmlUrl());
                                     isUpdate = true;
+                                }else{
+                                    throw new ServerException(templateNode.getNodeName() + " html不存在");
                                 }
                             }
                         } else if (StringUtil.isNotBlank(templateNode.getHtmlUrl())) {
@@ -367,6 +375,8 @@ public class WbsSynchronousServiceImpl {
                                 templateNode.setExcelId(templateNode.getExcelId() == null ? list.get(0).getExcelId() : templateNode.getExcelId());
                                 templateNode.setInitTableName(templateNode.getInitTableName() == null ? list.get(0).getInitTableName() : templateNode.getInitTableName());
                                 isUpdate = true;
+                            }else{
+                                throw new ServerException(templateNode.getNodeName() + " html不存在");
                             }
                         }
                         if (isUpdate) {
@@ -577,7 +587,7 @@ public class WbsSynchronousServiceImpl {
                             .eq(WbsTreeContract::getContractId, contractInfo.getId())
                             .eq(WbsTreeContract::getIsDeleted, 0)
                             .apply("FIND_IN_SET({0},ancestors_p_id)", wbsTreeContract.getPKeyId());
-                        wrapperContract.apply("FIND_IN_SET({0},ancestors_p_id)", wbsTreeContract.getPKeyId());
+                    wrapperContract.apply("FIND_IN_SET({0},ancestors_p_id)", wbsTreeContract.getPKeyId());
 
                     //当前合同的子节点数据
                     List<WbsTreeContract> wbsTreeContracts = wbsTreeContractMapper.selectList(wrapperContract);