From a1f1444bf37b7014bc2ace34b7b58dd5204eff6c Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 12 Jun 2023 18:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E6=88=90=E7=BB=A9=E7=AE=A1=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuScoreOnlineController.cs | 1244 +++++++++ .../StuScoreOnline/InputScoreIndex.cshtml | 122 + .../Views/StuScoreOnline/InputScoreIndex.js | 553 ++++ .../Views/StuScoreOnline/Monitor.cshtml | 38 + .../Views/StuScoreOnline/Monitor.js | 132 + .../Learun.Application.Web.csproj | 5 + .../StuScoreOnlineMap.cs | 29 + .../Learun.Application.Mapping.csproj | 1 + .../StuScoreOnline/StuScoreOnlineBLL.cs | 1146 ++++++++ .../StuScoreOnline/StuScoreOnlineEntity.cs | 452 +++ .../StuScoreOnline/StuScoreOnlineIBLL.cs | 261 ++ .../StuScoreOnline/StuScoreOnlineService.cs | 2468 +++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 13 files changed, 6455 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOnlineController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOnlineMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOnlineController.cs new file mode 100644 index 000000000..9ad9d7fd8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreOnlineController.cs @@ -0,0 +1,1244 @@ +using Hangfire; +using Learun.Application.Base.SystemModule; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuScoreOnlineController : MvcControllerBase + { + private StuScoreOnlineIBLL stuScoreOnlineIBLL = new StuScoreOnlineBLL(); + //暂时注释 + //private StuScoreOnlineNotPassIBLL stuScoreOnlineNotPassIBLL = new StuScoreOnlineNotPassBLL(); + //private StuScoreOnlineNotPassTwoIBLL stuScoreOnlineNotPassTwoIBLL = new StuScoreOnlineNotPassTwoBLL(); + private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private CdMajorIBLL cdMajorIBLL = new CdMajorBLL(); + private UserIBLL userIBLL = new UserBLL(); + private EADateArrangeIBLL eADateArrangeIBLL = new EADateArrangeBLL(); + private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); + + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + [HttpGet] + public ActionResult Monitor() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 主页面【班级学生成绩初始化】 + /// + /// + [HttpGet] + public ActionResult ClassIndex() + { + return View(); + } + /// + /// 班级成绩查看页面 + /// + /// + [HttpGet] + public ActionResult ScoreQueryIndex() + { + return View(); + } + /// + /// 毕业证资格审核 + /// + /// + [HttpGet] + public ActionResult ScoreQueryAllIndex() + { + return View(); + } + /// + /// 个人成绩查看 + /// + /// + [HttpGet] + public ActionResult StuScoreOnlineQueryIndex() + { + var logininfo = LoginUserInfo.Get(); + ViewBag.StuNo = logininfo.account; + return View(); + } + /// + /// 毕业证资格审核(班主任) + /// + /// + [HttpGet] + public ActionResult ScoreQueryAllIndexTeacher() + { + return View(); + } + /// + /// 全院班级成绩查看页面 + /// + /// + [HttpGet] + public ActionResult AllScoreQueryIndex() + { + return View(); + } + /// + /// 新版成绩录入 + /// + /// + [HttpGet] + public ActionResult InputScoreIndex() + { + //获取“教学工作安排”中“线上成绩录入”的记录 + var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("线上成绩录入"); + if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) + { + ViewBag.CanInputFlag = true;//可以录入成绩标识 + } + else + { + ViewBag.CanInputFlag = false; + } + + return View(); + } + /// + /// 新版成绩录入 + /// + /// + [HttpGet] + public ActionResult InputScoreIndexInTeacher() + { + //获取“教学工作安排”中“线上成绩录入”的记录 + var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("线上成绩录入"); + if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) + { + ViewBag.CanInputFlag = true;//可以录入成绩标识 + } + else + { + ViewBag.CanInputFlag = false; + } + + return View(); + } + + /// + /// 成绩统计分析 + /// + /// + [HttpGet] + public ActionResult ScoreStatisticAnalysis() + { + return View(); + } + + /// + /// 毕业学生成绩查看页面 + /// + /// + [HttpGet] + public ActionResult GraduateScoreQueryAllIndex() + { + return View(); + } + + + + /// + /// 学生成绩录入可去审核页面 + /// + /// + [HttpGet] + public ActionResult ScoreInputCancelIndex() + { + return View(); + } + /// + /// 学生成绩录入可去审核页面 + /// + /// + [HttpGet] + public ActionResult ScoreInputCancelForm() + { + return View(); + } + /// + /// 全院学生成绩查看页面 + /// + /// + [HttpGet] + public ActionResult AllStuScoreOnlineQueryIndex() + { + return View(); + } + /// + /// 全院学生成绩打印 + /// + /// + [HttpGet] + public ActionResult AllStuScoreOnlineQueryPrint() + { + ViewBag.WebApi = ConfigurationManager.AppSettings["WebApi"]; + return View(); + } + + + /// + /// 成绩录入导入 + /// + /// + [HttpGet] + public ActionResult InputScoreIndexInTeacherImport() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var data = stuScoreOnlineIBLL.GetList(queryJson).OrderBy(a => a.StuNo); + return Success(data); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetMonitorList(string queryJson) + { + var data = stuScoreOnlineIBLL.GetMonitorList(queryJson); + return Success(data); + } + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stuScoreOnlineIBLL.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 = stuScoreOnlineIBLL.GetEntity(keyValue); + return Success(data); + } + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreInputCancelPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + + var aa = JsonConvert.DeserializeObject(queryJson); + + var data = new List(); + if (!string.IsNullOrEmpty(aa.AcademicYearNo) || !string.IsNullOrEmpty(aa.Semester) || !string.IsNullOrEmpty(aa.EmpNo) || !string.IsNullOrEmpty(aa.LessonNo) || !string.IsNullOrEmpty(aa.ClassNo) || !string.IsNullOrEmpty(aa.StuNo)) + { + data = stuScoreOnlineIBLL.GetScoreInputCancelPageList(paginationobj, queryJson).ToList(); + } + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// 主键 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreInputCancelFormData(string keyValue) + { + var data = stuScoreOnlineIBLL.GetEntity(keyValue); + var StuSelectLessonListData = stuScoreOnlineIBLL.GetStuSelectLessonListEntity(data); + var jsonData = new + { + StuScoreOnline = data, + StuSelectLessonList = StuSelectLessonListData + }; + return Success(jsonData); + } + + /// + /// 获取列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEntityByJson(string queryJson) + { + var data = stuScoreOnlineIBLL.GetEntityByJson(queryJson); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + stuScoreOnlineIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + [HttpPost] + [AjaxOnly] + public ActionResult Submit(string AcademicYearNo, string Semester, string LessonNo, string EmpNo, string EditUserId) + { + stuScoreOnlineIBLL.SubmitStuScoreOnline(AcademicYearNo, Semester, LessonNo, EmpNo); + var userEntity = userIBLL.GetEntityByAccount(EditUserId); + if (userEntity != null) + { + var name = userEntity.F_Account + "_" + userEntity.F_RealName + "_线上成绩录入"; + + //删除任务 + RecurringJob.RemoveIfExists(name); + } + return Success("操作成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult DeleteList() + { + stuScoreOnlineIBLL.DeleteList(); + return Success("清空成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, StuScoreOnlineEntity entity) + { + stuScoreOnlineIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + + /// + /// 获取班级成绩初始化分页数据 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListAboutClass(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stuScoreOnlineIBLL.GetPageListAboutClass(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 班级学生成绩录入初始化 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoInitAboutClass(string academicYearNo, string semester, string classNo) + { + stuScoreOnlineIBLL.DoInitAboutClass(academicYearNo, semester, classNo); + return Success("初始化成功!"); + } + + /// + /// 学年下拉框信息【班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetAcademicYearNoData() + { + var data = stuScoreOnlineIBLL.GetAcademicYearNoData(); + + return Success(data); + } + /// + /// 学期下拉框信息【班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetSemesterData() + { + var data = WebHelper.GenerateNearBySemeter(); + + return Success(data); + } + + /// + /// 学期下拉框信息【班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetSemesterDataTwo() + { + var data = WebHelper.GenerateNearBySemeterTwo(); + + return Success(data); + } + /// + /// 班级下拉框信息【成绩录入新页面】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassNoDataOfAll(string lessonNo) + { + var data = stuScoreOnlineIBLL.GetClassNoData("", "", lessonNo); + + return Success(data); + } + /// + /// 班级下拉框信息【班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassNoData(string lessonNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetClassNoData(loginInfo.account, loginInfo.Description, lessonNo); + + return Success(data); + } + + /// + /// 班级下拉框信息【成绩录入】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassNoDataForInput(string lessonNo, string AcademicYearShort, string Semester) + { + var loginInfo = LoginUserInfo.Get(); + // var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreOnlineIBLL.GetClassNoDataForInput(loginInfo.account, loginInfo.Description, lessonNo, AcademicYearShort, Semester); + + return Success(data); + } + /// + /// 班级下拉框信息【全院班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetAllClassNoData() + { + var data = stuScoreOnlineIBLL.GetClassNoData("", "", ""); + + return Success(data); + } + /// + /// 教师下拉框信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEmpNoDataOfAll(string lessonNo) + { + var data = stuScoreOnlineIBLL.GetEmpNoData("", "", lessonNo); + + return Success(data); + } + /// + /// 教师下拉框信息【学生成绩录入可去审核】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEmpNoData(string lessonNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetEmpNoData(loginInfo.account, loginInfo.Description, lessonNo); + + return Success(data); + } + /// + /// 课程下拉框信息【学生成绩录入可去审核】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataOfAll() + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); + + return Success(data); + } + /// + /// 课程下拉框 带编号 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataOfAllWithNo() + { + var data = stuScoreOnlineIBLL.GetLessonNoDataOfAll("", ""); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + /// + /// 课程下拉框 带编号 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataWithNo(string AcademicYearShort, string Semester) + { + var loginInfo = LoginUserInfo.Get(); + //var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreOnlineIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description, AcademicYearShort, Semester); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + /// + /// 选修课程下拉框 带编号【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonNoDataOfAllWithNo() + { + var data = stuScoreOnlineIBLL.GetElectiveLessonNoDataOfAll("", ""); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + /// + /// 选修课程下拉框 带编号【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonNoDataWithNo(string AcademicYearShort, string Semester) + { + var loginInfo = LoginUserInfo.Get(); + //var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreOnlineIBLL.GetElectiveLessonNoDataOfAll(loginInfo.account, loginInfo.Description, AcademicYearShort, Semester); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveClassRoomNoDataOfAll(string lessonNo) + { + var data = stuScoreOnlineIBLL.GetElectiveClassRoomNoData("", "", lessonNo); + + return Success(data); + } + /// + /// 教室下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveClassRoomNoData(string lessonNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetElectiveClassRoomNoData(loginInfo.account, loginInfo.Description, lessonNo); + + return Success(data); + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonSectionDataOfAll(string classRoomNo) + { + var data = stuScoreOnlineIBLL.GetElectiveLessonSectionData("", "", classRoomNo); + + return Success(data); + } + /// + /// 节次下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonSectionData(string classRoomNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetElectiveLessonSectionData(loginInfo.account, loginInfo.Description, classRoomNo); + + return Success(data); + } + + /// + /// 课程信息【班级成绩查看】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoData(string academicYearNo, string semester, string classNo) + { + var data = stuScoreOnlineIBLL.GetLessonNoData(academicYearNo, semester, classNo).OrderBy(x => x.value); + + return Success(data); + } + + /// + /// 根据StuNo查询班级课程 + /// + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataFromStuNo(string academicYearNo, string semester, string StuNo) + { + var data = stuScoreOnlineIBLL.GetLessonNoDataFromStuNo(academicYearNo, semester, StuNo).OrderBy(x => x.value); + + return Success(data); + } + + /// + /// 获取班级成绩列表 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByClassNo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetScoreListByClassNo(queryJson); + var stuData = stuInfoBasicIBLL.GetAllList(); + + var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new + { + StuId = x.Key.StuId, + StuNo = x.Key.StuNo, + StuName = x.Key.StuName, + FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, + TotalScore = x.Select(y => y.Score).Sum(), + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) + }).OrderByDescending(x => x.TotalScore); + + var result = new List>(); + foreach (var item in aa) + { + var aaa = new Dictionary(); + aaa.Add("StuId", item.StuId); + aaa.Add("StuNo", item.StuNo); + aaa.Add("StuName", item.StuName); + aaa.Add("FinishSchoolMark", item.FinishSchoolMark); + aaa.Add("TotalScore", item.TotalScore.ToString()); + foreach (var lessonInfoItem in item.LessonInfo) + { + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); + } + + result.Add(aaa); + } + + return Success(result); + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByStuNo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetScoreListByStuNo(queryJson); + var stuData = stuInfoBasicIBLL.GetAllList(); + + var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new + { + StuId = x.Key.StuId, + StuNo = x.Key.StuNo, + StuName = x.Key.StuName, + FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, + TotalScore = x.Where(m => m.LessonSortNo == "1").Select(y => y.Score).Sum(), + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) + }).OrderByDescending(x => x.TotalScore); + + var result = new List>(); + foreach (var item in aa) + { + var aaa = new Dictionary(); + aaa.Add("StuId", item.StuId); + aaa.Add("StuNo", item.StuNo); + aaa.Add("StuName", item.StuName); + aaa.Add("FinishSchoolMark", item.FinishSchoolMark); + aaa.Add("TotalScore", item.TotalScore.ToString()); + foreach (var lessonInfoItem in item.LessonInfo) + { + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); + } + + result.Add(aaa); + } + + return Success(result); + } + + /// + /// 全院学生成绩查看 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByStuInfo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetScoreListByStuInfo(queryJson); + if (data.Any()) + { + data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonSortNo).ThenBy(x => x.LessonNo); + } + + return Success(data); + } + + public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) + { + var data = stuScoreOnlineIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); + return Success(data); + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreInfo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetScoreInfo(queryJson); + return JsonResult(data); + } + + /// + /// 导出班级成绩列表 + /// + /// + //[HttpGet] + //[AjaxOnly] + [HttpPost, ValidateInput(false)] + public ActionResult ExportScoreListByClassNo(string queryJson) + { + var queryModel = JsonConvert.DeserializeObject(queryJson); + var className = string.Empty; + if (!string.IsNullOrEmpty(queryModel.ClassNo)) + { + var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(queryModel.ClassNo); + className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty; + } + + var data = stuScoreOnlineIBLL.GetScoreListByClassNo(queryJson); + var aa = data.GroupBy(x => new { x.StuNo, x.StuName }).Select(x => new + { + StuNo = x.Key.StuNo, + StuName = x.Key.StuName, + TotalScore = x.Select(y => y.Score).Sum(), + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) + }).OrderByDescending(x => x.TotalScore); + var result = new List>(); + foreach (var item in aa) + { + var aaa = new Dictionary(); + aaa.Add("StuNo", item.StuNo); + aaa.Add("StuName", item.StuName); + aaa.Add("TotalScore", item.TotalScore.ToString()); + foreach (var lessonInfoItem in item.LessonInfo) + { + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); + } + + result.Add(aaa); + } + var resultStr = JsonConvert.SerializeObject(result); + + //班级成绩源 + var exportTable = resultStr.ToTable(); + //设置导出格式 + ExcelConfig excelconfig = new ExcelConfig(); + excelconfig.Title = className + " 班级成绩列表"; + excelconfig.TitleFont = "微软雅黑"; + excelconfig.TitlePoint = 20; + excelconfig.FileName = className + " 班级成绩导出.xls"; + excelconfig.IsAllSizeColumn = true; + //每一列的设置,没有设置的列信息,系统将按datatable中的列名导出 + excelconfig.ColumnEntity = new List(); + excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuNo", ExcelColumn = "学号" }); + excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "StuName", ExcelColumn = "姓名" }); + excelconfig.ColumnEntity.Add(new ColumnModel() { Column = "TotalScore", ExcelColumn = "总分" }); + + //课程动态列 + var lessonTemp = stuScoreOnlineIBLL.GetLessonNoData(queryModel.AcademicYearNo, queryModel.Semester, queryModel.ClassNo).OrderBy(x => x.value); + foreach (var lessonTempItem in lessonTemp) + { + excelconfig.ColumnEntity.Add(new ColumnModel() { Column = lessonTempItem.value, ExcelColumn = lessonTempItem.text }); + } + + //调用导出方法 + ExcelHelper.ExcelDownload(exportTable, excelconfig); + + return Success("导出成功!"); + } + /// + /// 查询条件模型【班级成绩查看】 + /// + public class QueryModel + { + public string AcademicYearNo { get; set; } + public string Semester { get; set; } + public string ClassNo { get; set; } + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetStuGraduateInfo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetStuGraduateInfo(queryJson); + return JsonResult(data); + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetPassInfo(string queryJson) + { + var data = stuScoreOnlineIBLL.GetPassInfo(queryJson); + return JsonResult(data); + } + + + [HttpGet] + [AjaxOnly] + public ActionResult GetClassOfMy() + { + var data = stuScoreOnlineIBLL.GetClassOfMy(); + return JsonResult(data); + } + + + + /// + /// 获取打印成绩单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByStuNoList(string stuNoList) + { + var dataList = new List(); + var stuNoArr = stuNoList.Split(','); + foreach (var stuNo in stuNoArr) + { + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(stuNo); + if (stuInfoBasicEntity != null) + { + var classInfoEntity = classInfoIBLL.GetClassInfoEntityByClassNo(stuInfoBasicEntity.ClassNo); + var cdMajorEntity = cdMajorIBLL.GetCdMajorEntityByMajorNo(stuInfoBasicEntity.MajorNo); + var scoreList = stuScoreOnlineIBLL.GetAllScoreListByStuNo(stuNo); + var scoreListOfSortNo1 = scoreList.Where(x => x.LessonSortNo == "1"); //必修课 + if (scoreListOfSortNo1.Any()) + { + foreach (var item in scoreListOfSortNo1) + { + if ((item.Score >= 0 && item.Score < 60) || item.Score == (-5) || item.Score == (-10)) + { + item.StuNo = stuNo; + var scoreNotPassEntity = stuScoreOnlineIBLL.GetScoreNotPassByEntity(item); + if (scoreNotPassEntity != null) + { + item.Score = scoreNotPassEntity.Score; + if ((scoreNotPassEntity.Score >= 0 && scoreNotPassEntity.Score < 60) || scoreNotPassEntity.Score == (-5) || scoreNotPassEntity.Score == (-10)) + { + scoreNotPassEntity.StuNo = stuNo; + var scoreNotPassTwoEntity = stuScoreOnlineIBLL.GetScoreNotPassTwoByEntity(scoreNotPassEntity); + if (scoreNotPassTwoEntity != null) + { + item.Score = scoreNotPassTwoEntity.Score; + } + } + } + } + } + } + + var list = scoreList.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new + { + academicYearNo = x.Key.AcademicYearNo, + semester = x.Key.Semester, + title = string.Format("{0}学年度第{1}学期", x.Key.AcademicYearNo, x.Key.Semester), + list = x.Select(y => new + { + type = y.LessonSortNo == "1" ? "专业课" : y.LessonSortNo == "2" ? "选修课" : "公共课", + className = y.LessonName, + achievement = y.Score.HasValue ? y.Score.Value.ToString() : string.Empty, + lessonNo = y.LessonNo + }).OrderBy(y => y.lessonNo) + }).OrderByDescending(x => x.academicYearNo).OrderByDescending(x => x.semester); + + var data = new + { + schoolId = stuInfoBasicEntity.F_SchoolId, + school = string.Empty, + major = cdMajorEntity != null ? cdMajorEntity.MajorName : string.Empty, + className = classInfoEntity != null ? classInfoEntity.ClassName : string.Empty, + student = stuInfoBasicEntity.StuName, + number = stuInfoBasicEntity.StuNo, + arrangementId = stuInfoBasicEntity.EduSystem, + arrangement = string.Empty, + list = list.Select(x => new { x.title, list = x.list.Select(y => new { y.type, y.className, y.achievement }) }) + }; + + dataList.Add(data); + } + } + + return Success(dataList); + } + + /// + /// 审核学生成绩 + /// + /// 成绩主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult CheckStuScoreOnline(string keyValue) + { + stuScoreOnlineIBLL.CheckStuScoreOnline(keyValue); + return Success("操作成功!"); + } + /// + /// 去审核学生成绩 + /// + /// 成绩主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UnCheckStuScoreOnline(string keyValue) + { + stuScoreOnlineIBLL.UnCheckStuScoreOnline(keyValue); + return Success("操作成功!"); + } + + /// + /// 开始录入:占用成绩 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult StartInputScore(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_线上成绩录入"; + + stuScoreOnlineIBLL.StartInputScore(queryJson); + + //添加任务 + //RecurringJob.AddOrUpdate(name, + // () => SaveInputScoreStatus2(queryJson, name), + // Cron.MinuteInterval(3), TimeZoneInfo.Local); + //var m = DateTime.Now.Minute + 30; + //if (m >= 60) + //{ + // m = m - 60; + //} + var newDate = DateTime.Now.AddMinutes(30); + RecurringJob.AddOrUpdate(name, + () => SaveInputScoreStatus2(queryJson, name), + string.Format("{0} {1} * * *", newDate.Minute, newDate.Hour), TimeZoneInfo.Local); + return Success("操作成功"); + } + /// + /// 续时 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult AddMinutes(string queryJson, int minutes) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_线上成绩录入"; + + //更新任务 + //var m = DateTime.Now.Minute + minutes; + //if (m >= 60) + //{ + // m = m - 60; + //} + 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()) + { + stuScoreOnlineIBLL.SaveInputScore(list); + } + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveInputScoreStatus(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_线上成绩录入"; + + stuScoreOnlineIBLL.SaveInputScoreStatus(queryJson); + //删除任务 + RecurringJob.RemoveIfExists(name); + + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public ActionResult SaveInputScoreStatus2(string queryJson, string name) + { + stuScoreOnlineIBLL.SaveInputScoreStatus2(queryJson, name); + //删除任务 + RecurringJob.RemoveIfExists(name); + + return Success("操作成功"); + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCheckScore(string queryJson, int checkMark) + { + stuScoreOnlineIBLL.DoCheckScore(queryJson, checkMark); + return Success("操作成功"); + } + + + #endregion + + #region 成绩录入--导入 + /// + /// 成绩导入---下载导入模板 + /// + /// + /// 表头 + /// 列表数据 + [HttpPost, ValidateInput(false)] + public void ExportExcel(string fileName, string columnJson, string dataJson) + { + //设置导出格式 + ExcelConfig excelconfig = new ExcelConfig(); + //excelconfig.Title = Server.UrlDecode(fileName); + excelconfig.TitleFont = "微软雅黑"; + excelconfig.TitlePoint = 15; + excelconfig.FileName = Server.UrlDecode(fileName) + ".xls"; + excelconfig.IsAllSizeColumn = true; + excelconfig.ColumnEntity = new List(); + //表头 + List columnList = columnJson.ToList(); + //行数据 + DataTable rowData = dataJson.ToTable(); + ////写入Excel表头 + //Dictionary exportFieldMap = new Dictionary(); + //if (!string.IsNullOrEmpty(exportField)) + //{ + // string[] exportFields = exportField.Split(','); + // foreach (var field in exportFields) + // { + // if (!exportFieldMap.ContainsKey(field)) + // { + // exportFieldMap.Add(field, "1"); + // } + // } + //} + + foreach (jfGridModel columnModel in columnList) + { + //if (exportFieldMap.ContainsKey(columnModel.name) || string.IsNullOrEmpty(exportField)) + //{ + excelconfig.ColumnEntity.Add(new ColumnModel() + { + Column = columnModel.name, + ExcelColumn = columnModel.label, + Alignment = columnModel.align, + }); + + // } + } + ExcelHelper.ExcelDownload(rowData, excelconfig); + } + + /// + /// 成绩导入 + /// + /// 1必修;2选修;3补考成绩;4二次补考成绩 + /// + /// + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult ExecuteImportExcel(int type, string fileGuid, int chunks, string queryJson) + { + string path = annexesFileIBLL.SaveAnnexes(fileGuid, fileGuid, chunks, LoginUserInfo.Get()); + if (!string.IsNullOrEmpty(path)) + { + DataTable dt = ExcelHelper.ExcelImport(path); + (DataTable failDt, int snum, int fnum) res; + + res = stuScoreOnlineIBLL.ExecuteImportExcel(type, dt, fileGuid, queryJson); + + //暂时注释 + //if (type == 1 || type == 2) + //{ + // //必修选修 + // res = stuScoreOnlineIBLL.ExecuteImportExcel(type, dt, fileGuid, queryJson); + //} + //else if (type == 3) + //{ + // //补考 + // res = stuScoreOnlineNotPassIBLL.ExecuteImportExcelForNotPass(dt, fileGuid, queryJson); + //} + //else + //{ + // //二次补考 + // res = stuScoreOnlineNotPassTwoIBLL.ExecuteImportExcelForNotPassTwo(dt, fileGuid, queryJson); + //} + var data = new + { + Success = res.snum, + Fail = res.failDt.Rows.Count + }; + return Success(data); + } + else + { + return Fail("导入数据失败!"); + } + } + + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.cshtml new file mode 100644 index 000000000..2c34f895c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.cshtml @@ -0,0 +1,122 @@ +@{ ViewBag.Title = "全院学生线上成绩录入"; Layout = "~/Views/Shared/_Index.cshtml"; } + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + 开始录入 + 提交成绩 + 审核 + 取消审核 + @* 设置成绩比例*@ + 导入更新 + + + + + + @*比例设置: + 平时成绩占比 0 %, + 期中成绩占比 0 %, + 期末成绩占比 0 %, + 其他成绩占比 0 %*@ + 提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失! + + 倒计时: + 分钟(秒) + 续时 + + + + + + + +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js new file mode 100644 index 000000000..7ae6b5bea --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js @@ -0,0 +1,553 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-12 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: "CheckMark", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == "1" ? "已审核" : "未审核"; + } + }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 40, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + { + label: "学校名称", name: "F_SchoolId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + label: "学院", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: '学生姓名', name: 'StuName', width: 100, align: "left" }, + { label: '学生学号', name: 'StuNo', width: 100, align: "left" }, + ]; + headDataEdit = [ + { + label: '成绩', name: 'TermEndScore', width: 80, align: "left", + edit: { + type: 'input', + inputType: 'number', + change: function (row, rownum) { + row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(2); + $('#gridtable').jfGridSet('updateRow', rownum); + }, + } + }, + { label: '最终核定成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left", + edit: { + type: 'input', + } + }, + ]; + headDataNoEdit = [ + { + label: '成绩', name: 'TermEndScore', width: 80, align: "left" + }, + { 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_setScale').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data["OpenLessonPlan"] != null) { + if (data["OpenLessonPlan"].IsAllowEdit) { //教务允许成绩录入时编辑比例 + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data["StuSelectLessonList"] != null) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { //学生成绩已审核 + learun.alert.warning("学生成绩已审核!"); + return false; + } else { + learun.layerForm({ + id: 'FormOfClass', + title: '班级成绩比例设置', + url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData2); + } + }); + } + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } else { + learun.alert.warning("学生选课数据不存在!"); + return false; + } + }); + } else { + learun.alert.warning("教务不允许设置成绩比例!"); + return false; + } + } else { + learun.alert.warning("开课计划不存在!"); + return false; + } + }); + } + }); + // 开始录入 + $('#lr_input').on('click', function () { + //提示弹框 + learun.layerConfirm('录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!', function (res) { + if (res) { + + var query = judgeSelect(); + if (query) { + //判断成绩比例是否合理 + //var OrdinaryScoreScale = $('#OrdinaryScoreScale').html(); + //var TermInScoreScale = $('#TermInScoreScale').html(); + //var TermEndScoreScale = $('#TermEndScoreScale').html(); + //var OtherScoreScale = $('#OtherScoreScale').html(); + //var totalScale = Number(OrdinaryScoreScale) + Number(TermInScoreScale) + Number(TermEndScoreScale) + Number(OtherScoreScale); + //if (totalScale !== 100) { + // learun.alert.warning("成绩比例设置不合理!"); + // return false; + //} else { + //判断是否已审核;判断是否被其他教师占用 + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + 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/StuScoreOnline/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(); + //显示“倒计时” + $('.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/StuScoreOnline/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + 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/StuScoreOnline/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + if (res.code == 200) { + //提交成绩:取消占用 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/SaveInputScoreStatus', { queryJson: JSON.stringify(query) }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + modifyDate = null; + //隐藏“提交成绩”按钮 + $('#lr_save').hide(); + //显示“开始录入”按钮 + $('#lr_input').show(); + //隐藏“倒计时” + $('.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/StuScoreOnline/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + learun.layerConfirm('是否确认审核当前班级的学生成绩!', function (res) { + if (res) { + //审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 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/StuScoreOnline/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark != 1) { + learun.alert.warning("学生成绩未审核!"); + return false; + } + learun.layerConfirm('是否确认去审核当前班级的学生成绩!', function (res) { + if (res) { + //去审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 0 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("去审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + //续时 + $('#addMinutesBtn').on('click', function () { + var query = judgeSelect(); + if (query) { + clearInterval(timer); + var addMinutes = $('#addMinutesBtn').attr('data-minutes'); + var newMinutes = addMinutes; + var minutes = $('#minutes').html(); + if (minutes > 0) { + newMinutes = Number(newMinutes) + Number(minutes); + } + $('#minutes').html(newMinutes); + page.countDown(); + //修改服务时间 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/AddMinutes', { queryJson: JSON.stringify(query), minutes: newMinutes }, function (res) { }); + } + }); + //导入更新 + $('#lr_importScore').on('click', function () { + //todo: + + }); + }, + bindSelect: function () { + //校区 + $('#F_SchoolId').lrDataSourceSelect({ + code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { } + }); + $('#F_SchoolId').lrselectSet(learun.clientdata.get(['userinfo']).companyId); + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#EmpNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEmpNoDataOfAll?lessonNo=' + item.value, + value: 'value', + text: 'text', + }); + } + } + }); + //教师 + $('#EmpNo').lrselect({ + placeholder: "请选择教师", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEmpNoDataOfAll', + value: 'value', + text: 'text' + }); + //绑定学年、学期 + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + } + }.bind(this), "json"); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetList', + headData: headDataFinally, + mainId: 'ScoreId', + isPage: false, + sidx: 'StuNo', + sord: 'asc' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + searchScale: function (param) { + param = param || {}; + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { + if (data["StuSelectLessonList"] != null) { + var ssll = data["StuSelectLessonList"]; + $('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); + $('#TermInScoreScale').html(ssll.TermInScoreScale > 0 ? ssll.TermInScoreScale : 0); + $('#TermEndScoreScale').html(ssll.TermEndScoreScale > 0 ? ssll.TermEndScoreScale : 0); + $('#OtherScoreScale').html(ssll.OtherScoreScale > 0 ? ssll.OtherScoreScale : 0); + } else { + $('#OrdinaryScoreScale').html(0); + $('#TermInScoreScale').html(0); + $('#TermEndScoreScale').html(0); + $('#OtherScoreScale').html(0); + } + }); + }, + 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/StuScoreOnline/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + }); + }, 300000); + }, + }; + 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 () { + if (CanInputFlag != "True") { + top.learun.layerConfirm('当前时间不是线上成绩录入时间!', function (res) { }); + return false; + } + + var $content = $('body').find('.lr-layout-tool-left'); + var query = $content.lrGetFormData(); + if (query.F_SchoolId == null || query.F_SchoolId == "") { + learun.alert.warning("请选择校区!"); + return false; + } + if (query.AcademicYearNo == null || query.AcademicYearNo == "") { + learun.alert.warning("请选择学年!"); + return false; + } + if (query.Semester == null || query.Semester == "") { + learun.alert.warning("请选择学期!"); + return false; + } + if (query.LessonNo == null || query.LessonNo == "") { + learun.alert.warning("请选择课程!"); + return false; + } + if (query.EmpNo == null || query.EmpNo == "") { + learun.alert.warning("请选择教师!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.cshtml new file mode 100644 index 000000000..46703b746 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "线上成绩录入监控管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + + + + + + + + + + + + + + 查询 + + + + + + + + 强制提交 + + + + + + + +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.js new file mode 100644 index 000000000..b772c7a08 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/Monitor.js @@ -0,0 +1,132 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-14 11:02 + * 描 述:考试成绩同步 + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initGird(); + }, + bind: function () { + //学年 + $('#AcademicYearNo').lrselect({ + width: '150px', + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + width: '150px', + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetSemesterData', + value: 'value', + text: 'text' + }); + // 查询 + $('#btn_Search').on('click', function () { + page.search({ AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet() }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //强制提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + var IsEditable = $('#gridtable').jfGridValue('IsEditable'); + if (IsEditable == "1") { + learun.alert.warning("当前项目无需提交!"); + return; + } + learun.layerConfirm('是否确认提交该项?未保存的成绩将会丢失!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/Submit', + { + AcademicYearNo: $('#gridtable').jfGridValue('AcademicYearNo'), + Semester: $('#gridtable').jfGridValue('Semester'), + LessonNo: $('#gridtable').jfGridValue('LessonNo'), + EmpNo: $('#gridtable').jfGridValue('EmpNo'), + EditUserId: $('#gridtable').jfGridValue('EditUserId'), + }, + function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetMonitorList', + headData: [ + { + label: "录入状态", name: "IsEditable", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == "1" ? "未占用" : "正在录入"; + } + }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 40, align: "left" }, + { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + { 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=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: '占用教师编号', name: 'EditUserId', width: 100, align: "left" }, + { + label: '占用教师姓名', name: 'EditUserId', width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: '开始录入日期', name: 'BeginModifyDate', width: 150, align: "left" }, + { label: '最后保存日期', name: 'ModifyDate', width: 150, align: "left" }, + + ], + //mainId: 'ScoreId', + isPage: false + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + 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 f28aebf75..0621a1e80 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 @@ -340,6 +340,7 @@ + @@ -1030,6 +1031,8 @@ + + @@ -8214,6 +8217,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOnlineMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOnlineMap.cs new file mode 100644 index 000000000..aea32cc0b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/StuScoreOnlineMap.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-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuScoreOnlineMap : EntityTypeConfiguration + { + public StuScoreOnlineMap() + { + #region 表、主键 + //表 + this.ToTable("STUSCOREONLINE"); + //主键 + this.HasKey(t => t.ScoreId); + #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 5ce5ca424..11c7695c4 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 @@ -112,6 +112,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineBLL.cs new file mode 100644 index 000000000..0a2e3839f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineBLL.cs @@ -0,0 +1,1146 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; +using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOnlineService; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuScoreOnlineBLL : StuScoreOnlineIBLL + { + private StuScoreOnlineService stuScoreOnlineService = new StuScoreOnlineService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + public IEnumerable GetList(string queryJson) + { + try + { + return stuScoreOnlineService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public DataTable GetListForExport(string queryJson) + { + try + { + return stuScoreOnlineService.GetListForExport(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetMonitorList(string queryJson) + { + try + { + return stuScoreOnlineService.GetMonitorList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return stuScoreOnlineService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// 主键 + /// + /// + public StuScoreOnlineEntity GetEntity(string keyValue) + { + try + { + return stuScoreOnlineService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetScoreInputCancelPageList(Pagination pagination, string queryJson) + { + try + { + return stuScoreOnlineService.GetScoreInputCancelPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public StuScoreOnlineEntity GetEntityByJson(string queryJson) + { + try + { + return stuScoreOnlineService.GetEntityByJson(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + stuScoreOnlineService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void SubmitStuScoreOnline(string AcademicYearNo, string Semester, string LessonNo, string EmpNo) + { + try + { + stuScoreOnlineService.SubmitStuScoreOnline(AcademicYearNo, Semester, LessonNo, EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuScoreOnlineEntity entity) + { + try + { + stuScoreOnlineService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public void DeleteList() + { + try + { + stuScoreOnlineService.DeleteList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 获取学年学期列表 + /// + /// + public IEnumerable GetAcademicAndSemesterList() + { + try + { + return stuScoreOnlineService.GetAcademicAndSemesterList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 根据学号获取成绩列表 + /// + /// + /// + /// 学号 + /// 班级编号 + /// + public ScoreListByStuNoModel GetScoreListByStuNo(string academic, string semester, string stuNo, string classNo) + { + try + { + return stuScoreOnlineService.GetScoreListByStuNo(academic, semester, stuNo, classNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public bool GetAny() + { + try + { + return stuScoreOnlineService.GetAny(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade) + { + try + { + stuScoreOnlineService.UpEmpNos(xn, xq, classNo, LessonNo, EmpNo, HisEmpNo, Grade); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取一次补考名单数据 + /// + /// + public IEnumerable GetStuScoreOnlineNotPassList() + { + try + { + return stuScoreOnlineService.GetStuScoreOnlineNotPassList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取二次补考名单数据 + /// + /// + public IEnumerable GetStuScoreOnlineNotPassTwoList() + { + try + { + return stuScoreOnlineService.GetStuScoreOnlineNotPassTwoList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取班级成绩初始化信息 + /// + /// + public IEnumerable GetPageListAboutClass(Pagination pagination, string queryJson) + { + try + { + return stuScoreOnlineService.GetPageListAboutClass(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public StuSelectLessonListEntity GetStuSelectLessonListEntity(StuScoreOnlineEntity entity) + { + try + { + return stuScoreOnlineService.GetStuSelectLessonListEntity(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 班级学生成绩初始化 + /// + /// + public void DoInitAboutClass(string academicYearNo, string semester, string classNo) + { + try + { + stuScoreOnlineService.DoInitAboutClass(academicYearNo, semester, classNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 学年下拉框信息【班级成绩查看】 + /// + /// + public IEnumerable GetAcademicYearNoData() + { + try + { + return stuScoreOnlineService.GetAcademicYearNoData(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 班级下拉框信息【班级成绩查看】 + /// + /// + public IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo) + { + try + { + return stuScoreOnlineService.GetClassNoData(userAccount, userType, lessonNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetClassNoDataForInput(string userAccount, string userType, string lessonNo, string academicYearShort, string semester) + { + try + { + return stuScoreOnlineService.GetClassNoDataForInput(userAccount, userType, lessonNo, academicYearShort, semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 教师下拉框信息【学生成绩录入可去审核】 + /// + /// + public IEnumerable GetEmpNoData(string userAccount, string userType, string lessonNo) + { + try + { + return stuScoreOnlineService.GetEmpNoData(userAccount, userType, lessonNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 课程下拉框信息【学生成绩录入可去审核】 + /// + /// + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + return stuScoreOnlineService.GetLessonNoDataOfAll(userAccount, userType, AcademicYearNo, Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 课程下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + return stuScoreOnlineService.GetElectiveLessonNoDataOfAll(userAccount, userType, AcademicYearNo, Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo) + { + try + { + return stuScoreOnlineService.GetElectiveClassRoomNoData(userAccount, userType, lessonNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo) + { + try + { + return stuScoreOnlineService.GetElectiveLessonSectionData(userAccount, userType, classRoomNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 课程信息【班级成绩查看】 + /// + /// + public IEnumerable GetLessonNoData(string academicYearNo, string semester, string classNo) + { + try + { + return stuScoreOnlineService.GetLessonNoData(academicYearNo, semester, classNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取班级成绩列表 + /// + /// + public IEnumerable GetScoreListByClassNo(string queryJson) + { + try + { + return stuScoreOnlineService.GetScoreListByClassNo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetScoreListByClassNoForScholarship(string queryJson) + { + try + { + return stuScoreOnlineService.GetScoreListByClassNoForScholarship(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetScoreListByStuNo(string queryJson) + { + try + { + return stuScoreOnlineService.GetScoreListByStuNo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 根据学号/姓名获取学生成绩列表 + /// + /// + /// + public IEnumerable GetScoreListByStuInfo(string queryJson) + { + try + { + return stuScoreOnlineService.GetScoreListByStuInfo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public List GetStuGraduateInfo(string queryJson) + { + try + { + return stuScoreOnlineService.GetStuGraduateInfo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public List GetPassInfo(string queryJson) + { + try + { + return stuScoreOnlineService.GetPassInfo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public List GetClassOfMy() + { + try + { + return stuScoreOnlineService.GetClassOfMy(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取个人成绩列表 + /// + /// + public IEnumerable GetAllScoreListByStuNo(string stuNo) + { + try + { + return stuScoreOnlineService.GetAllScoreListByStuNo(stuNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public object GetScoreCharts(string academicYearNo, string semester, string classNo, string lessonNo) + { + try + { + var data = stuScoreOnlineService.GetScoreCharts(academicYearNo, semester, classNo, lessonNo); + return data; + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public List GetScoreInfo(string queryJson) + { + try + { + var data = stuScoreOnlineService.GetScoreInfo(queryJson); + return data; + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 审核学生成绩 + /// 主键 + /// + /// + public void CheckStuScoreOnline(string keyValue) + { + try + { + stuScoreOnlineService.CheckStuScoreOnline(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 去审核学生成绩 + /// 主键 + /// + /// + public void UnCheckStuScoreOnline(string keyValue) + { + try + { + stuScoreOnlineService.UnCheckStuScoreOnline(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取个人补考成绩 + /// + /// + public StuScoreOnlineEntity GetScoreNotPassByEntity(StuScoreOnlineEntity entity) + { + try + { + return stuScoreOnlineService.GetScoreNotPassByEntity(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取个人二次补考成绩 + /// + /// + public StuScoreOnlineEntity GetScoreNotPassTwoByEntity(StuScoreOnlineEntity entity) + { + try + { + return stuScoreOnlineService.GetScoreNotPassTwoByEntity(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + stuScoreOnlineService.StartInputScore(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 提交成绩 + /// + /// + public void SaveInputScore(List list) + { + try + { + stuScoreOnlineService.SaveInputScore(list); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + stuScoreOnlineService.SaveInputScoreStatus(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public void SaveInputScoreStatus2(string queryJson, string name) + { + try + { + stuScoreOnlineService.SaveInputScoreStatus2(queryJson, name); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + public void DoCheckScore(string queryJson, int checkMark) + { + try + { + stuScoreOnlineService.DoCheckScore(queryJson, checkMark); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) + { + try + { + return stuScoreOnlineService.GetLessonNoDataFromStuNo(academicYearNo, semester, stuNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 成绩导入 + /// + /// + /// + /// + /// + /// + public (DataTable failDt, int snum, int fnum) ExecuteImportExcel(int type, DataTable dt, string fileGuid, string queryJson) + { + try + { + return stuScoreOnlineService.ExecuteImportExcel(type, dt, fileGuid, queryJson); + + } + 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/StuScoreOnline/StuScoreOnlineEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineEntity.cs new file mode 100644 index 000000000..998f8de7f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineEntity.cs @@ -0,0 +1,452 @@ +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 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuScoreOnlineEntity + { + #region 实体成员 + /// + /// ScoreId + /// + /// + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("SCOREID")] + public int? ScoreId { get; set; } + /// + /// 通知书号 + /// + /// + [Column("NOTICEBOOKNO")] + public string NoticeBookNo { get; set; } + /// + /// 学号 + /// + /// + [Column("STUNO")] + public string StuNo { get; set; } + /// + /// 学生所在系部 + /// + /// + [Column("DEPTNO")] + public string DeptNo { get; set; } + /// + /// 学生所在专业号 + /// + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// 行政班号 + /// + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// 姓名 + /// + /// + [Column("STUNAME")] + public string StuName { get; set; } + /// + /// GenderNo + /// + /// + [Column("GENDERNO")] + public string GenderNo { get; set; } + /// + /// 学年度 + /// + /// + [Column("ACADEMICYEARNO")] + public string AcademicYearNo { get; set; } + /// + /// 学期 + /// + /// + [Column("SEMESTER")] + public string Semester { get; set; } + /// + /// 开课系部码 + /// + /// + [Column("OPENLESSONDEPTNO")] + public string OpenLessonDeptNo { get; set; } + /// + /// 开课专业码 + /// + /// + [Column("OPENLESSONMAJORNO")] + public string OpenLessonMajorNo { get; set; } + /// + /// 课程号 + /// + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + /// + /// 课程名称 + /// + /// + [Column("LESSONNAME")] + public string LessonName { get; set; } + /// + /// LessonNameEn + /// + /// + [Column("LESSONNAMEEN")] + public string LessonNameEn { get; set; } + /// + /// 教学班号 + /// + /// + [Column("TEACHCLASSNO")] + public string TeachClassNo { get; set; } + /// + /// 课程类别码 + /// + /// + [Column("LESSONSORTNO")] + public string LessonSortNo { get; set; } + /// + /// 学生类别 + /// + /// + [Column("STUSORTNO")] + public string StuSortNo { get; set; } + /// + /// 年级 + /// + /// + [Column("GRADE")] + public string Grade { get; set; } + /// + /// 学分 + /// + /// + [Column("STUDYSCORE")] + public decimal? StudyScore { get; set; } + /// + /// 总学时 + /// + /// + [Column("TOTALSTUDYHOUR")] + public decimal? TotalStudyHour { get; set; } + /// + /// 专业属性 + /// + /// + [Column("ZYSX")] + public string zysx { get; set; } + /// + /// 考核(试)方式码(关联表BCdTestMode) + /// + /// + [Column("TESTMODENO")] + public string TestModeNo { get; set; } + /// + /// ScoreRecordStyleNo + /// + /// + [Column("SCORERECORDSTYLENO")] + public string ScoreRecordStyleNo { get; set; } + /// + /// 平时成绩 + /// + /// + [Column("ORDINARYSCORE")] + public decimal? OrdinaryScore { get; set; } + /// + /// 期中成绩 + /// + /// + [Column("TERMINSCORE")] + public decimal? TermInScore { get; set; } + /// + /// 期末成绩 学期 + /// + /// + [Column("TERMENDSCORE")] + public decimal? TermEndScore { get; set; } + /// + /// OtherScore + /// + /// + [Column("OTHERSCORE")] + public decimal? OtherScore { get; set; } + /// + /// 总评成绩 + /// + /// + [Column("SCORE")] + public decimal? Score { get; set; } + /// + /// 绩点 + /// + /// + [Column("SCOREPOINT")] + public decimal? ScorePoint { get; set; } + /// + /// 考试日期 + /// + /// + [Column("TESTDATE")] + public DateTime? TestDate { get; set; } + /// + /// 是否有效 + /// + /// + [Column("ISINEFFECT")] + public string IsInEffect { get; set; } + /// + /// 备注 + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 冲突课程代码 + /// + /// + [Column("CONFLICTLESSONNO")] + public string ConflictLessonNo { get; set; } + /// + /// 是否重修成绩 + /// + /// + [Column("ISRESTUDY")] + public string IsReStudy { get; set; } + /// + /// 审查标志 + /// + /// + [Column("CHECKMARK")] + public string CheckMark { get; set; } + /// + /// 是否选中 + /// + /// + [Column("ISPITCHON")] + public string IsPitchOn { get; set; } + /// + /// 教师号 + /// + /// + [Column("EMPNO")] + public string EmpNo { get; set; } + /// + /// 专业教学计划编码 + /// + /// + [Column("TECHPLANNO")] + public string TechPlanNo { get; set; } + /// + /// 考试性质码(关联表CdTestKind) + /// + /// + [Column("TESTKINDNO")] + public string TestKindNo { get; set; } + /// + /// 课程区别码(此编码针对同一课程编号,同一门课程、不同课时、学分的情况而加,由系统自动产生以区分此类课程) + /// + /// + [Column("PARTCODE")] + public string PartCode { get; set; } + /// + /// LessonSection + /// + /// + [Column("LESSONSECTION")] + public string LessonSection { get; set; } + /// + /// ClassRoomNo + /// + /// + [Column("CLASSROOMNO")] + public string ClassRoomNo { get; set; } + /// + /// ClassRoomName + /// + /// + [Column("CLASSROOMNAME")] + public string ClassRoomName { get; set; } + /// + /// IsEditable + /// + /// + [Column("ISEDITABLE")] + public string IsEditable { get; set; } + /// + /// EditUserId + /// + /// + [Column("EDITUSERID")] + public string EditUserId { get; set; } + /// + /// ModifyDate + /// + /// + [Column("MODIFYDATE")] + public DateTime? ModifyDate { get; set; } + + [Column("BEGINMODIFYDATE")] + public DateTime? BeginModifyDate { get; set; } + /// + /// ModifyUserId + /// + /// + [Column("MODIFYUSERID")] + public string ModifyUserId { get; set; } + /// + /// ModifyUserName + /// + /// + [Column("MODIFYUSERNAME")] + public string ModifyUserName { get; set; } + /// + /// 学校主键 + /// + /// + [Column("F_SCHOOLID")] + public string F_SchoolId { get; set; } + + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + } + /// + /// 编辑调用 + /// + /// + public void Modify(int? keyValue) + { + this.ScoreId = keyValue; + } + #endregion + + + /// + /// 学生Id + /// + [NotMapped] + public string StuId { get; set; } + /// + /// 课程Id + /// + [NotMapped] + public string LessonId { get; set; } + /// + /// 班级名称 + /// + [NotMapped] + public string ClassName { get; set; } + /// + /// 班级Id + /// + [NotMapped] + public string ClassId { get; set; } + /// + /// 教师姓名 + /// + [NotMapped] + public string EmpName { get; set; } + /// + /// 教师主键 + /// + [NotMapped] + public string EmpId { get; set; } + /// + /// 补考标识(1:一次补考;2:二次补考) + /// + [NotMapped] + public int BuKaoFlag { get; set; } + /// + /// 学生成绩数量 + /// + [NotMapped] + public int StuScoreOnlineNum { get; set; } + /// + /// 临时主键 + /// + [NotMapped] + public string TempId { get; set; } + [NotMapped] + public string DepositBank { get; set; } + [NotMapped] + public string BankCard { get; set; } + [NotMapped] + public string IdCard { get; set; } + [NotMapped] + public string Birthday { get; set; } + [NotMapped] + public string NationalityNo { get; set; } + [NotMapped] + public string PartyFaceNo { get; set; } + + + /// + /// 成绩格式化(补)(重)(选修) + /// + [NotMapped] + public string ScoreFormat { get; set; } + + /// + /// 补考成绩 + /// + [NotMapped] + public string ScoreOfNotPass { get; set; } + /// + /// 二次补考成绩 + /// + [NotMapped] + public string ScoreOfNotPassTwo { get; set; } + /// + /// 课程类别名称 + /// + /// + [NotMapped] + public string LessonSortName { get; set; } + /// + /// 专业名称 + /// + [NotMapped] + public string MajorName { get; set; } + /// + /// 专业排名 + /// + [NotMapped] + public int RankInMajor { get; set; } + /// + /// 班级排名 + /// + [NotMapped] + public int RankInClass { get; set; } + /// + /// 学习形式 + /// + [NotMapped] + public string StudyModality { get; set; } + /// + /// 异动类型 + /// + [NotMapped] + public string MoveType { get; set; } + + + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineIBLL.cs new file mode 100644 index 000000000..1c9c9437e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineIBLL.cs @@ -0,0 +1,261 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; +using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOnlineService; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public interface StuScoreOnlineIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + IEnumerable GetList(string queryJson); + DataTable GetListForExport(string queryJson); + + IEnumerable GetMonitorList(string queryJson); + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// 主键 + /// + /// + StuScoreOnlineEntity GetEntity(string keyValue); + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetScoreInputCancelPageList(Pagination pagination, string queryJson); + + + List GetStuGraduateInfo(string queryJson); + List GetPassInfo(string queryJson); + List GetClassOfMy(); + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + StuSelectLessonListEntity GetStuSelectLessonListEntity(StuScoreOnlineEntity entity); + + /// + /// 获取列表数据 + /// + /// + StuScoreOnlineEntity GetEntityByJson(string queryJson); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + void SubmitStuScoreOnline(string AcademicYearNo, string Semester, string LessonNo, string EmpNo); + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, StuScoreOnlineEntity entity); + #endregion + + void DeleteList(); + + #region 扩展数据 + + /// + /// 获取学年学期列表 + /// + /// + IEnumerable GetAcademicAndSemesterList(); + /// + /// 根据学号获取成绩列表 + /// + /// + /// + /// 学号 + /// 班级编号 + /// + ScoreListByStuNoModel GetScoreListByStuNo(string academic, string semester, string stuNo, string classNo); + bool GetAny(); + + + /// + /// 获取一次补考名单数据 + /// + /// + IEnumerable GetStuScoreOnlineNotPassList(); + + /// + /// 获取二次补考名单数据 + /// + /// + IEnumerable GetStuScoreOnlineNotPassTwoList(); + + /// + /// 获取班级成绩初始化信息 + /// + /// + IEnumerable GetPageListAboutClass(Pagination pagination, string queryJson); + + /// + /// 班级学生成绩初始化 + /// + /// + void DoInitAboutClass(string academicYearNo, string semester, string classNo); + + /// + /// 学年下拉框信息【班级成绩查看】 + /// + /// + IEnumerable GetAcademicYearNoData(); + + /// + /// 班级下拉框信息【班级成绩查看】 + /// + /// + IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo); + IEnumerable GetClassNoDataForInput(string userAccount, string userType, string lessonNo, string academicYearShort, string semester); + + /// + /// 教师下拉框信息【学生成绩录入可去审核】 + /// + /// + IEnumerable GetEmpNoData(string userAccount, string userType, string lessonNo); + + /// + /// 课程下拉框信息【学生成绩录入可去审核】 + /// + /// + IEnumerable GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = ""); + + /// + /// 课程下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = ""); + + /// + /// 教室下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo); + + /// + /// 节次下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo); + + /// + /// 课程信息【班级成绩查看】 + /// + /// + IEnumerable GetLessonNoData(string academicYearNo, string semester, string classNo); + + /// + /// 获取班级成绩列表 + /// + /// + IEnumerable GetScoreListByClassNo(string queryJson); + IEnumerable GetScoreListByClassNoForScholarship(string queryJson); + /// + /// 获取学生成绩 + /// + /// + /// + IEnumerable GetScoreListByStuNo(string queryJson); + /// + /// 根据学号/姓名获取学生成绩列表 + /// + /// + /// + IEnumerable GetScoreListByStuInfo(string queryJson); + + /// + /// 获取个人成绩列表 + /// + /// + IEnumerable GetAllScoreListByStuNo(string stuNo); + object GetScoreCharts(string academicYearNo, string semester, string classNo, string lessonNo); + void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade); + + + /// + /// 审核学生成绩 + /// 主键 + /// + /// + void CheckStuScoreOnline(string keyValue); + /// + /// 去审核学生成绩 + /// 主键 + /// + /// + void UnCheckStuScoreOnline(string keyValue); + List GetScoreInfo(string queryJson); + + /// + /// 获取个人补考成绩 + /// + /// + StuScoreOnlineEntity GetScoreNotPassByEntity(StuScoreOnlineEntity entity); + + /// + /// 获取个人二次补考成绩 + /// + /// + StuScoreOnlineEntity GetScoreNotPassTwoByEntity(StuScoreOnlineEntity entity); + /// + /// 开始录入:占用成绩 + /// + /// + void StartInputScore(string queryJson); + /// + /// 提交成绩 + /// + /// + void SaveInputScore(List list); + /// + /// 提交成绩:取消占用 + /// + /// + void SaveInputScoreStatus(string queryJson); + /// + /// 提交成绩:取消占用【服务】 + /// + /// + void SaveInputScoreStatus2(string queryJson, string name); + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + void DoCheckScore(string queryJson, int checkMark); + + (DataTable failDt, int snum, int fnum) ExecuteImportExcel(int type, DataTable dt, string fileGuid, string queryJson); + + #endregion + + IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo); + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineService.cs new file mode 100644 index 000000000..5a628a84c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineService.cs @@ -0,0 +1,2468 @@ +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; +using Learun.Cache.Base; +using Learun.Cache.Factory; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-06-14 11:02 + /// 描 述:考试成绩同步 + /// + public class StuScoreOnlineService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + public StuScoreOnlineService() + { + fieldSql = @" + t.ScoreId, + t.NoticeBookNo, + t.StuNo, + t.DeptNo, + t.MajorNo, + t.ClassNo, + t.StuName, + t.GenderNo, + t.AcademicYearNo, + t.Semester, + t.OpenLessonDeptNo, + t.OpenLessonMajorNo, + t.LessonNo, + t.LessonName, + t.LessonNameEn, + t.TeachClassNo, + t.LessonSortNo, + t.StuSortNo, + t.Grade, + t.StudyScore, + t.TotalStudyHour, + t.zysx, + t.TestModeNo, + t.ScoreRecordStyleNo, + t.OrdinaryScore, + t.TermInScore, + t.TermEndScore, + t.OtherScore, + t.Score, + t.ScorePoint, + t.TestDate, + t.IsInEffect, + t.Remark, + t.ConflictLessonNo, + t.IsReStudy, + t.CheckMark, + t.IsPitchOn, + t.EmpNo, + t.TechPlanNo, + t.TestKindNo, + t.PartCode, + t.LessonSection, + t.ClassRoomNo, + t.ClassRoomName, + t.IsEditable, + t.EditUserId, + t.ModifyDate, + t.ModifyUserId, + t.ModifyUserName + "; + } + #endregion + #region 缓存定义 + private ICache cache = CacheFactory.CaChe(); + private string cacheKey = "Learun_adms_excelError_"; + #endregion + #region 获取数据 + + public IEnumerable GetMonitorList(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var strSql = new StringBuilder(); + strSql.Append("select AcademicYearNo,Semester,lessonno,LessonName,EmpNo,IsEditable,EditUserId,BeginModifyDate,ModifyDate from StuScoreOnline where 1=1 "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and AcademicYearNo = @AcademicYearNo "); + dp.Add("AcademicYearNo", "" + queryParam["AcademicYearNo"].ToString() + "", DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and Semester =@Semester "); + dp.Add("Semester", "" + queryParam["Semester"].ToString() + "", DbType.String); + } + if (!queryParam["LessonSortNo"].IsEmpty()) + { + strSql.Append(" and LessonSortNo =@LessonSortNo "); + dp.Add("LessonSortNo", "" + queryParam["LessonSortNo"].ToString() + "", DbType.String); + } + strSql.Append(" group by AcademicYearNo,Semester,lessonno,LessonName, EmpNo, IsEditable, EditUserId, BeginModifyDate, ModifyDate "); + strSql.Append(" order by IsEditable, BeginModifyDate, edituserid,AcademicYearNo,Semester,LessonNo "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + 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 t.*,sb.StudyModality,sb.MoveType FROM StuScoreOnline t "); + strSql.Append(" left join StuInfoBasic sb on t.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 "); + + //学籍异动的学生不显示 + //strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus=1) "); + //20220616改 休学的要录入成绩,退学和转校的不用 + strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasicChange where StuChangeType in('04','06')) "); + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + strSql.Append(" and t.F_SchoolId=@F_SchoolId "); + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["LessonName"].IsEmpty()) + { + strSql.Append(" and t.LessonName=@LessonName "); + dp.Add("LessonName", queryParam["LessonName"].ToString(), DbType.String); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append(" and t.EmpNo=@EmpNo "); + dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); + dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); + } + if (!queryParam["LessonSection"].IsEmpty()) + { + strSql.Append(" and t.LessonSection=@LessonSection "); + dp.Add("LessonSection", queryParam["LessonSection"].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 DataTable GetListForExport(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.*,sb.StudyModality,sb.MoveType FROM StuScoreOnline t "); + strSql.Append(" left join StuInfoBasic sb on t.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 "); + + //学籍异动的学生不显示 + //strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus=1) "); + //20220616改 休学的要录入成绩,退学和转校的不用 + strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasicChange where StuChangeType in('04','06')) "); + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + strSql.Append(" and t.F_SchoolId=@F_SchoolId "); + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); + dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); + } + if (!queryParam["LessonSection"].IsEmpty()) + { + strSql.Append(" and t.LessonSection=@LessonSection "); + dp.Add("LessonSection", queryParam["LessonSection"].ToString(), DbType.String); + } + + return new DataTable(); //this.BaseRepository("CollegeMIS").FindList(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 StuScoreOnline 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 StuScoreOnlineEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(Convert.ToInt32(keyValue)); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetScoreInputCancelPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT * FROM StuScoreOnline t where 1=1 "); + + var loginInfo = LoginUserInfo.Get(); + if (loginInfo.Description == "教师") + { + strSql.Append(" and t.EmpNo='" + loginInfo.account + "' "); + } + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append(" and t.EmpNo=@EmpNo "); + dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + if (!queryParam["StuNo"].IsEmpty()) + { + strSql.Append(" and t.StuNo=@StuNo "); + dp.Add("StuNo", queryParam["StuNo"].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 StuSelectLessonListEntity GetStuSelectLessonListEntity(StuScoreOnlineEntity entity) + { + try + { + var model = this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.EmpNo == entity.EmpNo && x.LessonNo == entity.LessonNo && x.ClassNo == entity.ClassNo && x.StuNo == entity.StuNo); + return model; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表数据 + /// + /// + public StuScoreOnlineEntity GetEntityByJson(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* FROM StuScoreOnline t where 1=1 "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + strSql.Append(" and t.F_SchoolId=@F_SchoolId "); + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and t.AcademicYearNo=@AcademicYearNo "); + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and t.Semester=@Semester "); + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + strSql.Append(" and t.LessonNo=@LessonNo "); + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + strSql.Append(" and t.EmpNo=@EmpNo "); + dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + strSql.Append(" and t.ClassNo=@ClassNo "); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + } + if (!queryParam["LessonSection"].IsEmpty()) + { + strSql.Append(" and t.LessonSection=@LessonSection "); + dp.Add("LessonSection", queryParam["LessonSection"].ToString(), DbType.String); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); + dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); + } + return this.BaseRepository("CollegeMIS").FindEntity(strSql.ToString(), dp); + } + 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.ScoreId == Convert.ToInt32(keyValue)); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void SubmitStuScoreOnline(string AcademicYearNo, string Semester, string LessonNo, string EmpNo) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql( + @"update StuScoreOnline set IsEditable=1,EditUserId=null,BeginModifyDate=null + where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + + LessonNo + "' and EmpNo='" + EmpNo + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, StuScoreOnlineEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(Convert.ToInt32(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); + } + } + } + + internal bool GetAny() + { + try + { + var yearAndSemester = Common.GetSemesterAndYear(); + return this.BaseRepository("CollegeMIS").FindList(a => a.AcademicYearNo == yearAndSemester.AcademicYearShort && a.Semester == yearAndSemester.Semester).Any(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string hisempno, string Grade) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(" update StuScoreOnline set EmpNo ='" + EmpNo + "' where classno = '" + classNo + "' and Semester ='" + xq + "' and AcademicYearNo ='" + xn + "' and LessonNo ='" + LessonNo + "' and empno = '" + hisempno + "' and Grade='" + Grade + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql(sb.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + private static HttpClient Client; + + internal List GetScoreInfo(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var academicYearNo = queryParam["AcademicYearNo"].ToString(); + var semester = queryParam["Semester"].ToString(); + var classNo = queryParam["ClassNo"].ToString(); + var lessonNo = queryParam["LessonNo"].ToString(); + + var data = this.BaseRepository("CollegeMIS").FindList(a => a.AcademicYearNo == academicYearNo && a.Semester == semester && a.ClassNo == classNo && a.LessonNo == lessonNo).OrderByDescending(a => a.Score).ToList(); + //及格的 + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + internal object GetScoreCharts(string academicYearNo, string semester, string classNo, string lessonNo) + { + try + { + var aab = new List(); + var data = this.BaseRepository("CollegeMIS").FindList(a => a.AcademicYearNo == academicYearNo && a.Semester == semester && a.ClassNo == classNo && a.LessonNo == lessonNo).ToList(); + //及格的 + aab.Add(new { name = "及格", value = data.Count(a => a.Score >= 60).ToString() }); + //不及格的 + aab.Add(new { name = "不及格", value = data.Count(a => a.Score < 60).ToString() }); + var aaa = new List { "及格", "不及格" }; + var aa = new { aaa, aab }; + + + var bbb = new List(); + bbb.Add(new { name = "80-100", value = data.Count(a => a.Score >= 80).ToString() }); + bbb.Add(new { name = "60-80", value = data.Count(a => a.Score >= 60 && a.Score < 80).ToString() }); + bbb.Add(new { name = "0-60", value = data.Count(a => a.Score >= 0 && a.Score < 60).ToString() }); + var bba = new List { "80-100", "60-80", "0-60" }; + var bb = new { bba, bbb }; + + return new { aa, bb }; + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void DeleteList() + { + try + { + var semesterAndYear = Common.GetSemesterAndYear(); + var strAcademicYear = semesterAndYear.AcademicYearShort; + var strSemester = semesterAndYear.Semester; + BaseRepository("CollegeMIS").ExecuteBySql("delete from StuScoreOnline where AcademicYearNo = '" + strAcademicYear + "' and Semester = '" + strSemester + "'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + + } + + #region 扩展数据 + + /// + /// 获取学年学期列表 + /// + /// + public IEnumerable GetAcademicAndSemesterList() + { + try + { + var aa = this.BaseRepository("CollegeMIS").FindList(x => !string.IsNullOrEmpty(x.AcademicYearNo) && !string.IsNullOrEmpty(x.Semester)); + var aaa = aa.ToList().GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new WebHelper.YearGrade() + { + text = string.Format("{0}学年第{1}学期", x.Key.AcademicYearNo, x.Key.Semester), + value = string.Format("{0},{1}", x.Key.AcademicYearNo, x.Key.Semester) + }); + return aaa; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 根据学号获取成绩列表 + /// + /// + /// + /// 学号 + /// 班级编号 + /// + public ScoreListByStuNoModel GetScoreListByStuNo(string academic, string semester, string stuNo, string classNo) + { + try + { + var result = new ScoreListByStuNoModel(); + + //获取已审核成绩列表 + var stuScoreOnlineList = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academic && x.Semester == semester && x.StuNo == stuNo && x.CheckMark == "1"); + foreach (var scoreEntity in stuScoreOnlineList) + { + if (scoreEntity.LessonSortNo == "2") + { + scoreEntity.LessonName = scoreEntity.LessonName + "(选修)"; + } + else + { + if (scoreEntity.Score < 60) + { + //暂时注释 + //var notpass = this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == scoreEntity.AcademicYearNo && x.Semester == scoreEntity.Semester && x.StuNo == scoreEntity.StuNo && x.LessonNo == scoreEntity.LessonNo && x.CheckMark == "1"); + //if (notpass != null) + //{ + // if (notpass.Score >= 60) + // { + // scoreEntity.Score = notpass.Score; + // } + // else + // { + // var notpasstwo = this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == scoreEntity.AcademicYearNo && x.Semester == scoreEntity.Semester && x.StuNo == scoreEntity.StuNo && x.LessonNo == scoreEntity.LessonNo && x.CheckMark == "1"); + // if (notpasstwo != null) + // { + // if (notpasstwo.Score >= 60) + // { + // scoreEntity.Score = notpasstwo.Score; + // } + // } + // } + //} + } + } + } + result.ScoreList = stuScoreOnlineList.ToList(); + //获取排名、综合成绩 + var aa = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academic && x.Semester == semester && x.ClassNo == classNo && x.CheckMark == "1" && x.LessonSortNo == "1"); + var aaa = aa.GroupBy(x => x.StuNo).Select(x => new + { + StuNo = x.Key, + Score = x.Select(y => y.Score).Sum() + }).OrderByDescending(x => x.Score); + if (aaa.Any()) + { + var rank = aaa.Select(x => x.StuNo).ToList().IndexOf(stuNo); + var totalScore = aaa.FirstOrDefault(x => x.StuNo == stuNo)?.Score; + + result.Rank = rank + 1; + result.TotalScore = totalScore.Value; + } + + return result; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public class ScoreListByStuNoModel + { + /// + /// 成绩列表 + /// + public List ScoreList { get; set; } + /// + /// 排名 + /// + public int Rank { get; set; } + /// + /// 综合成绩 + /// + public decimal TotalScore { get; set; } + } + + /// + /// 获取一次补考名单数据 + /// + /// + public IEnumerable GetStuScoreOnlineNotPassList() + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.AcademicYearNo,s.Semester,s.StuNo,s.StuName,si.StuId,s.LessonNo,s.LessonName,l.LessonId,s.ClassNo,c.ClassName,c.ClassId,s.EmpNo,e.EmpName,e.EmpId,1 AS BuKaoFlag "); + strSql.Append(" from StuScoreOnlineNotPass s left join ClassInfo c on s.ClassNo=c.ClassNo left join EmpInfo e on s.EmpNo=e.EmpNo left join StuInfoBasic si on s.StuNo=si.StuNo left join LessonInfo l on s.LessonNo=l.LessonNo "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取二次补考名单数据 + /// + /// + public IEnumerable GetStuScoreOnlineNotPassTwoList() + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.AcademicYearNo,s.Semester,s.StuNo,s.StuName,si.StuId,s.LessonNo,s.LessonName,l.LessonId,s.ClassNo,c.ClassName,c.ClassId,s.EmpNo,e.EmpName,e.EmpId,2 AS BuKaoFlag "); + strSql.Append(" from StuScoreOnlineNotPassTwo s left join ClassInfo c on s.ClassNo=c.ClassNo left join EmpInfo e on s.EmpNo=e.EmpNo left join StuInfoBasic si on s.StuNo=si.StuNo left join LessonInfo l on s.LessonNo=l.LessonNo "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取班级成绩初始化信息 + /// + /// + public IEnumerable GetPageListAboutClass(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.AcademicYearNo+'/'+s.Semester+'/'+s.ClassNo as TempId,s.AcademicYearNo,s.Semester,s.ClassNo,c.ClassName,count(s.scoreid) as StuScoreOnlineNum "); + strSql.Append(" FROM stuscore s inner join classinfo c on s.ClassNo=c.ClassNo "); + + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + if (!queryParam["keyword"].IsEmpty()) + { + strSql.Append(" where c.classname like @keyword "); + dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + } + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,c.ClassName "); + + return this.BaseRepository("CollegeMIS").FindList