From 5cec775e4fa6830850fd5c4c391fec60a02b7cc9 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Sat, 8 May 2021 08:56:18 +0800 Subject: [PATCH] 123 --- .../Controllers/StuEnrollController.cs | 112 ++++++++++++++++++ .../Views/Shared/_Layout.cshtml | 40 +++++++ .../Views/StuEnroll/Peichart.cshtml | 42 +++++++ .../Views/StuEnroll/Peichart.js | 73 ++++++++++++ .../Views/_ViewStart.cshtml | 3 + .../LR_Desktop/Views/MessageRind/Index.cshtml | 64 +++++++++- .../LR_Desktop/Views/MessageRind/Index.js | 2 + .../Learun.Application.Web/Content/Site.css | 18 +++ .../Learun.Application.Web.csproj | 5 + .../StuEnroll/StuEnrollBLL.cs | 4 + .../StuEnroll/StuEnrollIBLL.cs | 1 + .../StuEnroll/StuEnrollService.cs | 5 +- 12 files changed, 366 insertions(+), 3 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Shared/_Layout.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/_ViewStart.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Content/Site.css diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs index 68591a54d..59c8df85b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollController.cs @@ -5,8 +5,10 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Web.Mvc; +using Hangfire.Annotations; using Learun.Application.Base.SystemModule; using Newtonsoft.Json; +using System.Data; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -61,6 +63,116 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + [HttpGet] + /// + /// 是否饼状图 + /// + /// + public ActionResult Peichart() + { + //是否报道 + string sql = $"SELECT COUNT(CASE WHEN IsReport=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsReport = 0 THEN 1 END) AS num2 FROM StuEnroll"; + var data = stuEnrollIBLL.Execute(sql); + List list2 = new List(); + list2.Add(new + { + name = "报道人数", + value = data.Rows[0]["num1"].ToString() + + }); + list2.Add(new + { + name = "未报道人数", + value = data.Rows[0]["num2"].ToString() + + }); + var jsonData = new + { + rows = list2 + }; + //是否住宿 + string sql1 = $"SELECT COUNT(CASE WHEN IsCheckIn=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsCheckIn = 0 THEN 1 END) AS num2 FROM StuEnroll"; + var data1 = stuEnrollIBLL.Execute(sql); + List list3 = new List(); + list3.Add(new + { + name = "住宿人数", + value = data.Rows[0]["num1"].ToString() + + }); + list3.Add(new + { + name = "未住宿人数", + value = data.Rows[0]["num2"].ToString() + + }); + var jsonData1 = new + { + rows = list3 + }; + ///是否资助 + string sql2 = $"SELECT COUNT(CASE WHEN IsSubsidize1=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsSubsidize1 = 0 THEN 1 END) AS num2 FROM StuEnroll"; + var data2 = stuEnrollIBLL.Execute(sql); + List list4 = new List(); + list4.Add(new + { + name = "资助人数", + value = data.Rows[0]["num1"].ToString() + + }); + list4.Add(new + { + name = "未资助人数", + value = data.Rows[0]["num2"].ToString() + + }); + var jsonData2 = new + { + rows = list4 + }; + //是否军训 + string sql3 = $"SELECT COUNT(CASE WHEN IsMilitary=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsMilitary = 0 THEN 1 END) AS num2 FROM StuEnroll"; + var data3 = stuEnrollIBLL.Execute(sql); + List list5 = new List(); + list5.Add(new + { + name = "军训人数", + value = data.Rows[0]["num1"].ToString() + + }); + list5.Add(new + { + name = "未军训人数", + value = data.Rows[0]["num2"].ToString() + + }); + var jsonData3 = new + { + rows = list5 + }; + //是否缴费 + string sql4 = $"SELECT COUNT(CASE WHEN IsPay=1 THEN 1 END) AS num1, COUNT(CASE WHEN IsPay = 0 THEN 1 END) AS num2 FROM StuEnroll"; + var data4 = stuEnrollIBLL.Execute(sql); + List list6 = new List(); + list6.Add(new + { + name = "缴费人数", + value = data.Rows[0]["num1"].ToString() + + }); + list6.Add(new + { + name = "未缴费人数", + value = data.Rows[0]["num2"].ToString() + + }); + var jsonData4 = new + { + rows = list6 + }; + return JsonResult(jsonData); + } + /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Shared/_Layout.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Shared/_Layout.cshtml new file mode 100644 index 000000000..ad42acf45 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Shared/_Layout.cshtml @@ -0,0 +1,40 @@ + + + + + + @ViewBag.Title - My ASP.NET Application + + + + + + + +
+ @RenderBody() +
+
+

