Przeglądaj źródła

调整出让空目录结构

chenendian 2 miesięcy temu
rodzic
commit
a2b03ac75f

+ 6 - 25
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/NodeAttachmentController.java

@@ -307,37 +307,18 @@ public class NodeAttachmentController extends BaseController {
             NodeAttachment nodeAttachment = null;
             TdgyRes tdgyRes =  tdgyService.getById(nodeId);
             if (Objects.nonNull(tdgyRes)) {
-                String dbGdType = tdgyRes.getGdType();
-                //如果当前类型与库中一致,则直接取
-                if(("出让".equals(dbGdType) && "1".equals(gdType)) ||  ("划拨".equals(dbGdType) && "2".equals(gdType))){
-                    // 1.如果出让
-                    nodeAttachment = nodeAttachmentService.getByNodeId(nodeId);
-                    //增加一条空目录结构
-                    if (Objects.isNull(nodeAttachment)) {
-                        nodeAttachmentService.addDefaultAttachment(projectId, nodeId,gdType);
-                    }
-                    //这里重新获取依赖关系
-                    nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
-                }else {
-                    //1.先删除当前节点
-                    nodeAttachmentService.deleteByNodeId(nodeId);
-                    nodeAttachmentService.addDefaultAttachment(projectId,nodeId,gdType);
-                    //这里重新获取依赖关系
-                    nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
-                }
+                //1.先删除当前节点
+                nodeAttachmentService.deleteByNodeId(nodeId);
+                nodeAttachmentService.addDefaultAttachment(projectId,nodeId,gdType);
+                //这里重新获取依赖关系
+                nodeAttachment = nodeAttachmentService.getNodeAttachmentData(nodeId,gdType);
             }
             return R.ok(nodeAttachment);
         } catch (Exception e) {
             logger.error("初始化附件信息异常", e);
             return R.fail(502,"初始化附件信息异常:" + e.getMessage());
         }
-
-
-
-
-
-
-        }
+    }
 
 
 

+ 3 - 4
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/NodeAttachmentImpl.java

@@ -498,7 +498,6 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
         }else {
             attachmentChildrenList = new ArrayList<>();
         }
-
         //当前节点的当前名称子children list
         List<Map <String,String>> currentAttachmentList = ServiceUtil.getDirChildrenList(name,nodeAttachment);
         //当前目录不存在此节点,需要通过依赖关系填充
@@ -555,9 +554,9 @@ public class NodeAttachmentImpl implements NodeAttachmentService {
         }else if(AloneWorkFlowEnum.NODE_2.getTableName().equalsIgnoreCase(tableName)){
             //出让 (两种类型,获取的目录结构不同,这里区分)
             if("1".equals(gdType)){
-                parentName = YdbpAttachmentNameEnum.NAME_1.getParentName();
-                YdbpAttachmentNameEnum[] enumValues = YdbpAttachmentNameEnum.values();
-                nameList = Arrays.stream(enumValues).map(YdbpAttachmentNameEnum::getName).collect(Collectors.toList());
+                parentName = TdgyAttachmentNameEnum.NAME_1.getParentName();
+                TdgyAttachmentNameEnum[] enumValues = TdgyAttachmentNameEnum.values();
+                nameList = Arrays.stream(enumValues).map(TdgyAttachmentNameEnum::getName).collect(Collectors.toList());
             }else if("2".equals(gdType)){//划拨
                 parentName = TdgyHbAttachmentNameEnum.NAME_1.getParentName();
                 TdgyHbAttachmentNameEnum[] enumValues = TdgyHbAttachmentNameEnum.values();