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);