Browse Source

Merge branch '黑龙江艺术高中职' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 黑龙江艺术高中职

黑艺新账号
ndbs 8 months ago
parent
commit
b91be3ad45
10 changed files with 477 additions and 60 deletions
  1. +82
    -15
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs
  2. +37
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml
  3. +79
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js
  4. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.cshtml
  5. +107
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js
  6. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/UploadifyForm.js
  7. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  8. +24
    -10
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs
  9. +7
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs
  10. +136
    -18
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs

+ 82
- 15
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs View File

@@ -10,6 +10,7 @@ using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using Quanjiang.DigitalSchool.AsposeHelper;

namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
{
@@ -82,6 +83,15 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
{
return View();
}
/// <summary>
/// 云盘文件统计
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult FileStatistic()
{
return View();
}
#endregion

#region 获取数据
@@ -120,10 +130,24 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
/// <param name="folderId">文件夹Id</param>
/// <returns>返回列表Json</returns>
[HttpGet]
public ActionResult GetListJson(string folderId)
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>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string folderId, string queryJson)
{
string userId = LoginUserInfo.Get().userId;
var data = fileInfoBLL.GetList(folderId, userId, queryJson);
return JsonResult(data);
}
/// <summary>
@@ -131,10 +155,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
/// </summary>
/// <returns>返回列表Json</returns>
[HttpGet]
public ActionResult GetDocumentListJson()
public ActionResult GetDocumentListJson(string queryJson)
{
string userId = LoginUserInfo.Get().userId;
var data = fileInfoBLL.GetDocumentList(userId);
var data = fileInfoBLL.GetDocumentList(userId, queryJson);
return JsonResult(data);
}
/// <summary>
@@ -142,10 +166,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
/// </summary>
/// <returns>返回列表Json</returns>
[HttpGet]
public ActionResult GetImageListJson()
public ActionResult GetImageListJson(string queryJson)
{
string userId = LoginUserInfo.Get().userId;
var data = fileInfoBLL.GetImageList(userId);
var data = fileInfoBLL.GetImageList(userId, queryJson);
return JsonResult(data);
}
/// <summary>
@@ -164,10 +188,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
/// </summary>
/// <returns>返回列表Json</returns>
[HttpGet]
public ActionResult GetMyShareListJson()
public ActionResult GetMyShareListJson(string queryJson)
{
string userId = LoginUserInfo.Get().userId;
var data = fileInfoBLL.GetMyShareList(userId);
var data = fileInfoBLL.GetMyShareList(userId, queryJson);
return JsonResult(data);
}
/// <summary>
@@ -175,10 +199,10 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
/// </summary>
/// <returns>返回列表Json</returns>
[HttpGet]
public ActionResult GetOthersShareListJson()
public ActionResult GetOthersShareListJson(string queryJson)
{
string userId = LoginUserInfo.Get().userId;
var data = fileInfoBLL.GetOthersShareList(userId);
var data = fileInfoBLL.GetOthersShareList(userId, queryJson);
return JsonResult(data);
}
/// <summary>
@@ -203,6 +227,43 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
var data = fileInfoBLL.GetEntity(keyValue);
return JsonResult(data);
}
/// <summary>
/// 获取云盘文件统计数据
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public ActionResult GetFileStatisitcData(string queryJson)
{
var data = fileInfoBLL.GetListByJson(queryJson);
var dataGroup = data.Where(x => x.F_CreateDate.HasValue).GroupBy(x => x.F_CreateDate.Value.Month).Select(x => new TempClass()
{
month = x.Key,
count = x.Select(y => y.F_FileId).Count()
});

var xAxis = new List<string>();
var seriesData = new List<int>();
for (int i = 0; i < 12; i++)
{
xAxis.Add(string.Format("{0}月", i + 1));
var aa = dataGroup.FirstOrDefault(x => x.month == (i + 1));
seriesData.Add(aa == null ? 0 : aa.count);
}

var jsonData = new
{
seriesData = seriesData,
xAxis = xAxis
};

return Success(jsonData);
}
public class TempClass
{
public int month { get; set; }
public int count { get; set; }
}

#endregion

#region 提交数据
@@ -420,8 +481,8 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
}
}


