From 032f048a16f92953bb0b426719c86a88e4af871b Mon Sep 17 00:00:00 2001 From: owen Date: Sun, 6 Sep 2026 16:07:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DatabaseAccessor/MasterDbContext.cs | 2 +- .../DatabaseAccessor/SecondaryDbContext.cs | 3 +- .../Policy/CoreMessagePolicy.cs | 7 +- .../Policy/SearchFilterOperatorPolicy.cs | 7 +- .../Policy/SearchFilterTypePolicy.cs | 7 +- .../CloudBuilder.Core/Policy/YesNoPolicy.cs | 4 +- .../Request/ServiceRequest.cs | 17 +- .../Service/SearchCriteria.cs | 15 +- .../DmsFileService.auto.cs | 256 +++- .../CloudBuilderMasterRegistEntity.auto.cs | 9 +- .../Entity/DmsFileDeleteLogEntity.auto.cs | 149 +-- .../DmsFileUploadDeleteLogEntity.auto.cs | 56 +- .../DmsFileUploadDeleteLogViewEntity.auto.cs | 148 +-- .../Entity/DmsFolderDeleteLogEntity.auto.cs | 69 +- .../DmsFolderMapDeleteLogEntity.auto.cs | 36 +- .../Policy/MasterPrefixPolicy.cs | 8 + .../Service/IDmsFileService.auto.cs | 1 + .../Master/DmsFileRequest.auto.cs | 4 + .../Policy/FileTypePolicy_en.resx | 135 ++ .../Policy/FileTypePolicy_zh-cn.resx | 135 ++ .../Master/DmsFileController.auto.cs | 20 + .../basic/OperatorStationDelete.vue | 223 ++++ WebVue/src/service/master/dmsFileService.ts | 10 + .../src/views/master/DmsFileDeleteEnquiry.vue | 1158 +++++++++++------ .../views/master/OrgDmsFileDeleteEnquiry.vue | 912 +++++++++++++ 25 files changed, 2673 insertions(+), 718 deletions(-) create mode 100644 CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_en.resx create mode 100644 CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_zh-cn.resx create mode 100644 WebVue/src/components/basic/OperatorStationDelete.vue create mode 100644 WebVue/src/views/master/OrgDmsFileDeleteEnquiry.vue diff --git a/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/MasterDbContext.cs b/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/MasterDbContext.cs index 3c8e6ce..c2744f2 100644 --- a/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/MasterDbContext.cs +++ b/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/MasterDbContext.cs @@ -59,7 +59,7 @@ namespace CloudBuilder.Core.DatabaseAccessor //public byte[] RowVersion { get; set; } if (ex.Message.Contains("data may have been modified or deleted since entities were loaded.")) { - throw new ValidatedException(CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.THE_DATA_HAS_BEEN_MODIFIED)); + throw new ValidatedException(CoreMessagePolicy.GetInstance(_serviceProvider).ComposeMessage(CoreMessagePolicy.THE_DATA_HAS_BEEN_MODIFIED)); } throw new ValidatedException(ex.InnerException?.Message ?? ex.Message); } diff --git a/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/SecondaryDbContext.cs b/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/SecondaryDbContext.cs index 2e5cb26..5908b82 100644 --- a/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/SecondaryDbContext.cs +++ b/CloudBuilder/CloudBuilder.Core/DatabaseAccessor/SecondaryDbContext.cs @@ -5,6 +5,7 @@ using CloudBuilder.Core.Service; using DocumentFormat.OpenXml.Spreadsheet; using Microsoft.AspNetCore.Http; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.JsonWebTokens; using System; using System.Collections.Generic; @@ -45,7 +46,7 @@ namespace CloudBuilder.Core.DatabaseAccessor { if (ex.Message.Contains("data may have been modified or deleted since entities were loaded.")) { - throw new ValidatedException(CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.THE_DATA_HAS_BEEN_MODIFIED)); + throw new ValidatedException(CoreMessagePolicy.GetInstance(_serviceProvider).ComposeMessage(CoreMessagePolicy.THE_DATA_HAS_BEEN_MODIFIED)); } throw new ValidatedException(ex.InnerException?.Message ?? ex.Message); } diff --git a/CloudBuilder/CloudBuilder.Core/Policy/CoreMessagePolicy.cs b/CloudBuilder/CloudBuilder.Core/Policy/CoreMessagePolicy.cs index a614ff0..b9271bb 100644 --- a/CloudBuilder/CloudBuilder.Core/Policy/CoreMessagePolicy.cs +++ b/CloudBuilder/CloudBuilder.Core/Policy/CoreMessagePolicy.cs @@ -1,4 +1,5 @@ -using CloudBuilder.Core.DependencyInjection.Form; +using CloudBuilder.Core.DatabaseAccessor.Entity; +using CloudBuilder.Core.DependencyInjection.Form; using CloudBuilder.Core.DependencyInjection.Policy; using CloudBuilder.Core.DependencyInjection.Request; using Microsoft.Extensions.DependencyInjection; @@ -22,9 +23,9 @@ namespace CloudBuilder.Core.Policy this.values = new string[] { THE_DATA_HAS_BEEN_MODIFIED, NO_PERMISSION }; } - public static CoreMessagePolicy GetInstance() + public static CoreMessagePolicy GetInstance(IServiceProvider serviceProvider) { - instance = ApplicationServiceContext.ServiceProvider.GetKeyedService(typeof(CoreMessagePolicy).Name); + instance = serviceProvider.GetKeyedService(typeof(CoreMessagePolicy).Name); return instance; } diff --git a/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterOperatorPolicy.cs b/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterOperatorPolicy.cs index 84f970c..7bdf1d0 100644 --- a/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterOperatorPolicy.cs +++ b/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterOperatorPolicy.cs @@ -1,4 +1,5 @@ using CloudBuilder.Core.DependencyInjection.Form; +using CloudBuilder.Core.DependencyInjection.Policy; using CloudBuilder.Core.DependencyInjection.Request; using Microsoft.Extensions.DependencyInjection; using System; @@ -9,7 +10,7 @@ using System.Threading.Tasks; namespace System { - public class SearchFilterOperatorPolicy : AbstractPolicy + public class SearchFilterOperatorPolicy : AbstractPolicy, IPolicy { public const string EQUAL_TO = "equal_to";//='value' public const string CONTAIN = "contain";//like '%value%' @@ -71,9 +72,9 @@ namespace System }; } - public static SearchFilterOperatorPolicy GetInstance() + public static SearchFilterOperatorPolicy GetInstance(IServiceProvider serviceProvider) { - instance = ApplicationServiceContext.ServiceProvider.GetKeyedService(typeof(SearchFilterOperatorPolicy).Name); + instance = serviceProvider.GetKeyedService(typeof(SearchFilterOperatorPolicy).Name); return instance; } diff --git a/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterTypePolicy.cs b/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterTypePolicy.cs index 5e00ef3..ac8caad 100644 --- a/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterTypePolicy.cs +++ b/CloudBuilder/CloudBuilder.Core/Policy/SearchFilterTypePolicy.cs @@ -1,4 +1,5 @@ using CloudBuilder.Core.DependencyInjection.Form; +using CloudBuilder.Core.DependencyInjection.Policy; using CloudBuilder.Core.DependencyInjection.Request; using Microsoft.Extensions.DependencyInjection; using System; @@ -9,7 +10,7 @@ using System.Threading.Tasks; namespace System { - public class SearchFilterTypePolicy : AbstractPolicy + public class SearchFilterTypePolicy : AbstractPolicy, IPolicy { public const string TEXT = "Text"; public const string TEXT_CONTAIN = "TextContain"; @@ -31,9 +32,9 @@ namespace System this.values = new string[] { TEXT, TEXT_CONTAIN, NUMBER, DATE, DATETIME, MULTIPLE_SELECTION, SINGLE_SELECTION }; } - public static SearchFilterTypePolicy GetInstance() + public static SearchFilterTypePolicy GetInstance(IServiceProvider serviceProvider) { - instance = ApplicationServiceContext.ServiceProvider.GetKeyedService(typeof(SearchFilterTypePolicy).Name); + instance = serviceProvider.GetKeyedService(typeof(SearchFilterTypePolicy).Name); return instance; } } diff --git a/CloudBuilder/CloudBuilder.Core/Policy/YesNoPolicy.cs b/CloudBuilder/CloudBuilder.Core/Policy/YesNoPolicy.cs index ff6c6b7..ae5bb1b 100644 --- a/CloudBuilder/CloudBuilder.Core/Policy/YesNoPolicy.cs +++ b/CloudBuilder/CloudBuilder.Core/Policy/YesNoPolicy.cs @@ -18,9 +18,9 @@ namespace System this.values = new string[] { YES, NO }; } - public static YesNoPolicy GetInstance() + public static YesNoPolicy GetInstance(IServiceProvider serviceProvider) { - instance = ApplicationServiceContext.ServiceProvider.GetKeyedService(typeof(YesNoPolicy).Name); + instance = serviceProvider.GetKeyedService(typeof(YesNoPolicy).Name); return instance; } diff --git a/CloudBuilder/CloudBuilder.Core/Request/ServiceRequest.cs b/CloudBuilder/CloudBuilder.Core/Request/ServiceRequest.cs index 9b6ec9b..865550e 100644 --- a/CloudBuilder/CloudBuilder.Core/Request/ServiceRequest.cs +++ b/CloudBuilder/CloudBuilder.Core/Request/ServiceRequest.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; +using System; using System.Net.Http.Headers; using System.Net.Http.Json; using System.Text; @@ -138,7 +139,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -188,7 +189,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -244,7 +245,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -275,7 +276,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -306,7 +307,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -335,7 +336,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -395,7 +396,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } @@ -429,7 +430,7 @@ namespace CloudBuilder.Core.Request if (responseContext != null && responseContext.StartsWith("{\"errors\"")) errors = responseContext.Substring(11, responseContext.IndexOf("}") - 11); if (response.ReasonPhrase == "Forbidden") - throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance().ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); + throw new Exception(string.Format("{0}", CoreMessagePolicy.GetInstance(provider).ComposeMessage(CoreMessagePolicy.NO_PERMISSION))); throw new Exception(string.Format("{0}{1}", response.ReasonPhrase, string.IsNullOrEmpty(errors) ? "" : "\r\n" + errors)); } diff --git a/CloudBuilder/CloudBuilder.Core/Service/SearchCriteria.cs b/CloudBuilder/CloudBuilder.Core/Service/SearchCriteria.cs index 676357f..86841f8 100644 --- a/CloudBuilder/CloudBuilder.Core/Service/SearchCriteria.cs +++ b/CloudBuilder/CloudBuilder.Core/Service/SearchCriteria.cs @@ -1,4 +1,5 @@ -using System; +using Microsoft.Extensions.DependencyInjection; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,16 +13,16 @@ namespace CloudBuilder.Core.Service public const string KEY_FILTER_OPERATOR = "filter_operator"; public const string KEY_FILTER_TYPE = "filter_type"; - public SearchCriteria() + public SearchCriteria(IServiceProvider serviceProvider) { - Add(KEY_FILTER_OPERATOR, SearchFilterOperatorPolicy.GetInstance().GetBindOptions()); - Add(KEY_FILTER_TYPE, SearchFilterTypePolicy.GetInstance().GetBindOptions()); + Add(KEY_FILTER_OPERATOR, SearchFilterOperatorPolicy.GetInstance(serviceProvider).GetBindOptions()); + Add(KEY_FILTER_TYPE, SearchFilterTypePolicy.GetInstance(serviceProvider).GetBindOptions()); } - public SearchCriteria(Selection[] selections) + public SearchCriteria(IServiceProvider serviceProvider,Selection[] selections) { Selections = selections; - Add(KEY_FILTER_OPERATOR, SearchFilterOperatorPolicy.GetInstance().GetBindOptions()); - Add(KEY_FILTER_TYPE, SearchFilterTypePolicy.GetInstance().GetBindOptions()); + Add(KEY_FILTER_OPERATOR, SearchFilterOperatorPolicy.GetInstance(serviceProvider).GetBindOptions()); + Add(KEY_FILTER_TYPE, SearchFilterTypePolicy.GetInstance(serviceProvider).GetBindOptions()); } public Selection[] Selections { get; set; } diff --git a/CloudBuilder/CloudBuilder.Master.Service/DmsFileService.auto.cs b/CloudBuilder/CloudBuilder.Master.Service/DmsFileService.auto.cs index c62218a..597ad52 100644 --- a/CloudBuilder/CloudBuilder.Master.Service/DmsFileService.auto.cs +++ b/CloudBuilder/CloudBuilder.Master.Service/DmsFileService.auto.cs @@ -364,35 +364,29 @@ namespace CloudBuilder.Master.Service [PermissionOperate(name: MasterPermissionPolicy.DmsFile, operate: Operate.Delete)] [UnitOfWork] public void Delete(long key) + { + Delete(key, false); + } + + private void Delete(long key, bool hasCreateDmsFileDeleteLog) { DmsFileEntity dmsFile = repository.DetachedEntities.Where(x => x.FileId == key).FirstOrDefault()!; if (dmsFile == null) return; + if (!hasCreateDmsFileDeleteLog) CreateDmsFileDeleteLog(dmsFile, null); + IRepository repositoryUpload = repository.GetRepository>(); IRepository repositoryFolderMap = repository.GetRepository>(); IRepository repositoryFolder = repository.GetRepository>(); repository.DeleteNow(dmsFile); - IRepository repositoryDmsFileDeleteLog = repository.GetRepository>(); - DmsFileDeleteLogEntity dmsFileDeleteLogEntity = new DmsFileDeleteLogEntity(); - ObjectCopyHelper.Copy(dmsFile, dmsFileDeleteLogEntity); - repositoryDmsFileDeleteLog.InsertNow(dmsFileDeleteLogEntity); - DmsFileUploadEntity DmsFileUpload = repositoryUpload.DetachedEntities.Where(x => x.FileId == key).FirstOrDefault()!; - IRepository repositoryDmsFileUploadDeleteLog = repository.GetRepository>(); - IRepository repositoryDmsFolderDeleteLog = repository.GetRepository>(); - IRepository repositoryDmsFolderMapDeleteLog = repository.GetRepository>(); - if (DmsFileUpload != null) { repositoryUpload.DeleteNow(DmsFileUpload); - - DmsFileUploadDeleteLogEntity DmsFileUploadDeleteLogEntity = new DmsFileUploadDeleteLogEntity(); - ObjectCopyHelper.Copy(DmsFileUpload, DmsFileUploadDeleteLogEntity); - repositoryDmsFileUploadDeleteLog.InsertNow(DmsFileUploadDeleteLogEntity); } if (dmsFile.IsDirectoryIndc == YesNoPolicy.YES) @@ -404,32 +398,21 @@ namespace CloudBuilder.Master.Service if (folder != null) { repositoryFolder.DeleteNow(folder); - - DmsFolderDeleteLogEntity dfdLog = new DmsFolderDeleteLogEntity(); - ObjectCopyHelper.Copy(folder, dfdLog); - repositoryDmsFolderDeleteLog.InsertNow(dfdLog); - } DmsFolderMapEntity[] folderMaps = repositoryFolderMap.DetachedEntities.Where(x => x.FolderNameSon == dmsFile.FileName || x.FolderNameParent == dmsFile.FileName).ToArray(); - DmsFolderMapDeleteLogEntity dmsFolderMapEntity; if (folderMaps != null && folderMaps.Length > 0) { foreach (var map in folderMaps) { repositoryFolderMap.DeleteNow(map); - dmsFolderMapEntity = new DmsFolderMapDeleteLogEntity(); - ObjectCopyHelper.Copy(map, dmsFolderMapEntity); - repositoryDmsFolderMapDeleteLog.InsertNow(dmsFolderMapEntity); if (map.FolderNameSon == folder.FolderName) continue; //刪除dmsfoler下的所有內容 DeleteFolder(map.FolderNameSon); } } - - } else { @@ -438,12 +421,229 @@ namespace CloudBuilder.Master.Service if (folderMap != null) repositoryFolderMap.DeleteNow(folderMap); } - } + + private void CreateDmsFileDeleteLogByDirectory(DmsFileEntity dmsFile, DmsFolderDeleteLogEntity folder) + { + IRepository repositoryFolder = repository.GetRepository>(); + ISecurityGeneratorNumberService securityGeneratorNumberService = service.ServiceProvider.GetService()!; + + string folderNameParent = folder.FolderName; + + //创建当前目录 + folder = new DmsFolderDeleteLogEntity(); + folder.FolderName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG, MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG_FOLDER_NAME, "DR", YesNoPolicy.NO, "00000000"); + folder.FolderLocalName = dmsFile.OrgFileName;//如果是目录,这个就是目录名称 + repositoryFolder.InsertNow(folder); + //创建目录关系表 + DmsFolderMapDeleteLogEntity map = new DmsFolderMapDeleteLogEntity(); + IRepository repositoryFolderMap = repository.GetRepository>(); + map.FolderNameParent = folderNameParent; + map.FolderNameSon = folder.FolderName; + repositoryFolderMap.InsertNow(map); + + //创建Dms目录 + IRepository repositoryDmsFileDeleteLog = repository.GetRepository>(); + DmsFileDeleteLogEntity entity = new DmsFileDeleteLogEntity(); + ObjectCopyHelper.Copy(dmsFile, entity); + entity.OrderKey = entity.FileName = folder.FolderName; + + entity.FileId = 0; + entity.FilePath = folderNameParent; + repositoryDmsFileDeleteLog.InsertNow(entity); + + DmsFileUploadDeleteLogEntity upload = new DmsFileUploadDeleteLogEntity(); + upload.FileId = entity.FileId; + upload.FileCategory = "MASTER"; + upload.UploadName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_UPLOAD_NAME, "DR", YesNoPolicy.NO, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_FORMAT); + upload.OrgFileName = entity.OrgFileName; + + IRepository repositoryUpload = repository.GetRepository>(); + + repositoryUpload.InsertNow(upload); + + //创建所有目录下的内容 + DmsFileEntity[] dmsFiles = repository.DetachedEntities.Where(x => x.FilePath == dmsFile.FileName).ToArray(); + if (dmsFiles == null || dmsFiles.Length == 0) return; + + foreach (var dms in dmsFiles) + { + CreateDmsFileDeleteLog(dms, folder); + } + } + + private void CreateDmsFileDeleteLog(DmsFileEntity dmsFile, DmsFolderDeleteLogEntity folderLog) + { + IRepository repositoryDmsFileDeleteLog = repository.GetRepository>(); + IRepository repositoryDmsFileUploadDeleteLog = repository.GetRepository>(); + IRepository repositoryDmsFolderDeleteLog = repository.GetRepository>(); + IRepository repositoryDmsFolderMapDeleteLog = repository.GetRepository>(); + + ISecurityGeneratorNumberService securityGeneratorNumberService = service.ServiceProvider.GetService()!; + + //如果顶级目录不存在,创建顶级目录 + if (folderLog == null) + folderLog = repositoryDmsFolderDeleteLog.DetachedEntities.Where(x => x.FolderLocalName == service.UserId).FirstOrDefault()!; + + if (folderLog == null) + { + folderLog = new DmsFolderDeleteLogEntity(); + folderLog.FolderName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG, MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG_FOLDER_NAME, null, YesNoPolicy.NO, "00000000"); + folderLog.FolderLocalName = service.UserId; + repositoryDmsFolderDeleteLog.InsertNow(folderLog); + } + + string folderNameParent = folderLog.FolderName; + + if (dmsFile.IsDirectoryIndc == YesNoPolicy.YES) + { + CreateDmsFileDeleteLogByDirectory(dmsFile, folderLog); + return; + } + + DmsFileUploadDeleteLogEntity uploadLog = new DmsFileUploadDeleteLogEntity(); + + uploadLog.FileCategory = "MASTER"; + uploadLog.UploadName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_UPLOAD_NAME, "FL", YesNoPolicy.NO, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_FORMAT); + uploadLog.OrgFileName = dmsFile.OrgFileName; + + //创建Dms文件,需更新父目录 + DmsFileDeleteLogEntity entityLog = new DmsFileDeleteLogEntity(); + ObjectCopyHelper.Copy(dmsFile, entityLog); + entityLog.FilePath = folderNameParent; + entityLog.FileId = 0; + repositoryDmsFileDeleteLog.InsertNow(entityLog); + + uploadLog.FileId = entityLog.FileId; + repositoryDmsFileUploadDeleteLog.InsertNow(uploadLog); + + //创建目录关系表 + DmsFolderMapDeleteLogEntity mapLog = new DmsFolderMapDeleteLogEntity(); + mapLog.FolderNameParent = folderNameParent; + mapLog.FolderNameSon = entityLog.FileName; + repositoryDmsFolderMapDeleteLog.InsertNow(mapLog); + } + + + [PermissionOperate(name: MasterPermissionPolicy.DmsFile, operate: Operate.Insert)] + [UnitOfWork] + public void RestoreDmsFile(long key) + { + DeleteLog(key, true); + } + + + private void RestoreDmsFileByDirectory(DmsFileDeleteLogEntity dmsFile, DmsFolderEntity folder) + { + IRepository repositoryFolder = repository.GetRepository>(); + ISecurityGeneratorNumberService securityGeneratorNumberService = service.ServiceProvider.GetService()!; + + string folderNameParent = folder.FolderName; + + //创建当前目录 + folder = new DmsFolderEntity(); + folder.FolderName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG, MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG_FOLDER_NAME, "DR", YesNoPolicy.NO, "00000000"); + folder.FolderLocalName = dmsFile.OrgFileName;//如果是目录,这个就是目录名称 + repositoryFolder.InsertNow(folder); + //创建目录关系表 + DmsFolderMapEntity map = new DmsFolderMapEntity(); + IRepository repositoryFolderMap = repository.GetRepository>(); + map.FolderNameParent = folderNameParent; + map.FolderNameSon = folder.FolderName; + repositoryFolderMap.InsertNow(map); + + //创建Dms目录,要更新目录名 + IRepository repositoryDmsFile = repository.GetRepository>(); + DmsFileEntity entity = new DmsFileEntity(); + ObjectCopyHelper.Copy(dmsFile, entity); + entity.OrderKey = entity.FileName = folder.FolderName; + + entity.FileId = 0; + entity.FilePath = folderNameParent; + repositoryDmsFile.InsertNow(entity); + + DmsFileUploadEntity upload = new DmsFileUploadEntity(); + upload.FileId = entity.FileId; + upload.FileCategory = "MASTER"; + upload.UploadName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_UPLOAD_NAME, "DR", YesNoPolicy.NO, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_FORMAT); + upload.OrgFileName = entity.OrgFileName; + + IRepository repositoryUpload = repository.GetRepository>(); + + repositoryUpload.InsertNow(upload); + + IRepository repositoryDmsFileDeleteLog = repository.GetRepository>(); + //创建所有目录下的内容 + DmsFileDeleteLogEntity[] dmsFiles = repositoryDmsFileDeleteLog.DetachedEntities.Where(x => x.FilePath == dmsFile.FileName).ToArray(); + if (dmsFiles == null || dmsFiles.Length == 0) return; + + foreach (var dms in dmsFiles) + { + RestoreDmsFile(dms, folder); + } + } + + private void RestoreDmsFile(DmsFileDeleteLogEntity dmsFile, DmsFolderEntity folder) + { + IRepository repositoryDmsFile = repository.GetRepository>(); + IRepository repositoryDmsFileUpload = repository.GetRepository>(); + IRepository repositoryDmsFolder = repository.GetRepository>(); + IRepository repositoryDmsFolderMap = repository.GetRepository>(); + + ISecurityGeneratorNumberService securityGeneratorNumberService = service.ServiceProvider.GetService()!; + + //如果顶级目录不存在,创建顶级目录 + if (folder == null) + folder = repositoryDmsFolder.DetachedEntities.Where(x => x.FolderLocalName == service.UserId).FirstOrDefault()!; + + if (folder == null) + { + folder = new DmsFolderEntity(); + folder.FolderName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG, MasterPrefixPolicy.DMS_FOLDER_DELETE_LOG_FOLDER_NAME, null, YesNoPolicy.NO, "00000000"); + folder.FolderLocalName = service.UserId; + repositoryDmsFolder.InsertNow(folder); + } + + string folderNameParent = folder.FolderName; + + if (dmsFile.IsDirectoryIndc == YesNoPolicy.YES) + { + RestoreDmsFileByDirectory(dmsFile, folder); + return; + } + + DmsFileUploadEntity uploadLog = new DmsFileUploadEntity(); + + uploadLog.FileCategory = "MASTER"; + uploadLog.UploadName = securityGeneratorNumberService.GetNo(MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_UPLOAD_NAME, "FL", YesNoPolicy.NO, MasterPrefixPolicy.UPLOAD_DMS_FILE_DELETE_LOG_FORMAT); + uploadLog.OrgFileName = dmsFile.OrgFileName; + + //创建Dms文件,需更新父目录 + DmsFileEntity entityLog = new DmsFileEntity(); + ObjectCopyHelper.Copy(dmsFile, entityLog); + entityLog.FilePath = folderNameParent; + entityLog.FileId = 0; + repositoryDmsFile.InsertNow(entityLog); + + uploadLog.FileId = entityLog.FileId; + repositoryDmsFileUpload.InsertNow(uploadLog); + + //创建目录关系表 + DmsFolderMapEntity mapLog = new DmsFolderMapEntity(); + mapLog.FolderNameParent = folderNameParent; + mapLog.FolderNameSon = entityLog.FileName; + repositoryDmsFolderMap.InsertNow(mapLog); + } + + [PermissionOperate(name: MasterPermissionPolicy.DmsFile, operate: Operate.Delete)] [UnitOfWork] public void DeleteLog(long key) + { + DeleteLog(key, false); + } + private void DeleteLog(long key, bool isRestore) { IRepository repositoryDmsFileDeleteLog = repository.GetRepository>(); @@ -451,6 +651,8 @@ namespace CloudBuilder.Master.Service if (dmsFile == null) return; + if (isRestore) RestoreDmsFile(dmsFile, null); + repositoryDmsFileDeleteLog.DeleteNow(dmsFile); IRepository repositoryDmsFileUploadDeleteLog = repository.GetRepository>(); @@ -502,7 +704,7 @@ namespace CloudBuilder.Master.Service if (dmsFiles == null || dmsFiles.Length == 0) return; foreach (var dmsFile in dmsFiles) { - DeleteLog(dmsFile.FileId); + DeleteLog(dmsFile.FileId, false); } } @@ -512,7 +714,7 @@ namespace CloudBuilder.Master.Service if (dmsFiles == null || dmsFiles.Length == 0) return; foreach (var dmsFile in dmsFiles) { - Delete(dmsFile.FileId); + Delete(dmsFile.FileId, true); } } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs index 40d2e32..004f70d 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs @@ -98,7 +98,14 @@ builder.Entity().HasKey(c => new {c.FamilyName,c. -//***END*** + + + +builder.Entity(eb => { eb.HasNoKey(); }); + + +builder.Entity(eb => { eb.HasNoKey(); }); + //***END*** } } } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileDeleteLogEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileDeleteLogEntity.auto.cs index 18c030b..77a34ac 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileDeleteLogEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileDeleteLogEntity.auto.cs @@ -14,14 +14,16 @@ namespace CloudBuilder.Master.Entity { } - [Column("allow_delete_indc")] - public string AllowDeleteIndc { get; set; } - [Column("allow_rename_indc")] - public string AllowRenameIndc { get; set; } - [Column("created_by")] - public string CreatedBy { get; set; } [Column("created_datetime")] public DateTime CreatedDatetime { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } + [Column("updated_datetime")] + public DateTime UpdatedDatetime { get; set; } + [Column("updated_by")] + public string UpdatedBy { get; set; } + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Column("file_id")] public long FileId { get; set; } [Column("file_name")] @@ -30,85 +32,79 @@ namespace CloudBuilder.Master.Entity public string FilePath { get; set; } [Column("file_size")] public int FileSize { get; set; } - [Column("file_tag")] - public string? FileTag { get; set; } - [Column("file_type")] - public string? FileType { get; set; } - [Column("is_directory_indc")] - public string IsDirectoryIndc { get; set; } - [Column("is_link_indc")] - public string IsLinkIndc { get; set; } - [Column("landscape_indc")] - public string? LandscapeIndc { get; set; } - [Column("linked_file_id")] - public int LinkedFileId { get; set; } - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("log_id")] - public int LogId { get; set; } - [Column("order_key")] - public string? OrderKey { get; set; } - [Column("org_file_name")] - public string OrgFileName { get; set; } [Column("ower_id")] public string OwerId { get; set; } [Column("revision_no")] public int RevisionNo { get; set; } + [Column("is_directory_indc")] + public string IsDirectoryIndc { get; set; } + [Column("is_link_indc")] + public string IsLinkIndc { get; set; } + [Column("linked_file_id")] + public int LinkedFileId { get; set; } + [Column("org_file_name")] + public string OrgFileName { get; set; } + [Column("order_key")] + public string? OrderKey { get; set; } + [Column("file_tag")] + public string? FileTag { get; set; } + [Column("allow_rename_indc")] + public string AllowRenameIndc { get; set; } + [Column("allow_delete_indc")] + public string AllowDeleteIndc { get; set; } + [Column("file_type")] + public string? FileType { get; set; } + [Column("landscape_indc")] + public string? LandscapeIndc { get; set; } [Column("transcode_indc")] public string? TranscodeIndc { get; set; } - [Column("updated_by")] - public string UpdatedBy { get; set; } - [Column("updated_datetime")] - public DateTime UpdatedDatetime { get; set; } - public const string ALLOW_DELETE_INDC = "AllowDeleteIndc"; - public const string ALLOW_RENAME_INDC = "AllowRenameIndc"; - public const string CREATED_BY = "CreatedBy"; public const string CREATED_DATETIME = "CreatedDatetime"; + public const string CREATED_BY = "CreatedBy"; + public const string UPDATED_DATETIME = "UpdatedDatetime"; + public const string UPDATED_BY = "UpdatedBy"; public const string FILE_ID = "FileId"; public const string FILE_NAME = "FileName"; public const string FILE_PATH = "FilePath"; public const string FILE_SIZE = "FileSize"; - public const string FILE_TAG = "FileTag"; - public const string FILE_TYPE = "FileType"; - public const string IS_DIRECTORY_INDC = "IsDirectoryIndc"; - public const string IS_LINK_INDC = "IsLinkIndc"; - public const string LANDSCAPE_INDC = "LandscapeIndc"; - public const string LINKED_FILE_ID = "LinkedFileId"; - public const string LOG_ID = "LogId"; - public const string ORDER_KEY = "OrderKey"; - public const string ORG_FILE_NAME = "OrgFileName"; public const string OWER_ID = "OwerId"; public const string REVISION_NO = "RevisionNo"; + public const string IS_DIRECTORY_INDC = "IsDirectoryIndc"; + public const string IS_LINK_INDC = "IsLinkIndc"; + public const string LINKED_FILE_ID = "LinkedFileId"; + public const string ORG_FILE_NAME = "OrgFileName"; + public const string ORDER_KEY = "OrderKey"; + public const string FILE_TAG = "FileTag"; + public const string ALLOW_RENAME_INDC = "AllowRenameIndc"; + public const string ALLOW_DELETE_INDC = "AllowDeleteIndc"; + public const string FILE_TYPE = "FileType"; + public const string LANDSCAPE_INDC = "LandscapeIndc"; public const string TRANSCODE_INDC = "TranscodeIndc"; - public const string UPDATED_BY = "UpdatedBy"; - public const string UPDATED_DATETIME = "UpdatedDatetime"; public const string DB_NAME_DMS_FILE_DELETE_LOG = "dms_file_delete_log"; - public const string DB_NAME_FIELDS="allow_delete_indc,allow_rename_indc,created_by,created_datetime,file_id,file_name,file_path,file_size,file_tag,file_type,is_directory_indc,is_link_indc,landscape_indc,linked_file_id,log_id,order_key,org_file_name,ower_id,revision_no,transcode_indc,updated_by,updated_datetime"; + public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,file_id,file_name,file_path,file_size,ower_id,revision_no,is_directory_indc,is_link_indc,linked_file_id,org_file_name,order_key,file_tag,allow_rename_indc,allow_delete_indc,file_type,landscape_indc,transcode_indc"; - public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc"; - public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc"; - public const string DB_CREATED_BY = "created_by"; public const string DB_CREATED_DATETIME = "created_datetime"; + public const string DB_CREATED_BY = "created_by"; + public const string DB_UPDATED_DATETIME = "updated_datetime"; + public const string DB_UPDATED_BY = "updated_by"; public const string DB_FILE_ID = "file_id"; public const string DB_FILE_NAME = "file_name"; public const string DB_FILE_PATH = "file_path"; public const string DB_FILE_SIZE = "file_size"; - public const string DB_FILE_TAG = "file_tag"; - public const string DB_FILE_TYPE = "file_type"; - public const string DB_IS_DIRECTORY_INDC = "is_directory_indc"; - public const string DB_IS_LINK_INDC = "is_link_indc"; - public const string DB_LANDSCAPE_INDC = "landscape_indc"; - public const string DB_LINKED_FILE_ID = "linked_file_id"; - public const string DB_LOG_ID = "log_id"; - public const string DB_ORDER_KEY = "order_key"; - public const string DB_ORG_FILE_NAME = "org_file_name"; public const string DB_OWER_ID = "ower_id"; public const string DB_REVISION_NO = "revision_no"; + public const string DB_IS_DIRECTORY_INDC = "is_directory_indc"; + public const string DB_IS_LINK_INDC = "is_link_indc"; + public const string DB_LINKED_FILE_ID = "linked_file_id"; + public const string DB_ORG_FILE_NAME = "org_file_name"; + public const string DB_ORDER_KEY = "order_key"; + public const string DB_FILE_TAG = "file_tag"; + public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc"; + public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc"; + public const string DB_FILE_TYPE = "file_type"; + public const string DB_LANDSCAPE_INDC = "landscape_indc"; public const string DB_TRANSCODE_INDC = "transcode_indc"; - public const string DB_UPDATED_BY = "updated_by"; - public const string DB_UPDATED_DATETIME = "updated_datetime"; private string ProviderName { get; set; } @@ -129,35 +125,34 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.AllowDeleteIndc = source.AllowDeleteIndc; - this.AllowRenameIndc = source.AllowRenameIndc; - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; + this.CreatedBy = source.CreatedBy; + this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; this.FileId = source.FileId; this.FileName = source.FileName; this.FilePath = source.FilePath; this.FileSize = source.FileSize; - this.FileTag = source.FileTag; - this.FileType = source.FileType; - this.IsDirectoryIndc = source.IsDirectoryIndc; - this.IsLinkIndc = source.IsLinkIndc; - this.LandscapeIndc = source.LandscapeIndc; - this.LinkedFileId = source.LinkedFileId; - this.LogId = source.LogId; - this.OrderKey = source.OrderKey; - this.OrgFileName = source.OrgFileName; this.OwerId = source.OwerId; this.RevisionNo = source.RevisionNo; + this.IsDirectoryIndc = source.IsDirectoryIndc; + this.IsLinkIndc = source.IsLinkIndc; + this.LinkedFileId = source.LinkedFileId; + this.OrgFileName = source.OrgFileName; + this.OrderKey = source.OrderKey; + this.FileTag = source.FileTag; + this.AllowRenameIndc = source.AllowRenameIndc; + this.AllowDeleteIndc = source.AllowDeleteIndc; + this.FileType = source.FileType; + this.LandscapeIndc = source.LandscapeIndc; this.TranscodeIndc = source.TranscodeIndc; - this.UpdatedBy = source.UpdatedBy; - this.UpdatedDatetime = source.UpdatedDatetime; if (includeSystemFields) { - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; } } @@ -229,7 +224,7 @@ namespace CloudBuilder.Master.Entity public string GetSelectTopFromByMySql(int limit, int start,string orderby,string orderbytag, string sqlWhere) { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_LOG_ID ; + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_FILE_ID ; int offset = limit * (start - 1); return $" select {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FILE_DELETE_LOG} where 1=1 {sqlWhere} ) a where num> {offset} LIMIT {limit} "; } @@ -237,7 +232,7 @@ namespace CloudBuilder.Master.Entity public string GetSelectTopFromBySqlServer(int limit, int start,string orderby,string orderbytag, string sqlWhere) { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_LOG_ID ; + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_FILE_ID ; string top = limit > 0 ? $"top {limit}" : ""; return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FILE_DELETE_LOG} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}"; } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogEntity.auto.cs index 1920af2..115da24 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogEntity.auto.cs @@ -14,44 +14,44 @@ namespace CloudBuilder.Master.Entity { } - [Column("created_by")] - public string CreatedBy { get; set; } [Column("created_datetime")] public DateTime CreatedDatetime { get; set; } - [Column("file_category")] - public string FileCategory { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } + [Column("updated_datetime")] + public DateTime UpdatedDatetime { get; set; } + [Column("updated_by")] + public string UpdatedBy { get; set; } [Key] [Column("file_id")] public long FileId { get; set; } - [Column("org_file_name")] - public string OrgFileName { get; set; } - [Column("updated_by")] - public string UpdatedBy { get; set; } - [Column("updated_datetime")] - public DateTime UpdatedDatetime { get; set; } [Column("upload_name")] public string UploadName { get; set; } + [Column("file_category")] + public string FileCategory { get; set; } + [Column("org_file_name")] + public string OrgFileName { get; set; } - public const string CREATED_BY = "CreatedBy"; public const string CREATED_DATETIME = "CreatedDatetime"; - public const string FILE_CATEGORY = "FileCategory"; - public const string FILE_ID = "FileId"; - public const string ORG_FILE_NAME = "OrgFileName"; - public const string UPDATED_BY = "UpdatedBy"; + public const string CREATED_BY = "CreatedBy"; public const string UPDATED_DATETIME = "UpdatedDatetime"; + public const string UPDATED_BY = "UpdatedBy"; + public const string FILE_ID = "FileId"; public const string UPLOAD_NAME = "UploadName"; + public const string FILE_CATEGORY = "FileCategory"; + public const string ORG_FILE_NAME = "OrgFileName"; public const string DB_NAME_DMS_FILE_UPLOAD_DELETE_LOG = "dms_file_upload_delete_log"; - public const string DB_NAME_FIELDS="created_by,created_datetime,file_category,file_id,org_file_name,updated_by,updated_datetime,upload_name"; + public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,file_id,upload_name,file_category,org_file_name"; - public const string DB_CREATED_BY = "created_by"; public const string DB_CREATED_DATETIME = "created_datetime"; - public const string DB_FILE_CATEGORY = "file_category"; - public const string DB_FILE_ID = "file_id"; - public const string DB_ORG_FILE_NAME = "org_file_name"; - public const string DB_UPDATED_BY = "updated_by"; + public const string DB_CREATED_BY = "created_by"; public const string DB_UPDATED_DATETIME = "updated_datetime"; + public const string DB_UPDATED_BY = "updated_by"; + public const string DB_FILE_ID = "file_id"; public const string DB_UPLOAD_NAME = "upload_name"; + public const string DB_FILE_CATEGORY = "file_category"; + public const string DB_ORG_FILE_NAME = "org_file_name"; private string ProviderName { get; set; } @@ -72,21 +72,21 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.FileCategory = source.FileCategory; - this.FileId = source.FileId; - this.OrgFileName = source.OrgFileName; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; + this.FileId = source.FileId; this.UploadName = source.UploadName; + this.FileCategory = source.FileCategory; + this.OrgFileName = source.OrgFileName; if (includeSystemFields) { - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; } } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogViewEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogViewEntity.auto.cs index b43a2da..77af223 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogViewEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/DmsFileUploadDeleteLogViewEntity.auto.cs @@ -14,102 +14,102 @@ namespace CloudBuilder.Master.Entity { } - [Column("allow_delete_indc")] - public string AllowDeleteIndc { get; set; } - [Column("allow_rename_indc")] - public string AllowRenameIndc { get; set; } - [Column("created_by")] - public string CreatedBy { get; set; } [Column("created_datetime")] public DateTime CreatedDatetime { get; set; } - [Column("file_category")] - public string FileCategory { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } [Column("file_id")] public long FileId { get; set; } + [Column("upload_name")] + public string UploadName { get; set; } + [Column("file_category")] + public string FileCategory { get; set; } + [Column("org_file_name")] + public string OrgFileName { get; set; } [Column("file_name")] public string FileName { get; set; } [Column("file_path")] public string FilePath { get; set; } - [Column("file_size")] - public int FileSize { get; set; } - [Column("file_tag")] - public string? FileTag { get; set; } - [Column("file_type")] - public string? FileType { get; set; } [Column("folder_local_name")] public string? FolderLocalName { get; set; } - [Column("is_directory_indc")] - public string IsDirectoryIndc { get; set; } - [Column("is_link_indc")] - public string IsLinkIndc { get; set; } - [Column("landscape_indc")] - public string? LandscapeIndc { get; set; } - [Column("linked_file_id")] - public int LinkedFileId { get; set; } - [Column("order_key")] - public string? OrderKey { get; set; } - [Column("org_file_name")] - public string OrgFileName { get; set; } + [Column("file_size")] + public int FileSize { get; set; } [Column("ower_id")] public string OwerId { get; set; } [Column("revision_no")] public int RevisionNo { get; set; } + [Column("is_directory_indc")] + public string IsDirectoryIndc { get; set; } + [Column("is_link_indc")] + public string IsLinkIndc { get; set; } + [Column("linked_file_id")] + public int LinkedFileId { get; set; } + [Column("order_key")] + public string? OrderKey { get; set; } + [Column("file_tag")] + public string? FileTag { get; set; } + [Column("allow_rename_indc")] + public string AllowRenameIndc { get; set; } + [Column("allow_delete_indc")] + public string AllowDeleteIndc { get; set; } + [Column("file_type")] + public string? FileType { get; set; } + [Column("landscape_indc")] + public string? LandscapeIndc { get; set; } [Column("transcode_indc")] public string? TranscodeIndc { get; set; } - [Column("upload_name")] - public string UploadName { get; set; } [Column("url")] public string Url { get; set; } - public const string ALLOW_DELETE_INDC = "AllowDeleteIndc"; - public const string ALLOW_RENAME_INDC = "AllowRenameIndc"; - public const string CREATED_BY = "CreatedBy"; public const string CREATED_DATETIME = "CreatedDatetime"; - public const string FILE_CATEGORY = "FileCategory"; + public const string CREATED_BY = "CreatedBy"; public const string FILE_ID = "FileId"; + public const string UPLOAD_NAME = "UploadName"; + public const string FILE_CATEGORY = "FileCategory"; + public const string ORG_FILE_NAME = "OrgFileName"; public const string FILE_NAME = "FileName"; public const string FILE_PATH = "FilePath"; - public const string FILE_SIZE = "FileSize"; - public const string FILE_TAG = "FileTag"; - public const string FILE_TYPE = "FileType"; public const string FOLDER_LOCAL_NAME = "FolderLocalName"; - public const string IS_DIRECTORY_INDC = "IsDirectoryIndc"; - public const string IS_LINK_INDC = "IsLinkIndc"; - public const string LANDSCAPE_INDC = "LandscapeIndc"; - public const string LINKED_FILE_ID = "LinkedFileId"; - public const string ORDER_KEY = "OrderKey"; - public const string ORG_FILE_NAME = "OrgFileName"; + public const string FILE_SIZE = "FileSize"; public const string OWER_ID = "OwerId"; public const string REVISION_NO = "RevisionNo"; + public const string IS_DIRECTORY_INDC = "IsDirectoryIndc"; + public const string IS_LINK_INDC = "IsLinkIndc"; + public const string LINKED_FILE_ID = "LinkedFileId"; + public const string ORDER_KEY = "OrderKey"; + public const string FILE_TAG = "FileTag"; + public const string ALLOW_RENAME_INDC = "AllowRenameIndc"; + public const string ALLOW_DELETE_INDC = "AllowDeleteIndc"; + public const string FILE_TYPE = "FileType"; + public const string LANDSCAPE_INDC = "LandscapeIndc"; public const string TRANSCODE_INDC = "TranscodeIndc"; - public const string UPLOAD_NAME = "UploadName"; public const string URL = "Url"; public const string DB_NAME_DMS_FILE_UPLOAD_DELETE_LOG_VIEW = "dms_file_upload_delete_log_view"; - public const string DB_NAME_FIELDS="allow_delete_indc,allow_rename_indc,created_by,created_datetime,file_category,file_id,file_name,file_path,file_size,file_tag,file_type,folder_local_name,is_directory_indc,is_link_indc,landscape_indc,linked_file_id,order_key,org_file_name,ower_id,revision_no,transcode_indc,upload_name,url"; + public const string DB_NAME_FIELDS="created_datetime,created_by,file_id,upload_name,file_category,org_file_name,file_name,file_path,folder_local_name,file_size,ower_id,revision_no,is_directory_indc,is_link_indc,linked_file_id,order_key,file_tag,allow_rename_indc,allow_delete_indc,file_type,landscape_indc,transcode_indc,url"; - public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc"; - public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc"; - public const string DB_CREATED_BY = "created_by"; public const string DB_CREATED_DATETIME = "created_datetime"; - public const string DB_FILE_CATEGORY = "file_category"; + public const string DB_CREATED_BY = "created_by"; public const string DB_FILE_ID = "file_id"; + public const string DB_UPLOAD_NAME = "upload_name"; + public const string DB_FILE_CATEGORY = "file_category"; + public const string DB_ORG_FILE_NAME = "org_file_name"; public const string DB_FILE_NAME = "file_name"; public const string DB_FILE_PATH = "file_path"; - public const string DB_FILE_SIZE = "file_size"; - public const string DB_FILE_TAG = "file_tag"; - public const string DB_FILE_TYPE = "file_type"; public const string DB_FOLDER_LOCAL_NAME = "folder_local_name"; - public const string DB_IS_DIRECTORY_INDC = "is_directory_indc"; - public const string DB_IS_LINK_INDC = "is_link_indc"; - public const string DB_LANDSCAPE_INDC = "landscape_indc"; - public const string DB_LINKED_FILE_ID = "linked_file_id"; - public const string DB_ORDER_KEY = "order_key"; - public const string DB_ORG_FILE_NAME = "org_file_name"; + public const string DB_FILE_SIZE = "file_size"; public const string DB_OWER_ID = "ower_id"; public const string DB_REVISION_NO = "revision_no"; + public const string DB_IS_DIRECTORY_INDC = "is_directory_indc"; + public const string DB_IS_LINK_INDC = "is_link_indc"; + public const string DB_LINKED_FILE_ID = "linked_file_id"; + public const string DB_ORDER_KEY = "order_key"; + public const string DB_FILE_TAG = "file_tag"; + public const string DB_ALLOW_RENAME_INDC = "allow_rename_indc"; + public const string DB_ALLOW_DELETE_INDC = "allow_delete_indc"; + public const string DB_FILE_TYPE = "file_type"; + public const string DB_LANDSCAPE_INDC = "landscape_indc"; public const string DB_TRANSCODE_INDC = "transcode_indc"; - public const string DB_UPLOAD_NAME = "upload_name"; public const string DB_URL = "url"; private string ProviderName { get; set; } @@ -131,34 +131,34 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.AllowDeleteIndc = source.AllowDeleteIndc; - this.AllowRenameIndc = source.AllowRenameIndc; - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.FileCategory = source.FileCategory; + this.CreatedBy = source.CreatedBy; this.FileId = source.FileId; + this.UploadName = source.UploadName; + this.FileCategory = source.FileCategory; + this.OrgFileName = source.OrgFileName; this.FileName = source.FileName; this.FilePath = source.FilePath; - this.FileSize = source.FileSize; - this.FileTag = source.FileTag; - this.FileType = source.FileType; this.FolderLocalName = source.FolderLocalName; - this.IsDirectoryIndc = source.IsDirectoryIndc; - this.IsLinkIndc = source.IsLinkIndc; - this.LandscapeIndc = source.LandscapeIndc; - this.LinkedFileId = source.LinkedFileId; - this.OrderKey = source.OrderKey; - this.OrgFileName = source.OrgFileName; + this.FileSize = source.FileSize; this.OwerId = source.OwerId; this.RevisionNo = source.RevisionNo; + this.IsDirectoryIndc = source.IsDirectoryIndc; + this.IsLinkIndc = source.IsLinkIndc; + this.LinkedFileId = source.LinkedFileId; + this.OrderKey = source.OrderKey; + this.FileTag = source.FileTag; + this.AllowRenameIndc = source.AllowRenameIndc; + this.AllowDeleteIndc = source.AllowDeleteIndc; + this.FileType = source.FileType; + this.LandscapeIndc = source.LandscapeIndc; this.TranscodeIndc = source.TranscodeIndc; - this.UploadName = source.UploadName; this.Url = source.Url; if (includeSystemFields) { - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; + this.CreatedBy = source.CreatedBy; } } @@ -231,7 +231,7 @@ namespace CloudBuilder.Master.Entity { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_ALLOW_DELETE_INDC ; int offset = limit * (start - 1); + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CREATED_DATETIME ; int offset = limit * (start - 1); return $" select {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FILE_UPLOAD_DELETE_LOG_VIEW} where 1=1 {sqlWhere} ) a where num> {offset} LIMIT {limit} "; } @@ -239,7 +239,7 @@ namespace CloudBuilder.Master.Entity { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_ALLOW_DELETE_INDC ; string top = limit > 0 ? $"top {limit}" : ""; + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_CREATED_DATETIME ; string top = limit > 0 ? $"top {limit}" : ""; return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FILE_UPLOAD_DELETE_LOG_VIEW} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}"; } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderDeleteLogEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderDeleteLogEntity.auto.cs index 54cfce2..e19e7df 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderDeleteLogEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderDeleteLogEntity.auto.cs @@ -14,45 +14,41 @@ namespace CloudBuilder.Master.Entity { } - [Column("created_by")] - public string CreatedBy { get; set; } [Column("created_datetime")] public DateTime CreatedDatetime { get; set; } - [Column("folder_id")] - public int FolderId { get; set; } - [Column("folder_local_name")] - public string? FolderLocalName { get; set; } - [Column("folder_name")] - public string FolderName { get; set; } - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - [Column("log_id")] - public long LogId { get; set; } - [Column("updated_by")] - public string UpdatedBy { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } [Column("updated_datetime")] public DateTime UpdatedDatetime { get; set; } + [Column("updated_by")] + public string UpdatedBy { get; set; } + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("folder_id")] + public long FolderId { get; set; } + [Column("folder_name")] + public string FolderName { get; set; } + [Column("folder_local_name")] + public string? FolderLocalName { get; set; } - public const string CREATED_BY = "CreatedBy"; public const string CREATED_DATETIME = "CreatedDatetime"; - public const string FOLDER_ID = "FolderId"; - public const string FOLDER_LOCAL_NAME = "FolderLocalName"; - public const string FOLDER_NAME = "FolderName"; - public const string LOG_ID = "LogId"; - public const string UPDATED_BY = "UpdatedBy"; + public const string CREATED_BY = "CreatedBy"; public const string UPDATED_DATETIME = "UpdatedDatetime"; + public const string UPDATED_BY = "UpdatedBy"; + public const string FOLDER_ID = "FolderId"; + public const string FOLDER_NAME = "FolderName"; + public const string FOLDER_LOCAL_NAME = "FolderLocalName"; public const string DB_NAME_DMS_FOLDER_DELETE_LOG = "dms_folder_delete_log"; - public const string DB_NAME_FIELDS="created_by,created_datetime,folder_id,folder_local_name,folder_name,log_id,updated_by,updated_datetime"; + public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,folder_id,folder_name,folder_local_name"; - public const string DB_CREATED_BY = "created_by"; public const string DB_CREATED_DATETIME = "created_datetime"; - public const string DB_FOLDER_ID = "folder_id"; - public const string DB_FOLDER_LOCAL_NAME = "folder_local_name"; - public const string DB_FOLDER_NAME = "folder_name"; - public const string DB_LOG_ID = "log_id"; - public const string DB_UPDATED_BY = "updated_by"; + public const string DB_CREATED_BY = "created_by"; public const string DB_UPDATED_DATETIME = "updated_datetime"; + public const string DB_UPDATED_BY = "updated_by"; + public const string DB_FOLDER_ID = "folder_id"; + public const string DB_FOLDER_NAME = "folder_name"; + public const string DB_FOLDER_LOCAL_NAME = "folder_local_name"; private string ProviderName { get; set; } @@ -73,21 +69,20 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.FolderId = source.FolderId; - this.FolderLocalName = source.FolderLocalName; - this.FolderName = source.FolderName; - this.LogId = source.LogId; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; + this.FolderId = source.FolderId; + this.FolderName = source.FolderName; + this.FolderLocalName = source.FolderLocalName; if (includeSystemFields) { - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; } } @@ -159,7 +154,7 @@ namespace CloudBuilder.Master.Entity public string GetSelectTopFromByMySql(int limit, int start,string orderby,string orderbytag, string sqlWhere) { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_LOG_ID ; + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_FOLDER_ID ; int offset = limit * (start - 1); return $" select {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FOLDER_DELETE_LOG} where 1=1 {sqlWhere} ) a where num> {offset} LIMIT {limit} "; } @@ -167,7 +162,7 @@ namespace CloudBuilder.Master.Entity public string GetSelectTopFromBySqlServer(int limit, int start,string orderby,string orderbytag, string sqlWhere) { if (string.IsNullOrEmpty(orderbytag) || orderbytag.Trim() != "desc") orderbytag = "asc"; - if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_LOG_ID ; + if (string.IsNullOrEmpty(orderby) || !DB_NAME_FIELDS.Contains(orderby)) orderby = DB_FOLDER_ID ; string top = limit > 0 ? $"top {limit}" : ""; return $" select {top} {DB_NAME_FIELDS} from (select {DB_NAME_FIELDS} ,row_number() over(order by {orderby} {orderbytag}) as num from { DB_NAME_DMS_FOLDER_DELETE_LOG} with(nolock) where 1=1 {sqlWhere} ) a where num> {limit * (start - 1)}"; } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderMapDeleteLogEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderMapDeleteLogEntity.auto.cs index dd6e6e4..8c3491c 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderMapDeleteLogEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/DmsFolderMapDeleteLogEntity.auto.cs @@ -14,39 +14,39 @@ namespace CloudBuilder.Master.Entity { } - [Column("created_by")] - public string CreatedBy { get; set; } [Column("created_datetime")] public DateTime CreatedDatetime { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } + [Column("updated_datetime")] + public DateTime UpdatedDatetime { get; set; } + [Column("updated_by")] + public string UpdatedBy { get; set; } [Column("folder_name_parent")] public string FolderNameParent { get; set; } [Column("folder_name_son")] public string FolderNameSon { get; set; } [Column("orderby")] public int Orderby { get; set; } - [Column("updated_by")] - public string UpdatedBy { get; set; } - [Column("updated_datetime")] - public DateTime UpdatedDatetime { get; set; } - public const string CREATED_BY = "CreatedBy"; public const string CREATED_DATETIME = "CreatedDatetime"; + public const string CREATED_BY = "CreatedBy"; + public const string UPDATED_DATETIME = "UpdatedDatetime"; + public const string UPDATED_BY = "UpdatedBy"; public const string FOLDER_NAME_PARENT = "FolderNameParent"; public const string FOLDER_NAME_SON = "FolderNameSon"; public const string ORDERBY = "Orderby"; - public const string UPDATED_BY = "UpdatedBy"; - public const string UPDATED_DATETIME = "UpdatedDatetime"; public const string DB_NAME_DMS_FOLDER_MAP_DELETE_LOG = "dms_folder_map_delete_log"; - public const string DB_NAME_FIELDS="created_by,created_datetime,folder_name_parent,folder_name_son,orderby,updated_by,updated_datetime"; + public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,folder_name_parent,folder_name_son,orderby"; - public const string DB_CREATED_BY = "created_by"; public const string DB_CREATED_DATETIME = "created_datetime"; + public const string DB_CREATED_BY = "created_by"; + public const string DB_UPDATED_DATETIME = "updated_datetime"; + public const string DB_UPDATED_BY = "updated_by"; public const string DB_FOLDER_NAME_PARENT = "folder_name_parent"; public const string DB_FOLDER_NAME_SON = "folder_name_son"; public const string DB_ORDERBY = "orderby"; - public const string DB_UPDATED_BY = "updated_by"; - public const string DB_UPDATED_DATETIME = "updated_datetime"; private string ProviderName { get; set; } @@ -67,20 +67,20 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; + this.CreatedBy = source.CreatedBy; + this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; this.FolderNameParent = source.FolderNameParent; this.FolderNameSon = source.FolderNameSon; this.Orderby = source.Orderby; - this.UpdatedBy = source.UpdatedBy; - this.UpdatedDatetime = source.UpdatedDatetime; if (includeSystemFields) { - this.CreatedBy = source.CreatedBy; this.CreatedDatetime = source.CreatedDatetime; - this.UpdatedBy = source.UpdatedBy; + this.CreatedBy = source.CreatedBy; this.UpdatedDatetime = source.UpdatedDatetime; + this.UpdatedBy = source.UpdatedBy; } } diff --git a/CloudBuilder/CloudBuilder.Master/Policy/MasterPrefixPolicy.cs b/CloudBuilder/CloudBuilder.Master/Policy/MasterPrefixPolicy.cs index e84ca3c..dca8d6c 100644 --- a/CloudBuilder/CloudBuilder.Master/Policy/MasterPrefixPolicy.cs +++ b/CloudBuilder/CloudBuilder.Master/Policy/MasterPrefixPolicy.cs @@ -36,5 +36,13 @@ namespace CloudBuilder.Master.Policy public const string AUDIO_PUBLISH = "AUDIO_PUBLISH"; public const string AUDIO_PUBLISH_PUBLISH_NAME = "PUBLISH_NAME"; + + + public const string DMS_FOLDER_DELETE_LOG = "DMS_FOLDER_DELETE_LOG"; + public const string DMS_FOLDER_DELETE_LOG_FOLDER_NAME = "FOLDER_NAME"; + + public const string UPLOAD_DMS_FILE_DELETE_LOG = "DMS_FOLDER_DELETE_LOG"; + public const string UPLOAD_DMS_FILE_DELETE_LOG_UPLOAD_NAME = "UPLOAD_NAME"; + public const string UPLOAD_DMS_FILE_DELETE_LOG_FORMAT = "00000000"; } } diff --git a/CloudBuilder/CloudBuilder.Master/Service/IDmsFileService.auto.cs b/CloudBuilder/CloudBuilder.Master/Service/IDmsFileService.auto.cs index 1d5f888..8309880 100644 --- a/CloudBuilder/CloudBuilder.Master/Service/IDmsFileService.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Service/IDmsFileService.auto.cs @@ -17,6 +17,7 @@ namespace CloudBuilder.Master.Service DmsFileEntity CreateDmsFile(DmsFileEntity dmsFile); string CreateDmsFolder(DmsFileEntity dmsFile); + void RestoreDmsFile(long fileId); void UpdateDmsFolder(DmsFileEntity dmsFile); diff --git a/CloudBuilder/CloudBuilder.Request/Master/DmsFileRequest.auto.cs b/CloudBuilder/CloudBuilder.Request/Master/DmsFileRequest.auto.cs index b176010..4125cd6 100644 --- a/CloudBuilder/CloudBuilder.Request/Master/DmsFileRequest.auto.cs +++ b/CloudBuilder/CloudBuilder.Request/Master/DmsFileRequest.auto.cs @@ -63,6 +63,10 @@ return Task.Run(() => serviceRequest.PostAsJsonAsync serviceRequest.PostAsync("/DmsFile/Delete?key=" + key.ToString())).GetAwaiter().GetResult(); } + public void RestoreDmsFile(Int64 key) + { + Task.Run(() => serviceRequest.PostAsync("/DmsFile/RestoreDmsFile?key=" + key.ToString())).GetAwaiter().GetResult(); } + public void DeleteLog(Int64 key) { Task.Run(() => serviceRequest.PostAsync("/DmsFile/DeleteLog?key=" + key.ToString())).GetAwaiter().GetResult(); } diff --git a/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_en.resx b/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_en.resx new file mode 100644 index 0000000..0e731f2 --- /dev/null +++ b/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_en.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Audio + + + Document + + + Lyric + + + Picture + + + Video + + \ No newline at end of file diff --git a/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_zh-cn.resx b/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_zh-cn.resx new file mode 100644 index 0000000..fb2a5ec --- /dev/null +++ b/CloudBuilder/CloudBuilder.Security/Policy/FileTypePolicy_zh-cn.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 音频 + + + 文档 + + + 歌词 + + + 图片 + + + 视频 + + \ No newline at end of file diff --git a/CloudBuilder/CloudBuilder.Web.Entry/Controllers/Master/DmsFileController.auto.cs b/CloudBuilder/CloudBuilder.Web.Entry/Controllers/Master/DmsFileController.auto.cs index aad9b97..aa87550 100644 --- a/CloudBuilder/CloudBuilder.Web.Entry/Controllers/Master/DmsFileController.auto.cs +++ b/CloudBuilder/CloudBuilder.Web.Entry/Controllers/Master/DmsFileController.auto.cs @@ -219,6 +219,26 @@ this.dmsFileService= dmsFileService; { dmsFileService.Delete(key); + return string.Empty; + } + catch (ValidatedException vex) + { + return vex; + } + catch (Exception ex) + { + return new ServiceErrorException(ex); + } + } + + [PermissionOperate(name: "DmsFile", operate: "Insert")] + [HttpPost] + [UnitOfWork] + public dynamic RestoreDmsFile(Int64 key){ + try + { + dmsFileService.RestoreDmsFile(key); + return string.Empty; } catch (ValidatedException vex) diff --git a/WebVue/src/components/basic/OperatorStationDelete.vue b/WebVue/src/components/basic/OperatorStationDelete.vue new file mode 100644 index 0000000..da2151a --- /dev/null +++ b/WebVue/src/components/basic/OperatorStationDelete.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/WebVue/src/service/master/dmsFileService.ts b/WebVue/src/service/master/dmsFileService.ts index a318c5e..0a6ebc3 100644 --- a/WebVue/src/service/master/dmsFileService.ts +++ b/WebVue/src/service/master/dmsFileService.ts @@ -112,6 +112,16 @@ class DmsFileService{ ) }; + async RestoreDmsFile(data: number) { + return request( + { + url: "/DmsFile/RestoreDmsFile?key="+data, + method: "post", + data, + } + ) + }; + async DeleteLog(data: number) { return request( { diff --git a/WebVue/src/views/master/DmsFileDeleteEnquiry.vue b/WebVue/src/views/master/DmsFileDeleteEnquiry.vue index 1179624..f121c40 100644 --- a/WebVue/src/views/master/DmsFileDeleteEnquiry.vue +++ b/WebVue/src/views/master/DmsFileDeleteEnquiry.vue @@ -1,186 +1,52 @@ + + diff --git a/WebVue/src/views/master/OrgDmsFileDeleteEnquiry.vue b/WebVue/src/views/master/OrgDmsFileDeleteEnquiry.vue new file mode 100644 index 0000000..1179624 --- /dev/null +++ b/WebVue/src/views/master/OrgDmsFileDeleteEnquiry.vue @@ -0,0 +1,912 @@ + + +