修改递归文件接口

master
孙亮 12 months ago
parent 627a77fdfb
commit 8a7a3758eb

@ -100,10 +100,20 @@ namespace IBKLinker_Minio.Common
{
RequstStoragePath subDirModel = new RequstStoragePath();
subDirModel.Pk = subDir.Pk;//主键ID
subDirModel.Upk = subDir.Upk;//父级文件夹pk
subDirModel.FileName = subDir.FileName;//文件名称
subDirModel.FilePath = subDir.FilePath;//文件路径
subDirModel.FileType = subDir.FileType;//文件类型
subDirModel.FileLever = subDir.FileLevel;//层级
subDirModel.FileLevel = subDir.FileLevel;//层级
subDirModel.CreatorTime = subDir.CreatorTime;//创建时间
subDirModel.CreatorUser = subDir.CreatorUser;//创建者
subDirModel.DownloadNum = subDir.DownloadNum;//下载次数
subDirModel.ModifyUsers = subDir.ModifyUsers;//修改用户
subDirModel.ModifyTime = subDir.ModifyTime;//修改时间
subDirModel.ClearUsers = subDir.ClearUsers;//删除用户
subDirModel.ClearTime = subDir.ClearTime;//删除时间
subDirModel.ClearFlag = subDir.ClearFlag;//删除标记 0未删除 1删除
subDirModel.DocumentType = subDir.DocumentType;//文件种类1、技术协议 2、质量要点 3、工艺卡 4、其他
subDirModel.requstStoragePaths = GetSubDirectories(subDir.Pk); // 递归调用获取子文件夹
subDirs.Add(subDirModel);
}

@ -1132,49 +1132,39 @@ namespace IBKLinker_Minio.Controller.MinioController
return date;
}
/// <summary>
/// 获取根目录和根目录下一级得菜单信息
/// 获取所有文件夹
/// </summary>
/// <returns></returns>
[HttpPost, Route("GetRecursion")]
public RequestEntity GetRecursion()
{
MinioBusinessLogic bb = new MinioBusinessLogic();//定义业务逻辑方法
RequestEntity request = new RequestEntity();
try
{
//拿到根目录
List<RequstStoragePath> requstStoragePaths = new List<RequstStoragePath>();
List<MinioStoragePath> date = new List<MinioStoragePath>();
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
string sql = string.Empty;
date = db.Query<MinioStoragePath>("select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0'and FILE_TYPE='0' ORDER BY PK").ToList();
//UPK=0 AND FILE_LEVEL=1 and
}
if (date.Count > 0)
{
foreach (var item in date)
List<MinioStoragePath> rootDirectories = db.Query<MinioStoragePath>("select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0'and FILE_LEVEL='1' ORDER BY PK").ToList();//查询根文件夹
foreach (var rootDir in rootDirectories)
{
RequstStoragePath model = new RequstStoragePath();
model.Pk = item.Pk;
model.FileName = item.FileName;
model.FilePath = item.FilePath;
model.FileType = item.FileType;
model.FileLever = item.FileLevel;
model.requstStoragePaths = new List<StoragePath>();
List<MinioStoragePath> ds = GetMenuTree(item.Pk.ToString());
foreach (var items in ds)
{
StoragePath models = new StoragePath();
models.Pk = items.Pk;
models.FileName = items.FileName;
models.FilePath = items.FilePath;
models.FileType = items.FileType;
models.FileLever = items.FileLevel;
model.requstStoragePaths.Add(models);
}
requstStoragePaths.Add(model);
RequstStoragePath rootModel = new RequstStoragePath();
rootModel.Pk = rootDir.Pk;//主键ID
rootModel.Upk = rootDir.Upk;//父级文件夹pk
rootModel.FileName = rootDir.FileName;//文件名称
rootModel.FilePath = rootDir.FilePath;//文件路径
rootModel.FileType = rootDir.FileType;//文件类型
rootModel.FileLevel = rootDir.FileLevel;//层级
rootModel.CreatorTime = rootDir.CreatorTime;//创建时间
rootModel.CreatorUser = rootDir.CreatorUser;//创建者
rootModel.DownloadNum = rootDir.DownloadNum;//下载次数
rootModel.ModifyUsers = rootDir.ModifyUsers;//修改用户
rootModel.ModifyTime = rootDir.ModifyTime;//修改时间
rootModel.ClearUsers = rootDir.ClearUsers;//删除用户
rootModel.ClearTime = rootDir.ClearTime;//删除时间
rootModel.ClearFlag = rootDir.ClearFlag;//删除标记 0未删除 1删除
rootModel.requstStoragePaths = bb.GetSubDirectories(rootDir.Pk);//子级存进list
requstStoragePaths.Add(rootModel);//添加list
}
}
request.data = requstStoragePaths;
@ -1188,8 +1178,6 @@ namespace IBKLinker_Minio.Controller.MinioController
return request;
}
/// <summary>
/// 权限查询
/// </summary>
@ -1346,7 +1334,7 @@ namespace IBKLinker_Minio.Controller.MinioController
{
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
request.data = db.Query<MinioOperationlog>("select * from MINIO_OPERATIONLOG where 1=1");
request.data = db.Query<MinioOperationlog>("select * from MINIO_OPERATIONLOG where 1=1 order by OPERATE_TIME desc");
request.code = "0";
}
}
@ -1590,42 +1578,6 @@ namespace IBKLinker_Minio.Controller.MinioController
}
#endregion
#region
[HttpPost, Route("CESHI")]
public RequestEntity CESHI()
{
MinioBusinessLogic bb = new MinioBusinessLogic();//定义业务逻辑方法
RequestEntity request = new RequestEntity();
try
{
List<RequstStoragePath> requstStoragePaths = new List<RequstStoragePath>();
using (IDbContext db = ObjectContainer.GetObject<IDbContext>("db"))
{
List<MinioStoragePath> rootDirectories = db.Query<MinioStoragePath>("select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0'and FILE_LEVEL='1' ORDER BY PK").ToList();//查询根文件夹
foreach (var rootDir in rootDirectories)
{
RequstStoragePath rootModel = new RequstStoragePath();
rootModel.Pk = rootDir.Pk;//主键ID
rootModel.FileName = rootDir.FileName;//文件名称
rootModel.FilePath = rootDir.FilePath;//文件路径
rootModel.FileType = rootDir.FileType;//文件类型
rootModel.FileLever = rootDir.FileLevel;//层级
rootModel.requstStoragePaths = bb.GetSubDirectories(rootDir.Pk);//子级存进list
requstStoragePaths.Add(rootModel);//添加list
}
}
request.data = requstStoragePaths;
request.code = "0";
}
catch (Exception)
{
request.code = "1";
throw;
}
return request;
}
#endregion
}
}

@ -14,6 +14,12 @@ namespace IBKLinker_Minio.Entity.MinioController
/// 主键
/// </summary>
public int Pk { get; set; }
/// <summary>
/// 主键
/// </summary>
public int Upk { get; set; }
/// <summary>
///文件名称
/// </summary>
@ -31,7 +37,52 @@ namespace IBKLinker_Minio.Entity.MinioController
/// <summary>
///层级
/// </summary>
public int FileLever { get; set; }
public int FileLevel { get; set; }
/// <summary>
///下载次数
/// </summary>
public int DownloadNum { get; set; }
/// <summary>
///创建者
/// </summary>
public string CreatorUser { get; set; }
/// <summary>
///创建时间
/// </summary>
public DateTime? CreatorTime { get; set; }
/// <summary>
///修改用户
/// </summary>
public string ModifyUsers { get; set; }
/// <summary>
///修改时间
/// </summary>
public DateTime? ModifyTime { get; set; }
/// <summary>
///删除标记 0未删除 1删除
/// </summary>
public string ClearFlag { get; set; }
/// <summary>
///删除用户
/// </summary>
public string ClearUsers { get; set; }
/// <summary>
///删除时间
/// </summary>
public DateTime? ClearTime { get; set; }
/// <summary>
///文件种类1、技术协议 2、质量要点 3、工艺卡 4、其他
/// </summary>
public string DocumentType { get; set; }
}
public class RequstStoragePath: StoragePath
{

Loading…
Cancel
Save