/// <summary>
/// 下载文件
@@ -463,7 +524,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
filePreviewIBLL.GetExcelData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//filePreviewIBLL.GetExcelData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//liang 2021-6-25 改aspose预览
AsposeCore.GetExcelData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
}
}
if (data.F_FileType == "docx" || data.F_FileType == "doc")
@@ -471,7 +534,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
filePreviewIBLL.GetWordData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//filePreviewIBLL.GetWordData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//liang 2021-6-25 改aspose预览
AsposeCore.GetWordData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
}
}
if (data.F_FileType == "ppt" || data.F_FileType == "pptx")
@@ -479,7 +544,9 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers
filepath = filepath.Substring(0, filepath.LastIndexOf(".")) + ".pdf";//文件名
if (!DirFileHelper.IsExistFile(filepath))
{
filePreviewIBLL.GetPptData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//filePreviewIBLL.GetPptData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
//liang 2021-6-25 改aspose预览
AsposeCore.GetWordData(DirFileHelper.GetAbsolutePath(data.F_FilePath));
}
}
//FileDownHelper.DownLoadold(filepath, filename);


+ 37
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml View File

@@ -0,0 +1,37 @@

@{
ViewBag.Title = "流程使用报表";
Layout = "~/Views/Shared/_ReportTemplate.cshtml";
}

<div class="lr-layout ui-report">
<div class="lr-layout-center">
<div class="lr-layout-wrap lr-layout-wrap-notitle">
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<input id="year" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy',onpicked: function () { $('#year').trigger('change'); } })" placeholder="请选择年" />
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span class="lrlt">查询</span></a>
</div>
</div>
<div class="lr-layout-tool-right">
<div class="btn-group btn-group-sm" learun-authorize="yes">
<a id="lr-replace" class="btn btn-default"><i class="fa fa-refresh"></i>&nbsp;<span class="lrlt">刷新</span></a>
</div>
</div>
</div>
<div class="lr-layout-grid" style="overflow:auto;">
<div class="grid-title">
<div style="overflow: hidden; padding-bottom: 20px; text-align: center; margin-left: auto; margin-right: auto;">
<div id="main" style="width: 650px; height: 350px;border: 1px solid #ccc;">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="~/Content/echarts/echarts.js"></script>
@Html.AppendJsFile("/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js")

+ 79
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js View File

@@ -0,0 +1,79 @@
var bootstrap = function ($, learun) {
"use strict";
var year = "";
var page = {
init: function () {
page.bind();
page.initChart();
},
bind: function () {
//当前年
var now = learun.formatDate(new Date(), 'yyyy');
$('#year').val(now);
year = now;
// 刷新
$('#lr-replace').on('click', function () {
location.reload();
});
//查询
$('#btn_Search').on('click', function () {
year = $('#year').val();
page.search();
});
},
initChart: function () {
var myChart1 = echarts.init(document.getElementById('main'));
var queryJson = { year: year };
learun.httpAsyncPost(top.$.rootUrl + "/LR_OAModule/ResourceFile/GetFileStatisitcData", { queryJson: JSON.stringify(queryJson) }, function (res) {
if (res.code == 200) {
var option1 = {
title: {
text: year + '年云盘文件统计图',
x: 'center'
},
legend: {
orient: 'vertical',
left: 'left',
data: ['数量']
},
tooltip: {
trigger: 'axis'
},
grid: {
left: '5%',
right: '3%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
data: res.data.xAxis
},
yAxis: {
type: 'value',
name: '文件数/个'

},
series: [
{
name: '数量',
type: 'bar',
data: res.data.seriesData
}
]
};
myChart1.setOption(option1);
}
});

},
search: function (param) {
param = param || {};
param.year = year;
page.initChart();
}
};
page.init();
}



+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.cshtml View File

@@ -7,7 +7,7 @@
<div class="lr-layout-wrap lr-layout-wrap-notitle" style="padding-top:10px;">
<div class="lr-layout-body">
<ul class="lr-left-list" id="lr_left_list">
<li data-value="allFile" class="lrlt active">所有文件</li>
<li data-value="allFile" class="lrlt active">所有文件/文件夹</li>
<li data-value="allDocument" class="lrlt">文档</li>
<li data-value="allImage" class="lrlt">图片</li>
<li data-value="recycledFile" class="lrlt">回收站</li>
@@ -31,6 +31,7 @@
<div id="datesearch" class="datetime"></div>
</div>
<div class="lr-layout-tool-item">
<span type="text" style="cursor:pointer;">文件大小不能超过200M</span>
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" />
</div>
<div class="lr-layout-tool-item">


