diff --git a/IBKLinker-Minio/.vs/IBKLinker-Minio/v17/.suo b/IBKLinker-Minio/.vs/IBKLinker-Minio/v17/.suo index 3dc3169..b6889c4 100644 Binary files a/IBKLinker-Minio/.vs/IBKLinker-Minio/v17/.suo and b/IBKLinker-Minio/.vs/IBKLinker-Minio/v17/.suo differ diff --git a/IBKLinker-Minio/Common/MinioBusinessLogic.cs b/IBKLinker-Minio/Common/MinioBusinessLogic.cs index 0a3da8d..9eac8c6 100644 --- a/IBKLinker-Minio/Common/MinioBusinessLogic.cs +++ b/IBKLinker-Minio/Common/MinioBusinessLogic.cs @@ -1,41 +1,15 @@ -using IBKLinker_Minio.Entity; -using log4net; +using log4net; using System; using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Text; using System.Threading.Tasks; -using System.Web.Http; using Minio; -using System.Net.PeerToPeer; using System.IO; -using System.Reactive.Linq; -using Minio.DataModel; -using System.Security.AccessControl; -using System.IO.Pipes; -using System.Net.Mime; using IBKLinker_Minio.Entity.MinioController; using SOA.Objects; using SOA.Persistent; -using System.Web.Http.Results; -using System.Runtime.InteropServices.ComTypes; -using System.Xml; -using Swashbuckle.Swagger; -using System.Runtime.ConstrainedExecution; -using System.Net.Http; -using System.Web.UI.WebControls; -using System.Runtime.Remoting.Contexts; -using System.Runtime.InteropServices; -using System.Net; -using NPOI.XSSF.UserModel; -using NPOI.SS.UserModel; -using System.Net.Http.Headers; -using NPOI.SS.Formula.Functions; -using System.Xml.Linq; -using NPOI.HPSF; using System.Configuration; -using NPOI.SS.Formula.Atp; +using IBKLinker_Minio.Controller.MinioController; namespace IBKLinker_Minio.Common { @@ -103,7 +77,6 @@ namespace IBKLinker_Minio.Common } #endregion - #region 文件夹递归查询 /// /// 文件夹递归查询 @@ -111,10 +84,10 @@ namespace IBKLinker_Minio.Common public List GetSubDirectories(int parentPk) { List subDirs = new List(); - using (IDbContext db = ObjectContainer.GetObject("db")) + + foreach (var subDir in MinioApiController.rootDirectories) { - List subDirectories = db.Query("select * from MINIO_STORAGE_PATH where UPK ='" + parentPk + "' and CLEAR_FLAG='0' and FILE_TYPE='0' ORDER BY PK").ToList();//查询子级中是否还有子级 - foreach (var subDir in subDirectories) + if (subDir.Upk == parentPk) { RequstStoragePath subDirModel = new RequstStoragePath(); subDirModel.Pk = subDir.Pk;//主键ID @@ -228,5 +201,7 @@ namespace IBKLinker_Minio.Common } } #endregion + + } } diff --git a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs index af5ac67..4c253d4 100644 --- a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs +++ b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs @@ -4,45 +4,21 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; -using System.Text; using System.Threading.Tasks; using System.Web.Http; using Minio; -using System.Net.PeerToPeer; using System.IO; using System.Reactive.Linq; -using Minio.DataModel; -using System.Security.AccessControl; -using System.IO.Pipes; -using System.Net.Mime; using IBKLinker_Minio.Entity.MinioController; using SOA.Objects; using SOA.Persistent; -using System.Web.Http.Results; -using System.Runtime.InteropServices.ComTypes; -using System.Xml; -using Swashbuckle.Swagger; -using System.Runtime.ConstrainedExecution; using System.Net.Http; -using System.Web.UI.WebControls; -using System.Runtime.Remoting.Contexts; -using System.Runtime.InteropServices; using System.Net; using NPOI.XSSF.UserModel; -using NPOI.SS.UserModel; using System.Net.Http.Headers; -using NPOI.SS.Formula.Functions; -using System.Xml.Linq; -using NPOI.HPSF; using IBKLinker_Minio.Common; -using NPOI.POIFS.Crypt.Dsig; -using NPOI.SS.Formula.Atp; -using Org.BouncyCastle.Asn1.Pkcs; using System.Windows.Forms; -using Org.BouncyCastle.Asn1.Ocsp; using System.Data; -using System.Web.WebSockets; -using System.Security.Cryptography; namespace IBKLinker_Minio.Controller.MinioController { @@ -59,7 +35,7 @@ namespace IBKLinker_Minio.Controller.MinioController /// private static readonly ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static List SliceUploadData = new List(); - + public static List rootDirectories = new List(); #region minio权限表 /// @@ -1258,26 +1234,29 @@ namespace IBKLinker_Minio.Controller.MinioController List requstStoragePaths = new List(); using (IDbContext db = ObjectContainer.GetObject("db")) { - List rootDirectories = db.Query("select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0'and FILE_LEVEL='1' ORDER BY PK").ToList();//查询根文件夹 + rootDirectories = db.Query("select * from MINIO_STORAGE_PATH where CLEAR_FLAG='0' and FILE_TYPE='0' ORDER BY PK").ToList();//查询所有文件夹 foreach (var rootDir in rootDirectories) { - 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 + if (rootDir.Upk == 0 && rootDir.FileLevel == 1)//只要根目录文件夹 + { + 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; @@ -1785,149 +1764,5 @@ namespace IBKLinker_Minio.Controller.MinioController } #endregion - #region 同步关联 - [HttpPost, Route("UdpDlsync")] - public RequestEntity UdpDlsync(string master) - { - RequestEntity request = new RequestEntity();//定义返回集合 - List data = new List();//定义输出下载的list - List newdata = new List();//定义输出下载的list - List dldata = new List();//定义输出下载的list - List datan = new List(); - List mfcion = new List(); - DataTable dt = new DataTable(); - using (IDbContext db = ObjectContainer.GetObject("db")) - { - using (IDbContext filedb = ObjectContainer.GetObject("filedb")) - { - string sql = ""; - data = db.Query("select * from minio_storage_path where upk='" + master + "' order by CREATOR_TIME asc").ToList(); - foreach (var item in data) - { - bool Asstion = true;//定义是否执行关联 - //sql = string.Format("select g.title from ASSETENTRY g where entryid in (select entryid2 from ASSETLINK t where entryid1 = (select t.entryid from ASSETENTRY t ,(select p.fileid from DLSYNC p where p.name = '{0}' and (p.event='add' or p.event = 'update') )o where t.classpk = o.fileid))", item.FileName); - sql = string.Format("select g.title,g.username,g.createdate from ASSETENTRY g where entryid in (select entryid2 from ASSETLINK t where entryid1 = (select t.entryid from ASSETENTRY t ,(select p.fileid from DLSYNC p where p.name = '{0}' and (p.event='add' or p.event = 'update') and p.version='{1}' and ROWNUM = 1 order by p.version desc)o where t.classpk = o.fileid)) ", item.FileName, item.Version); - dt = db.Query(sql); - if (dt.Rows.Count > 0) - { - for (int i = 0; i < dt.Rows.Count; i++) - { - MinioFileassociation dc = new MinioFileassociation(); - datan = db.Query("select * from minio_storage_path where file_name='" + dt.Rows[i]["title"].ToString() + "'").ToList(); - if (datan.Count != 0) - { - - IList SelMFdata = new List(); - SelMFdata = db.Query("select * from MINIO_FILEASSOCIATION where 1=1 and (FILE_PK='" + item.Pk + "' or ASSOCIATION_FILE_PK='" + item.Pk + "')"); - if (SelMFdata.Count > 0) - { - foreach (var ca in SelMFdata) - { - if (item.Pk == ca.FilePk && datan[0].Pk == ca.AssociationFilePk) //如果当前要关联的pk 等于已有的关联pk 被关联pk 等于已有的被关联pk - { - Asstion = false; - } - if (item.Pk == ca.AssociationFilePk && datan[0].Pk == ca.FilePk) //如果当前要关联的pk 等于已有的被关联pk 被关联pk 等于已有的关联pk - { - Asstion = false; - } - } - } - if (Asstion) - { - dc.Pk = Convert.ToInt32(db.QueryScalar("select S_MINIO_FILEASSOCIATION.nextval from dual")); - dc.FilePk = item.Pk; - dc.FileName = item.FileName; - dc.CreatorUser = dt.Rows[i]["username"].ToString().Replace(" ", ""); - dc.CreatorTime = dt.Rows[i]["createdate"].ToString().ToDateTime(); - dc.FilePath = item.FilePath; - dc.FileLevel = item.FileLevel; - dc.DownloadNum = item.DownloadNum; - dc.FileType = item.FileType; - dc.Version = item.Version; - dc.AssociationFilePk = datan[0].Pk; - dc.AssociationFileName = datan[0].FileName; - dc.AssociationFilePath = datan[0].FilePath; - dc.AssociationFileType = datan[0].FileType; - dc.AssociationFileLevel = datan[0].FileLevel; - dc.AssociationDownloadNum = datan[0].DownloadNum; - dc.AssociationVersion = datan[0].Version; - mfcion.Add(dc); - } - } - } - } - } - db.Insert(mfcion); - } - - } - return request; - } - #endregion - - #region - [HttpPost, Route("UdpDlsyncFile")] - public RequestEntity UdpDlsyncFile(string master,string parentfolderid) - { - RequestEntity request = new RequestEntity();//定义返回集合 - //List data = new List();//定义输出下载的list - List newdata = new List();//定义输出下载的list - List dldata = new List();//定义输出下载的list - List datan = new List(); - List mfcion = new List(); - DataTable dt = new DataTable(); - DataTable dta = new DataTable(); - string ctime = ""; - string mtime = ""; - using (IDbContext db = ObjectContainer.GetObject("db")) - { - using (IDbContext filedb = ObjectContainer.GetObject("filedb")) - { - string sql = ""; - //data = db.Query("select * from minio_storage_path where upk='" + master + "' order by CREATOR_TIME desc").ToList(); - - //foreach (var item in data) - //{ - //sql = string.Format("select g.title from ASSETENTRY g where entryid in (select entryid2 from ASSETLINK t where entryid1 = (select t.entryid from ASSETENTRY t ,(select p.fileid from DLSYNC p where p.name = '{0}' and (p.event='add' or p.event = 'update') )o where t.classpk = o.fileid))", item.FileName); - sql = string.Format("select * from DLSYNC where parentfolderid='{0}' and (event='update' or event='add') ", parentfolderid); - dt = db.Query(sql); - string sel = string.Format("select * from minio_storage_path where pk='{0}'", master); ; - dta = db.Query(sel); - if (dt.Rows.Count > 0) - { - for (int i = 0; i < dt.Rows.Count; i++) - { - ctime = dt.Rows[i]["CREATEDATE"].ToString(); - mtime = dt.Rows[i]["MODIFIEDDATE"].ToString(); - MinioStoragePath dc = new MinioStoragePath(); - datan = db.Query("select * from minio_storage_path where file_name='" + dt.Rows[i]["NAME"].ToString() + "'").ToList(); - if (datan.Count < 1) - { - dc.Pk = Convert.ToInt32(db.QueryScalar("select s_minio_storage_path.nextval from dual")); - dc.Upk = Convert.ToInt32(master); - dc.FileName = dt.Rows[i]["NAME"].ToString(); - dc.FileType = 1; - dc.FilePath = dta.Rows[0]["FILE_PATH"].ToString()+"/"+ dt.Rows[i]["NAME"].ToString(); - dc.CreatorUser = "sunliang"; - dc.CreatorTime = ctime.ToDateTime(); - dc.DownloadNum = 0; - dc.FileLevel = Convert.ToInt32( dta.Rows[0]["FILE_LEVEL"].ToString())+1; - dc.ModifyTime = mtime.ToDateTime(); - dc.ClearFlag = "0"; - dc.Version = dt.Rows[i]["VERSION"].ToString(); - newdata.Add(dc); - } - } - } - //} - db.Insert(newdata); - } - - } - return request; - } - #endregion - } } diff --git a/IBKLinker-Minio/Entity/MinioController/GetStoragePathModel.cs b/IBKLinker-Minio/Entity/MinioController/GetStoragePathModel.cs index 06edc48..43bc543 100644 --- a/IBKLinker-Minio/Entity/MinioController/GetStoragePathModel.cs +++ b/IBKLinker-Minio/Entity/MinioController/GetStoragePathModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IBKLinker_Minio.Entity.MinioController +namespace IBKLinker_Minio.Entity.MinioController { /// /// 查询minio文件文件夹路径model(包括模糊查询文件名称以及根据时间查询) diff --git a/IBKLinker-Minio/Entity/MinioController/MinioAuthority.cs b/IBKLinker-Minio/Entity/MinioController/MinioAuthority.cs index 97f31c9..48f6115 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioAuthority.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioAuthority.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/MinioControllerInputModel.cs b/IBKLinker-Minio/Entity/MinioController/MinioControllerInputModel.cs index da5a73a..d9b6139 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioControllerInputModel.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioControllerInputModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IBKLinker_Minio.Entity.MinioController +namespace IBKLinker_Minio.Entity.MinioController { /// /// 文件上传前端发送model diff --git a/IBKLinker-Minio/Entity/MinioController/MinioFileassociation.cs b/IBKLinker-Minio/Entity/MinioController/MinioFileassociation.cs index 3027093..5d52d13 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioFileassociation.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioFileassociation.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/MinioOperationlog.cs b/IBKLinker-Minio/Entity/MinioController/MinioOperationlog.cs index 2117fad..a2772eb 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioOperationlog.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioOperationlog.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/MinioRolePermission.cs b/IBKLinker-Minio/Entity/MinioController/MinioRolePermission.cs index a6fdfd5..4c95393 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioRolePermission.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioRolePermission.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/MinioStoragePath.cs b/IBKLinker-Minio/Entity/MinioController/MinioStoragePath.cs index fa121c9..dab5ddd 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioStoragePath.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioStoragePath.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/MinioUser.cs b/IBKLinker-Minio/Entity/MinioController/MinioUser.cs index 00026d9..6df19da 100644 --- a/IBKLinker-Minio/Entity/MinioController/MinioUser.cs +++ b/IBKLinker-Minio/Entity/MinioController/MinioUser.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; using Newtonsoft.Json; using SOA.Persistent; diff --git a/IBKLinker-Minio/Entity/MinioController/RequstStoragePath.cs b/IBKLinker-Minio/Entity/MinioController/RequstStoragePath.cs index f807dc0..9e736ee 100644 --- a/IBKLinker-Minio/Entity/MinioController/RequstStoragePath.cs +++ b/IBKLinker-Minio/Entity/MinioController/RequstStoragePath.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IBKLinker_Minio.Entity.MinioController { diff --git a/IBKLinker-Minio/Entity/MinioController/SliceUploadModel.cs b/IBKLinker-Minio/Entity/MinioController/SliceUploadModel.cs index adc77a3..7d823c4 100644 --- a/IBKLinker-Minio/Entity/MinioController/SliceUploadModel.cs +++ b/IBKLinker-Minio/Entity/MinioController/SliceUploadModel.cs @@ -1,10 +1,4 @@ -using SOA.Persistent; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace IBKLinker_Minio.Entity.MinioController { diff --git a/IBKLinker-Minio/Entity/MinioController/StandardListGenerationModel.cs b/IBKLinker-Minio/Entity/MinioController/StandardListGenerationModel.cs index a91b14b..3995cea 100644 --- a/IBKLinker-Minio/Entity/MinioController/StandardListGenerationModel.cs +++ b/IBKLinker-Minio/Entity/MinioController/StandardListGenerationModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IBKLinker_Minio.Entity.MinioController +namespace IBKLinker_Minio.Entity.MinioController { /// /// 文件上传标准清单model diff --git a/IBKLinker-Minio/Entity/MinioController/UserModel.cs b/IBKLinker-Minio/Entity/MinioController/UserModel.cs index b036baa..039ac03 100644 --- a/IBKLinker-Minio/Entity/MinioController/UserModel.cs +++ b/IBKLinker-Minio/Entity/MinioController/UserModel.cs @@ -1,13 +1,4 @@ -using Org.BouncyCastle.Bcpg.Sig; -using SOA.Persistent; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IBKLinker_Minio.Entity.MinioController +namespace IBKLinker_Minio.Entity.MinioController { public class UserModel : MinioUser { diff --git a/IBKLinker-Minio/bin/Debug/SOA.ServiceHost.exe b/IBKLinker-Minio/bin/Debug/SOA.ServiceHost.exe deleted file mode 100644 index 5b04961..0000000 Binary files a/IBKLinker-Minio/bin/Debug/SOA.ServiceHost.exe and /dev/null differ