© @DateTime.Now.Year - My ASP.NET Application

+
+
+ + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.cshtml new file mode 100644 index 000000000..003d1ad39 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.cshtml @@ -0,0 +1,42 @@ + +@{ + ViewBag.Title = "资产新增报表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + + + + + Peichart + + +
+
+
+ @*
+
+
+
+
+  刷新 +
+
+
*@ +
+
+
+
+
+
+
+
+
+
+
+
+ + + +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/Peichart.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.js new file mode 100644 index 000000000..98bcee8ed --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/Peichart.js @@ -0,0 +1,73 @@ +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 + '/AssetManagementSystem/AssReport/AssAddReportList', + // headData: [ + // { name: "name", label: "年份", width: 100, align: "center" }, + // { name: "value", label: "金额", width: 150, align: "center" } + + // ] + //}); + //page.search(); + }, + initChart: function () { + var myChart1 = echarts.init(document.getElementById('main')); + //var myChart2 = echarts.init(document.getElementById('main1')); + var queryJson = { year: year }; + learun.httpAsyncPost(top.$.rootUrl + "/EducationalAdministration/StuEnroll/Peichart", { queryJson: JSON.stringify(queryJson) }, function (res) { + if (res.code == 200) { + var option = { + xAxis: { + type: 'category', + data: res.data.name + }, + yAxis: { + type: 'value' + }, + series: [{ + data: res.data.value, + type: 'bar' + }] + }; + + 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/Areas/EducationalAdministration/Views/_ViewStart.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/_ViewStart.cshtml new file mode 100644 index 000000000..334424cae --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Areas/EducationalAdministration/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml index c89b38a02..d5a0cddf7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.cshtml @@ -15,16 +15,76 @@
-
+
+
您有新的未读消息x
+
+
+ +
-@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRind/Index.js") +@Html.AppendJsFile("/Areas/LR_Desktop/Views/MessageRind/Index.js"); + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js index e8a336cd1..41b8d3c42 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/MessageRind/Index.js @@ -93,6 +93,8 @@ var bootstrap = function ($, learun) { $('#gridtable').jqprintTable(); }); }, + + // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/Site.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/Site.css new file mode 100644 index 000000000..c631428c6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/Site.css @@ -0,0 +1,18 @@ +body { + padding-top: 50px; + padding-bottom: 20px; +} + +/* Set padding to keep content from hitting the edges */ +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +/* Set width on the form input elements since they're 100% wide by default */ +input, +select, +textarea { + max-width: 280px; +} + 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 b1b6ccb3b..5e97a1398 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 @@ -955,6 +955,7 @@ + @@ -3028,6 +3029,7 @@ + @@ -6908,6 +6910,9 @@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs index b4b9898e7..f9f744eb2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollBLL.cs @@ -42,6 +42,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + public DataTable Execute(string sql) + { + return stuEnrollService.Execute(sql); + } public IEnumerable AllStudent() { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs index 3313c1ab3..eb6e0876e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + DataTable Execute(string sql); IEnumerable AllStudent(); IEnumerable GetDormitorys(Pagination pagination, string queryJson); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs index 95bc560b0..7e1e89fea 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollService.cs @@ -342,7 +342,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - + public DataTable Execute(string sql) + { + return this.BaseRepository("CollegeMIS").FindTable(sql); + } public IEnumerable AllStudent() {