@@ -130,10 +130,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers | |||
/// <param name="folderId">文件夹Id</param> | |||
/// <returns>返回列表Json</returns> | |||
[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); | |||
} | |||
/// <summary> | |||
@@ -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); | |||
}); | |||
}); | |||
@@ -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(); | |||
@@ -21,9 +21,9 @@ namespace Learun.Application.OA.File.FileInfo | |||
/// <param name="folderId">文件夹Id</param> | |||
/// <param name="userId">用户Id</param> | |||
/// <returns></returns> | |||
public IEnumerable<FileInfoEntity> GetList(string folderId, string userId) | |||
public IEnumerable<FileInfoEntity> GetList(string folderId, string userId, string keyword, string share) | |||
{ | |||
return service.GetList(folderId, userId); | |||
return service.GetList(folderId, userId,keyword,share); | |||
} | |||
/// <summary> | |||
/// 所有文件(夹)列表 | |||
@@ -18,7 +18,7 @@ namespace Learun.Application.OA.File.FileInfo | |||
/// <param name="folderId">文件夹Id</param> | |||
/// <param name="userId">用户Id</param> | |||
/// <returns></returns> | |||
IEnumerable<FileInfoEntity> GetList(string folderId, string userId); | |||
IEnumerable<FileInfoEntity> GetList(string folderId, string userId,string keyword,string share); | |||
IEnumerable<FileInfoEntity> GetList(string folderId, string userId, string queryJson); | |||
IEnumerable<FileInfoEntity> GetList(string userId); | |||
@@ -54,7 +54,7 @@ namespace Learun.Application.OA.File.FileInfo | |||
/// <param name="folderId">文件夹Id</param> | |||
/// <param name="userId">用户Id</param> | |||
/// <returns></returns> | |||
public IEnumerable<FileInfoEntity> GetList(string folderId, string userId) | |||
public IEnumerable<FileInfoEntity> 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<FileInfoEntity>(strSql.ToString(), new { userId = userId, folderId = folderId }); | |||
@@ -103,7 +111,7 @@ namespace Learun.Application.OA.File.FileInfo | |||
/// <returns></returns> | |||
public IEnumerable<FileInfoEntity> 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<FileInfoEntity>(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 { }); | |||