Browse Source

按部门统计论文

master
zhangli 3 years ago
parent
commit
aca3340eeb
8 changed files with 235 additions and 2 deletions
  1. +55
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs
  2. +32
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml
  3. +88
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js
  4. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  5. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs
  6. +4
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs
  7. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs
  8. +27
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs

+ 55
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs View File

@@ -4,6 +4,7 @@ using Learun.Application.TwoDevelopment.CustomFunction;
using System.Web.Mvc;
using System.Collections.Generic;
using Learun.Application.Organization;
using System;

namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
@@ -18,6 +19,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
private PaperManageIBLL paperManageIBLL = new PaperManageBLL();
private UserIBLL userIBLL = new UserBLL();
private DepartmentIBLL departmentIBLL = new DepartmentBLL();

#region 视图功能

@@ -39,6 +41,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexReport()
{
return View();
}
#endregion

#region 获取数据
@@ -65,6 +77,49 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers
return Success(jsonData);
}
/// <summary>
/// 获取论文统计列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
public ActionResult GetReportList(string queryJson)
{
var data = paperManageIBLL.GetReportList(queryJson);
List<object> list2 = new List<object>();
foreach (var item in data)
{
if (!string.IsNullOrEmpty(item.UserDeptId))
{
var name = departmentIBLL.GetEntity(item.UserDeptId)?.F_FullName;
list2.Add(new { name = name, num = item.num });
}

}
return Success(list2);
}
/// <summary>
/// 获取论文统计列表数据
/// </summary>
/// <returns></returns>
public ActionResult GetReportData(string queryJson)
{
var data = paperManageIBLL.GetReportList(queryJson);
List<String> list1 = new List<String>();
List<object> list2 = new List<object>();
foreach (var item in data)
{
if (!string.IsNullOrEmpty(item.UserDeptId))
{
var name = departmentIBLL.GetEntity(item.UserDeptId)?.F_FullName;
list2.Add(new { name = name, value = item.num });
list1.Add(name);
}

}
return Success(new { list1, list2 });
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="keyValue">主键</param>


+ 32
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml View File

@@ -0,0 +1,32 @@

@{
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>
<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="float: left; margin-right: 20px; width: 650px; height: 350px;border: 1px solid #ccc;">
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
</div>
<script src="~/Content/echarts/echarts.js"></script>
@Html.AppendJsFile("/Areas/CustomFunction/Views/PaperManage/IndexReport.js")

+ 88
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js View File

@@ -0,0 +1,88 @@
var bootstrap = function ($, learun) {
"use strict";
var year = "";
var page = {
init: function () {
page.bind();
page.initGrid();
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();
});
},
initGrid: function () {
$(".lr-layout-grid").height($(window).height() - 110);
$('#gridtable').lrAuthorizeJfGridLei({
url: top.$.rootUrl + '/CustomFunction/PaperManage/GetReportList',
headData: [
{ name: "name", label: "部门", width: 100, align: "center" },
{ name: "num", label: "论文个数", width: 150, align: "center" }
]
});
page.search();
},
initChart: function () {
var myChart1 = echarts.init(document.getElementById('main'));
var queryJson = { year: year };
learun.httpAsyncPost(top.$.rootUrl + '/CustomFunction/PaperManage/GetReportData', { queryJson: JSON.stringify(queryJson) }, function (res) {
if (res.code == 200) {
var option = {
title: {
text: '按部门统计论文图表',
x: 'center'
},
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: res.data.list1
},
series: [
{
name: '论文统计',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: res.data.list2,
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart1.setOption(option);

}
});

},
search: function (param) {
param = param || {};
param.year = year;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
page.initChart();
}
};
page.init();
}



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

@@ -939,6 +939,7 @@
<Content Include="Areas\AssetManagementSystem\Views\Ass_UserChangeInfo\Index.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Form.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" />
<Content Include="Areas\CustomFunction\Views\PaperManage\IndexReport.js" />
<Content Include="Areas\CustomFunction\Views\SRProjectAchievement\IndexYJ.js" />
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\FormNoCompleted.js" />
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\IndexNoCompleted.js" />
@@ -7359,6 +7360,7 @@
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\IndexCompleted.cshtml" />
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\IndexNoCompleted.cshtml" />
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\FormNoCompleted.cshtml" />
<Content Include="Areas\CustomFunction\Views\PaperManage\IndexReport.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" />


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs View File

@@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
}
}

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<PaperManageEntity> GetReportList(string queryJson)
{
try
{
return paperManageService.GetReportList(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取PaperManage表实体数据
/// </summary>


+ 4
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs View File

@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
/// 日 期:2021-09-24 15:18
/// 描 述:论文管理
/// </summary>
public class PaperManageEntity
public class PaperManageEntity
{
#region 实体成员
/// <summary>
@@ -103,6 +103,9 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
}
#endregion
#region 扩展字段
[NotMapped]
public int? num { get; set; }

#endregion
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs View File

@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<PaperManageEntity> GetPageList(Pagination pagination, string queryJson);
IEnumerable<PaperManageEntity> GetReportList(string queryJson);
/// <summary>
/// 获取PaperManage表实体数据
/// </summary>


+ 27
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs View File

@@ -74,7 +74,33 @@ namespace Learun.Application.TwoDevelopment.CustomFunction
}
}
}

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<PaperManageEntity> GetReportList(string queryJson)
{
try
{
var strSql = "select UserDeptId,COUNT(1) as num from PaperManage group by UserDeptId ";
return this.BaseRepository("CollegeMIS").FindList<PaperManageEntity>(strSql);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取PaperManage表实体数据
/// </summary>


Loading…
Cancel
Save