diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs index 3ef093f68..a4aa3092c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuVolunteerController.cs @@ -147,6 +147,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + /// + /// 专业 + /// + /// + [HttpGet] + public ActionResult MajorIndex() + { + return View(); + } #endregion #region 获取数据 @@ -188,6 +197,30 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取专业统计 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetMajorStatistics(string queryJson) + { + var Data = stuVolunteerIBLL.GetMajorStatistics(queryJson); + var list = Data.GroupBy(x => x.Grade).Select(x => new + { + DeptNo = x.FirstOrDefault()?.DeptNo, + MajorNo = x.FirstOrDefault()?.MajorNo, + Grade = x.FirstOrDefault()?.Grade, + ZRNum = x.Count(), + EnrollNum = x.Count(s => s.IsEnroll == true), + WillNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true), + ManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "1"), + WoManNum = x.Count(s => s.IsEnroll == true && s.IsSubmit == true && s.Sex == "0") + }); + return Success(list); + } #endregion #region 提交数据 @@ -377,9 +410,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// /// /// - public ActionResult MajorForm(string keyValue ,int MajorStatus) + public ActionResult MajorForm(string keyValue, int MajorStatus) { - stuVolunteerIBLL.MajorForm(keyValue,MajorStatus); + stuVolunteerIBLL.MajorForm(keyValue, MajorStatus); return Success("录取成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml index 475180aca..8a99bdc75 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.cshtml @@ -43,6 +43,10 @@
录取意向(本校)*
+
+
学年*
+
+
第一志愿
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.js index 74d49c484..d99ac4026 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/Form.js @@ -17,6 +17,11 @@ var bootstrap = function ($, learun) { bind: function () { $('#IsCYSchool').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#Sex').lrDataItemSelect({ code: 'usersex' }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text' + }); }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.cshtml new file mode 100644 index 000000000..0315c2ce2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.cshtml @@ -0,0 +1,40 @@ +@{ + ViewBag.Title = "专业统计"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
专业部
+
+
+
+
学年
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.js new file mode 100644 index 000000000..6d73ca4b5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuVolunteer/MajorIndex.js @@ -0,0 +1,89 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-12-16 10:14 + * 描 述:长阳迎新 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DeptNo').lrselect({ + allowSearch: true, + value: "deptno", + text: "deptname", + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo', + }); + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetYearListByClass', + value: "year", + text: "year", + }); + $('#Sex').lrDataItemSelect({ code: 'usersex' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuVolunteer/GetMajorStatistics', + headData: [ + { + label: "专业部", name: "DeptNo", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "总人数", name: "ZRNum", width: 200, align: "left" }, + { label: "年级", name: "Grade", width: 200, align: "left" }, + { label: "录取人数", name: "EnrollNum", width: 200, align: "left" }, + { label: "报名人数", name: "WillNum", width: 200, align: "left" }, + { label: "男生", name: "ManNum", width: 200, align: "left" }, + { label: "女生", name: "WoManNum", width: 200, align: "left" }, + ], + mainId: 'DeptNo', + sidx: 'DeptNo asc,MajorNo desc,Grade desc', + isPage: false, + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + 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 2f97830e9..bdd514b18 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 @@ -1124,6 +1124,7 @@ + @@ -7558,6 +7559,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs index 7344b170c..ec03bc07a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerBLL.cs @@ -66,7 +66,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 专业统计 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetMajorStatistics(string queryJson) + { + try + { + return stuVolunteerService.GetMajorStatistics(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 @@ -143,7 +166,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - public void CheckForm(string keyValue,int ClassStatus) + public void CheckForm(string keyValue, int ClassStatus) { try { @@ -377,7 +400,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// /// 获取StuVolunteer表实体数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs index 8ea525103..cbac5004a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerEntity.cs @@ -256,7 +256,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("PROVINCECODE")] public string ProvinceCode { get; set; } - + /// + /// 学年 + /// + [Column("GRADE")] + public string Grade { get; set; } + /// + /// 提交标识 + /// + public bool? IsSubmit { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs index 0d1eaa80e..9fd618d4b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerIBLL.cs @@ -27,6 +27,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// StuVolunteerEntity GetStuVolunteerEntity(string keyValue); + + /// + /// 专业统计 + /// + /// + /// + /// + IEnumerable GetMajorStatistics(string queryJson); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs index 5d9689f7b..88e286df8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuVolunteer/StuVolunteerService.cs @@ -151,6 +151,51 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 获取专业统计 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetMajorStatistics(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(" SELECT "); + strSql.Append(@" t.* "); + strSql.Append(" FROM StuVolunteer t "); + strSql.Append(" WHERE 1=1 "); + + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND t.Grade = @Grade "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -736,4 +781,48 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion } + + public class MajorStatistics + { + /// + /// 专业部 + /// + public string DeptNo { get; set; } + /// + /// 专业部 + /// + public string DeptName { get; set; } + /// + /// 专业名称 + /// + public string MajorNo { get; set; } + /// + /// 专业名称 + /// + public string MajorName { get; set; } + /// + /// 年级 + /// + public string Grade { get; set; } + /// + /// 总人数 + /// + public string ZRNum { get; set; } + /// + /// 录取人数 + /// + public int? EnrollNum { get; set; } + /// + /// 报名人数 + /// + public int? WillNum { get; set; } + /// + /// 男生 + /// + public int? ManNum { get; set; } + /// + /// 女生 + /// + public int? WoManNum { get; set; } + } }