From aca3340eeb0fa227af1bc33ac557465d9b08eb5f Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Sun, 26 Sep 2021 15:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=89=E9=83=A8=E9=97=A8=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=AE=BA=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/PaperManageController.cs | 55 ++++++++++++ .../Views/PaperManage/IndexReport.cshtml | 32 +++++++ .../Views/PaperManage/IndexReport.js | 88 +++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../PaperManage/PaperManageBLL.cs | 26 ++++++ .../PaperManage/PaperManageEntity.cs | 5 +- .../PaperManage/PaperManageIBLL.cs | 1 + .../PaperManage/PaperManageService.cs | 28 +++++- 8 files changed, 235 insertions(+), 2 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs index 8e00656ce..adc520d08 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/PaperManageController.cs @@ -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(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexReport() + { + return View(); + } + #endregion #region 获取数据 @@ -65,6 +77,49 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers return Success(jsonData); } /// + /// 获取论文统计列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + public ActionResult GetReportList(string queryJson) + { + var data = paperManageIBLL.GetReportList(queryJson); + List list2 = new List(); + 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); + } + /// + /// 获取论文统计列表数据 + /// + /// + public ActionResult GetReportData(string queryJson) + { + var data = paperManageIBLL.GetReportList(queryJson); + List list1 = new List(); + List list2 = new List(); + 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 }); + } + /// /// 获取表单数据 /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml new file mode 100644 index 000000000..3c3080c4c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.cshtml @@ -0,0 +1,32 @@ + +@{ + ViewBag.Title = "论文统计"; + Layout = "~/Views/Shared/_ReportTemplate.cshtml"; +} + +
+
+
+
+
+
+
+
+  刷新 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +@Html.AppendJsFile("/Areas/CustomFunction/Views/PaperManage/IndexReport.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js new file mode 100644 index 000000000..716f5d58e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/PaperManage/IndexReport.js @@ -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}
{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(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index a13d6afaa..ac06fb0cf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -939,6 +939,7 @@ + @@ -7359,6 +7360,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs index 284502d51..a1b102786 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageBLL.cs @@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetReportList(string queryJson) + { + try + { + return paperManageService.GetReportList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取PaperManage表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs index 5fc24865b..b82371811 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 日 期:2021-09-24 15:18 /// 描 述:论文管理 /// - public class PaperManageEntity + public class PaperManageEntity { #region 实体成员 /// @@ -103,6 +103,9 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + [NotMapped] + public int? num { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs index 94099f27b..7c00706e1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetReportList(string queryJson); /// /// 获取PaperManage表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs index e427a6b6a..cb2a7e1f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/PaperManage/PaperManageService.cs @@ -74,7 +74,33 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } } - + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetReportList(string queryJson) + { + try + { + var strSql = "select UserDeptId,COUNT(1) as num from PaperManage group by UserDeptId "; + + return this.BaseRepository("CollegeMIS").FindList(strSql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取PaperManage表实体数据 ///