diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs index 0abf80489..ae881ba38 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoFreshController.cs @@ -261,6 +261,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers ViewBag.Grade = academic.AcademicYearShort.Substring(0, 2); return View(); } + /// + /// 新生信息班级统计 + /// + /// + [HttpGet] + public ActionResult StatisticClassIndex() + { + var academic = Common.GetSemesterAndYear(); + ViewBag.Grade = academic.AcademicYearShort.Substring(0, 2); + return View(); + } #endregion #region 获取数据 @@ -1036,7 +1047,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetStatisticList(string queryJson) { - var data = stuInfoFreshIBLL.GetList(queryJson); + var data = stuInfoFreshIBLL.GetList2(queryJson); var list = data.Where(x => !string.IsNullOrEmpty(x.MajorNo)).GroupBy(x => x.MajorNo).Select(x => new StatisticModel { MajorNo = x.Key, @@ -1045,8 +1056,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers TotalNum = x.Count(), InfoNum = x.Count(y => y.IsStudentEdit == true), RegisterNum = x.Count(y => y.RegisterStatus == "1"), - PayFeeNum = x.Count(y => y.PayFeeStatus == "1"), + PayFeeNum = x.Count(y => y.PayFeeStatus == "1" || y.OnsitePayFeeStatus == "1"), GetKeyNum = x.Count(y => y.GetKeyStatus == "1"), + GetCardNum = x.Count(y => y.GetCardStatus == "1"), + CollectFileNum = x.Count(y => y.CollectFileStatus == "1"), + LoanNum = x.Count(y => y.StudentLoanStatus == "1") }).OrderBy(x => x.MajorNo); //var aa = new StatisticModel @@ -1066,19 +1080,73 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers //allList.AddRange(list); return Success(list); - - + } + /// + /// 获取列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetStatisticListOfClass(string queryJson) + { + var data = stuInfoFreshIBLL.GetList2(queryJson); + var list = data.Where(x => !string.IsNullOrEmpty(x.ClassNo) && !string.IsNullOrEmpty(x.MajorNo)).GroupBy(x => new { x.MajorNo, x.ClassNo }).Select(x => new StatisticModel + { + ClassNo = x.Key.ClassNo, + ClassName = x.FirstOrDefault()?.ClassName, + Grade = x.FirstOrDefault()?.Grade, + MajorNo = x.Key.MajorNo, + MajorName = x.FirstOrDefault()?.MajorName, + TotalNum = x.Count(), + InfoNum = x.Count(y => y.IsStudentEdit == true), + RegisterNum = x.Count(y => y.RegisterStatus == "1"), + PayFeeNum = x.Count(y => y.PayFeeStatus == "1" || y.OnsitePayFeeStatus == "1"), + GetKeyNum = x.Count(y => y.GetKeyStatus == "1"), + GetCardNum = x.Count(y => y.GetCardStatus == "1"), + CollectFileNum = x.Count(y => y.CollectFileStatus == "1"), + LoanNum = x.Count(y => y.StudentLoanStatus == "1") + }).OrderBy(x => x.MajorNo).ThenBy(x => x.ClassNo); + return Success(list); } public class StatisticModel { public string MajorNo { get; set; } public string MajorName { get; set; } + public string ClassNo { get; set; } + public string ClassName { get; set; } public string Grade { get; set; } + /// + /// 总人数 + /// public int TotalNum { get; set; } + /// + /// 完善个人信息人数 + /// public int InfoNum { get; set; } + /// + /// 报到人数 + /// public int RegisterNum { get; set; } + /// + /// 缴费人数 + /// public int PayFeeNum { get; set; } + /// + /// 领钥匙人数 + /// public int GetKeyNum { get; set; } + /// + /// 已领取校园卡人数 + /// + public int GetCardNum { get; set; } + /// + /// 已收取档案人数 + /// + public int CollectFileNum { get; set; } + /// + /// 贷款人数 + /// + public int LoanNum { get; set; } } /// /// 获取列表数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.cshtml new file mode 100644 index 000000000..713285640 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.cshtml @@ -0,0 +1,40 @@ +@{ + ViewBag.Title = "新生信息统计"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + +
+
+
+
+
+ +
+
+
+
+  查询 +
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.js new file mode 100644 index 000000000..78d35159f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticClassIndex.js @@ -0,0 +1,79 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-08-08 17:21 + * 描 述:新生信息统计 + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + page.bindSelect(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var Grade = $('#Grade').lrselectGet(); + if (Grade == null || Grade == "") { + learun.alert.warning("请选择年级!"); + return; + } + page.search({ Grade: Grade }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + + }, + bindSelect: function () { + //年级 + $('#Grade').lrselect({ + placeholder: "请选择年级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', + value: 'value', + text: 'text' + }); + $('#Grade').lrselectSet(Grade); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetStatisticListOfClass', + headData: [ + { label: '年级', name: 'Grade', width: 80, align: "left" }, + { label: '专业编号', name: 'MajorNo', width: 100, align: "left" }, + { label: '专业名称', name: 'MajorName', width: 100, align: "left" }, + { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, + { label: '总人数', name: 'TotalNum', width: 100, align: "left", statistics: true }, + { label: '已完善个人信息人数', name: 'InfoNum', width: 130, align: "left", statistics: true }, + { label: '已报到人数', name: 'RegisterNum', width: 100, align: "left", statistics: true }, + { label: '已缴费人数', name: 'PayFeeNum', width: 100, align: "left", statistics: true }, + { label: '贷款人数', name: 'LoanNum', width: 100, align: "left", statistics: true }, + { label: '已领取钥匙人数', name: 'GetKeyNum', width: 100, align: "left", statistics: true }, + { label: '已领取校园卡人数', name: 'GetCardNum', width: 120, align: "left", statistics: true }, + { label: '已收取档案人数', name: 'CollectFileNum', width: 100, align: "left", statistics: true }, + ], + mainId: 'MajorNo', + isPage: false, + sidx: 'MajorNo,ClassNo', + sord: 'asc', + }); + page.search({ Grade: Grade }); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticIndex.js index 527d2e6a1..0312eeed9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/StatisticIndex.js @@ -46,19 +46,49 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetStatisticList', headData: [ - { label: '年级', name: 'Grade', width: 150, align: "left" }, - { label: '专业编号', name: 'MajorNo', width: 150, align: "left" }, - { label: '专业名称', name: 'MajorName', width: 150, align: "left" }, - { label: '总人数', name: 'TotalNum', width: 150, align: "left", statistics: true }, + { label: '年级', name: 'Grade', width: 80, align: "left" }, + { label: '专业编号', name: 'MajorNo', width: 100, align: "left" }, + { label: '专业名称', name: 'MajorName', width: 100, align: "left" }, + { label: '总人数', name: 'TotalNum', width: 100, align: "left", statistics: true }, { label: '已完善个人信息人数', name: 'InfoNum', width: 130, align: "left", statistics: true }, { label: '已报到人数', name: 'RegisterNum', width: 100, align: "left", statistics: true }, { label: '已缴费人数', name: 'PayFeeNum', width: 100, align: "left", statistics: true }, - { label: '已领取用品人数', name: 'GetKeyNum', width: 100, align: "left", statistics: true }, + { label: '贷款人数', name: 'LoanNum', width: 100, align: "left", statistics: true }, + { label: '已领取钥匙人数', name: 'GetKeyNum', width: 100, align: "left", statistics: true }, + { label: '已领取校园卡人数', name: 'GetCardNum', width: 120, align: "left", statistics: true }, + { label: '已收取档案人数', name: 'CollectFileNum', width: 100, align: "left", statistics: true }, ], mainId: 'MajorNo', isPage: false, sidx: 'MajorNo', - sord: 'asc' + sord: 'asc', + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetStatisticListOfClass', + headData: [ + { label: '年级', name: 'Grade', width: 80, align: "left" }, + { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, + { label: "班级名称", name: "ClassName", width: 100, align: "left" }, + { label: '总人数', name: 'TotalNum', width: 100, align: "left" }, + { label: '已完善个人信息人数', name: 'InfoNum', width: 130, align: "left" }, + { label: '已报到人数', name: 'RegisterNum', width: 100, align: "left" }, + { label: '已缴费人数', name: 'PayFeeNum', width: 100, align: "left" }, + { label: '贷款人数', name: 'LoanNum', width: 100, align: "left" }, + { label: '已领取钥匙人数', name: 'GetKeyNum', width: 100, align: "left" }, + { label: '已领取校园卡人数', name: 'GetCardNum', width: 120, align: "left" }, + { label: '已收取档案人数', name: 'CollectFileNum', width: 100, align: "left" }, + ], + mainId: 'ClassNo', + isPage: false, + sidx: 'ClassNo' + }); + var param; + param = param || {}; + param.Grade = rowItem.Grade; + param.MajorNo = rowItem.MajorNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } }); page.search({ Grade: Grade }); }, 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 d7d098713..b38d0bd04 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 @@ -952,6 +952,7 @@ + @@ -6818,6 +6819,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshBLL.cs index 44e2c1b3a..65a5ef009 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshBLL.cs @@ -42,6 +42,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList2(string queryJson) + { + try + { + return stuInfoFreshService.GetList2(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取列表分页数据 /// 分页参数 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs index 67bb71c37..b7a16a27b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs @@ -710,7 +710,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [NotMapped] public string Build { get; set; } - + /// + /// 是否完善个人信息 + /// [NotMapped] public bool? IsStudentEdit { get; set; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshIBLL.cs index 8c61dddef..d86565ebf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshIBLL.cs @@ -22,6 +22,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// IEnumerable GetList(string queryJson); /// + /// 获取列表数据 + /// + /// + IEnumerable GetList2(string queryJson); + /// /// 获取列表分页数据 /// 分页参数 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs index bdee91610..20ec72cce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs @@ -159,6 +159,65 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList2(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + //虚拟参数 + var dp = new DynamicParameters(new { }); + + var strSql = new StringBuilder(); + strSql.Append("SELECT t.*,d.DeptName,m.MajorName,c.ClassName "); + strSql.Append(" FROM StuInfoFresh t "); + strSql.Append(" left join CdDept d on t.DeptNo=d.DeptNo "); + strSql.Append(" left join CdMajor m on t.MajorNo=m.MajorNo "); + strSql.Append(" left join ClassInfo c on t.ClassNo=c.ClassNo "); + strSql.Append(" where 1=1 "); + + if (!queryParam["DeptNo"].IsEmpty()) + { + strSql.Append(" and t.DeptNo = @DeptNo "); + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + strSql.Append(" and t.MajorNo = @MajorNo "); + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo = @ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + if (!queryParam["Grade"].IsEmpty()) + { + strSql.Append(" and t.Grade = @Grade "); + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); foreach (var item in data)