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 1/3] 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() { From 5da6b955dd75d2fe7d3bff9042a1c6b68ff29536 Mon Sep 17 00:00:00 2001 From: zhichao lei <442149704@qq.com> Date: Sat, 8 May 2021 09:32:22 +0800 Subject: [PATCH 2/3] zhaosheng --- .../Learun.Application.Web/Learun.Application.Web.csproj | 1 + 1 file changed, 1 insertion(+) 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 95a697197..1d2a9645e 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 @@ -7142,6 +7142,7 @@ + From b984172d2f15cc33e1a25e24629318ae80df1875 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Sat, 8 May 2021 17:07:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E6=8B=9B=E7=94=9F=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E8=BF=8E=E6=96=B0=E7=B3=BB=E7=BB=9F=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8B=9B=E7=94=9F=E7=BB=9F=E8=AE=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuEnrollController.cs | 206 ++++++++- .../Views/StuEnroll/StatisticIndex.cshtml | 76 ++++ .../Views/StuEnroll/StatisticIndex.js | 397 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../StuEnroll/StuEnrollBLL.cs | 25 ++ .../StuEnroll/StuEnrollIBLL.cs | 7 + .../StuEnroll/StuEnrollService.cs | 253 +++++++++++ 7 files changed, 961 insertions(+), 5 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.js 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 4fe77cd56..97764b3fd 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 @@ -9,6 +9,7 @@ using Hangfire.Annotations; using Learun.Application.Base.SystemModule; using Newtonsoft.Json; using System.Data; +using Learun.Application.WorkFlow; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -321,6 +322,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 招生统计 + /// + /// + public ActionResult StatisticIndex() + { + return View(); + } #endregion @@ -426,13 +435,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers if (string.IsNullOrEmpty(student.PhotoUrl)) { student.PhotoUrl = Guid.NewGuid().ToString(); - stuEnrollIBLL.SaveEntity(student.StuId,student); + stuEnrollIBLL.SaveEntity(student.StuId, student); } var annexEntity = annexesFileIBLL.GetEntityByFolderId(student.PhotoUrl); if (annexEntity == null) { - annexEntity=new AnnexesFileEntity(); + annexEntity = new AnnexesFileEntity(); annexEntity.Create(); annexEntity.F_Id = Guid.NewGuid().ToString(); } @@ -456,11 +465,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetYearListByClass() { var classList = classInfoIBLL.GetAllClass().ToList(); - var result = classList.GroupBy(a => a.Grade).Select(m=>m.Key).ToList(); - List list=new List(); + var result = classList.GroupBy(a => a.Grade).Select(m => m.Key).ToList(); + List list = new List(); foreach (var item in result) { - list.Add(new{year=item}); + list.Add(new { year = item }); } return Success(list); @@ -959,6 +968,193 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers + /// + /// 招生统计数据 + /// + /// + /// + public ActionResult GetStatisticData(string queryJson) + { + var data = stuEnrollIBLL.GetList(queryJson); + //是否报到 + var datagroupIsReport = data.OrderByDescending(x => x.IsReport).GroupBy(x => x.IsReport).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "报到" : "未报到") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsReport = new List(); + var seriesDataIsReport = new List(); + foreach (var item in datagroupIsReport) + { + legendDataIsReport.Add(item.status); + seriesDataIsReport.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //是否住宿 + var datagroupIsCheckIn = data.OrderByDescending(x => x.IsCheckIn).GroupBy(x => x.IsCheckIn).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "住宿" : "走读") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsCheckIn = new List(); + var seriesDataIsCheckIn = new List(); + foreach (var item in datagroupIsCheckIn) + { + legendDataIsCheckIn.Add(item.status); + seriesDataIsCheckIn.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //是否资助 + var datagroupIsSubsidize1 = data.OrderByDescending(x => x.IsSubsidize1).GroupBy(x => x.IsSubsidize1).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "资助" : "不资助") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsSubsidize1 = new List(); + var seriesDataIsSubsidize1 = new List(); + foreach (var item in datagroupIsSubsidize1) + { + legendDataIsSubsidize1.Add(item.status); + seriesDataIsSubsidize1.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //是否军训 + var datagroupIsMilitary = data.OrderByDescending(x => x.IsMilitary).GroupBy(x => x.IsMilitary).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "军训" : "不军训") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsMilitary = new List(); + var seriesDataIsMilitary = new List(); + foreach (var item in datagroupIsMilitary) + { + legendDataIsMilitary.Add(item.status); + seriesDataIsMilitary.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //缴费状态 + var datagroupIsPay = data.OrderByDescending(x => x.IsPay).GroupBy(x => x.IsPay).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "缴费" : "未缴费") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsPay = new List(); + var seriesDataIsPay = new List(); + foreach (var item in datagroupIsPay) + { + legendDataIsPay.Add(item.status); + seriesDataIsPay.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //拍照 + var datagroupIsMug = data.OrderByDescending(x => x.IsMug).GroupBy(x => x.IsMug).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "已拍照" : "未拍照") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsMug = new List(); + var seriesDataIsMug = new List(); + foreach (var item in datagroupIsMug) + { + legendDataIsMug.Add(item.status); + seriesDataIsMug.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //领取军训服 + var datagroupIsTakeCloths = data.OrderByDescending(x => x.IsTakeCloths).GroupBy(x => x.IsTakeCloths).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsTakeCloths = new List(); + var seriesDataIsTakeCloths = new List(); + foreach (var item in datagroupIsTakeCloths) + { + legendDataIsTakeCloths.Add(item.status); + seriesDataIsTakeCloths.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //量取校服尺寸 + var datagroupIsQuantity = data.OrderByDescending(x => x.IsQuantity).GroupBy(x => x.IsQuantity).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "已量" : "未量") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsQuantity = new List(); + var seriesDataIsQuantity = new List(); + foreach (var item in datagroupIsQuantity) + { + legendDataIsQuantity.Add(item.status); + seriesDataIsQuantity.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + //领取床上用品 + var datagroupIsGetBeddingArticle = data.OrderByDescending(x => x.IsGetBeddingArticle).GroupBy(x => x.IsGetBeddingArticle).Select(x => new + { + status = x.Key.HasValue ? (x.Key.Value == true ? "已领取" : "未领取") : "未处理", + count = x.Select(y => y.StuId).Count() + }); + var legendDataIsGetBeddingArticle = new List(); + var seriesDataIsGetBeddingArticle = new List(); + foreach (var item in datagroupIsGetBeddingArticle) + { + legendDataIsGetBeddingArticle.Add(item.status); + seriesDataIsGetBeddingArticle.Add(new WfSchemeReportModelOfPie() + { + value = item.count, + name = item.status + }); + } + + var jsonData = new + { + legendDataIsReport = legendDataIsReport, + seriesDataIsReport = seriesDataIsReport, + legendDataIsCheckIn = legendDataIsCheckIn, + seriesDataIsCheckIn = seriesDataIsCheckIn, + legendDataIsSubsidize1 = legendDataIsSubsidize1, + seriesDataIsSubsidize1 = seriesDataIsSubsidize1, + legendDataIsMilitary = legendDataIsMilitary, + seriesDataIsMilitary = seriesDataIsMilitary, + legendDataIsPay = legendDataIsPay, + seriesDataIsPay = seriesDataIsPay, + legendDataIsMug = legendDataIsMug, + seriesDataIsMug = seriesDataIsMug, + legendDataIsTakeCloths = legendDataIsTakeCloths, + seriesDataIsTakeCloths = seriesDataIsTakeCloths, + legendDataIsQuantity = legendDataIsQuantity, + seriesDataIsQuantity = seriesDataIsQuantity, + legendDataIsGetBeddingArticle = legendDataIsGetBeddingArticle, + seriesDataIsGetBeddingArticle = seriesDataIsGetBeddingArticle + }; + + return Success(jsonData); + } + #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.cshtml new file mode 100644 index 000000000..9e5789ae3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.cshtml @@ -0,0 +1,76 @@ + +@{ + ViewBag.Title = "招生统计"; + Layout = "~/Views/Shared/_ReportTemplate.cshtml"; +} + +@Html.AppendJsFile("/Views/LR_Content/script/lr-form.js") +
+
+
+
+
+
+
+
+
+
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
学年
+
+
+ +
+
+
+
+
+
+  刷新 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.js new file mode 100644 index 000000000..bc69a1882 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/StatisticIndex.js @@ -0,0 +1,397 @@ + +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initChart(); + }, + bind: function () { + // 刷新 + $('#lr-replace').on('click', function () { + location.reload(); + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 250, 400); + $('#DeptNo').lrselect({ + allowSearch: true, + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + select: function (item) { + if (item) { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" } + }); + } else { + $('#MajorNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } + + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + value: "majorno", + text: "majorname", + param: { strWhere: "1=1 AND CheckMark=1" }, + select: function (item) { + if (item) { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1" } + }); + } else { + $('#ClassNo').lrselectRefresh({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" } + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 AND CheckMark=1" }, + value: "classno", + text: "classname" + }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass', + value: "year", + text: "year", + }) + + }, + initChart: function (param) { + var myChartIsReport = echarts.init(document.getElementById('mainIsReport')); + var myChartIsCheckIn = echarts.init(document.getElementById('mainIsCheckIn')); + var myChartIsSubsidize1 = echarts.init(document.getElementById('mainIsSubsidize1')); + var myChartIsMilitary = echarts.init(document.getElementById('mainIsMilitary')); + var myChartIsPay = echarts.init(document.getElementById('mainIsPay')); + var myChartIsMug = echarts.init(document.getElementById('mainIsMug')); + var myChartIsTakeCloths = echarts.init(document.getElementById('mainIsTakeCloths')); + var myChartIsQuantity = echarts.init(document.getElementById('mainIsQuantity')); + var myChartIsGetBeddingArticle = echarts.init(document.getElementById('mainIsGetBeddingArticle')); + var queryJson = param || {}; + learun.httpAsyncPost(top.$.rootUrl + "/EducationalAdministration/StuEnroll/GetStatisticData", { queryJson: JSON.stringify(queryJson) }, function (res) { + if (res.code == 200) { + var optionIsReport = { + title: { + text: '新生报到分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsReport + }, + series: [ + { + name: '是否报到', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsReport, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsReport.setOption(optionIsReport); + + var optionIsCheckIn = { + title: { + text: '新生住宿分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsCheckIn + }, + series: [ + { + name: '是否住宿', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsCheckIn, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsCheckIn.setOption(optionIsCheckIn); + + var optionIsSubsidize1 = { + title: { + text: '新生资助分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsSubsidize1 + }, + series: [ + { + name: '是否资助', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsSubsidize1, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsSubsidize1.setOption(optionIsSubsidize1); + + var optionIsMilitary = { + title: { + text: '新生军训分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsMilitary + }, + series: [ + { + name: '是否军训', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsMilitary, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsMilitary.setOption(optionIsMilitary); + + var optionIsPay = { + title: { + text: '新生缴费分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsPay + }, + series: [ + { + name: '是否缴费', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsPay, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsPay.setOption(optionIsPay); + + var optionIsMug = { + title: { + text: '新生拍照分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsMug + }, + series: [ + { + name: '是否拍照', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsMug, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsMug.setOption(optionIsMug); + + var optionIsTakeCloths = { + title: { + text: '新生领取军训服分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsTakeCloths + }, + series: [ + { + name: '是否领取军训服', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsTakeCloths, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsTakeCloths.setOption(optionIsTakeCloths); + + var optionIsQuantity = { + title: { + text: '新生量取校服尺寸分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsQuantity + }, + series: [ + { + name: '是否量取校服尺寸', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsQuantity, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsQuantity.setOption(optionIsQuantity); + + var optionIsGetBeddingArticle = { + title: { + text: '新生领取床上用品分析图', + x: 'center' + }, + tooltip: { + trigger: 'item', + formatter: "{a}
{b} : {c}人 ({d}%)" + }, + legend: { + orient: 'vertical', + left: 'left', + data: res.data.legendDataIsGetBeddingArticle + }, + series: [ + { + name: '是否领取床上用品', + type: 'pie', + radius: '55%', + center: ['50%', '60%'], + data: res.data.seriesDataIsGetBeddingArticle, + itemStyle: { + emphasis: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)' + } + } + } + ] + }; + myChartIsGetBeddingArticle.setOption(optionIsGetBeddingArticle); + + } + }); + }, + search: function (param) { + param = param || {}; + page.initChart(param); + } + + }; + 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 1d2a9645e..3327f407a 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 @@ -971,6 +971,7 @@ + @@ -7143,6 +7144,7 @@ + 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 83d5a4acd..eaea15193 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,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return stuEnrollService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public DataTable Execute(string sql) { return stuEnrollService.Execute(sql); 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 d41a148a4..7009b7375 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,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList(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 eb851db21..fbbd1cc37 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,6 +342,259 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList( string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM StuEnroll t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["IDCard"].IsEmpty()) + { + dp.Add("IDCard", "%" + queryParam["IDCard"].ToString() + "%", DbType.String); + strSql.Append(" AND t.IDCard Like @IDCard "); + } + if (!queryParam["Year"].IsEmpty()) + { + dp.Add("Year", "%" + queryParam["Year"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassNo Like @Year "); + } + //sql条件 + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + + if (!queryParam["RegistrationNo"].IsEmpty()) + { + dp.Add("RegistrationNo", "%" + queryParam["RegistrationNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.RegistrationNo Like @RegistrationNo "); + } + if (!queryParam["Admissions"].IsEmpty()) + { + dp.Add("Admissions", queryParam["Admissions"].ToString(), DbType.String); + strSql.Append(" AND t.Admissions = @Admissions "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND t.Grade = @Grade "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassNo = @ClassNo "); + } + if (!queryParam["IsAllocation"].IsEmpty()) + { + var IsAllocation = Convert.ToBoolean(queryParam["IsAllocation"].ToString()); + if (IsAllocation) + { + strSql.Append(" AND (t.ClassNo IS NOT NULL AND t.ClassNo<>'')"); + } + else + { + strSql.Append(" AND (t.ClassNo IS NULL OR t.ClassNo='')"); + } + } + if (!queryParam["IsAllocationDormitory"].IsEmpty()) + { + var IsAllocation = Convert.ToBoolean(queryParam["IsAllocationDormitory"].ToString()); + if (IsAllocation) + { + strSql.Append(" AND (t.DormitoryNo IS NOT NULL AND t.DormitoryNo<>'')"); + } + else + { + strSql.Append(" AND (t.DormitoryNo IS NULL OR t.DormitoryNo='')"); + } + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + + if (!queryParam["Status"].IsEmpty()) + { + dp.Add("Status", queryParam["Status"].ToString(), DbType.String); + strSql.Append(" AND t.Status = @Status "); + } + if (!queryParam["Gender"].IsEmpty()) + { + dp.Add("Gender", Convert.ToBoolean(queryParam["Gender"].ToString()), DbType.Boolean); + strSql.Append(" AND t.Gender = @Gender "); + } + + if (!queryParam["PayList"].IsEmpty()) + { + strSql.Append(" AND t.Status>=3 AND t.Status<6 "); + } + + + if (!queryParam["IsCheckIn"].IsEmpty()) + { + if (queryParam["IsCheckIn"].ToString() == "null") + { + strSql.Append(" AND t.IsCheckIn is null "); + + } + else + { + dp.Add("IsCheckIn", queryParam["IsCheckIn"].ToString(), DbType.String); + strSql.Append(" AND t.IsCheckIn = @IsCheckIn "); + } + } + if (!queryParam["IsSubsidize1"].IsEmpty()) + { + if (queryParam["IsSubsidize1"].ToString() == "null") + { + strSql.Append(" AND t.IsSubsidize1 is null "); + + } + else + { + dp.Add("IsSubsidize1", queryParam["IsSubsidize1"].ToString(), DbType.String); + strSql.Append(" AND t.IsSubsidize1 = @IsSubsidize1 "); + } + } + if (!queryParam["IsMilitary"].IsEmpty()) + { + if (queryParam["IsMilitary"].ToString() == "null") + { + strSql.Append(" AND t.IsMilitary is null "); + + } + else + { + dp.Add("IsMilitary", queryParam["IsMilitary"].ToString(), DbType.String); + strSql.Append(" AND t.IsMilitary = @IsMilitary "); + } + } + + if (!queryParam["IsPay"].IsEmpty()) + { + if (queryParam["IsPay"].ToString() == "null") + { + strSql.Append(" AND t.IsPay is null "); + + } + else + { + dp.Add("IsPay", queryParam["IsPay"].ToString(), DbType.String); + strSql.Append(" AND t.IsPay = @IsPay "); + } + } + if (!queryParam["IsMug"].IsEmpty()) + { + if (queryParam["IsMug"].ToString() == "null") + { + strSql.Append(" AND t.IsMug is null "); + + } + else + { + dp.Add("IsMug", queryParam["IsMug"].ToString(), DbType.String); + strSql.Append(" AND t.IsMug = @IsMug "); + } + } + if (!queryParam["IsTakeCloths"].IsEmpty()) + { + if (queryParam["IsTakeCloths"].ToString() == "null") + { + strSql.Append(" AND t.IsTakeCloths is null "); + + } + else + { + dp.Add("IsTakeCloths", queryParam["IsTakeCloths"].ToString(), DbType.String); + strSql.Append(" AND t.IsTakeCloths = @IsTakeCloths "); + } + } + if (!queryParam["IsQuantity"].IsEmpty()) + { + if (queryParam["IsQuantity"].ToString() == "null") + { + strSql.Append(" AND t.IsQuantity is null "); + + } + else + { + dp.Add("IsQuantity", queryParam["IsQuantity"].ToString(), DbType.String); + strSql.Append(" AND t.IsQuantity = @IsQuantity "); + } + } + if (!queryParam["IsGetBeddingArticle"].IsEmpty()) + { + if (queryParam["IsGetBeddingArticle"].ToString() == "null") + { + strSql.Append(" AND t.IsGetBeddingArticle is null "); + + } + else + { + dp.Add("IsGetBeddingArticle", queryParam["IsGetBeddingArticle"].ToString(), DbType.String); + strSql.Append(" AND t.IsGetBeddingArticle = @IsGetBeddingArticle "); + } + } + + //获取班主任所带的班级 + var roleid = this.BaseRepository().FindEntity(a => a.F_FullName == "班主任")?.F_RoleId; + var userInfo = LoginUserInfo.Get(); + var sqlClasses = ""; + if (!string.IsNullOrEmpty(roleid)) + { + if (userInfo.roleIds.Contains(roleid)) + { + var classes = this.BaseRepository("CollegeMIS").FindList(a => a.ClassDiredctorNo == userInfo.account).Select(a => a.ClassNo).ToList(); + if (classes != null) + { + foreach (var item in classes) + { + sqlClasses += $"'{item}',"; + } + sqlClasses = sqlClasses.TrimEnd(','); + } + } + if (!string.IsNullOrEmpty(sqlClasses)) + { + strSql.Append($" AND t.ClassNo IN({sqlClasses})"); + } + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public DataTable Execute(string sql) { return this.BaseRepository("CollegeMIS").FindTable(sql);