+ 107
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/Index.js View File

@@ -7,11 +7,15 @@
*/

var refreshGirdData;
var serchvalue;
var params;
var queryJsons;
var bootstrap = function ($, learun) {
"use strict";

var _url = "/LR_OAModule/ResourceFile/GetListJson";
var fileId = "";
var isShare = '0';

var page = {
init: function () {
@@ -22,8 +26,76 @@ var bootstrap = function ($, learun) {
bind: function () {
// 查询
$('#btn_Search').on('click', function () {
var keyword = $('#txt_Keyword').val();
page.search({ keyword: keyword });
params = params || {};
params.keyword = $('#txt_Keyword').val();
queryJsons = JSON.stringify(params);
switch (serchvalue) {
case "allFile":
_url = "/LR_OAModule/ResourceFile/GetListJson";
$(".crumb-path").find('[data-folderid=allfile]').html('所有文件');
$("#lr-uploadify").show();
$("#lr-addfolder").show();
$("#lr-download").show();
$("#lr-delete").show();
$("#lr-share").show();
$("#lr-more").show();
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "allDocument":
_url = "/LR_OAModule/ResourceFile/GetDocumentListJson?queryJson=" + queryJsons;
$(".crumb-path").find('[data-folderid=allfile]').html('所有文档');
$("#lr-download").show();
$("#lr-delete").show();
$("#lr-share").show();
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "allImage":
_url = "/LR_OAModule/ResourceFile/GetImageListJson?queryJson=" + queryJsons;
$(".crumb-path").find('[data-folderid=allfile]').html('所有图片');
$("#lr-download").show();
$("#lr-delete").show();
$("#lr-share").show();
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "recycledFile":
_url = "/LR_OAModule/ResourceFile/GetRecycledListJson";
$(".crumb-path").find('[data-folderid=allfile]').html('回收站');
$("#lr-restoreFile").show();
$("#lr-thoroughDelete").show();
$("#lr-emptyRecycled").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").hide();
$("#btn_Search").hide();
break;
case "myShare":
_url = "/LR_OAModule/ResourceFile/GetMyShareListJson?queryJson=" + queryJsons;
$(".crumb-path").find('[data-folderid=allfile]').html('我的共享');
$("#lr-cancelshare").show();
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "othersShare":
_url = "/LR_OAModule/ResourceFile/GetOthersShareListJson?queryJson=" + queryJsons;
$(".crumb-path").find('[data-folderid=allfile]').html('他人共享');
//$gridTable.setGridParam().showCol("CreateUserName");
$("#lr-download").show();
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
default:
break;
}
$.lrSetForm(top.$.rootUrl + _url, function (res) {//
if (res.length != 0) {
$('#gridTable').jfGridSet('refreshdata', res);
}
else {
$('#gridTable').jfGridSet('refreshdata', {});
}
});
});
// 刷新
$('#lr_refresh').on('click', function () {
@@ -33,7 +105,6 @@ var bootstrap = function ($, learun) {
$(".crumb-path span").click(function () {
var value = $(this).attr('data-folderId');
var folderId = $(".crumb-path span:last").attr('data-folderId');
console.log(value);
if (value == "back") {
if (folderId == 0) {
$(".crumb-path .back").hide();
@@ -266,12 +337,13 @@ var bootstrap = function ($, learun) {
var $parent = $this.parent();
$parent.find('.active').removeClass('active');
$this.addClass('active');
var data_value = $this.context.dataset.value;
//var data_value = $this.context.dataset.value;
var data_value = $this[0].dataset.value;
serchvalue = data_value;
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();
@@ -279,36 +351,61 @@ var bootstrap = function ($, learun) {
$("#lr-delete").show();
$("#lr-share").show();
$("#lr-more").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "allDocument":
_url = "/LR_OAModule/ResourceFile/GetDocumentListJson";
isShare = '0';
$(".crumb-path").find('[data-folderid=allfile]').html('所有文档');
$("#lr-download").show();
$("#lr-delete").show();
$("#lr-share").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "allImage":
_url = "/LR_OAModule/ResourceFile/GetImageListJson";
isShare = '0';
$(".crumb-path").find('[data-folderid=allfile]').html('所有图片');
$("#lr-download").show();
$("#lr-delete").show();
$("#lr-share").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "recycledFile":
_url = "/LR_OAModule/ResourceFile/GetRecycledListJson";
isShare = '0';
$(".crumb-path").find('[data-folderid=allfile]').html('回收站');
$("#lr-restoreFile").show();
$("#lr-thoroughDelete").show();
$("#lr-emptyRecycled").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").hide();
$("#btn_Search").hide();
break;
case "myShare":
_url = "/LR_OAModule/ResourceFile/GetMyShareListJson";
isShare = '0';
$(".crumb-path").find('[data-folderid=allfile]').html('我的共享');
$("#lr-cancelshare").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
case "othersShare":
_url = "/LR_OAModule/ResourceFile/GetOthersShareListJson";
isShare = '1';
$(".crumb-path").find('[data-folderid=allfile]').html('他人共享');
//$gridTable.setGridParam().showCol("CreateUserName");
$("#lr-download").show();
$("#txt_Keyword").val('');
$("#txt_Keyword").show();
$("#btn_Search").show();
break;
default:
break;
@@ -328,7 +425,7 @@ var bootstrap = function ($, learun) {
initGrid: function () {
var $gridTable = $("#gridTable");
$('#gridTable').jfGrid({
url: top.$.rootUrl + '/LR_OAModule/ResourceFile/GetListJson',
url: top.$.rootUrl + '/LR_OAModule/ResourceFile/GetPageList',
headData: [
{
label: '文件名', name: 'F_FileName', width: 520, align: 'left',
@@ -336,7 +433,7 @@ var bootstrap = function ($, learun) {
if (options.length != 0) {
return "<div style='cursor:pointer;'><div style='float: left;'><img src='" + top.$.rootUrl + "/Content/images/filetype/" + options.F_FileType + ".png' style='width:30px;height:30px;padding:5px;margin-left:-5px;margin-right:5px;' /></div><div style='float: left;line-height:35px;'>" + options.F_FileName + "</div></div>";
}
}
}
},
{
label: '大小', name: 'F_FileSize', index: 'F_FileSize', width: 100, align: 'center',
@@ -358,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);
});

@@ -367,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);
});
});


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/UploadifyForm.js View File

@@ -31,7 +31,7 @@ var bootstrap = function ($, learun) {
dnd: '#lr_form_file_queue',
paste: 'document.body',
accept: {
extensions: "jpg,gif,png,bmp,jpeg,doc,docx,ppt,pptx,xls,xlsx,pdf,txt,rar,zip,csv"
extensions: "*"
},
multiple: true,
// 上传参数


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -1690,6 +1690,7 @@
<Content Include="Areas\LR_OAModule\Views\Notice\IndexStatistics.js" />
<Content Include="Areas\LR_OAModule\Views\Notice\IndexFlow.js" />
<Content Include="Areas\LR_OAModule\Views\ResourceFile\BcIndex.js" />
<Content Include="Areas\LR_OAModule\Views\ResourceFile\FileStatistic.js" />
<Content Include="Areas\LR_OAModule\Views\Signet\Index.js" />
<Content Include="Areas\LR_PortalSite\Views\Article\Form.css" />
<Content Include="Areas\LR_PortalSite\Views\Article\Form.js" />
@@ -8357,6 +8358,7 @@
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\PrintCourseStatistic.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\TimeTable\PkImportForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTerm\EmptyByConditionFormNew.cshtml" />
<Content Include="Areas\LR_OAModule\Views\ResourceFile\FileStatistic.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 24
- 10
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs View File

@@ -21,9 +21,19 @@ 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>
/// 所有文件(夹)列表
/// </summary>
/// <param name="folderId">文件夹Id</param>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetList(string folderId, string userId, string queryJson)
{
return service.GetList(folderId, userId, queryJson);
}
public IEnumerable<FileInfoEntity> GetList(string userId)
{
@@ -33,23 +43,27 @@ namespace Learun.Application.OA.File.FileInfo
{
return service.GetList();
}
public IEnumerable<FileInfoEntity> GetListByJson(string queryJson)
{
return service.GetListByJson(queryJson);
}
/// <summary>
/// 文档列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetDocumentList(string userId)
public IEnumerable<FileInfoEntity> GetDocumentList(string userId,string queryJson)
{
return service.GetDocumentList(userId);
return service.GetDocumentList(userId, queryJson);
}
/// <summary>
/// 图片列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetImageList(string userId)
public IEnumerable<FileInfoEntity> GetImageList(string userId,string queryJson)
{
return service.GetImageList(userId);
return service.GetImageList(userId, queryJson);
}
/// <summary>
/// 回收站文件(夹)列表
@@ -65,18 +79,18 @@ namespace Learun.Application.OA.File.FileInfo
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetMyShareList(string userId)
public IEnumerable<FileInfoEntity> GetMyShareList(string userId, string queryJson)
{
return service.GetMyShareList(userId);
return service.GetMyShareList(userId, queryJson);
}
/// <summary>
/// 他人文件(夹)共享列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetOthersShareList(string userId)
public IEnumerable<FileInfoEntity> GetOthersShareList(string userId, string queryJson)
{
return service.GetOthersShareList(userId);
return service.GetOthersShareList(userId, queryJson);
}
/// <summary>
/// 文件信息实体


+ 7
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs View File

@@ -18,22 +18,24 @@ 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);
IEnumerable<FileInfoEntity> GetList();
IEnumerable<FileInfoEntity> GetListByJson(string queryJson);
/// <summary>
/// 文档列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
IEnumerable<FileInfoEntity> GetDocumentList(string userId);
IEnumerable<FileInfoEntity> GetDocumentList(string userId,string queryJson);
/// <summary>
/// 图片列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
IEnumerable<FileInfoEntity> GetImageList(string userId);
IEnumerable<FileInfoEntity> GetImageList(string userId, string queryJson);
/// <summary>
/// 回收站文件(夹)列表
/// </summary>
@@ -45,13 +47,13 @@ namespace Learun.Application.OA.File.FileInfo
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
IEnumerable<FileInfoEntity> GetMyShareList(string userId);
IEnumerable<FileInfoEntity> GetMyShareList(string userId, string queryJson);
/// <summary>
/// 他人文件(夹)共享列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
IEnumerable<FileInfoEntity> GetOthersShareList(string userId);
IEnumerable<FileInfoEntity> GetOthersShareList(string userId, string queryJson);
/// <summary>
/// 文件信息实体
/// </summary>


+ 136
- 18
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs View File

@@ -1,6 +1,9 @@
using Learun.DataBase.Repository;
using Dapper;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
namespace Learun.Application.OA.File.FileInfo
@@ -24,7 +27,25 @@ namespace Learun.Application.OA.File.FileInfo
public IEnumerable<FileInfoEntity> GetList()
{
string sql = "select * from LR_OA_FileInfo where F_DeleteMark = 0";
return this.BaseRepository().FindList<FileInfoEntity>();
return this.BaseRepository().FindList<FileInfoEntity>(sql);
}
public IEnumerable<FileInfoEntity> GetListByJson(string queryJson)
{
var dp = new object();
var queryParam = queryJson.ToJObject();
var strSql = new StringBuilder();
strSql.Append("select * from LR_OA_FileInfo where F_DeleteMark = 0 ");
if (!queryParam["year"].IsEmpty())
{
dp = new { year = queryParam["year"].ToInt() };
strSql.Append(" and DATEPART(yyyy,F_CreateDate) = @year ");
}
else
{
dp = new { year = DateTime.Now.Year };
strSql.Append(" and DATEPART(yyyy,F_CreateDate) = @year ");
}
return this.BaseRepository().FindList<FileInfoEntity>(strSql.ToString(), dp);
}

/// <summary>
@@ -33,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 = "";
@@ -41,10 +62,11 @@ namespace Learun.Application.OA.File.FileInfo
if (!string.IsNullOrEmpty(folderId))
{
folderCondition = " AND F_ParentId = @folderId";
fileCondition=" AND F_FolderId = @folderId";
fileCondition = " AND F_FolderId = @folderId";
}
else
{
folderCondition = " and F_ParentId is null ";
fileCondition = " AND F_FolderId = '0'";
}
strSql.Append(@"SELECT *
@@ -69,17 +91,81 @@ 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 });
}
/// <summary>
/// 所有文件(夹)列表
/// </summary>
/// <param name="folderId">文件夹Id</param>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetList(string folderId, string userId, string queryJson)
{
var strSql = new StringBuilder();
string folderCondition = "";
string fileCondition = "";
if (!string.IsNullOrEmpty(folderId))
{
folderCondition = " AND F_ParentId = @folderId";
fileCondition = " AND F_FolderId = @folderId";
}
else
{
folderCondition = " and F_ParentId is null ";
fileCondition = " AND F_FolderId = '0'";
}
strSql.Append(@"SELECT *
FROM ( SELECT F_FolderId AS F_FileId ,
F_ParentId AS F_FolderId ,
F_FolderName AS F_FileName ,
'' AS F_FileSize ,
'folder' AS F_FileType ,
F_CreateUserId,
F_ModifyDate,
F_IsShare
FROM LR_OA_FileFolder where F_DeleteMark = 0");
strSql.Append(folderCondition);
strSql.Append(" UNION ");
strSql.Append(@"SELECT F_FileId ,
F_FolderId ,
F_FileName ,
F_FileSize ,
F_FileType ,
F_CreateUserId,
F_ModifyDate,
F_IsShare
FROM LR_OA_FileInfo where F_DeleteMark = 0 ");
strSql.Append(fileCondition);
strSql.Append(") t WHERE F_CreateUserId = @userId");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["keyword"].IsEmpty())
{
string keyword = "%" + queryParam["keyword"].ToString() + "%";
strSql.Append(" AND F_FileName like '" + keyword + "' ");
}
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 });
}
/// <summary>
/// 文档列表
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetDocumentList(string userId)
public IEnumerable<FileInfoEntity> GetDocumentList(string userId,string queryJson)
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT F_FileId ,
@@ -95,6 +181,14 @@ namespace Learun.Application.OA.File.FileInfo
AND F_FileType IN ( 'log', 'txt', 'pdf', 'doc', 'docx', 'ppt', 'pptx',
'xls', 'xlsx' )
AND F_CreateUserId = @userId");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["keyword"].IsEmpty())
{
string keyword = "%" + queryParam["keyword"].ToString() + "%";
strSql.Append(" AND F_FileName like '" + keyword + "' ");
}
strSql.Append(" ORDER BY F_ModifyDate ASC");
return this.BaseRepository().FindList<FileInfoEntity>(strSql.ToString(), new { userId = userId });
}
@@ -103,7 +197,7 @@ namespace Learun.Application.OA.File.FileInfo
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetImageList(string userId)
public IEnumerable<FileInfoEntity> GetImageList(string userId,string queryJson)
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT F_FileId ,
@@ -118,6 +212,14 @@ namespace Learun.Application.OA.File.FileInfo
WHERE F_DeleteMark = 0
AND F_FileType IN ( 'ico', 'gif', 'jpeg', 'jpg', 'png', 'psd' )
AND F_CreateUserId = @userId");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["keyword"].IsEmpty())
{
string keyword = "%" + queryParam["keyword"].ToString() + "%";
strSql.Append(" AND F_FileName like '" + keyword + "' ");
}
strSql.Append(" ORDER BY F_ModifyDate ASC");
return this.BaseRepository().FindList<FileInfoEntity>(strSql.ToString(), new { userId = userId });
}
@@ -137,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 ,
@@ -146,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 });
@@ -156,7 +258,7 @@ namespace Learun.Application.OA.File.FileInfo
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetMyShareList(string userId)
public IEnumerable<FileInfoEntity> GetMyShareList(string userId,string queryJson)
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT *
@@ -167,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 ,
@@ -176,8 +278,16 @@ 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 F_CreateUserId = @userId");
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 { });
if (!queryParam["keyword"].IsEmpty())
{
string keyword = "%" + queryParam["keyword"].ToString() + "%";
strSql.Append(" AND F_FileName like '" + keyword + "' ");
}
strSql.Append(" ORDER BY F_ModifyDate DESC");
return this.BaseRepository().FindList<FileInfoEntity>(strSql.ToString(), new { userId = userId });
}
@@ -186,7 +296,7 @@ namespace Learun.Application.OA.File.FileInfo
/// </summary>
/// <param name="userId">用户Id</param>
/// <returns></returns>
public IEnumerable<FileInfoEntity> GetOthersShareList(string userId)
public IEnumerable<FileInfoEntity> GetOthersShareList(string userId,string queryJson)
{
var strSql = new StringBuilder();
strSql.Append(@"SELECT *
@@ -198,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 ,
@@ -208,8 +318,16 @@ 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 F_CreateUserId != @userId");
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 { });
if (!queryParam["keyword"].IsEmpty())
{
string keyword = "%" + queryParam["keyword"].ToString() + "%";
strSql.Append(" AND F_FileName like '" + keyword + "' ");
}
strSql.Append(" ORDER BY F_ModifyDate DESC");
return this.BaseRepository().FindList<FileInfoEntity>(strSql.ToString(), new { userId = userId });
}


Loading…
Cancel
Save