Compare commits
No commits in common. "952efbd78de76bf896f4569b07a4c7cd87964fc1" and "4bf52c4404a5cd82262e46f02a52d2054b420fa1" have entirely different histories.
952efbd78d
...
4bf52c4404
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface EdFileInfoMapper extends BaseMapper<EdFileInfo> {
|
public interface EdFileInfoMapper extends BaseMapper<EdFileInfo> {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ public interface UserMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查找用户角色名称
|
* 查找用户角色名称
|
||||||
*
|
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -20,102 +20,6 @@ import java.util.Date;
|
||||||
@FieldNameConstants
|
@FieldNameConstants
|
||||||
public class EdFileInfo extends BaseModel{
|
public class EdFileInfo extends BaseModel{
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
@TableField(value = "id")
|
|
||||||
private String id;
|
|
||||||
/**
|
|
||||||
* 文件id,如果是第一个版本,则和id一致,同一个文件不同版本,file_id是一致的
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_id")
|
|
||||||
private String fileId;
|
|
||||||
/**
|
|
||||||
* 父目录id
|
|
||||||
*/
|
|
||||||
@TableField(value = "parent_id")
|
|
||||||
private String parentId;
|
|
||||||
/**
|
|
||||||
* 文件类型
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_type")
|
|
||||||
private String fileType;
|
|
||||||
/**
|
|
||||||
* 文件名
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_name")
|
|
||||||
private String fileName;
|
|
||||||
/**
|
|
||||||
* 文件备注
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_note")
|
|
||||||
private String fileNote;
|
|
||||||
/**
|
|
||||||
* 文件内容
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_content")
|
|
||||||
private String fileContent;
|
|
||||||
/**
|
|
||||||
* 文件当前版本,文件版本号默认从100开始
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_version")
|
|
||||||
private Integer fileVersion;
|
|
||||||
/**
|
|
||||||
* 文件时间,文件编号的最后15位,精确到毫秒
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_time")
|
|
||||||
private String fileTime;
|
|
||||||
/**
|
|
||||||
* 文件路径,指到文件的父目录,有各个父目录的id加下划线组成
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_path")
|
|
||||||
private String filePath;
|
|
||||||
/**
|
|
||||||
* 数据类型,0-文件夹 1-文件
|
|
||||||
*/
|
|
||||||
@TableField(value = "data_type")
|
|
||||||
private Integer dataType;
|
|
||||||
/**
|
|
||||||
* 数据状态,0-发布 1-占用
|
|
||||||
*/
|
|
||||||
@TableField(value = "data_status")
|
|
||||||
private Integer dataStatus;
|
|
||||||
/**
|
|
||||||
* 文件的上一个版本号
|
|
||||||
*/
|
|
||||||
@TableField(value = "pre_version")
|
|
||||||
private Integer preVersion;
|
|
||||||
/**
|
|
||||||
* 是否有效 0-无效 1-有效
|
|
||||||
*/
|
|
||||||
@TableField(value = "effect_flag")
|
|
||||||
private Integer effectFlag;
|
|
||||||
/**
|
|
||||||
* 保存状态,0-上传中 1-上传成功 2-上传失败
|
|
||||||
*/
|
|
||||||
@TableField(value = "save_status")
|
|
||||||
private Integer saveStatus;
|
|
||||||
/**
|
|
||||||
* 文件大小
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_size")
|
|
||||||
private Long fileSize;
|
|
||||||
/**
|
|
||||||
* 文件夹顺序
|
|
||||||
*/
|
|
||||||
@TableField(value = "sort")
|
|
||||||
private Integer sort;
|
|
||||||
/**
|
|
||||||
* 文件编码
|
|
||||||
*/
|
|
||||||
@TableField(value = "file_code")
|
|
||||||
private String fileCode;
|
|
||||||
/**
|
|
||||||
* 是否是管理员定义的系统层级目录
|
|
||||||
*/
|
|
||||||
@TableField(value = "prj_dir")
|
|
||||||
private Boolean prjDir;
|
|
||||||
|
|
||||||
public void newInit() {
|
public void newInit() {
|
||||||
String userId = UserThreadLocal.getUserId();
|
String userId = UserThreadLocal.getUserId();
|
||||||
String newFileDbId = IdWorker.getSnowFlakeIdString();
|
String newFileDbId = IdWorker.getSnowFlakeIdString();
|
||||||
|
|
@ -130,4 +34,119 @@ public class EdFileInfo extends BaseModel {
|
||||||
this.setFileId(newFileDbId);
|
this.setFileId(newFileDbId);
|
||||||
this.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
this.setEffectFlag(EffectFlagEnum.EFFECT.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableField(value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件id,如果是第一个版本,则和id一致,同一个文件不同版本,file_id是一致的
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_id")
|
||||||
|
private String fileId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父目录id
|
||||||
|
*/
|
||||||
|
@TableField(value = "parent_id")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_type")
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_name")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件备注
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_note")
|
||||||
|
private String fileNote;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件内容
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_content")
|
||||||
|
private String fileContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件当前版本,文件版本号默认从100开始
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_version")
|
||||||
|
private Integer fileVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件时间,文件编号的最后15位,精确到毫秒
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_time")
|
||||||
|
private String fileTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件路径,指到文件的父目录,有各个父目录的id加下划线组成
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_path")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型,0-文件夹 1-文件
|
||||||
|
*/
|
||||||
|
@TableField(value = "data_type")
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据状态,0-发布 1-占用
|
||||||
|
*/
|
||||||
|
@TableField(value = "data_status")
|
||||||
|
private Integer dataStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件的上一个版本号
|
||||||
|
*/
|
||||||
|
@TableField(value = "pre_version")
|
||||||
|
private Integer preVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有效 0-无效 1-有效
|
||||||
|
*/
|
||||||
|
@TableField(value = "effect_flag")
|
||||||
|
private Integer effectFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存状态,0-上传中 1-上传成功 2-上传失败
|
||||||
|
*/
|
||||||
|
@TableField(value = "save_status")
|
||||||
|
private Integer saveStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件大小
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_size")
|
||||||
|
private Long fileSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件夹顺序
|
||||||
|
*/
|
||||||
|
@TableField(value = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件编码
|
||||||
|
*/
|
||||||
|
@TableField(value = "file_code")
|
||||||
|
private String fileCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否是管理员定义的系统层级目录
|
||||||
|
*/
|
||||||
|
@TableField(value = "prj_dir")
|
||||||
|
private Boolean prjDir;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,48 +5,30 @@ import lombok.Data;
|
||||||
@Data
|
@Data
|
||||||
public class FileInfoQueryDTO {
|
public class FileInfoQueryDTO {
|
||||||
|
|
||||||
/**
|
/** 父文件夹id */
|
||||||
* 父文件夹id
|
|
||||||
*/
|
|
||||||
private String parentId;
|
private String parentId;
|
||||||
|
|
||||||
/**
|
/** 当前页码 */
|
||||||
* 当前页码
|
|
||||||
*/
|
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
|
|
||||||
/**
|
/** 每页的数量 */
|
||||||
* 每页的数量
|
|
||||||
*/
|
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
|
||||||
/**
|
/** 搜索关键词 */
|
||||||
* 搜索关键词
|
|
||||||
*/
|
|
||||||
private String keyword;
|
private String keyword;
|
||||||
|
|
||||||
/**
|
/** 文件类型 (0-文件夹 1-文件)*/
|
||||||
* 文件类型 (0-文件夹 1-文件)
|
|
||||||
*/
|
|
||||||
private Integer fileType;
|
private Integer fileType;
|
||||||
|
|
||||||
/**
|
/** 上传时间(0-升序,1-降序)*/
|
||||||
* 上传时间(0-升序,1-降序)
|
|
||||||
*/
|
|
||||||
private Integer createdTime;
|
private Integer createdTime;
|
||||||
|
|
||||||
/**
|
/** 版本号(0-升序,1-降序 */
|
||||||
* 版本号(0-升序,1-降序
|
|
||||||
*/
|
|
||||||
private Integer fileVersion;
|
private Integer fileVersion;
|
||||||
|
|
||||||
/**
|
/** 文件大小0-升序,1-降序) */
|
||||||
* 文件大小0-升序,1-降序)
|
|
||||||
*/
|
|
||||||
private Integer fileSize;
|
private Integer fileSize;
|
||||||
|
|
||||||
/**
|
/** 状态(0-未发布 1-已发布 2-占用) */
|
||||||
* 状态(0-未发布 1-已发布 2-占用)
|
|
||||||
*/
|
|
||||||
private Integer dataStatus;
|
private Integer dataStatus;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询文件列表
|
* 查询文件列表
|
||||||
*
|
|
||||||
* @param fileInfoQueryDTO
|
* @param fileInfoQueryDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -23,7 +22,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建文件夹
|
* 新建文件夹
|
||||||
*
|
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param newFolderName
|
* @param newFolderName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -32,7 +30,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目层级结构查询
|
* 项目层级结构查询
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
ElectromagneticResult<?> tree();
|
ElectromagneticResult<?> tree();
|
||||||
|
|
@ -47,7 +44,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -55,14 +51,12 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新文件信息
|
* 更新文件信息
|
||||||
*
|
|
||||||
* @param updateFileInfoDTO
|
* @param updateFileInfoDTO
|
||||||
*/
|
*/
|
||||||
ElectromagneticResult<?> updateFileInfo(UpdateFileInfoDTO updateFileInfoDTO);
|
ElectromagneticResult<?> updateFileInfo(UpdateFileInfoDTO updateFileInfoDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 版本回退
|
* 版本回退
|
||||||
*
|
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @param targetVersion
|
* @param targetVersion
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -71,7 +65,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看分片是否存在
|
* 查看分片是否存在
|
||||||
*
|
|
||||||
* @param fileChunkDTO
|
* @param fileChunkDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -79,7 +72,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量导入
|
* 批量导入
|
||||||
*
|
|
||||||
* @param fileChunkDTO
|
* @param fileChunkDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -87,7 +79,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并分片
|
* 合并分片
|
||||||
*
|
|
||||||
* @param identifier
|
* @param identifier
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* @param totalChunks
|
* @param totalChunks
|
||||||
|
|
@ -97,7 +88,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
*
|
|
||||||
* @param dataIdArr
|
* @param dataIdArr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -105,7 +95,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传
|
* 文件上传
|
||||||
*
|
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param file
|
* @param file
|
||||||
* @param strategy
|
* @param strategy
|
||||||
|
|
@ -115,7 +104,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 版本查看
|
* 版本查看
|
||||||
*
|
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -123,7 +111,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 移动文件
|
* 移动文件
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param targetFolderId
|
* @param targetFolderId
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -132,7 +119,6 @@ public interface EdFileInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复制文件
|
* 复制文件
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param targetFolderId
|
* @param targetFolderId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ public interface PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得当前角色权限
|
* 获得当前角色权限
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -32,7 +31,6 @@ public interface PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户权限列表 转换为 哈希
|
* 用户权限列表 转换为 哈希
|
||||||
*
|
|
||||||
* @param permissionCodes
|
* @param permissionCodes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建角色
|
* 新建角色
|
||||||
*
|
|
||||||
* @param roleDTO
|
* @param roleDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -21,7 +20,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新角色
|
* 更新角色
|
||||||
*
|
|
||||||
* @param roleDTO
|
* @param roleDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,7 +27,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除角色
|
* 删除角色
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -37,7 +34,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看角色
|
* 查看角色
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -45,7 +41,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看角色列表
|
* 查看角色列表
|
||||||
*
|
|
||||||
* @param rolePageDTO
|
* @param rolePageDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -60,7 +55,6 @@ public interface RoleService extends IService<Role> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色名称查看角色权限
|
* 通过角色名称查看角色权限
|
||||||
*
|
|
||||||
* @param roleName
|
* @param roleName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ public interface UserService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
*
|
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
Boolean resetPassword(String userId);
|
Boolean resetPassword(String userId);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.lang.tree.Tree;
|
import cn.hutool.core.lang.tree.Tree;
|
||||||
import cn.hutool.core.lang.tree.TreeNodeConfig;
|
import cn.hutool.core.lang.tree.TreeNodeConfig;
|
||||||
import cn.hutool.core.lang.tree.TreeUtil;
|
import cn.hutool.core.lang.tree.TreeUtil;
|
||||||
|
import cn.hutool.core.text.StrFormatter;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
@ -41,9 +42,14 @@ import static com.electromagnetic.industry.software.common.cons.ElectromagneticC
|
||||||
@Component
|
@Component
|
||||||
public class CommonService {
|
public class CommonService {
|
||||||
|
|
||||||
|
private final EleLog log = new EleLog(CommonService.class);
|
||||||
private static final Map<String, String> FILE_TYPE_ENUM = new HashMap<>();
|
private static final Map<String, String> FILE_TYPE_ENUM = new HashMap<>();
|
||||||
|
|
||||||
private static final Map<String, String> ID_NAME = new ConcurrentHashMap<>();
|
private static final Map<String, String> ID_NAME = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@Value("${prj.folder.max.length}")
|
||||||
|
private int prjFolderMaxLength;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
FILE_TYPE_ENUM.put(EleDataTypeEnum.FOLDER.desc, "01");
|
FILE_TYPE_ENUM.put(EleDataTypeEnum.FOLDER.desc, "01");
|
||||||
FILE_TYPE_ENUM.put("py", "02");
|
FILE_TYPE_ENUM.put("py", "02");
|
||||||
|
|
@ -66,9 +72,6 @@ public class CommonService {
|
||||||
FILE_TYPE_ENUM.put("pptx", "19");
|
FILE_TYPE_ENUM.put("pptx", "19");
|
||||||
}
|
}
|
||||||
|
|
||||||
private final EleLog log = new EleLog(CommonService.class);
|
|
||||||
@Value("${prj.folder.max.length}")
|
|
||||||
private int prjFolderMaxLength;
|
|
||||||
@Getter
|
@Getter
|
||||||
private String eleDataPath;
|
private String eleDataPath;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询文件列表
|
* 查询文件列表
|
||||||
*
|
|
||||||
* @param fileInfoQueryDTO
|
* @param fileInfoQueryDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -124,7 +123,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建文件夹
|
* 新建文件夹
|
||||||
*
|
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param newFolderName
|
* @param newFolderName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -137,7 +135,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目层级结构查询
|
* 项目层级结构查询
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -147,7 +144,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除目录
|
* 删除目录
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -167,7 +163,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -201,32 +196,19 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新文件信息
|
* 更新文件信息
|
||||||
*
|
|
||||||
* @param updateFileInfoDTO
|
* @param updateFileInfoDTO
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ElectromagneticResult<?> updateFileInfo(UpdateFileInfoDTO updateFileInfoDTO) {
|
public ElectromagneticResult<?> updateFileInfo(UpdateFileInfoDTO updateFileInfoDTO) {
|
||||||
try {
|
try {
|
||||||
// 首先检查新名称是否存在
|
|
||||||
EdFileInfo fileInfo = this.baseMapper.selectById(updateFileInfoDTO.getId());
|
EdFileInfo fileInfo = this.baseMapper.selectById(updateFileInfoDTO.getId());
|
||||||
|
|
||||||
String parentId = fileInfo.getParentId();
|
|
||||||
long count = this.baseMapper.selectCount(Wrappers.<EdFileInfo>lambdaQuery()
|
|
||||||
.select(EdFileInfo::getFileName)
|
|
||||||
.eq(EdFileInfo::getParentId, parentId)
|
|
||||||
.eq(EdFileInfo::getFileName, updateFileInfoDTO.getFileName())
|
|
||||||
.eq(EdFileInfo::getFileType, fileInfo.getFileType())
|
|
||||||
.eq(EdFileInfo::getEffectFlag, EffectFlagEnum.EFFECT.code));
|
|
||||||
Assert.isTrue(count == 0, "文件名已存在");
|
|
||||||
|
|
||||||
String srcFilePath = commonService.getFileSysPath(fileInfo.getFilePath());
|
|
||||||
this.baseMapper.update(null, Wrappers.lambdaUpdate(EdFileInfo.class)
|
this.baseMapper.update(null, Wrappers.lambdaUpdate(EdFileInfo.class)
|
||||||
.eq(EdFileInfo::getId, updateFileInfoDTO.getId())
|
.eq(EdFileInfo::getId, updateFileInfoDTO.getId())
|
||||||
.set(EdFileInfo::getFileName, updateFileInfoDTO.getFileName())
|
.set(EdFileInfo::getFileName, updateFileInfoDTO.getFileName())
|
||||||
.set(EdFileInfo::getFileNote, updateFileInfoDTO.getFileNote()));
|
.set(EdFileInfo::getFileNote, updateFileInfoDTO.getFileNote()));
|
||||||
String newName = updateFileInfoDTO.getFileName() + "." + fileInfo.getFileType() + "." + fileInfo.getFileCode();
|
String sysFilePath = commonService.getFileSysPath(fileInfo.getFilePath()); // file or folder
|
||||||
fileSystemService.renameFile(srcFilePath, newName);
|
fileSystemService.renameFile(sysFilePath, updateFileInfoDTO.getFileName());
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String info = "更新文件信息失败。";
|
String info = "更新文件信息失败。";
|
||||||
|
|
@ -264,7 +246,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看分片是否存在
|
* 查看分片是否存在
|
||||||
*
|
|
||||||
* @param fileChunkDTO
|
* @param fileChunkDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -292,7 +273,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量导入
|
* 批量导入
|
||||||
*
|
|
||||||
* @param fileChunkDTO
|
* @param fileChunkDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -323,7 +303,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
* case1: 用户上传的新文件
|
* case1: 用户上传的新文件
|
||||||
* case2: 用户上传的带版本号的文件
|
* case2: 用户上传的带版本号的文件
|
||||||
* case3: 用户上传的文件在线上已经被移动到其他目录
|
* case3: 用户上传的文件在线上已经被移动到其他目录
|
||||||
*
|
|
||||||
* @param identifier
|
* @param identifier
|
||||||
* @param fileName
|
* @param fileName
|
||||||
* @param totalChunks
|
* @param totalChunks
|
||||||
|
|
@ -503,7 +482,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
*
|
|
||||||
* @param dataIdArr
|
* @param dataIdArr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -573,7 +551,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件上传
|
* 文件上传
|
||||||
*
|
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param file
|
* @param file
|
||||||
* @param strategy 1-跳过冲突文件 2-做版本更新 3-重命名,文件名加“_1"
|
* @param strategy 1-跳过冲突文件 2-做版本更新 3-重命名,文件名加“_1"
|
||||||
|
|
@ -751,7 +728,6 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 复制文件
|
* 复制文件
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param targetFolderId
|
* @param targetFolderId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改项目名称
|
* 修改项目名称
|
||||||
*
|
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @param newPrjName
|
* @param newPrjName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -164,7 +163,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除一个项目,做逻辑删除
|
* 删除一个项目,做逻辑删除
|
||||||
*
|
|
||||||
* @param prjId
|
* @param prjId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -200,7 +198,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加子集
|
* 添加子集
|
||||||
*
|
|
||||||
* @param parentId
|
* @param parentId
|
||||||
* @param folderName
|
* @param folderName
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -215,7 +212,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有项目
|
* 查询所有项目
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -355,7 +351,6 @@ public class EdPrjServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改子集名称
|
* 修改子集名称
|
||||||
*
|
|
||||||
* @param id
|
* @param id
|
||||||
* @param newFolderName
|
* @param newFolderName
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户获得角色
|
* 根据用户获得角色
|
||||||
*
|
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -76,7 +75,6 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得角色权限
|
* 获得角色权限
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @param fileId
|
* @param fileId
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -92,7 +90,6 @@ public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户权限列表 转换为 哈希
|
* 用户权限列表 转换为 哈希
|
||||||
*
|
|
||||||
* @param permissionCodes
|
* @param permissionCodes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -20,19 +20,13 @@ import com.electromagnetic.industry.software.manage.pojo.models.UserRole;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RoleDTO;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RolePageDTO;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.RolePermissionDTO;
|
import com.electromagnetic.industry.software.manage.pojo.req.RolePermissionDTO;
|
||||||
import com.electromagnetic.industry.software.manage.service.PermissionService;
|
import com.electromagnetic.industry.software.manage.service.*;
|
||||||
import com.electromagnetic.industry.software.manage.service.RolePermissionService;
|
|
||||||
import com.electromagnetic.industry.software.manage.service.RoleService;
|
|
||||||
import com.electromagnetic.industry.software.manage.service.UserRoleService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.PRJ_PARENT_ID;
|
import static com.electromagnetic.industry.software.common.cons.ElectromagneticConstants.PRJ_PARENT_ID;
|
||||||
|
|
@ -55,7 +49,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新建角色
|
* 新建角色
|
||||||
*
|
|
||||||
* @param roleDTO
|
* @param roleDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -87,7 +80,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新角色
|
* 更新角色
|
||||||
*
|
|
||||||
* @param roleDTO
|
* @param roleDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -121,7 +113,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除角色
|
* 删除角色
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -144,7 +135,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看角色
|
* 查看角色
|
||||||
*
|
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -190,7 +180,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色名查看角色
|
* 通过角色名查看角色
|
||||||
*
|
|
||||||
* @param roleName
|
* @param roleName
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -205,7 +194,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看角色列表
|
* 查看角色列表
|
||||||
*
|
|
||||||
* @param rolePageDTO
|
* @param rolePageDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -270,7 +258,6 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限层级数据扁平化
|
* 权限层级数据扁平化
|
||||||
*
|
|
||||||
* @param nodes
|
* @param nodes
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.date.SystemClock;
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.electromagnetic.industry.software.common.cons.UserConstants;
|
import com.electromagnetic.industry.software.common.cons.UserConstants;
|
||||||
import com.electromagnetic.industry.software.common.enums.ActiveEnum;
|
import com.electromagnetic.industry.software.common.enums.ActiveEnum;
|
||||||
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
import com.electromagnetic.industry.software.common.enums.EffectFlagEnum;
|
||||||
|
|
@ -278,7 +279,6 @@ public class UserServiceImpl implements UserService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
*
|
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -253,10 +253,8 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectUserRoles" parameterType="String" resultType="String">
|
<select id="selectUserRoles" parameterType="String" resultType="String">
|
||||||
select r.role_name
|
select r.role_name from ed_role r where r.role_id in (
|
||||||
from ed_role r
|
select ur.role_id from ed_users u
|
||||||
where r.role_id in (select ur.role_id
|
|
||||||
from ed_users u
|
|
||||||
left join ed_user_role ur on u.user_id = ur.user_id
|
left join ed_user_role ur on u.user_id = ur.user_id
|
||||||
where u.user_id = #{userId})
|
where u.user_id = #{userId})
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue