diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/MajorAndSubjectController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/MajorAndSubjectController.cs new file mode 100644 index 000000000..640057194 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/MajorAndSubjectController.cs @@ -0,0 +1,121 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using System.Data; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public class MajorAndSubjectController : MvcControllerBase + { + private MajorAndSubjectIBLL majorAndSubjectIBLL = new MajorAndSubjectBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList( string queryJson ) + { + var data = majorAndSubjectIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = majorAndSubjectIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var data = majorAndSubjectIBLL.GetEntity(keyValue); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + majorAndSubjectIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue,MajorAndSubjectEntity entity) + { + majorAndSubjectIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + } +} 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..438916491 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 @@ -22,6 +22,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL(); private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); + private StuEnrollScoreIBLL stuEnrollScoreIBLL = new StuEnrollScoreBLL(); #region 视图功能 @@ -34,6 +35,61 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 新生报名 + /// + /// + [HttpGet] + public ActionResult EnrollForm() + { + return View(); + } + /// + /// 新生报名 + /// + /// + [HttpGet] + public ActionResult EnrollFormView() + { + return View(); + } + + /// + /// 新生报名 + /// + /// + [HttpGet] + public ActionResult EnrollIndex() + { + return View(); + } + /// + /// 新生报名审核 + /// + /// + [HttpGet] + public ActionResult EnrollSH() + { + return View(); + } + /// + /// 新生报名审核 + /// + /// + [HttpGet] + public ActionResult EnrollLQ() + { + return View(); + } + /// + /// 招生统计 + /// + /// + [HttpGet] + public ActionResult EnrollIndexTJ() + { + return View(); + } [HttpGet] public ActionResult StudentStatus() @@ -234,7 +290,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } - + /// + /// 招生统计 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTJList( string queryJson) + { + var data = stuEnrollIBLL.GetTJList(queryJson); + return Success(data); + } [HttpGet] [AjaxOnly] public ActionResult GetDormitorys(string pagination, string queryJson) @@ -835,8 +902,53 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("同步成功"); } + /// + /// 审核页面 获取考试科目信息 + /// + /// + public ActionResult GetExamDataByStuId(string keyValue) + { + var data= stuEnrollIBLL.GetExamDataByStuId(keyValue); + return Success(data); + } + /// + /// 报名审核 + /// + /// + public ActionResult UpdateEnrollStatus(string keyValue, string strEntity) + { + //StuEnrollEntity entity = strEntity.ToObject(); + //entity.EnrollStatus = 2; + stuEnrollIBLL.UpdateEnrollStatus(keyValue, 2); + return Success("保存成功"); + } + /// + /// 报名--去审核 + /// + /// + public ActionResult NoCheck(string keyValue) + { + //StuEnrollEntity entity = new StuEnrollEntity(); + //entity.EnrollStatus = 0; + stuEnrollIBLL.UpdateEnrollStatus(keyValue, 0); + return Success("保存成功"); + } + /// + /// 录取 + /// + /// + public ActionResult Admission(string keyValue, int IsAdmission) + { + var count= stuEnrollScoreIBLL.GetNoCheck(keyValue); + if (count > 0) + { + return Fail("该学生有未审核的科目成绩"); + } + stuEnrollIBLL.Admission(keyValue, IsAdmission); + return Success("保存成功"); + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollScoreController.cs new file mode 100644 index 000000000..bca75f9c0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuEnrollScoreController.cs @@ -0,0 +1,242 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Web.Mvc; +using Learun.Application.Base.SystemModule; +using Newtonsoft.Json; +using Hangfire; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + public class StuEnrollScoreController : MvcControllerBase + { + private StuEnrollScoreIBLL stuEnrollScoreIBLL = new StuEnrollScoreBLL(); + + #region 视图 + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 新生录取管理 + /// + /// + [HttpGet] + public ActionResult AdmissionIndex() + { + return View(); + } + /// + /// 新生录取管理 + /// + /// + [HttpGet] + public ActionResult AdmissionForm() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var data = stuEnrollScoreIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取学生的成绩 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByStuId(string stuid) + { + var data = stuEnrollScoreIBLL.GetScoreListByStuId(stuid); + return Success(data); + } + + /// + /// 获取列表分页数据--新生录取管理 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForAdmission(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stuEnrollScoreIBLL.GetPageListForAdmission(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEntityByJson(string queryJson) + { + var data = stuEnrollScoreIBLL.GetEntityByJson(queryJson); + return Success(data); + } + + /// + /// 学年 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetYearNoData() + { + var data = stuEnrollScoreIBLL.GetYearNoData(); + return Success(data); + } + /// + /// 学科 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetSubjectData() + { + var data = stuEnrollScoreIBLL.GetSubjectData(); + return Success(data); + } + /// + /// 专业 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetMajorData() + { + var data = stuEnrollScoreIBLL.GetMajorData(); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 开始录入:占用成绩 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult StartInputScore(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_新生成绩录入"; + stuEnrollScoreIBLL.StartInputScore(queryJson); + ////添加任务 + //var newDate = DateTime.Now.AddMinutes(30); + //RecurringJob.AddOrUpdate(name, + // () => SaveInputScoreStatus2(queryJson, name), + // string.Format("{0} {1} * * *", newDate.Minute, newDate.Hour), TimeZoneInfo.Local); + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public ActionResult SaveInputScoreStatus2(string queryJson, string name) + { + stuEnrollScoreIBLL.SaveInputScoreStatus2(queryJson, name); + //删除任务 + //RecurringJob.RemoveIfExists(name); + + return Success("操作成功"); + } + /// + /// 续时 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult AddMinutes(string queryJson, int minutes) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_新生成绩录入"; + + var newDate = DateTime.Now.AddMinutes(minutes); + RecurringJob.AddOrUpdate(name, + () => SaveInputScoreStatus2(queryJson, name), + string.Format("{0} {1} * * *", newDate.Minute, newDate.Hour), TimeZoneInfo.Local); + return Success("操作成功"); + } + /// + /// 提交成绩 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveInputScore(string data) + { + var list = JsonConvert.DeserializeObject>(data); + if (list.Any()) + { + stuEnrollScoreIBLL.SaveInputScore(list); + } + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveInputScoreStatus(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_新生成绩录入"; + + stuEnrollScoreIBLL.SaveInputScoreStatus(queryJson); + //删除任务 + //RecurringJob.RemoveIfExists(name); + + return Success("操作成功"); + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCheckScore(string queryJson, int Status) + { + stuEnrollScoreIBLL.DoCheckScore(queryJson, Status); + return Success("操作成功"); + } + #endregion + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.cshtml new file mode 100644 index 000000000..9c99ef899 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "MajorAndSubject"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
Id*
+ +
+
+
MajorId*
+ +
+
+
SubId*
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/MajorAndSubject/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.js new file mode 100644 index 000000000..37daa42ad --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Form.js @@ -0,0 +1,38 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-18 11:19 + * 描 述:MajorAndSubject + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var selectedRow = learun.frameTab.currentIframe().selectedRow; + var page = { + init: function () { + page.initData(); + }, + bind: function () { + }, + initData: function () { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/MajorAndSubject/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.cshtml new file mode 100644 index 000000000..3e66f53b7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "MajorAndSubject"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
树形目录
+
+
+
+
+
+
标题
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/MajorAndSubject/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.js new file mode 100644 index 000000000..6d2a180f0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/MajorAndSubject/Index.js @@ -0,0 +1,92 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-18 11:19 + * 描 述:MajorAndSubject + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/MajorAndSubject/Form', + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/MajorAndSubject/Form?keyValue=' + keyValue, + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/MajorAndSubject/DeleteForm', { keyValue: keyValue}, function () { + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/MajorAndSubject/GetPageList', + headData: [ + { label: 'Id', name: 'Id', width: 200, align: "left" }, + { label: 'MajorId', name: 'MajorId', width: 200, align: "left" }, + { label: 'SubId', name: 'SubId', width: 200, align: "left" }, + ], + mainId:'Id', + isPage: true + }); + 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/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.cshtml new file mode 100644 index 000000000..c384114a8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.cshtml @@ -0,0 +1,83 @@ +@{ + ViewBag.Title = "新生报名编辑"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
姓名*
+ +
+
+
性别*
+
+
+
+
民族*
+
+
+
+
身份证号*
+ +
+
+
住址*
+ +
+
+
手机号*
+ +
+
+
中考总分*
+ +
+
+
毕业学校*
+ +
+
+
特长
+ +
+
+
地市*
+
+
+
+
县区*
+
+ @* *@ +
+
+
专业*
+
+
+
+
身份证正面照片*
+
+
+
+
身份证反面照片*
+
+
+
+
初中毕业证照片*
+
+
+
+
中考成绩截图*
+
+
+
+
推荐教师*
+
+
+
+
备注
+ +
+ + +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js new file mode 100644 index 000000000..3d2e951b2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollForm.js @@ -0,0 +1,138 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日  期:2021-06-15 17:30 + * 描  述:新生报名 + */ +var acceptClick; +var keyValue = request('keyValue'); +var MajorNo; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + + }, + bind: function () { + $('#IdCardPto1').lrUploader(); + $('#IdCardPto2').lrUploader(); + $('#MidDiplomaPto').lrUploader(); + $('#MidAchievementPto').lrUploader(); + $('#Gender').lrDataItemSelect({ code: 'usersexbit' }); + $('#Nationals').lrDataItemSelect({ code: 'National' }); + + //地市 + $('#City').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', + param: { strWhere: "1=1 and cparent='650000'" }, + value: "ccode", + text: "cname", + maxHeight: 200, + select: function (item) { + if (item) { + var code = $("#City").lrselectGet(); + //县区 + $('#County').lrselectRefresh({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, + value: "acode", + text: "aname", + maxHeight: 200, + }); + } + } + }); + //县区 + $('#County').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 " }, + value: "acode", + text: "aname", + maxHeight: 200, + select: function (item) { + if (item) { + var countyCode = $("#County").lrselectGet(); + + //专业 + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { + strWhere: "1=1 and Area='" + countyCode + "'" + }, + value: "id", + text: "majorname", + maxHeight: 200, + }); + if (MajorNo) { + $('#MajorNo').lrselectSet(MajorNo); + MajorNo = ''; + } + } + + } + }); + //专业 + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + //$('#MajorNo').lrselectRefresh({ + // url: top.$.rootUrl + + // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + // param: { + // strWhere: "1=1" + // }, + // value: "id", + // text: "majorname", + // maxHeight: 200, + //}); + + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('#form').lrSetFormData(data[id]); + } + } + MajorNo = data.StuEnroll.MajorNo; + + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollPhone/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); + //console.log('MajorNo=', MajorNo); + //if (MajorNo) { + // console.log(333); + // $('#MajorNo').lrselectSet(MajorNo); + //} +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.cshtml new file mode 100644 index 000000000..a04af730c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.cshtml @@ -0,0 +1,93 @@ +@{ + ViewBag.Title = "新生报名管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
姓名*
+ +
+
+
性别*
+
+
+
+
民族*
+
+
+
+
身份证号*
+ +
+
+
住址*
+ +
+
+
手机号*
+ +
+
+
中考总分*
+ +
+
+
毕业学校*
+ +
+
+
特长
+ +
+
+
地市*
+
+
+
+
县区*
+
+
+
+
专业*
+
+
+
+
身份证正面照片*
+
+
+
+
身份证反面照片*
+
+
+
+
初中毕业证照片*
+
+
+
+
中考成绩截图*
+
+
+
+
推荐教师*
+
+
+
+
是否录取
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.js new file mode 100644 index 000000000..927656f2e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollFormView.js @@ -0,0 +1,121 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-07-17 11:20 + * 描 述:新生报名信息 + */ +var acceptClick; +var keyValue = request('keyValue'); +var MajorNo; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + + $('#MajorNo').lrselectSet(MajorNo); + }, + bind: function () { + $('#form1').find('input').attr('readonly', 'readonly'); + $('#form1').find('div').attr('readonly', 'readonly'); + $('#IsAdmission').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + $('#IdCardPto1').lrUploader({ isUpload:false}); + $('#IdCardPto2').lrUploader({ isUpload: false }); + $('#MidDiplomaPto').lrUploader({ isUpload: false }); + $('#MidAchievementPto').lrUploader({ isUpload: false }); + $('#Gender').lrDataItemSelect({ code: 'usersexbit' }); + $('#Nationals').lrDataItemSelect({ code: 'National' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //地市 + $('#City').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', + param: { strWhere: "1=1 and cparent='650000'" }, + value: "ccode", + text: "cname", + maxHeight: 200, + //select: function (item) { + // if (item) { + // var code = $("#City").lrselectGet(); + // //县区 + // $('#County').lrselectRefresh({ + // allowSearch: true, + // //type: 'multiple', + // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + // param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, + // value: "acode", + // text: "aname", + // maxHeight: 200, + // select: function (item) { + // if (item) { + // var countyCode = $("#County").lrselectGet(); + // //专业 + // $('#MajorNo').lrselectRefresh({ + // url: top.$.rootUrl + + // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + // param: { + // strWhere: "1=1 and City='" + code + "' and Area='" + countyCode + "'" + // }, + // value: "id", + // text: "majorname", + // maxHeight: 200, + // }); + // } + // } + // }); + // } + //} + }); + //县区 + $('#County').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 " }, + value: "acode", + text: "aname", + maxHeight: 200, + + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) { + // $(".headImg").attr("src", data.StuEnroll.PhotoUrl); + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('#form1').lrSetFormData(data[id]); + } + } + MajorNo = data.StuEnroll.MajorNo; + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.cshtml new file mode 100644 index 000000000..e1180b954 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.cshtml @@ -0,0 +1,82 @@ +@{ + ViewBag.Title = "新生报名管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
姓名
+ +
+
+
身份证号
+ +
+
+
手机号
+ +
+
+
推荐教师
+
+
+ @*
+
+
+
+
+
专业
+
+
+
+
班级
+
+
+
+
学年
+
+
+ +
+
是否报到
+
+
+ +
+
报名号
+ +
+
+
录取方式
+
+
*@ +
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.js new file mode 100644 index 000000000..da6319f1b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndex.js @@ -0,0 +1,288 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-07-17 11:20 + * 描 述:新生录取管理 + */ +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); + + + + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + value: "id", + text: "majorname", + param: { strWhere: "1=1 AND CheckMark=1" }, + + }); + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollForm', + width: 700, + height: 700, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + var enrollStatus = $('#gridtable').jfGridValue('EnrollStatus'); + if (enrollStatus != '0') { + return learun.alert.warning('选中记录已审核不可编辑!'); + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollForm?keyValue=' + keyValue, + width: 700, + height: 700, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollFormView?keyValue=' + keyValue, + width: 800, + height: 700, + btn: null + }); + } + }); + + // 审核 + $('#lr_yes').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + var status = $('#gridtable').jfGridValue('EnrollStatus'); + if (status == '2') { + return learun.alert.warning('选中项目已审核!'); + } + learun.layerForm({ + id: 'form', + title: '审核', + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollSH?keyValue=' + keyValue, + width: 700, + height: 700, + btn: ['确认审核', '取消'], + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + //var data = $('#gridtable').jfGridGet('rowdata'); + //if (data.length > 0) { + + //} + }); + // 去审 + $('#lr_nocheck').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + var status = $('#gridtable').jfGridValue('EnrollStatus'); + if (status == '0') { + return learun.alert.warning('选中项目未审核!'); + } + //是否录取 + var IsAdmission = $('#gridtable').jfGridValue('IsAdmission'); + if (IsAdmission == 1) { + return learun.alert.warning('选中项目已录取!'); + } + learun.layerConfirm('是否确认去审选中项目!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/NoCheck', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + }); + // 录取 + $('#lr_lq').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + var status = $('#gridtable').jfGridValue('EnrollStatus'); + if (status != 2) { + return learun.alert.warning('请选择审核通过的数据操作!'); + } + learun.layerForm({ + id: 'form', + title: '录取', + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollLQ?keyValue=' + keyValue, + width: 500, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetPageList', + headData: [ + { label: "姓名", name: "StuName", width: 100, align: "left" }, + { + label: "性别", name: "Gender", width: 100, align: "left", + formatter: function (value) { + if (value == '0') { + return '女'; + } else { + return '男'; + } + } + }, + { + label: "民族", name: "Nationals", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'National', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "身份证号", name: "IDCard", width: 100, align: "left" }, + { label: "住址", name: "HomeAddress", width: 100, align: "left" }, + { label: "手机号", name: "StuMobile", width: 100, align: "left" }, + { label: "中考总分", name: "MidTermExam", width: 100, align: "left" }, + { label: "毕业学校", name: "FromSchool", width: 100, align: "left" }, + { label: "特长", name: "Specialty", width: 100, align: "left" }, + { + label: "地市", name: "City", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', + key: value, + keyId: 'ccode', + callback: function (_data) { + callback(_data['cname']); + } + }); + } + }, + { + label: "县区", name: "County", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', + key: value, + keyId: 'acode', + callback: function (_data) { + callback(_data['aname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "推荐教师", name: "EmpNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empno', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { + label: "状态", name: "EnrollStatus", width: 100, align: "left", + formatter: function (value) { + if (value == 2) { + return "审核通过"; + } else if (value == 0) { + return "待审核"; + } + } + }, + { + label: "是否录取", name: "IsAdmission", width: 100, align: "left", + formatter: function (value) { + if (value == 1) { + return ""; + } else { + return ""; + } + } + }, + ], + //isMultiselect: true, + mainId: 'StuId', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //param.Grade = "20"; + $('#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/StuEnroll/EnrollIndexTJ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.cshtml new file mode 100644 index 000000000..0e91fd8e2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.cshtml @@ -0,0 +1,66 @@ +@{ + ViewBag.Title = "新生报名管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
地市
+
+
+
+
县区
+
+
+
+
专业
+
+
+
+
年度
+
+
+
+
姓名
+ +
+
+
身份证号
+ +
+
+
手机号
+ +
+
+
推荐教师
+
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.js new file mode 100644 index 000000000..e91dbb490 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollIndexTJ.js @@ -0,0 +1,153 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-07-17 11:20 + * 描 述:新生录取管理 + */ +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); + }, 400, 400); + + //地市 + $('#City').lrselect({ + allowSearch: true, + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', + param: { strWhere: "1=1 and cparent='650000'" }, + value: "ccode", + text: "cname", + maxHeight: 200, + select: function (item) { + if (item) { + var code = $("#City").lrselectGet(); + //县区 + $('#County').lrselectRefresh({ + allowSearch: true, + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, + value: "acode", + text: "aname", + maxHeight: 200, + //select: function(item) { + // if (item) { + // var countyCode = $("#County").lrselectGet(); + // //专业 + // $('#MajorNo').lrselectRefresh({ + // type: 'multiple', + // url: top.$.rootUrl + + // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + // param: { + // strWhere: "1=1 and City='" + code + "' and Area='" + countyCode + "'" + // }, + // value: "majorno", + // text: "majorname", + // maxHeight: 200, + // }); + // } + //} + }); + } + } + }); + //县区 + $('#County').lrselect({ + allowSearch: true, + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 " }, + value: "acode", + text: "aname", + maxHeight: 200, + + }); + //专业 + $('#MajorNo').lrselect({ + allowSearch: true, + type: 'multiple', + url: top.$.rootUrl + + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { + strWhere: "1=1 " + }, + value: "id", + text: "majorname", + maxHeight: 200, + }); + //老师 + $('#EmpNo').lrselect({ + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo', + param: { strWhere: "1=1 " }, + value: "empno", + text: "empname", + maxHeight: 200, + }); + //年度 + $('#Year').lrselect({ + type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorYear', + param: { strWhere: "1=1 " }, + value: "year", + text: "year", + maxHeight: 200, + }); + + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetTJList', + headData: [ + { label: "教师编号", name: "empno", width: 100, align: "left" }, + { + label: "教师姓名", name: "empno", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empno', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { label: "人数", name: "num", width: 100, align: "left" }, + ], + mainId: 'StuId', + isPage: false + + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //param.Grade = "20"; + $('#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/StuEnroll/EnrollLQ.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.cshtml new file mode 100644 index 000000000..858d6ff60 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.cshtml @@ -0,0 +1,16 @@ +@{ + ViewBag.Title = "新生录取"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
考试成绩*
+ +
+
+
是否录取
+
+
+ +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.js new file mode 100644 index 000000000..49fda3000 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollLQ.js @@ -0,0 +1,56 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日  期:2021-06-15 17:30 + * 描  述:新生报名审核 + */ +var acceptClick; +var keyValue = request('keyValue'); + +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#IsAdmission').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + }, + initData: function () { + if (!!keyValue) { + //$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + //}); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Admission?keyValue=' + keyValue, + postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.cshtml new file mode 100644 index 000000000..c7ad0787d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.cshtml @@ -0,0 +1,93 @@ +@{ + ViewBag.Title = "新生报名审核"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
姓名*
+ +
+
+
性别*
+
+
+
+
民族*
+
+
+
+
身份证号*
+ +
+
+
住址*
+ +
+
+
手机号*
+ +
+
+
中考总分*
+ +
+
+
毕业学校*
+ +
+
+
特长
+ +
+
+
地市*
+
+
+
+
县区*
+
+
+
+
专业*
+
+
+
+
身份证正面照片*
+
+
+
+
身份证反面照片*
+
+
+
+
初中毕业证照片*
+
+
+
+
中考成绩截图*
+
+
+
+
推荐教师*
+
+
+
+
考试信息
+
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.js new file mode 100644 index 000000000..f2bde2911 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnroll/EnrollSH.js @@ -0,0 +1,141 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日  期:2021-06-15 17:30 + * 描  述:新生报名审核 + */ +var acceptClick; +var keyValue = request('keyValue'); +var MajorNo; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#form1').find('input').attr('readonly', 'readonly'); + $('#form1').find('div').attr('readonly', 'readonly'); + $('#IsAdmission').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + $('#IdCardPto1').lrUploader(); + $('#IdCardPto2').lrUploader(); + $('#MidDiplomaPto').lrUploader(); + $('#MidAchievementPto').lrUploader(); + $('#Gender').lrDataItemSelect({ code: 'usersexbit' }); + $('#Nationals').lrDataItemSelect({ code: 'National' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'id', text: 'majorname' }); + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //地市 + $('#City').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_CITY', + param: { strWhere: "1=1 and cparent='650000'" }, + value: "ccode", + text: "cname", + maxHeight: 200, + //select: function (item) { + // if (item) { + // var code = $("#City").lrselectGet(); + // //县区 + // $('#County').lrselectRefresh({ + // allowSearch: true, + // //type: 'multiple', + // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + // param: { strWhere: "1=1 and charindex(aparent,('" + code + "'))>0 " }, + // value: "acode", + // text: "aname", + // maxHeight: 200, + // select: function (item) { + // if (item) { + // var countyCode = $("#County").lrselectGet(); + // //专业 + // $('#MajorNo').lrselectRefresh({ + // url: top.$.rootUrl + + // '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + // param: { + // strWhere: "1=1 and City='" + code + "' and Area='" + countyCode + "'" + // }, + // value: "id", + // text: "majorname", + // maxHeight: 200, + // }); + // } + // } + // }); + // } + //} + }); + //县区 + $('#County').lrselect({ + allowSearch: true, + //type: 'multiple', + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=DIC_AREA', + param: { strWhere: "1=1 " }, + value: "acode", + text: "aname", + maxHeight: 200, + + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetFormData?keyValue=' + keyValue, function (data) { + // $(".headImg").attr("src", data.StuEnroll.PhotoUrl); + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('#form1').lrSetFormData(data[id]); + } + } + MajorNo = data.StuEnroll.MajorNo; + }); + learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/StuEnroll/GetExamDataByStuId?keyValue=' + keyValue, function (res) { + var html = ''; + if (res.code == 200) { + var data = res.data; + if (data) { + for (var i = 0; i < data.length; i++) { + var etime = data[i].BeginTime + '~' + data[i].EndTime; + html += '
'; + html += '
科目
'; + html += ''; + html += '
'; + html += '
'; + html += '
时间
'; + html += ''; + html += '
'; + } + } + $('#examDiv').html(html); + } + + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/UpdateEnrollStatus?keyValue=' + keyValue, + postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.cshtml new file mode 100644 index 000000000..0fe0e7f8e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.cshtml @@ -0,0 +1,22 @@ +@{ + ViewBag.Title = "新生录取"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+ @*
+
姓名*
+ +
*@ +
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.js new file mode 100644 index 000000000..d2137ce1b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionForm.js @@ -0,0 +1,68 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日  期:2021-06-15 17:30 + * 描  述:新生录取 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + + }, + initData: function () { + if (!!keyValue) { + learun.httpAsyncGet(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetScoreListByStuId?stuid=' + keyValue, function (data) { + //learun.loading(false); + + if (data.code == 200) { + var data = data.data; + var html = ''; + for (var i = 0; i < data.length; i++) { + html += '
'; + html += '
' + data[i].SubjectName + ':
'; + html += ''; + html += '
'; + } + $('#form').html(html); + } + else { + learun.layerClose(window.name); + learun.alert.error('数据获取失败,请重新获取!'); + learun.httpErrorLog(data.info); + } + }); + + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + //var postData = { + // strEntity: JSON.stringify($('body').lrGetFormData()) + //}; + learun.layerConfirm('是否确认录取当前学生!', function (res) { + if (res) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Admission?keyValue=' + keyValue, + { IsAdmission: 1 }, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.cshtml new file mode 100644 index 000000000..1683efd84 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.cshtml @@ -0,0 +1,52 @@ +@{ + ViewBag.Title = "新生录取管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ @*
+
姓名
+ +
+
+
身份证号
+ +
+
+
手机号
+ +
*@ +
+
年度
+
+
+
+
专业
+
+
+
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.js new file mode 100644 index 000000000..ee19b45a6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/AdmissionIndex.js @@ -0,0 +1,198 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-18 11:20 + * 描 述:新生录取管理 + */ +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); + //专业 + $('#MajorNo').lrselect({ + placeholder: "请选择专业", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetMajorData', + value: 'value', + text: 'text' + + }); + //年度 + $('#Year').lrselect({ + placeholder: "请选择年度", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetYearNoData', + value: 'value', + text: 'text' + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + //查看成绩 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '查看成绩', + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/AdmissionForm?keyValue=' + keyValue, + width: 500, + height: 400, + btn: null + }); + } + }); + // 录取 + $('#lr_lq').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + var IsAdmission = $('#gridtable').jfGridValue('IsAdmission'); + if (IsAdmission == 1) { + return learun.alert.warning('该学生已被录取!'); + } + learun.layerForm({ + id: 'form', + title: '录取', + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/AdmissionForm?keyValue=' + keyValue, + width: 500, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 取消录取 + $('#lr_nolq').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('StuId'); + if (learun.checkrow(keyValue)) { + var IsAdmission = $('#gridtable').jfGridValue('IsAdmission'); + if (IsAdmission == 0) { + return learun.alert.warning('该学生未被录取!'); + } + learun.layerConfirm('是否确认取消录取当前学生!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/Admission?keyValue=' + keyValue, { IsAdmission: 0 }, function () { + refreshGirdData(); + }); + } + }); + + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetPageListForAdmission', + headData: [ + { label: "姓名", name: "StuName", width: 100, align: "left" }, + { + label: "性别", name: "Gender", width: 100, align: "left", + formatter: function (value) { + if (value == '0') { + return '女'; + } else { + return '男'; + } + } + }, + { + label: "民族", name: "Nationals", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'National', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "身份证号", name: "IDCard", width: 100, align: "left" }, + { label: "手机号", name: "StuMobile", width: 100, align: "left" }, + { label: "中考总分", name: "MidTermExam", width: 100, align: "left" }, + { label: "毕业学校", name: "FromSchool", width: 100, align: "left" }, + { + label: "地市", name: "City", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_CITY', + key: value, + keyId: 'ccode', + callback: function (_data) { + callback(_data['cname']); + } + }); + } + }, + { + label: "县区", name: "County", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'DIC_AREA', + key: value, + keyId: 'acode', + callback: function (_data) { + callback(_data['aname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "总分", name: "ExamScore", width: 100, align: "left" }, + { + label: "是否录取", name: "IsAdmission", width: 100, align: "left", + formatter: function (value) { + if (value == 1) { + return ""; + } else { + return ""; + } + } + }, + ], + //isMultiselect: true, + mainId: 'StuId', + isPage: true, + sidx: 'ExamScore', + sord: 'ASC', + }); + page.search(); + }, + search: function (param) { + param = param || {}; + //param.Grade = "20"; + $('#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/StuEnrollScore/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/Index.cshtml new file mode 100644 index 000000000..0ef2ab278 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/Index.cshtml @@ -0,0 +1,103 @@ +@{ ViewBag.Title = "新生考试成绩录入"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+ + +
+
+ +
提示:录入完成后,请务必点击“保存成绩”按钮,避免成绩丢失!
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuEnrollScore/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/Index.js new file mode 100644 index 000000000..cbd956220 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuEnrollScore/Index.js @@ -0,0 +1,416 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2021-06-18 11:02 + * 描 述:全院学生成绩录入(新) + */ +var selectedRow; +var refreshGirdData; +var refreshGirdData2; +var judgeSelect; //判断下拉框是否选择 +var modifyDate; //成绩被占用,且是登录用户时,成绩表中的编辑时间; +var timer; //计时器 +var submitScoreTimer; //五分钟提交成绩计时器 +var headData; //常规列头 +var headDataEdit; //可编辑列头 +var headDataNoEdit; //不可编辑列头 +var headDataFinally; //最终列头 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + headData = [ + { + label: '状态', name: 'Status', width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == "1" ? "已审核" : "未审核"; + } + }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { label: '手机号', name: 'StuMobile', width: 100, align: "left" }, + { label: '身份证号', name: 'IdCard', width: 100, align: "left" }, + { + label: "性别", name: "Gender", width: 40, align: "left", + formatter: function (cellvalue) { + return cellvalue == '1' ? "男" : "女"; + } + }, { label: '年度', name: 'YearNo', width: 100, align: "left" }, + { + label: "专业", name: "MajorId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "科目", name: "SubjectId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ExamSubject', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['subjectname']); + } + }); + } + }, + + ]; + headDataEdit = [ + { + label: '成绩', name: 'Score', width: 100, align: "left", + edit: { + type: 'input', + inputType: 'number', + change: function (row, rownum) { + //row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + $('#gridtable').jfGridSet('updateRow', rownum); + }, + } + }, + { + label: '备注', name: 'Remark', width: 100, align: "left", + edit: { + type: 'input', + } + }, + ]; + headDataNoEdit = [ + { label: '成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left" + }, + ]; + headDataFinally = headData.concat(headDataNoEdit); + + page.initGird(); + page.bind(); + page.bindSelect(); + }, + bind: function () { + //多条件选择 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 500); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //查询 + $('#btn_Search').on('click', function () { + refreshGirdData2(); + }); + //// 成绩初始化 + //$('#lr_add').on('click', function () { + // //提示弹框 + // learun.layerConfirm('确认初始化成绩吗!', function (res) { + // if (res) { + // //审核成绩 + // learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnroll/EnrollScoreAdd', { queryJson: JSON.stringify(query), checkMark: 1 }, function (res) { + // if (res.code == 200) { + // refreshGirdData2(); + // } else { + // learun.alert.warning("审核成绩失败!"); + // return false; + // } + // }); + + // } + // }); + //}); + // 开始录入 + $('#lr_input').on('click', function () { + //提示弹框 + learun.layerConfirm('录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!', function (res) { + if (res) { + var query = judgeSelect(); + if (query) { + + //判断是否已审核;判断是否被其他教师占用 + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.Status != 0) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + modifyDate = data.ModifyDate; + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else { + //占用成绩 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/StartInputScore', { queryJson: JSON.stringify(query) }, function (res) { }); + } + //显示可编辑列头 + headDataFinally = headData.concat(headDataEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + page.search(query); + + //显示“提交成绩”按钮 + $('#lr_save').show(); + //隐藏“开始录入”按钮 + $('#lr_input').hide(); + //隐藏审核按钮 + page.displaySubmit(0); + ////显示“倒计时” + //$('.timeBox').show(); + //$('#minutes').html($('#minutes').attr('data-minutes')); + ////开始倒计时 + //page.countDown(); + //五分钟提交成绩 + page.submitScore(); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + + } + + } + }); + }); + //提交成绩 + $('#lr_save').on('click', function () { + var query = judgeSelect(); + if (query) { + //成绩被占用,且是登录用户时,根据编辑时间判断是否是本人; + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.Status != 0) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + if (modifyDate != null && modifyDate != data.ModifyDate) { + learun.alert.warning("当前科目成绩被修改,请重新获取!"); + return false; + } + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else if (data.IsEditable == 1) { + learun.alert.warning("学生成绩已提交!"); + return false; + } + + //提交成绩 + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + if (res.code == 200) { + //提交成绩:取消占用 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/SaveInputScoreStatus', { queryJson: JSON.stringify(query) }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + modifyDate = null; + //隐藏“提交成绩”按钮 + $('#lr_save').hide(); + //显示“开始录入”按钮 + $('#lr_input').show(); + //显示审核按钮 + page.displaySubmit(1); + //隐藏“倒计时” + //$('.timeBox').hide(); + ////停止倒计时 + //clearInterval(timer); + //停止五分钟提交成绩 + clearInterval(submitScoreTimer); + } else { + learun.alert.warning("提交成绩:取消占用失败!"); + return false; + } + }); + } else { + learun.alert.warning("提交成绩失败!"); + return false; + } + }); + + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 审核 + $('#lr_check').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.Status != 0) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + learun.layerConfirm('是否确认审核当前科目的学生成绩!', function (res) { + if (res) { + //审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/DoCheckScore', { queryJson: JSON.stringify(query), Status: 1 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 去审核 + $('#lr_uncheck').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.Status != 1) { + learun.alert.warning("学生成绩未审核!"); + return false; + } + learun.layerConfirm('是否确认去审核科目的学生成绩!', function (res) { + if (res) { + //去审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/DoCheckScore', { queryJson: JSON.stringify(query), Status: 0 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("去审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + + }, + bindSelect: function () { + //年度 + $('#Year').lrselect({ + placeholder: "请选择年度", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetYearNoData', + value: 'value', + text: 'text' + }); + //科目 + $('#SubjectId').lrselect({ + placeholder: "请选择科目", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetSubjectData', + value: 'value', + text: 'text' + }); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/GetList', + headData: headDataFinally, + mainId: 'Id', + isPage: false, + + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + countDown: function () { + //var minutes = $('#minutes').html(); + //var minutesTemp = minutes; + //var seconds = $('#seconds').attr('data-seconds'); + //$('#seconds').html(seconds); + //var secondsTemp = seconds; + //timer = setInterval(function () { + // secondsTemp--; + // $('#seconds').html(secondsTemp); + // if (secondsTemp == 0) { + // secondsTemp = seconds; + // minutesTemp--; + // $('#minutes').html(minutesTemp); + // if (minutesTemp == 0) { + // //停止倒计时 + // clearInterval(timer); + // //自动提交成绩 + // $('#lr_save').trigger("click"); + // } + // } + //}, 1000); + }, + //提交成绩 + submitScore: function () { + submitScoreTimer = setInterval(function () { + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuEnrollScore/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + }); + }, 300000); + }, + displaySubmit: function (type) { + //显示隐藏审核按钮 + if (type == 1) { + //显示 + $('#lr_check').show(); + $('#lr_uncheck').show(); + } else { + //隐藏 + $('#lr_check').hide(); + $('#lr_uncheck').hide(); + } + } + }; + refreshGirdData = function () { + page.search(); + }; + refreshGirdData2 = function () { + var query = judgeSelect(); + if (query) { + //显示不可编辑列头 + headDataFinally = headData.concat(headDataNoEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + + page.search(query); + //page.searchScale(query); + } + }; + judgeSelect = function () { + var $content = $('body').find('.lr-layout-tool-left'); + var query = $content.lrGetFormData(); + if (query.Year == null || query.Year == "") { + learun.alert.warning("请选择年度!"); + return false; + } + if (query.SubjectId == null || query.SubjectId == "") { + learun.alert.warning("请选择科目!"); + return false; + } + + return query; + }; + 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 cf16c8223..aae5037e7 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 @@ -1,4 +1,4 @@ - + @@ -331,11 +331,13 @@ + + @@ -1026,6 +1028,8 @@ + + @@ -1050,7 +1054,16 @@ + + + + + + + + + @@ -7675,6 +7688,17 @@ + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index 860d203c0..35d60c2f6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -209,6 +209,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuEnrollApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuEnrollApi.cs new file mode 100644 index 000000000..5b258d633 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuEnrollApi.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using Nancy; + +namespace Learun.Application.WebApi.Modules +{ + public class StuEnrollApi : BaseApi + { + public StuEnrollApi() + : base("/learun/adms/StuEnroll") + { + Get["/pagelist"] = GetPageList; + Get["/list"] = GetList; + Get["/form"] = GetForm; + Post["/delete"] = DeleteForm; + Post["/save"] = SaveForm; + + } + + private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL(); + + #region 获取数据 + + /// + /// 获取页面显示列表分页数据 + /// + /// + /// + public Response GetPageList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = stuEnrollIBLL.GetPageList(parameter.pagination, parameter.queryJson); + var jsonData = new + { + rows = data, + total = parameter.pagination.total, + page = parameter.pagination.page, + records = parameter.pagination.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// + /// + public Response GetList(dynamic _) + { + string queryJson = this.GetReqData(); + var data = stuEnrollIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取表单数据 + /// + /// + /// + public Response GetForm(dynamic _) + { + string keyValue = this.GetReqData(); + var StuEnrollData = stuEnrollIBLL.GetStuEnrollEntity(keyValue); + var jsonData = new + { + StuEnroll = StuEnrollData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// + /// + public Response DeleteForm(dynamic _) + { + string keyValue = this.GetReqData(); + stuEnrollIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// + /// + public Response SaveForm(dynamic _) + { + ReqFormEntity parameter = this.GetReqData(); + StuEnrollEntity entity = parameter.strEntity.ToObject(); + + stuEnrollIBLL.SaveEntity( parameter.keyValue,entity); + return Success("保存成功!"); + } + #endregion + + #region 私有类 + + /// + /// 表单实体类 + /// + private class ReqFormEntity + { + public string keyValue { get; set; } + public string strEntity { get; set; } + public string EmpNo { get; set; } + } + #endregion + + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuEnrollScoreMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuEnrollScoreMap.cs new file mode 100644 index 000000000..939817b8c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuEnrollScoreMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-07-17 11:20 + /// 描 述:新生录取管理 + /// + public class StuEnrollScoreMap : EntityTypeConfiguration + { + public StuEnrollScoreMap() + { + #region 表、主键 + //表 + this.ToTable("StuEnrollScore"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index d130b9451..e45cf113a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -92,6 +92,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectBLL.cs new file mode 100644 index 000000000..56aa161ed --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectBLL.cs @@ -0,0 +1,172 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public class MajorAndSubjectBLL : MajorAndSubjectIBLL + { + private MajorAndSubjectService majorAndSubjectService = new MajorAndSubjectService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + return majorAndSubjectService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return majorAndSubjectService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public MajorAndSubjectEntity GetEntity(string keyValue) + { + try + { + return majorAndSubjectService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + majorAndSubjectService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, MajorAndSubjectEntity entity) + { + try + { + majorAndSubjectService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 删除关联 + /// + /// 删除关联 + /// + /// 主键 + public void DeleteEntityById(string ID) + { + try + { + majorAndSubjectService.DeleteEntityById(ID); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectEntity.cs new file mode 100644 index 000000000..95566c3fc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectEntity.cs @@ -0,0 +1,56 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public class MajorAndSubjectEntity + { + #region 实体成员 + /// + /// Id + /// + /// + [Column("ID")] + public string Id { get; set; } + /// + /// MajorId + /// + /// + [Column("MAJORID")] + public string MajorId { get; set; } + /// + /// SubId + /// + /// + [Column("SUBID")] + public string SubId { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectIBLL.cs new file mode 100644 index 000000000..9879179f1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectIBLL.cs @@ -0,0 +1,60 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public interface MajorAndSubjectIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList( string queryJson ); + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + MajorAndSubjectEntity GetEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, MajorAndSubjectEntity entity); + #endregion + + #region 删除关联 + + void DeleteEntityById(string Id); + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectService.cs new file mode 100644 index 000000000..5fa2efaab --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/MajorAndSubject/MajorAndSubjectService.cs @@ -0,0 +1,211 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-18 11:19 + /// 描 述:MajorAndSubject + /// + public class MajorAndSubjectService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + /// + /// 构造方法 + /// + public MajorAndSubjectService() + { + fieldSql=@" + t.Id, + t.MajorId, + t.SubId + "; + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + //参考写法 + //var queryParam = queryJson.ToJObject(); + // 虚拟参数 + //var dp = new DynamicParameters(new { }); + //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM MajorAndSubject t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 条件参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM MajorAndSubject t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public MajorAndSubjectEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t=>t.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, MajorAndSubjectEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region MyRegion + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntityById(string ID) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.MajorId == ID); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + } +} 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..774f1cbb8 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,56 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + + /// + /// 招生统计 + /// + /// 查询参数 + /// + public DataTable GetTJList(string queryJson) + { + try + { + return stuEnrollService.GetTJList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return stuEnrollService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable AllStudent() { try @@ -130,6 +180,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取StuEnroll表实体数据 + /// 主键 + /// + /// + public StuEnrollEntity GetEntityByPersonalData(string IDCard, string StuMobile) + { + try + { + return stuEnrollService.GetEntityByPersonalData(IDCard, StuMobile); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } public object GetStuInfo(string stuId) @@ -375,6 +448,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEnroll(string keyValue, StuEnrollEntity entity) + { + try + { + stuEnrollService.SaveEnroll(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// 查询 + /// 主键 + /// + /// + public StuEnrollEntity SearchForm(int type, StuEnrollEntity entity) + { + try + { + return stuEnrollService.SearchForm(type, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public void AllocationClass(string classNo, string dataJson) { @@ -899,6 +1018,63 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public void UpdateEnrollStatus(string keyValue, int EnrollStatus) + { + try + { + stuEnrollService.UpdateEnrollStatus(keyValue, EnrollStatus); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void Admission(string keyValue, int IsAdmission) + { + try + { + stuEnrollService.Admission(keyValue, IsAdmission); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public IEnumerable GetExamDataByStuId(string keyValue) + { + try + { + return stuEnrollService.GetExamDataByStuId(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollEntity.cs index a0f6ea151..1b9ae117b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnroll/StuEnrollEntity.cs @@ -20,11 +20,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("STUID")] public string StuId { get; set; } /// - /// 学生报名号 - /// - [Column("REGISTRATIONNO")] - public string RegistrationNo { get; set; } - /// /// 姓名 /// [Column("STUNAME")] @@ -34,34 +29,132 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("GENDER")] public bool? Gender { get; set; } - - /// - /// 出生年月 + /// 民族 /// - [Column("BIRTHDAY")] - public DateTime? Birthday { get; set; } + [Column("NATIONALS")] + public string Nationals { get; set; } + /// + /// 家庭住址 + /// + [Column("HOMEADDRESS")] + public string HomeAddress { get; set; } /// /// 身份证 /// [Column("IDCARD")] public string IDCard { get; set; } + + /// + /// 手机号 + /// + [Column("STUMOBILE")] + public string StuMobile { get; set; } /// - /// 学籍所在学校 + /// 毕业学校 /// [Column("FROMSCHOOL")] public string FromSchool { get; set; } /// + /// 中考总分 + /// + [Column("MIDTERMEXAM")] + public string MidTermExam { get; set; } + /// + /// 特长 + /// + [Column("SPECIALTY")] + public string Specialty { get; set; } + /// + /// 地市 + /// + [Column("CITY")] + public string City { get; set; } + /// + /// 县区 + /// + [Column("COUNTY")] + public string County { get; set; } + /// + /// 录取专业代码 + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// 录取专业名称 + /// + [Column("MAJORNAME")] + public string MajorName { get; set; } + /// + /// 身份证正面照片 + /// + [Column("IDCARDPTO1")] + public string IdCardPto1 { get; set; } + /// + /// 身份证反面照片 + /// + [Column("IDCARDPTO2")] + public string IdCardPto2 { get; set; } + /// + /// 初中毕业证 + /// + [Column("MIDDIPLOMAPTO")] + public string MidDiplomaPto { get; set; } + /// + /// 中考成绩截图 + /// + [Column("MIDACHIEVEMENTPTO")] + public string MidAchievementPto { get; set; } + + /// + /// 备注 + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 关联教师 + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 年度(专业的年度) + /// + [Column("YEAR")] + public string Year { get; set; } + + /// + /// 报名审核状态 + /// + [Column("ENROLLSTATUS")] + public int? EnrollStatus { get; set; } + /// + /// 考试成绩 + /// + [Column("EXAMSCORE")] + public decimal? ExamScore { get; set; } + /// + /// 是否录取 + /// + [Column("ISADMISSION")] + public bool? IsAdmission { get; set; } + + /// + /// 学生报名号 + /// + [Column("REGISTRATIONNO")] + public string RegistrationNo { get; set; } + + /// + /// 出生年月 + /// + [Column("BIRTHDAY")] + public DateTime? Birthday { get; set; } + /// /// 政治面貌 /// [Column("POLITICAL")] public string Political { get; set; } /// - /// 民族 - /// - [Column("NATIONALS")] - public string Nationals { get; set; } - /// /// 届别 /// [Column("FRESHTYPE")] @@ -90,11 +183,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("NONNATIVE")] public string NonNative { get; set; } /// - /// 家庭住址 - /// - [Column("HOMEADDRESS")] - public string HomeAddress { get; set; } - /// /// 第一监护人姓名 /// [Column("FIRSTGUARDIAN")] @@ -160,11 +248,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("ADDITIONALCARE")] public string AdditionalCare { get; set; } /// - /// 中考成绩 - /// - [Column("MIDTERMEXAM")] - public string MidTermExam { get; set; } - /// /// 语文 /// [Column("LANGUAGE")] @@ -230,16 +313,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("ADMISSIONNAME")] public string AdmissionName { get; set; } /// - /// 录取专业代码 - /// - [Column("MAJORNO")] - public string MajorNo { get; set; } - /// - /// 录取专业名称 - /// - [Column("MAJORNAME")] - public string MajorName { get; set; } - /// /// 录取方式 /// [Column("ADMISSIONS")] @@ -255,11 +328,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("EXAMREGISTRATION")] public string ExamRegistration { get; set; } /// - /// 备注 - /// - [Column("REMARK")] - public string Remark { get; set; } - /// /// 班级 /// [Column("CLASSNO")] 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..64adfdac2 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,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + DataTable GetTJList(string queryJson); + IEnumerable GetList(string queryJson); IEnumerable AllStudent(); IEnumerable GetDormitorys(Pagination pagination, string queryJson); @@ -32,6 +34,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// StuEnrollEntity GetStuEnrollEntity(string keyValue); + StuEnrollEntity GetEntityByPersonalData(string IDCard, string StuMobile); #endregion #region 提交数据 @@ -48,6 +51,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// void SaveEntity(string keyValue, StuEnrollEntity entity); + void SaveEnroll(string keyValue, StuEnrollEntity entity); + StuEnrollEntity SearchForm(int type, StuEnrollEntity strEntity); void EditEnrollType(string stuIds, string enrollType); void AllocationClass(string classNo, string dataJson); void NewAllocationDormitory(string classNo, string dataJson); @@ -85,6 +90,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void GetMoney(); void RelationPhoto(); void Synchronization(); + void UpdateEnrollStatus(string keyValue, int EnrollStatus); + void Admission(string keyValue, int IsAdmission); + IEnumerable GetExamDataByStuId(string keyValue); List GetStuIdCards(); List GetTree(); 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..b61bad7b5 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 @@ -98,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration t.DeptNo, t.Grade, t.THROUGHPROJECT, - t.Status + t.Status,t.StuMobile,t.Specialty,t.City,t.County,t.EmpNo,t.IsAdmission,t.EnrollStatus,t.MidTermExam "); strSql.Append(" FROM StuEnroll t "); strSql.Append(" WHERE 1=1 "); @@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["Admissions"].IsEmpty()) { - dp.Add("Admissions", queryParam["Admissions"].ToString() , DbType.String); + dp.Add("Admissions", queryParam["Admissions"].ToString(), DbType.String); strSql.Append(" AND t.Admissions = @Admissions "); } if (!queryParam["DeptNo"].IsEmpty()) @@ -181,6 +181,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" AND t.StuName Like @StuName "); } + + if (!queryParam["StuMobile"].IsEmpty()) + { + dp.Add("StuMobile", "%" + queryParam["StuMobile"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuMobile Like @StuMobile "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); + strSql.Append(" AND t.EmpNo = @EmpNo "); + } if (!queryParam["Status"].IsEmpty()) { dp.Add("Status", queryParam["Status"].ToString(), DbType.String); @@ -341,8 +352,129 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 招生统计 + /// + /// + /// + public DataTable GetTJList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select empno,count(1) as num from stuenroll t where IsAdmission=1"); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StuName"].IsEmpty()) + { + strSql.Append($" AND t.StuName Like '%{queryParam["StuName"]}%' "); + } + if (!queryParam["IDCard"].IsEmpty()) + { + strSql.Append($" AND t.IDCard Like '%{queryParam["IDCard"]}%' "); + } + if (!queryParam["StuMobile"].IsEmpty()) + { + strSql.Append($" AND t.StuMobile Like '%{queryParam["StuMobile"]}%' "); + } + if (!queryParam["Year"].IsEmpty()) + { + strSql.Append($" AND charindex(t.Year,('{queryParam["Year"]}'))>0 "); + } + if (!queryParam["City"].IsEmpty()) + { + strSql.Append($" AND charindex(t.City,('{queryParam["City"]}'))>0 "); + } + if (!queryParam["County"].IsEmpty()) + { + strSql.Append($" AND charindex(t.County,('{queryParam["County"]}'))>0 "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + strSql.Append($" AND charindex(t.MajorNo,('{queryParam["MajorNo"]}'))>0 "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append($" AND charindex(t.EmpNo,('{queryParam["EmpNo"]}'))>0 "); + } + //sql条件 + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + strSql.Append(" group by empno"); + return this.BaseRepository("CollegeMIS").FindTable(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.StuId, + t.StuName, + t.Gender, + t.Nationals, + t.HomeAddress, + t.IDCard, + t.StuMobile, + t.FromSchool, + t.MidTermExam, + t.Specialty, + t.City, + t.County, + t.MajorNo, + t.IdCardPto1, + t.IdCardPto2, + t.MidDiplomaPto, + t.MidAchievementPto, + t.Remark + "); + strSql.Append(" FROM StuEnroll t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); + strSql.Append(" AND t.StuName Like @StuName "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } public IEnumerable AllStudent() { @@ -1945,6 +2077,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取StuEnroll表实体数据 + /// + /// + /// + public StuEnrollEntity GetEntityByPersonalData(string IDCard, string StuMobile) + { + try + { + var year = DateTime.Now.Year; + return this.BaseRepository("CollegeMIS").FindEntity(x => (x.IDCard == IDCard || x.StuMobile == StuMobile) && x.AddTime.Value.Year == year); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion 获取数据 #region 提交数据 @@ -2011,6 +2167,71 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 新生报名 + /// 主键 + /// + /// + public void SaveEnroll(string keyValue, StuEnrollEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + entity.EnrollStatus = 0; + var sql = $" select top 1 [year] as year,Majorname from CdMajor where ID='{entity.MajorNo}'"; + var majorData = this.BaseRepository("CollegeMIS").FindTable(sql); + entity.MajorName = majorData.Rows[0]["Majorname"].ToString(); + entity.Year = majorData.Rows[0]["year"].ToString(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 学生查询考试地点或录取结果 + /// + /// + /// + public StuEnrollEntity SearchForm(int type, StuEnrollEntity entity) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(x => x.EnrollStatus == 2 && + x.StuName == entity.StuName && x.StuMobile == entity.StuMobile && x.IDCard == entity.IDCard); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public void EditEnrollType(string stuIds, string enrollType) { try @@ -2197,6 +2418,150 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + + /// + /// 报名审核 + /// 主键 + /// + /// + public void UpdateEnrollStatus(string keyValue, int EnrollStatus) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //新生报名表审核通过的数据 + //var enrollList = new List(); + //if (keyValue.Contains(",")) + //{ + // keyValue = string.Join("','", keyValue.Split(',')); + + // enrollList = db.FindList(x => keyValue.Contains(x.StuId)).ToList(); + //} + //else + //{ + // enrollList = db.FindList(x => x.StuId == keyValue).ToList(); + //} + var enrollList = db.FindList(x => x.StuId == keyValue).ToList(); + string sql = $"update StuEnroll set EnrollStatus='{EnrollStatus}' where stuid in ('{keyValue}')"; + db.ExecuteBySql(sql); + + //审核通过 添加新生成绩表 + if (EnrollStatus == 2) + { + //新生成绩表 + var list = db.FindList(); + foreach (var enrollData in enrollList) + { + if (list.Where(x => x.YearNo == enrollData.Year && x.StuId == enrollData.StuId).Count() <= 0) + { + //新生成绩表不存在当前新生 添加 + //循环报名的专业所关联的学科 + //专业学科关联表 + var MajorAndSubjectList = db.FindList(x => x.MajorId == enrollData.MajorNo); + foreach (var sub in MajorAndSubjectList) + { + StuEnrollScoreEntity model = new StuEnrollScoreEntity(); + model.Create(); + model.YearNo = enrollData.Year; + model.MajorId = enrollData.MajorNo; + model.StuId = enrollData.StuId; + model.SubjectId = sub.SubId; + model.Score = 0; + db.Insert(model); + } + } + } + } + else + { + //删除新生成绩表 + foreach (var enrollData in enrollList) + { + var scoreList = db.FindList(x => x.StuId == enrollData.StuId); + foreach (var item in scoreList) + { + db.Delete(item); + } + } + } + + db.Commit(); + + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 录取 + /// 主键 + /// + /// + public void Admission(string keyValue, int IsAdmission) + { + try + { + string sql = $"update StuEnroll set IsAdmission='{IsAdmission}' where stuid='{keyValue}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取学生考试信息 + /// + /// + /// + public IEnumerable GetExamDataByStuId(string keyValue) + { + try + { + string sql = $"select majorno from stuenroll where stuid='{keyValue}'"; + var majorId = ""; + var majorDt = this.BaseRepository("CollegeMIS").FindTable(sql); + if (majorDt != null) + { + majorId = majorDt.Rows[0]["majorno"].ToString(); + } + + string subSql = + $"select s.* from [dbo].[MajorAndSubject] m join ExamSubject s on m.SubId=s.Id where m.Majorid='31e1f414-892d-49e7-8559-631ebf22b15d' and s.IsFlag=1 "; + return this.BaseRepository("CollegeMIS").FindList(subSql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion 提交数据 } } \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreBLL.cs new file mode 100644 index 000000000..e84208c81 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreBLL.cs @@ -0,0 +1,454 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; +using static Learun.Application.TwoDevelopment.EducationalAdministration.StuEnrollScoreService; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuEnrollScoreBLL : StuEnrollScoreIBLL + { + private StuEnrollScoreService stuScoreService = new StuEnrollScoreService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + return stuScoreService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取学生成绩列表数据 + /// + /// + public IEnumerable GetScoreListByStuId(string stuid) + { + try + { + return stuScoreService.GetScoreListByStuId(stuid); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetPageListForAdmission(Pagination pagination, string queryJson) + { + try + { + return stuScoreService.GetPageListForAdmission(pagination,queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取列表数据 + /// + /// + public StuEnrollScoreEntity GetEntityByJson(string queryJson) + { + try + { + return stuScoreService.GetEntityByJson(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取学年 + /// + /// + public IEnumerable GetYearNoData() + { + try + { + return stuScoreService.GetYearNoData(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取学科 + /// + /// + public IEnumerable GetSubjectData() + { + try + { + return stuScoreService.GetSubjectData(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取学科 + /// + /// + public IEnumerable GetMajorData() + { + try + { + return stuScoreService.GetMajorData(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return stuScoreService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// 主键 + /// + /// + public StuEnrollScoreEntity GetEntity(string keyValue) + { + try + { + return stuScoreService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// + public int GetNoCheck(string StuId) + { + try + { + return stuScoreService.GetNoCheck(StuId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + stuScoreService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuEnrollScoreEntity entity) + { + try + { + stuScoreService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 判断是否有未审核的成绩 + /// + /// + public int IsExistNoCheck(string YearNo, string MajorId) + { + try + { + return stuScoreService.IsExistNoCheck(YearNo, MajorId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + stuScoreService.StartInputScore(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 开始录入:占用成绩 + /// + /// + public void SaveInputScore(List list) + { + try + { + stuScoreService.SaveInputScore(list); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public void SaveInputScoreStatus2(string queryJson, string name) + { + try + { + stuScoreService.SaveInputScoreStatus2(queryJson, name); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + stuScoreService.SaveInputScoreStatus(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 提交成绩:取消占用 + /// + /// + public void DoCheckScore(string queryJson, int Status) + { + try + { + stuScoreService.DoCheckScore(queryJson, Status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreEntity.cs new file mode 100644 index 000000000..e29dc2cca --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreEntity.cs @@ -0,0 +1,131 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-17 11:02 + /// 描 述:新生考试成绩 + /// + public class StuEnrollScoreEntity + { + #region 实体成员 + /// + /// 主键 + /// + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 学年 + /// + /// + [Column("YEARNO")] + public string YearNo { get; set; } + /// + /// 专业 + /// + /// + [Column("MAJORID")] + public string MajorId { get; set; } + /// + /// 新生 + /// + /// + [Column("STUID")] + public string StuId { get; set; } + /// + /// 学科 + /// + /// + [Column("SUBJECTID")] + public string SubjectId { get; set; } + /// + /// 成绩 + /// + /// + [Column("SCORE")] + public decimal? Score { get; set; } + /// + /// 状态 + /// + /// + [Column("STATUS")] + public int? Status { get; set; } + /// + /// 审核人 + /// + /// + [Column("STATUSUSERID")] + public string StatusUserId { get; set; } + /// + /// 审核人 + /// + /// + [Column("STATUSTIME")] + public DateTime? StatusTime { get; set; } + /// + /// 创建时间 + /// + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// 创建人 + /// + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + ///备注 + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.CreateTime=DateTime.Now; + this.CreateUserId = LoginUserInfo.Get().userId; + this.Status = 0; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + + /// + /// + /// + /// + [NotMapped] + public string StuName { get; set; } + [NotMapped] + public string StuMobile { get; set; } + [NotMapped] + public string IdCard { get; set; } + [NotMapped] + public string Gender { get; set; } + [NotMapped] + public string SubjectName { get; set; } + + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreIBLL.cs new file mode 100644 index 000000000..31d81cca5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreIBLL.cs @@ -0,0 +1,99 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; +using static Learun.Application.TwoDevelopment.EducationalAdministration.StuEnrollScoreService; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public interface StuEnrollScoreIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + IEnumerable GetList(string queryJson); + IEnumerable GetScoreListByStuId(string stuid); + IEnumerable GetPageListForAdmission(Pagination pagination, string queryJson); + StuEnrollScoreEntity GetEntityByJson(string queryJson); + IEnumerable GetYearNoData(); + IEnumerable GetSubjectData(); + IEnumerable GetMajorData(); + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// 主键 + /// + /// + StuEnrollScoreEntity GetEntity(string keyValue); + + int GetNoCheck(string StuId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, StuEnrollScoreEntity entity); + + /// + /// 判断是否有未审核的成绩 + /// + /// + int IsExistNoCheck(string YearNo, string MajorId); + + /// + /// 开始录入:占用成绩 + /// + /// + void StartInputScore(string queryJson); + /// + /// 保存成绩 + /// + /// + void SaveInputScore(List list); + /// + /// 保存成绩 取消录入 + /// + /// + /// + void SaveInputScoreStatus2(string queryJson, string name); + /// + /// 提交成绩 取消占用 + /// + /// + void SaveInputScoreStatus(string queryJson); + /// + /// 审核 + /// + /// + /// + void DoCheckScore(string queryJson, int Status); + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreService.cs new file mode 100644 index 000000000..ad7ce8991 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuEnrollScore/StuEnrollScoreService.cs @@ -0,0 +1,643 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuEnrollScoreService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + public StuEnrollScoreService() + { + fieldSql = @" + t.* + "; + } + #endregion + + #region 获取数据 + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"SELECT t.*,a.StuName,a.StuMobile,a.IdCard,a.Gender FROM StuEnrollScore t +join stuenroll a on t.stuid=a.stuid where 1=1 "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["YearNo"].IsEmpty()) + { + strSql.Append(" and t.YearNo=@YearNo "); + dp.Add("YearNo", queryParam["YearNo"].ToString(), DbType.String); + } + if (!queryParam["MajorId"].IsEmpty()) + { + strSql.Append(" and t.MajorId=@MajorId "); + dp.Add("MajorId", queryParam["MajorId"].ToString(), DbType.String); + } + if (!queryParam["SubjectId"].IsEmpty()) + { + strSql.Append(" and t.SubjectId=@SubjectId "); + dp.Add("SubjectId", queryParam["SubjectId"].ToString(), DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetScoreListByStuId(string stuid) + { + try + { + string sql = $"select a.Score,b.SubjectName from StuEnrollScore a left join ExamSubject b on a.subjectId=b.Id where a.stuid='{stuid}' "; + + return this.BaseRepository("CollegeMIS").FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取新生录取管理列表 + /// + /// + public IEnumerable GetPageListForAdmission(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"select t.* from StuEnroll t where t.EnrollStatus=2 "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["Year"].IsEmpty()) + { + strSql.Append(" and t.Year=@Year "); + dp.Add("Year", queryParam["Year"].ToString(), DbType.String); + } + if (!queryParam["MajorId"].IsEmpty()) + { + strSql.Append(" and t.MajorId=@MajorId "); + dp.Add("MajorId", queryParam["MajorId"].ToString(), DbType.String); + } + if (!queryParam["SubjectId"].IsEmpty()) + { + strSql.Append(" and t.SubjectId=@SubjectId "); + dp.Add("SubjectId", queryParam["SubjectId"].ToString(), DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public StuEnrollScoreEntity GetEntityByJson(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append(@"SELECT t.* FROM StuEnrollScore t where 1=1 "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["YearNo"].IsEmpty()) + { + strSql.Append(" and t.YearNo=@YearNo "); + dp.Add("YearNo", queryParam["YearNo"].ToString(), DbType.String); + } + if (!queryParam["MajorId"].IsEmpty()) + { + strSql.Append(" and t.MajorId=@MajorId "); + dp.Add("MajorId", queryParam["MajorId"].ToString(), DbType.String); + } + if (!queryParam["SubjectId"].IsEmpty()) + { + strSql.Append(" and t.SubjectId=@SubjectId "); + dp.Add("SubjectId", queryParam["SubjectId"].ToString(), DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindEntity(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM StuEnrollScore t where 1=1 "); + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["keyword"].IsEmpty()) + { + strSql.Append(" and (stuno like @keyword or stuname like @keyword )"); + dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// 主键 + /// + /// + public StuEnrollScoreEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + + /// + /// 学年下拉框信息 + /// + /// + public IEnumerable GetYearNoData() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList("select distinct s.yearno as value,s.yearno as text from StuEnrollScore s "); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 学科 + /// + /// + public IEnumerable GetSubjectData() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList("select distinct s.subjectId as value,a.SubjectName as text from StuEnrollScore s left join ExamSubject a on s.subjectId=a.id"); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 专业 + /// + /// + public IEnumerable GetMajorData() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList("select distinct s.MajorNo as value,a.MajorName as text from StuEnroll s left join CdMajor a on s.MajorNo=a.ID "); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 判断学生成绩是否都已审核 + /// 主键 + /// + /// + public int GetNoCheck(string StuId) + { + try + { + string sql = $"select count(1) from StuEnrollScore where StuId='{StuId}' and [Status]=0"; + var obj = this.BaseRepository("CollegeMIS").FindTable(sql); + if (obj == null) + { + return 0; + } + else + { + return Convert.ToInt32(obj.Rows[0][0]); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuEnrollScoreEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取未审核的成绩的数量 + /// 主键 + /// + /// + public int IsExistNoCheck(string YearNo, string MajorId) + { + try + { + string sql = + $"select count(1) as count from StuEnrollScore where [Status]=0 and YearNo='{YearNo}' and MajorId='{MajorId}' "; + DataTable dt = this.BaseRepository("CollegeMIS").FindTable(sql); + return Convert.ToInt32(dt.Rows[0]["count"]); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + //学年 + var Year = queryParam["Year"].ToString(); + //考试科目 + var SubjectId = queryParam["SubjectId"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + var sql = $"update StuEnrollScore set IsEditable='0',EditUserId='" + loginUserInfo.account + + "',BeginModifyDate='" + now + "' where YearNo='" + Year + "' and SubjectId='" + SubjectId + "'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 提交成绩 + /// + /// + public void SaveInputScore(List list) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + foreach (var item in list) + { + item.Score = item.Score.HasValue ? item.Score.Value : 0; + + db.ExecuteBySql($"update StuEnrollScore set Score={item.Score},Remark='{item.Remark}' where Id='{item.Id}' "); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public void SaveInputScoreStatus2(string queryJson, string name) + { + try + { + var queryParam = queryJson.ToJObject(); + //学年 + var Year = queryParam["Year"].ToString(); + //考试科目 + var SubjectId = queryParam["SubjectId"].ToString(); + + var now = DateTime.Now; + //var loginUserInfo = LoginUserInfo.Get(); + var loginUserInfo = new + { + account = name.Split('_')[0], + realName = name.Split('_')[1] + }; + var sql = + $"update StuEnrollScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where YearNo='{Year}' and SubjectId='{SubjectId}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + //学年 + var Year = queryParam["Year"].ToString(); + //考试科目 + var SubjectId = queryParam["SubjectId"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + var sql = $"update StuEnrollScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where YearNo='{Year}' and SubjectId='{SubjectId}'"; + + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + public void DoCheckScore(string queryJson, int Status) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var queryParam = queryJson.ToJObject(); + //学年 + var Year = queryParam["Year"].ToString(); + //考试科目 + var SubjectId = queryParam["SubjectId"].ToString(); + + db.ExecuteBySql($"update StuEnrollScore set Status='{Status}' where YearNo='{Year}' and SubjectId='{SubjectId}' "); + + //已审核 记录学生总分 + if (Status == 1) + { + var list = db.FindList(x => x.YearNo == Year && x.SubjectId == SubjectId).Select(x => x.StuId); + foreach (var item in list) + { + var stuEnrollEntity = db.FindEntity(x => x.StuId == item); + stuEnrollEntity.ExamScore = + db.FindList(x => x.YearNo == Year && x.StuId == item) + .Sum(x => x.Score); + db.Update(stuEnrollEntity); + } + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index c511cb3bd..4030d19f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -174,6 +174,10 @@ + + + + @@ -214,6 +218,10 @@ + + + +