From 9b677ea5c6978788d135fc15da3d78c5a93789c2 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 07 五月 2024 16:52:37 +0800
Subject: [PATCH] 代码整理1

---
 smart-man-boot/src/main/java/com/qianwen/smartman/modules/dnc/entity/File.java |   40 +++++++++++++++++++++-------------------
 1 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/dnc/entity/File.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/dnc/entity/File.java
index 0a852f3..694f00b 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/dnc/entity/File.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/dnc/entity/File.java
@@ -1,8 +1,5 @@
 package com.qianwen.smartman.modules.dnc.entity;
 
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -12,12 +9,19 @@
 import java.util.Map;
 import java.util.Optional;
 import java.util.stream.Collectors;
-import lombok.NonNull;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.qianwen.core.mp.base.BaseEntity;
 import com.qianwen.smartman.modules.dnc.enums.FileType;
 
+import lombok.NonNull;
+
+/**
+ * dnc鏂囦欢(鍖呮嫭鐩綍)
+ */
 @TableName(File.TABLE_NAME)
-/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/entity/File.class */
 public class File extends BaseEntity implements Serializable {
     public static final String TABLE_NAME = "blade_dnc_craft_file";
     private static final long serialVersionUID = 1;
@@ -583,13 +587,13 @@
         if (startFile == null) {
             throw new NullPointerException("startFile is marked non-null but is null");
         }
-        List<String> targetFilePath = (List) Optional.ofNullable(targetFile).map((v0) -> {
+        List<String> targetFilePath = Optional.ofNullable(targetFile).map((v0) -> {
             return v0.pathList();
-        }).orElse(new ArrayList());
+        }).orElse(new ArrayList<>());
         String startPath = startFile.getId().toString();
         List<String> thisPath = pathList();
         int startIndex = thisPath.indexOf(startPath);
-        Collection<? extends String> otherPath = (List) thisPath.stream().skip(startIndex == -1 ? 0L : startIndex).collect(Collectors.toList());
+        Collection<? extends String> otherPath = thisPath.stream().skip(startIndex == -1 ? 0L : startIndex).collect(Collectors.toList());
         List<String> newList = new ArrayList<>();
         newList.addAll(targetFilePath);
         newList.addAll(targetFilePath.size(), otherPath);
@@ -606,15 +610,15 @@
 
     public List<String> pathList() {
         Optional<String> path = Optional.ofNullable(this.allPath);
-        return (List) path.map(c -> {
+        return path.map(c -> {
             return Arrays.asList(c.split("\\/"));
-        }).orElse(new ArrayList());
+        }).orElse(new ArrayList<>());
     }
 
     public void joinPath(List<String> pathList, String startPath) {
         List<String> originPath = pathList();
         int startIndex = originPath.indexOf(startPath);
-        Collection<? extends String> list = (List) originPath.stream().skip(startIndex).collect(Collectors.toList());
+        Collection<? extends String> list = originPath.stream().skip(startIndex).collect(Collectors.toList());
         List<String> newList = new ArrayList<>();
         newList.addAll(pathList);
         newList.addAll(pathList.size(), list);
@@ -628,19 +632,17 @@
             changeParent(defaultValue);
             return;
         }
-        String key = (String) Optional.ofNullable(this.parentId).map((v0) -> {
-            return v0.toString();
-        }).orElse("");
-        String pid = (String) keyMap.getOrDefault(key, Optional.ofNullable(defaultValue).map((v0) -> {
-            return v0.toString();
-        }).orElse(null));
+       
+        String key = Optional.<Long>ofNullable(this.parentId).map(Object::toString).orElse("");
+        String pid = keyMap.getOrDefault(key, Optional.<Long>ofNullable(defaultValue).map(Object::toString).orElse(null));
+        
         changeParent(pid, defaultValue);
     }
 
     public void changeChildPath(Map<String, String> keyMap) {
         List<String> originPath = pathList();
-        List<String> newList1 = (List) originPath.stream().map(c -> {
-            return (String) keyMap.getOrDefault(c, c);
+        List<String> newList1 = originPath.stream().map(c -> {
+            return keyMap.getOrDefault(c, c);
         }).collect(Collectors.toList());
         this.allPath = String.join("/", newList1);
     }

--
Gitblit v1.9.3