From c4ec836273981c0cb5df80897b3df3abead12286 Mon Sep 17 00:00:00 2001 From: zzj <31836194@qq.com> Date: Thu, 21 Dec 2023 09:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=AE=A1=E7=90=86=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E6=96=87=E4=BB=B6=E5=A4=B9=E5=8F=AF=E4=BB=A5=E6=9F=A5?= =?UTF-8?q?=E4=B8=8B=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=8B=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E6=88=91=E7=9A=84=E5=85=B1=E4=BA=AB=E5=92=8C=E4=BB=96?= =?UTF-8?q?=E4=BA=BA=E5=85=B1=E4=BA=AB=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E5=B1=82=E7=BA=A7=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=8C=E6=9C=AA=E8=AF=BB=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=BF=AE=E5=A4=8D(=E6=9C=AA=E5=AE=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ResourceFileController.cs | 4 +-- .../LR_OAModule/Views/ResourceFile/Index.js | 11 +++++-- .../Controllers/HomeController.cs | 2 +- .../File/FileInfo/FileInfoBLL.cs | 4 +-- .../File/FileInfo/FileInfoIBLL.cs | 2 +- .../File/FileInfo/FileInfoService.cs | 31 ++++++++++++------- 6 files changed, 35 insertions(+), 19 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs index 481b70dae..ceaef6089 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs @@ -130,10 +130,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers /// 文件夹Id /// 返回列表Json [HttpGet] - public ActionResult GetListJson(string folderId, string keyword) + public ActionResult GetListJson(string folderId, string keyword, string share) { string userId = LoginUserInfo.Get().userId; - var data = fileInfoBLL.GetList(folderId, userId); + var data = fileInfoBLL.GetList(folderId, userId,keyword,share); return JsonResult(data); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js index 660a96880..08cb0eeac 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js @@ -15,6 +15,7 @@ var bootstrap = function ($, learun) { var _url = "/LR_OAModule/ResourceFile/GetListJson"; var fileId = ""; + var isShare = '0'; var page = { init: function () { @@ -342,6 +343,7 @@ var bootstrap = function ($, learun) { switch (data_value) { case "allFile": _url = "/LR_OAModule/ResourceFile/GetListJson"; + isShare = '0'; $(".crumb-path").find('[data-folderid=allfile]').html('所有文件'); $("#lr-uploadify").show(); $("#lr-addfolder").show(); @@ -355,6 +357,7 @@ var bootstrap = function ($, learun) { break; case "allDocument": _url = "/LR_OAModule/ResourceFile/GetDocumentListJson"; + isShare = '0'; $(".crumb-path").find('[data-folderid=allfile]').html('所有文档'); $("#lr-download").show(); $("#lr-delete").show(); @@ -365,6 +368,7 @@ var bootstrap = function ($, learun) { break; case "allImage": _url = "/LR_OAModule/ResourceFile/GetImageListJson"; + isShare = '0'; $(".crumb-path").find('[data-folderid=allfile]').html('所有图片'); $("#lr-download").show(); $("#lr-delete").show(); @@ -375,6 +379,7 @@ var bootstrap = function ($, learun) { break; case "recycledFile": _url = "/LR_OAModule/ResourceFile/GetRecycledListJson"; + isShare = '0'; $(".crumb-path").find('[data-folderid=allfile]').html('回收站'); $("#lr-restoreFile").show(); $("#lr-thoroughDelete").show(); @@ -385,6 +390,7 @@ var bootstrap = function ($, learun) { break; case "myShare": _url = "/LR_OAModule/ResourceFile/GetMyShareListJson"; + isShare = '0'; $(".crumb-path").find('[data-folderid=allfile]').html('我的共享'); $("#lr-cancelshare").show(); $("#txt_Keyword").val(''); @@ -393,6 +399,7 @@ var bootstrap = function ($, learun) { break; case "othersShare": _url = "/LR_OAModule/ResourceFile/GetOthersShareListJson"; + isShare = '1'; $(".crumb-path").find('[data-folderid=allfile]').html('他人共享'); //$gridTable.setGridParam().showCol("CreateUserName"); $("#lr-download").show(); @@ -448,7 +455,7 @@ var bootstrap = function ($, learun) { var rowData = $gridTable.jfGridGet('rowdata'); if (rowData.F_FileType == "folder") { fileId = rowData.F_FileId; - $.lrSetForm(top.$.rootUrl + '/LR_OAModule/ResourceFile/GetListJson?folderId=' + fileId, function (data) {// + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/ResourceFile/GetListJson?folderId=' + fileId + '&share=' + isShare, function (data) {// $('#gridTable').jfGridSet('refreshdata', data); }); @@ -457,7 +464,7 @@ var bootstrap = function ($, learun) { $(".crumb-path span.add").unbind('click'); $(".crumb-path span.add").click(function () { $(this).nextAll().remove(); - $.lrSetForm(top.$.rootUrl + '/LR_OAModule/ResourceFile/GetListJson?folderId=' + $(this).attr('data-fileId'), function (data) {// + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/ResourceFile/GetListJson?folderId=' + $(this).attr('data-fileId') + '&share=' + isShare, function (data) {// $('#gridTable').jfGridSet('refreshdata', data); }); }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs index e71d20ee8..40b05f1a0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -485,7 +485,7 @@ namespace Learun.Application.Web.Controllers } } } - var readnewslist = newsIBLL.GetList("", userinfo.userId).Where(m => !string.IsNullOrEmpty(m.RNewsId)).Select(m => m.F_NewsId); + var readnewslist = newsIBLL.GetList("", "").Where(m => !string.IsNullOrEmpty(m.RNewsId)).Select(m => m.F_NewsId); ViewBag.UnreadNews = outnewslist.Count(m => !readnewslist.Contains(m.F_NewsId)); paginationobj.sidx = "SendTime"; ViewBag.UnreadFile = sys_ReceiveFileIBLL.GetPageListBySenderId(userinfo.userId).Count(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs index 3c2353ce3..d642e03e5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs @@ -21,9 +21,9 @@ namespace Learun.Application.OA.File.FileInfo /// 文件夹Id /// 用户Id /// - public IEnumerable GetList(string folderId, string userId) + public IEnumerable GetList(string folderId, string userId, string keyword, string share) { - return service.GetList(folderId, userId); + return service.GetList(folderId, userId,keyword,share); } /// /// 所有文件(夹)列表 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs index c94089b48..6d3e7c658 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs @@ -18,7 +18,7 @@ namespace Learun.Application.OA.File.FileInfo /// 文件夹Id /// 用户Id /// - IEnumerable GetList(string folderId, string userId); + IEnumerable GetList(string folderId, string userId,string keyword,string share); IEnumerable GetList(string folderId, string userId, string queryJson); IEnumerable GetList(string userId); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs index 1e78dc797..9cdc7d768 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs @@ -54,7 +54,7 @@ namespace Learun.Application.OA.File.FileInfo /// 文件夹Id /// 用户Id /// - public IEnumerable GetList(string folderId, string userId) + public IEnumerable GetList(string folderId, string userId, string keyword, string share) { var strSql = new StringBuilder(); string folderCondition = ""; @@ -66,6 +66,7 @@ namespace Learun.Application.OA.File.FileInfo } else { + folderCondition = " and F_ParentId is null "; fileCondition = " AND F_FolderId = '0'"; } strSql.Append(@"SELECT * @@ -90,7 +91,14 @@ namespace Learun.Application.OA.File.FileInfo F_IsShare FROM LR_OA_FileInfo where F_DeleteMark = 0 "); strSql.Append(fileCondition); - strSql.Append(") t WHERE F_CreateUserId = @userId"); + if(share=="1") + { + strSql.Append(") t WHERE F_CreateUserId != @userId"); + } + else + { + strSql.Append(") t WHERE F_CreateUserId = @userId"); + } strSql.Append(" ORDER BY CASE WHEN F_FileType = 'folder' THEN 1 ELSE 2 END, F_ModifyDate ASC"); return this.BaseRepository().FindList(strSql.ToString(), new { userId = userId, folderId = folderId }); @@ -103,7 +111,7 @@ namespace Learun.Application.OA.File.FileInfo /// public IEnumerable GetList(string folderId, string userId, string queryJson) { - + var strSql = new StringBuilder(); string folderCondition = ""; string fileCondition = ""; @@ -114,6 +122,7 @@ namespace Learun.Application.OA.File.FileInfo } else { + folderCondition = " and F_ParentId is null "; fileCondition = " AND F_FolderId = '0'"; } strSql.Append(@"SELECT * @@ -230,7 +239,7 @@ namespace Learun.Application.OA.File.FileInfo 'folder' AS F_FileType , F_CreateUserId, F_ModifyDate - FROM LR_OA_FileFolder where F_DeleteMark = 1 + FROM LR_OA_FileFolder where F_DeleteMark = 1 and F_ParentId is null UNION SELECT F_FileId , F_FolderId , @@ -239,7 +248,7 @@ namespace Learun.Application.OA.File.FileInfo F_FileType , F_CreateUserId, F_ModifyDate - FROM LR_OA_FileInfo where F_DeleteMark = 1 + FROM LR_OA_FileInfo where F_DeleteMark = 1 and F_FolderId = '0' ) t WHERE F_CreateUserId = @userId"); strSql.Append(" ORDER BY F_ModifyDate DESC"); return this.BaseRepository().FindList(strSql.ToString(), new { userId = userId }); @@ -260,7 +269,7 @@ namespace Learun.Application.OA.File.FileInfo 'folder' AS F_FileType , F_CreateUserId, F_ModifyDate - FROM LR_OA_FileFolder WHERE F_DeleteMark = 0 AND F_IsShare = 1 + FROM LR_OA_FileFolder WHERE F_DeleteMark = 0 AND F_IsShare = 1 AND F_ParentId is null UNION SELECT F_FileId , F_FolderId , @@ -269,8 +278,8 @@ namespace Learun.Application.OA.File.FileInfo F_FileType , F_CreateUserId, F_ModifyDate - FROM LR_OA_FileInfo WHERE F_DeleteMark = 0 AND F_IsShare = 1 - ) t where 1=1 "); + FROM LR_OA_FileInfo WHERE F_DeleteMark = 0 AND F_IsShare = 1 AND F_FolderId = '0' + ) t where F_CreateUserId = @userId "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -299,7 +308,7 @@ namespace Learun.Application.OA.File.FileInfo F_CreateUserId, F_CreateUserName, F_ShareTime AS F_ModifyDate - FROM LR_OA_FileFolder WHERE F_DeleteMark = 0 AND F_IsShare = 1 + FROM LR_OA_FileFolder WHERE F_DeleteMark = 0 AND F_IsShare = 1 AND F_ParentId is null UNION SELECT F_FileId , F_FolderId , @@ -309,8 +318,8 @@ namespace Learun.Application.OA.File.FileInfo F_CreateUserId, F_CreateUserName, F_ShareTime AS F_ModifyDate - FROM LR_OA_FileInfo WHERE F_DeleteMark = 0 AND F_IsShare = 1 - ) t where 1=1 "); + FROM LR_OA_FileInfo WHERE F_DeleteMark = 0 AND F_IsShare = 1 AND F_FolderId = '0' + ) t where F_CreateUserId != @userId "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { });