yangys
2024-05-19 9e5da8899bc21bb5b6b0a3c267108caa00199291
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;
@@ -124,7 +128,7 @@
        return "File(displayName=" + getDisplayName() + ", parentId=" + getParentId() + ", allPath=" + getAllPath() + ", contentLength=" + getContentLength() + ", contentType=" + getContentType() + ", suffix=" + getSuffix() + ", fileType=" + getFileType() + ", objectKey=" + getObjectKey() + ", contentMd5=" + getContentMd5() + ", isLocked=" + isLocked() + ", owner=" + getOwner() + ", tenantId=" + getTenantId() + ", isCurrent=" + getIsCurrent() + ", coverTime=" + getCoverTime() + ", link=" + getLink() + ", version=" + getVersion() + ", mark=" + getMark() + ")";
    }
    /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/dnc/entity/File$FileBuilder.class */
    public static class FileBuilder {
        private String displayName;
        private Long parentId;
@@ -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);
    }