diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs index 10a625b59..ba7ff974f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleBLL.cs @@ -101,6 +101,24 @@ namespace Learun.Application.Organization } } } + public RoleEntity GetEntityByRoleCode(string code) + { + try + { + return roleService.GetEntityByRoleCode(code); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取分页数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs index ab41230e9..f95fc1c9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleIBLL.cs @@ -36,7 +36,8 @@ namespace Learun.Application.Organization /// /// RoleEntity GetRoleByRoleName(string roleName); - /// + RoleEntity GetEntityByRoleCode(string code); + /// /// 获取角色数据列表 /// /// 主键串 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleService.cs index 3fc54ab3f..9b1a8c3dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/Role/RoleService.cs @@ -231,5 +231,24 @@ namespace Learun.Application.Organization } #endregion + + public RoleEntity GetEntityByRoleCode(string code) + { + try + { + return this.BaseRepository().FindEntity(a => a.F_EnCode == code); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs index 3a40da078..21216a2f6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs @@ -5,6 +5,7 @@ using System.Web.Mvc; using System.Collections.Generic; using System.Linq; using System; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -19,6 +20,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { private Exam_ArrangeExamTermNewIBLL exam_ArrangeExamTermNewIBLL = new Exam_ArrangeExamTermNewBLL(); private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); #region 视图功能 @@ -47,11 +50,29 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult IndexForClass() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } [HttpGet] public ActionResult IndexItem() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -71,6 +92,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult IndexClassRoom() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } #endregion @@ -95,7 +125,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult GetClassTree() { - return Success(exam_ArrangeExamTermNewIBLL.GetClassTree()); + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + return Success(exam_ArrangeExamTermNewIBLL.GetClassTree(empinfo.DeptNo)); + } + else + return Success(exam_ArrangeExamTermNewIBLL.GetClassTree("")); + } + else + return Success(exam_ArrangeExamTermNewIBLL.GetClassTree("")); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs index 2443f0bb3..79aecafef 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,6 +17,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_ExamLessonController : MvcControllerBase { private Exam_ExamLessonIBLL exam_ExamLessonIBLL = new Exam_ExamLessonBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); + #region 视图功能 @@ -26,6 +30,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -44,6 +57,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormYearSemester() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -119,9 +141,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult Import(string AcademicYearNo, string Semester,string ExamTime) + public ActionResult Import(string AcademicYearNo, string Semester,string ExamTime,string ImportDeptNo) { - int res = exam_ExamLessonIBLL.Import(AcademicYearNo, Semester, ExamTime); + int res = exam_ExamLessonIBLL.Import(AcademicYearNo, Semester, ExamTime, ImportDeptNo); return Success("导入" + res + "条数据!"); } /// @@ -130,9 +152,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + public ActionResult DeleteWhere(string AcademicYearNo, string Semester,string ImportDeptNo) { - int res = exam_ExamLessonIBLL.DeleteWhere(AcademicYearNo, Semester); + int res = exam_ExamLessonIBLL.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); return Success("清空" + res + "条数据!"); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs index 1426f30ad..74b5924f4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs @@ -5,6 +5,7 @@ using System.Web.Mvc; using System.Collections.Generic; using System; using System.Linq; +using Learun.Application.Organization; using Newtonsoft.Json; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers @@ -22,6 +23,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); #region 视图功能 @@ -32,6 +35,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -41,6 +53,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs index c2ee9a8f6..5b441a152 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,6 +17,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_ExamRoomController : MvcControllerBase { private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); #region 视图功能 @@ -26,6 +29,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -44,6 +56,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormYearSemester() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } @@ -111,9 +132,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) + public ActionResult Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns, string ImportDeptNo) { - int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); + int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester,SeatRows,SeatColumns, ImportDeptNo); return Success("导入" + res + "条数据!"); } /// @@ -122,9 +143,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + public ActionResult DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { - int res = exam_ExamRoomIBLL.DeleteWhere(AcademicYearNo, Semester); + int res = exam_ExamRoomIBLL.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); return Success("清空" + res + "条数据!"); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs index f34ba8599..b07ce4851 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,6 +17,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_ExamStudentController : MvcControllerBase { private Exam_ExamStudentIBLL exam_ExamStudentIBLL = new Exam_ExamStudentBLL(); + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); #region 视图功能 @@ -26,6 +29,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -44,6 +56,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormImport() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } /// @@ -53,6 +74,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormClear() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } @@ -169,15 +199,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpPost] [AjaxOnly] [ValidateAntiForgeryToken] - public ActionResult ClearTable(string AcademicYearNo, string Semester, string ESType) + public ActionResult ClearTable(string AcademicYearNo, string Semester, string ESType, string ImportDeptNo) { - int res = exam_ExamStudentIBLL.ClaerForm(AcademicYearNo, Semester, ESType); + int res = exam_ExamStudentIBLL.ClaerForm(AcademicYearNo, Semester, ESType, ImportDeptNo); return Success("清空(" + res + ")条数据成功!"); } - public ActionResult ImportTable(string AcademicYearNo, int Semester, string ESType) + public ActionResult ImportTable(string AcademicYearNo, int Semester, string ESType, string ImportDeptNo) { - int res = exam_ExamStudentIBLL.ImportForm(AcademicYearNo, Semester, ESType); + int res = exam_ExamStudentIBLL.ImportForm(AcademicYearNo, Semester, ESType, ImportDeptNo); return Success("同步(" + res + ")条数据成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs index 1eba6143f..36adb43a2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -16,7 +17,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class Exam_InvigilateTeacherController : MvcControllerBase { private Exam_InvigilateTeacherIBLL exam_InvigilateTeacherIBLL = new Exam_InvigilateTeacherBLL(); - + private EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private RoleIBLL roleIbll = new RoleBLL(); #region 视图功能 /// @@ -26,7 +28,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } + return View(); } /// /// 表单页 @@ -35,7 +46,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } /// /// 表单页 @@ -44,6 +55,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormYearSemester() { + if (LoginUserInfo.Get().roleIds.Contains(roleIbll.GetEntityByRoleCode("paikaoerji").F_RoleId)) + { + ViewBag.IsTwoDept = true; + var empinfo = empInfoIbll.GetEmpInfoEntityByEmpNo(LoginUserInfo.Get().account); + if (empinfo != null) + { + ViewBag.DeptNo = empinfo.DeptNo; + } + } return View(); } @@ -164,9 +184,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult Import(string AcademicYearNo, string Semester) + public ActionResult Import(string AcademicYearNo, string Semester, string ImportDeptNo) { - int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester); + int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester, ImportDeptNo); return Success("导入" + res + "条数据!"); } /// @@ -175,9 +195,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + public ActionResult DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { - int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester); + int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); return Success("清空" + res + "条数据!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs index 8b261d341..704d075c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/LessonInfoOfElectiveOnlineController.cs @@ -19,6 +19,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private LessonInfoOfElectiveOnlineIBLL lessonInfoOfElectiveOnlineIBLL = new LessonInfoOfElectiveOnlineBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); CdMajorIBLL CdMajorIBLL = new CdMajorBLL(); + private StuSelectLessonListOfElectiveOnlineIBLL stuSelectLessonListOfElectiveOnlineIBLL = new StuSelectLessonListOfElectiveOnlineBLL(); + #region 视图功能 @@ -241,6 +243,138 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("线上选课还未开始!"); } + /// + /// 判断队列结果 + /// + /// + public ActionResult GetApplyResult(string keyvalue) + { + var loginUserInfo = LoginUserInfo.Get(); + //学员信息 + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(loginUserInfo.enCode); + if (stuInfoBasicEntity == null) + { + return Success("当前学员不存在!"); + } + //课程信息 + var olpeEntity = lessonInfoOfElectiveOnlineIBLL.GetLessonInfoOfElectiveOnlineEntity(keyvalue); + if (olpeEntity == null) + { + return Success("当前课程不存在!"); + } + + //当前学员本学期是否有报名课程:每学期一门 + //var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(loginUserInfo.enCode, ""); + //if (sslleEntity != null) + //{ + // if (sslleEntity.OLPEId != keyvalue && sslleEntity.Status != 3) + // { + // return Success("已存在报名课程,每学期只能选择一门选修课!如需报名其他课程请先取消。"); + // } + // if (sslleEntity.Status == 1) + // { + // return Success("报名审核中,请耐心等待!"); + // } + // else if (sslleEntity.Status == 2) + // { + // return Success("已存在报名成功的课程,只能选择一门选修课!"); + // } + + //} + //else + //{ + // //所选课程的报名人数是否已满 + // var aa = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(keyvalue); + // var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); + // if (aaa >= olpeEntity.StuNumMax) + // { + // return Success("当前课程报名人数已满,请选择其他课程!"); + // } + //} + + //每学期两门(几门根据系统配置文件值确定) + var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(loginUserInfo.enCode, keyvalue); + if (sslleEntity != null) + { + if (sslleEntity.Status == 1) + { + return Success("当前课程报名审核中,请耐心等待!"); + } + else if (sslleEntity.Status == 2) + { + return Success("当前课程已报名成功!"); + } + } + else + { + //所选课程的报名人数是否已满 + var aa = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(keyvalue); + var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); + if (aaa >= olpeEntity.StuNumMax) + { + return Success("当前课程报名人数已满,请选择其他课程!"); + } + //每学期最多两门 + var sslleList = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByStuNo(loginUserInfo.enCode); + var sslleListOfNow = sslleList.Where(x => x.AcademicYearNo == olpeEntity.AcademicYearNo && x.Semester == olpeEntity.Semester); + var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); + //if (sslleListOfNow1.Count() >= 2) + if (sslleListOfNow1.Count() >= Config.GetValue("OnlineElectiveLessonApplyMax").ToInt()) + { + return Success("每学期最多选择" + Config.GetValue("OnlineElectiveLessonApplyMax").ToInt() + "门线上选修课!"); + } + //相同时间不能报名 + if (!string.IsNullOrEmpty(olpeEntity.LessonSection) && sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) + { + //相同时间不能报名 + return Success("本学期此时间段已有报名的选修课!"); + } + + } + + return Fail("正在提交,请等待!"); + } + + /// + /// 取消报名 + /// + /// + /// + public ActionResult CancelApply(string keyvalue) + { + var loginUserInfo = LoginUserInfo.Get(); + //学员信息 + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(loginUserInfo.enCode); + if (stuInfoBasicEntity == null) + { + return Fail("当前学员不存在!"); + } + //课程信息 + var olpeEntity = lessonInfoOfElectiveOnlineIBLL.GetLessonInfoOfElectiveOnlineEntity(keyvalue); + if (olpeEntity == null) + { + return Fail("当前课程不存在!"); + } + //当前学员是否已经报名该课程 + var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(loginUserInfo.enCode, keyvalue); + if (sslleEntity != null) + { + if (sslleEntity.Status != 2) + { + stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(sslleEntity.Id); + return Success("取消成功"); + } + else + { + return Fail("取消失败,当前课程已报名成功!"); + } + } + else + { + return Fail("当前课程未报名,无需取消!"); + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 672fda519..07d0b303b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -44,6 +44,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + [HttpGet] + public ActionResult StuScoreQueryIndexRow() + { + return View(); + } [HttpGet] public ActionResult Monitor() { @@ -266,6 +272,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + /// + /// 全院成绩缓考 + /// + /// + [HttpGet] + public ActionResult SlowIndex() + { + return View(); + } + + #endregion #region 获取数据 @@ -835,7 +852,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonSortNo).ThenBy(x => x.LessonNo); } - return Success(data); } @@ -1193,6 +1209,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("操作成功"); } + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoSlow(string keyValue, int status) + { + stuScoreIBLL.DoSlow(keyValue, status); + return Success("操作成功"); + } + #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs index 7a6a979d5..23b2c4af5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs @@ -163,6 +163,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + /// + /// 全院补考成绩缓考 + /// + /// + [HttpGet] + public ActionResult SlowIndex() + { + return View(); + } + #endregion #region 获取数据 @@ -714,6 +724,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public string label { get; set; } public string name { get; set; } } + + + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoSlow(string keyValue, int status) + { + stuScoreNotPassIBLL.DoSlow(keyValue, status); + return Success("操作成功"); + } + #endregion } } 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..d113d09b8 --- /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 InputScoreIndexImport() + { + 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, string AcademicYearShort, string Semester) + { + var data = stuScoreOnlineIBLL.GetEmpNoData("", "", lessonNo, AcademicYearShort, Semester); + + return Success(data); + } + /// + /// 教师下拉框信息【学生成绩录入可去审核】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEmpNoData(string lessonNo, string AcademicYearShort, string Semester) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreOnlineIBLL.GetEmpNoData(loginInfo.account, loginInfo.Description, lessonNo, AcademicYearShort, Semester); + + 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(string AcademicYearShort, string Semester) + { + var data = stuScoreOnlineIBLL.GetLessonNoDataOfAll("", "", AcademicYearShort, Semester); + 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.fnum + }; + return Success(data); + } + else + { + return Fail("导入数据失败!"); + } + } + + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs index cbaee1a3d..e152b39c5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -68,6 +69,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 初始化线上课程成绩 + /// + /// + [HttpGet] + public ActionResult InitScoreForm() + { + return View(); + } #endregion #region 获取数据 @@ -123,6 +133,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + /// + /// 获取选课情况里的课程信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetSelectLessonInfo(string academicYearNo, string semester) + { + var Data = stuSelectLessonListOfElectiveOnlineIBLL.GetSelectLessonInfo(academicYearNo, semester).OrderBy(x => x.LessonNo); + + return Success(Data); + } + #endregion #region 提交数据 @@ -233,12 +256,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers if (aa == 1)//是 { //判断选课的课程的报名人数是否已满 - if (olpeEntity.StuNum >= olpeEntity.StuNumMax) + if (olpeEntity.StuNum.HasValue && olpeEntity.StuNum.Value >= olpeEntity.StuNumMax) { return Fail("当前选课的课程人数已满!"); } //选课的课程报名人数加1 - olpeEntity.StuNum = olpeEntity.StuNum + 1; + olpeEntity.StuNum = olpeEntity.StuNum.HasValue ? olpeEntity.StuNum.Value + 1 : 1; lessonInfoOfElectiveOnlineIBLL.SaveEntity(olpeEntity.Id, olpeEntity); //报名成功 sslleEntity.Status = 2; @@ -253,6 +276,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuSelectLessonListOfElectiveOnlineIBLL.SaveEntity(keyValue, sslleEntity); return Success("保存成功!"); } + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) + { + stuSelectLessonListOfElectiveOnlineIBLL.DoInitScore(entity); + return Success("初始化成功!"); + } + + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexStudent.js index 69d06fd10..e99a46bbc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexStudent.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexStudent.js @@ -14,7 +14,6 @@ var bootstrap = function ($, learun) { var ClassNo = ''; var page = { init: function () { - page.initGird(); page.bind(); }, bind: function () { @@ -69,6 +68,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + page.initGird(); + } + }.bind(this), "json"); $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder: '请选择课程' }); $('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname', placeholder: '请选择教室' }); $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname', placeholder: '请选择教师' }); @@ -105,6 +111,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); param.StartTime = datebegin; param.EndTime = dateend; var loginInfo = learun.clientdata.get(['userinfo']); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexTeach.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexTeach.js index 27f229dbd..c7881aa5b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexTeach.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexTeach.js @@ -13,7 +13,6 @@ var bootstrap = function ($, learun) { var dateend = ''; var page = { init: function () { - page.initGird(); page.bind(); }, bind: function () { @@ -68,6 +67,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + page.initGird(); + } + }.bind(this), "json"); //课程 $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder:'请选择课程' }); }, @@ -98,6 +104,8 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); param.StartTime = datebegin; param.EndTime = dateend; var loginInfo = learun.clientdata.get(['userinfo']); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.cshtml index f72030d04..f9f364722 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.cshtml @@ -48,4 +48,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js index 41bb19165..563090285 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js @@ -11,7 +11,6 @@ var bootstrap = function ($, learun) { var logend = ''; var page = { init: function () { - page.initGird(); page.bind(); }, bind: function () { @@ -40,7 +39,6 @@ var bootstrap = function ($, learun) { selectfn: function (begin, end) { logbegin = begin; logend = end; - page.search(); } }); @@ -67,6 +65,14 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + page.initGird(); + + } + }.bind(this), "json"); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -138,8 +144,14 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); param.StartTime = logbegin; param.EndTime = logend; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml index 140f63d8f..2e4585995 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.cshtml @@ -48,4 +48,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js index bdfac26da..c2426ca5c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexForClass.js @@ -14,7 +14,6 @@ var bootstrap = function ($, learun) { var ClassNo = ''; var page = { init: function () { - page.initGird(); page.bind(); }, bind: function () { @@ -78,6 +77,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + page.initGird(); + } + }.bind(this), "json"); //课程 //$('#LessonNo').lrselect({ // placeholder: "请选择课程", @@ -119,9 +125,14 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); param.StartTime = datebegin; param.EndTime = dateend; - //console.log(param); + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml index 133107ba9..3d45cadbf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.cshtml @@ -48,4 +48,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js index 2507f5f7c..1563c2a5d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexItem.js @@ -14,7 +14,6 @@ var bootstrap = function ($, learun) { var ClassNo = ''; var page = { init: function () { - page.initGird(); page.bind(); }, bind: function () { @@ -78,6 +77,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + page.initGird(); + } + }.bind(this), "json"); //课程 //$('#LessonNo').lrselect({ // placeholder: "请选择课程", @@ -121,9 +127,14 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); param.StartTime = datebegin; param.EndTime = dateend; - console.log(param); + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.cshtml index 4f82d2ede..8170c7f73 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.cshtml @@ -11,9 +11,17 @@
学期*
+
+
系部
+
+
考试时长(分钟)
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.js index 04764d409..0365a5042 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/FormYearSemester.js @@ -31,7 +31,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } }, initData: function () { if (type == 1) { @@ -49,7 +55,8 @@ var bootstrap = function ($, learun) { var postData = { AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), - ExamTime: $('#ExamTime').val() + ExamTime: $('#ExamTime').val(), + ImportDeptNo: $("#ImportDeptNo").lrselectGet() }; //从开课计划导入 if (type == 1) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml index b23a111f1..4bed21aca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml @@ -26,6 +26,10 @@
课程名称
+
+
是否启用
+
+
@@ -54,4 +58,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js index ea88e5f5e..8a083c419 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js @@ -30,6 +30,15 @@ var bootstrap = function ($, learun) { 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"); + $('#ELEnabled').lrDataItemSelect({ + code: "YesOrNoBit" + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -258,7 +267,7 @@ var bootstrap = function ($, learun) { { label: "是否启用", name: "ELEnabled", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 1 ? "" : ""; + return cellvalue == 1 ? "" : ""; } }, ], @@ -271,6 +280,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.cshtml index dc2ca6c33..1d378da85 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.cshtml @@ -11,6 +11,10 @@
学期*
+
+
系部
+
+
排考名称*
@@ -36,4 +40,8 @@
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.js index 7a12a2cb2..ad79343a9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Form.js @@ -30,6 +30,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } $('#PlanType').lrDataItemSelect({ code: 'StudentType' }); $('#EPRandom').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#EPGenarate').lrDataItemSelect({ code: 'YesOrNoBit' }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml index f25123037..7744f8478 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.cshtml @@ -82,4 +82,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js index cbae5c463..9c852c799 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js @@ -160,18 +160,19 @@ var bootstrap = function ($, learun) { function () { var keyValue = $('#gridtable').jfGridValue('EPId'); var PlanName = $('#gridtable').jfGridValue('PlanName'); - if (learun.checkrow(keyValue)) + if (learun.checkrow(keyValue)) { var EPGenarate = $('#gridtable').jfGridValue('EPGenarate'); - if (EPGenarate == true) { - return learun.alert.warning("选中记录已生成排考名单!"); + if (EPGenarate == true) { + return learun.alert.warning("选中记录已生成排考名单!"); + } + learun.frameTab.open({ + F_ModuleId: keyValue, + F_Icon: 'fa magic', + F_FullName: PlanName + '--安排考试', + F_UrlAddress: '/EducationalAdministration/Exam_ExamPlanLesson/Index?EPId=' + keyValue + }); } - learun.frameTab.open({ - F_ModuleId: keyValue, - F_Icon: 'fa magic', - F_FullName: PlanName + '--安排考试', - F_UrlAddress: '/EducationalAdministration/Exam_ExamPlanLesson/Index?EPId=' + keyValue - }); - }); + }); //一键安排课程 $('#lr_examlesson').on('click', function () { @@ -345,6 +346,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js index 4c9ea7c1c..460dcdff1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js @@ -95,11 +95,14 @@ var bootstrap = function ($, learun) { if (data[id].EmpNo && (data[id].EmpNo).indexOf(',') != -1) { var empnoArr = data[id].EmpNo.split(','); var empnameArr = data[id].EmpName.split(','); - $.each(empnoArr, function (i, val) { - if (!!val) { - tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); - } - }); + $.each(empnoArr, + function(i, val) { + if (!!val) { + tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); + } + }); + } else { + tempdatra.push({ EmpNo: data[id].EmpNo, EmpName: data[id].EmpName }); } $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.cshtml index 925f7362f..cbe6ba2a5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.cshtml @@ -11,6 +11,10 @@
学期*
+
+
系部
+
+
座位行数*
@@ -20,4 +24,8 @@
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js index 34afd6899..4bdf2f092 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormYearSemester.js @@ -31,6 +31,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } }, initData: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml index 05a38db32..77219682a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml @@ -26,6 +26,10 @@
考场名称
+
+
是否启用
+
+
@@ -52,4 +56,8 @@ + @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js index 922009c4f..fa19d5e9c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js @@ -30,6 +30,15 @@ var bootstrap = function ($, learun) { 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"); + $('#EREnabled').lrDataItemSelect({ + code: "YesOrNoBit" + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -173,7 +182,7 @@ var bootstrap = function ($, learun) { { label: "是否启用", name: "EREnabled", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 1 ? "" : ""; + return cellvalue == 1 ? "" : ""; } }, ], @@ -186,6 +195,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.cshtml index 4ebb6a098..e8ab089e3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.cshtml @@ -11,9 +11,17 @@
学期*
+
+
系部
+
+
考试类型
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.js index aba076183..b097f1b77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormClear.js @@ -30,6 +30,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } $('#ESType').lrDataItemSelect({ code: 'StudentType' }); } }; @@ -41,7 +48,8 @@ var bootstrap = function ($, learun) { var postData = { AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), - ESType: $('#ESType').lrselectGet() + ESType: $('#ESType').lrselectGet(), + ImportDeptNo: $("#ImportDeptNo").lrselectGet() }; learun.layerConfirm('是否确认清空!', function (res) { if (res) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.cshtml index bcab1d3bd..fa6f2529a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.cshtml @@ -11,9 +11,17 @@
学期*
+
+
系部
+
+
考试类型*
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.js index 3fa15ee32..4878d2d93 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/FormImport.js @@ -31,6 +31,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } $('#ESType').lrDataItemSelect({ code: 'StudentType' }); }, initData: function () { @@ -56,7 +63,8 @@ var bootstrap = function ($, learun) { var postData = { AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), - ESType: $('#ESType').lrselectGet() + ESType: $('#ESType').lrselectGet(), + ImportDeptNo: $("#ImportDeptNo").lrselectGet() }; $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/ImportTable?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml index 00ee8dad1..ed962b7f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml @@ -18,22 +18,30 @@
学期
-
+
班级
-
+
+
年级
+ +
+
学生学号
-
+
学生名称
-
+
考试类型
+
+
是否启用
+
+
@@ -60,4 +68,8 @@
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js index 1ddf2952e..98b71f197 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.js @@ -30,6 +30,15 @@ var bootstrap = function ($, learun) { 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"); + $('#ESEnabled').lrDataItemSelect({ + code: "YesOrNoBit" + }); $('#ESType').lrDataItemSelect({ code: 'StudentType' }); // 刷新 $('#lr_refresh').on('click', function () { @@ -194,7 +203,7 @@ var bootstrap = function ($, learun) { { label: "是否启用", name: "ESEnabled", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 1 ? "" : ""; + return cellvalue == 1 ? "" : ""; } }, ], @@ -208,6 +217,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml index 74924978e..336bdb9e3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.cshtml @@ -11,5 +11,13 @@
学期*
+
+
系部
+
+
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js index 7172be57e..de90956d1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/FormYearSemester.js @@ -31,6 +31,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#ImportDeptNo').lrDataSourceSelect({ code: "CdDeptInfo", text: "deptname", value: "deptno" }); + //判断是否分院老师,是就锁定系 + $('#ImportDeptNo').attr("disabled", "disabled"); + if (IsTwoDept) { + //绑定当前系 + $('#ImportDeptNo').lrselectSet(CurrentDeptNo); + } }, initData: function () { @@ -55,7 +62,8 @@ var bootstrap = function ($, learun) { } var postData = { AcademicYearNo: $('#AcademicYearNo').lrselectGet(), - Semester: $('#Semester').lrselectGet() + Semester: $('#Semester').lrselectGet(), + ImportDeptNo: $("#ImportDeptNo").lrselectGet() }; //导入 if (type == 1) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml index 6edcfcc99..75e5b36dd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml @@ -10,22 +10,26 @@
-
+
学年
-
+
学期
-
+
教师编号
-
+
教师姓名
+
+
是否启用
+
+
@@ -51,4 +55,8 @@
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js index ba0df12a6..86204ec21 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.js @@ -32,6 +32,15 @@ var bootstrap = function ($, learun) { 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"); + $('#ITEnabled').lrDataItemSelect({ + code: "YesOrNoBit" + }); // 刷新 $('#lr_refresh').on('click', function () { @@ -196,7 +205,7 @@ var bootstrap = function ($, learun) { { label: "是否启用", name: "ITEnabled", width: 100, align: "left", formatter: function (cellvalue) { - return cellvalue == 1 ? "" : ""; + return cellvalue == 1 ? "" : ""; } }, ], @@ -209,6 +218,10 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; + if (IsTwoDept) + param.ImportDeptNo = CurrentDeptNo; + else + param.ImportDeptNo = "0"; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js index 0e3b4eada..552839fa1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js @@ -175,8 +175,7 @@ var bootstrap = function ($, learun) { $('#Semester').lrselectSet(Semester); var param = { "AcademicYearNo": data.AcademicYearShort, "Semester": data.Semester }; - //todo:等待最后解除注释 - //page.search(param); + page.search(param); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { @@ -264,7 +263,7 @@ var bootstrap = function ($, learun) { isMultiselect: true, sidx: 'AcademicYearNo DESC, Semester DESC, LessonNo ASC,EmpNo ASC' }); - page.search(); + //page.search(); }, search: function (param) { param = param || {}; @@ -273,7 +272,8 @@ var bootstrap = function ($, learun) { } }; refreshGirdData = function () { - page.search(); + var param = { "AcademicYearNo": $('#AcademicYearNo').lrselectGet(), "Semester": $('#Semester').lrselectGet() }; + page.search(param); }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/StudentIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/StudentIndex.js index a1be98ab5..582c22dbc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/StudentIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/StudentIndex.js @@ -74,8 +74,6 @@ var bootstrap = function ($, learun) { location.reload(); }); - //todo:待一个个查看 - // 报名 $('#lr_apply').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); @@ -92,7 +90,7 @@ var bootstrap = function ($, learun) { _postData.keyValue = keyValue; _postData.StuNo = learun.clientdata.get(['userinfo']).enCode; $.ajax({ - url: WebApiUrl + '/Learun/LessonInfoOfElectiveOnlineStudent/SignIn', + url: WebApiUrl + '/Learun/LessonInfoOfElectiveOnline/SignIn', data: _postData, type: "POST", dataType: "json", @@ -142,6 +140,15 @@ var bootstrap = function ($, learun) { $('#lr_cancel').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status == "2") {//报名成功 + learun.alert.warning("当前课程已报名成功,无法取消!"); + return false; + } + if (Status != "1") {//审核中 + learun.alert.warning("当前课程未报名或者报名失败,无法取消!"); + return false; + } learun.layerConfirm('是否确认取消报名该课程!', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/EducationalAdministration/LessonInfoOfElectiveOnline/CancelApply', { keyValue: keyValue }, function () { @@ -183,7 +190,7 @@ var bootstrap = function ($, learun) { if (cellvalue == 1) { return '审核中'; } else if (cellvalue == 2) { - return '已报名'; + return '报名成功'; } else if (cellvalue == 3) { return '报名失败'; } else { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.cshtml index c612bbfac..f85d11a45 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.cshtml @@ -21,6 +21,18 @@ +
+
+
+ + 0 +
+
+
+
+ + 0 +
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js index a8553a604..31f813eb2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js @@ -79,7 +79,8 @@ var bootstrap = function ($, learun) { { label: '班级', name: 'ClassName', width: 100, align: "left" }, { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, { label: '学期', name: 'Semester', width: 50, align: "left" }, - { label: '科目类型', name: 'LessonSortName', width: 60, align: "left" }, + { label: '课程分类', name: 'LessonSortName', width: 60, align: "left" }, + { label: '课程类型', name: 'LessonTypeName', width: 100, align: "left" }, { label: '科目', name: 'LessonName', width: 300, align: "left" }, { label: '学分', name: 'StudyScore', width: 50, align: "left" }, { label: '成绩', name: 'Score', width: 100, align: "left" }, @@ -92,6 +93,22 @@ var bootstrap = function ($, learun) { isPage: false, sidx: '', sord: '', + onRenderComplete: function (data) { + var studyscoreall = 0; + var studyscore = 0; + for (var i = 0; i < data.length; i++) { + if (!!data[i].LessonSortNo && data[i].LessonSortNo == "1") { + if (!!data[i].StudyScore) { + studyscoreall += data[i].StudyScore; + } + } + if (!!data[i].Score && data[i].Score >= 60) { + studyscore += data[i].StudyScore; + } + } + $("#spanstudyscoreall").html(studyscoreall + 10); + $("#spanstudyscore").html(studyscore); + } }); //page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js index 30a4ef6a1..ebe979926 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js @@ -112,7 +112,7 @@ var bootstrap = function ($, learun) { { label: "年级", name: "Grade", width: 40, align: "left" }, { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, { label: '学期', name: 'Semester', width: 40, align: "left" }, - { label: '课程名称', name: 'LessonName', width: 150, align: "left" } + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, //{ // label: '课程名称', name: 'LessonNo', width: 150, align: "left", // formatterAsync: function (callback, value, row, op, $cell) { @@ -126,6 +126,11 @@ var bootstrap = function ($, learun) { // }); // } //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, ]; headDataEdit = [ { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js index ca6b5f3c3..376e64f1a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js @@ -118,7 +118,7 @@ var bootstrap = function ($, learun) { { label: "年级", name: "Grade", width: 40, align: "left" }, { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, { label: '学期', name: 'Semester', width: 40, align: "left" }, - { label: '课程名称', name: 'LessonName', width: 150, align: "left" } + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, //{ // label: '课程名称', name: 'LessonNo', width: 150, align: "left", // formatterAsync: function (callback, value, row, op, $cell) { @@ -132,6 +132,11 @@ var bootstrap = function ($, learun) { // }); // } //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, ]; headDataEdit = [ { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndexTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndexTeacher.js index c6df00e6d..8233b9cca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndexTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/ScoreQueryAllIndexTeacher.js @@ -37,22 +37,23 @@ var bootstrap = function ($, learun) { learun.alert.warning("请选择班级!"); return; } - $.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoData', p, - function (data) { - var temparr = []; - for (var i = 0; i < data.length; i++) { - var item = {}; - item.label = data[i].text; - item.name = data[i].value; - item.width = 150; - item.align = "left"; - temparr.push(item); - } - LessonTemp = temparr; - - page.initGird(); - page.search(p); - }); + //$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoData', { }, + // function (data) { + // var temparr = []; + // for (var i = 0; i < data.length; i++) { + // var item = {}; + // item.label = data[i].text; + // item.name = data[i].value; + // item.width = 150; + // item.align = "left"; + // temparr.push(item); + // } + // LessonTemp = temparr; + // page.initGird(); + // page.search(p); + // }); + page.initGird(); + page.search(p); }); // 刷新 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.cshtml new file mode 100644 index 000000000..1c6109349 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.cshtml @@ -0,0 +1,66 @@ +@{ ViewBag.Title = "全院学生成绩缓考"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScore/SlowIndex.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.js new file mode 100644 index 000000000..82c519064 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/SlowIndex.js @@ -0,0 +1,308 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-14 11:02 + * 描 述:全院学生成绩缓考 + */ +var selectedRow; +var refreshGirdData; +var refreshGirdData2; +var judgeSelect; //判断下拉框是否选择 +var headData; //常规列头 +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: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { + label: "性别", name: "GenderNo", width: 40, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + label: "学习形式", name: "StudyModality", width: 55, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StudyModality', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "异动类型", name: "MoveType", width: 55, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StuChangeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + 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: "Grade", width: 40, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 40, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + //{ + // label: '课程名称', name: 'LessonNo', width: 150, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + // key: value, + // keyId: 'lessonno', + // callback: function (_data) { + // callback(_data['lessonname']); + // } + // }); + // } + //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left",formatter:function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, + ]; + headDataNoEdit = [ + { + label: '平时成绩', name: 'OrdinaryScore', width: 80, align: "left" + }, + { + label: '期中成绩', name: 'TermInScore', width: 80, align: "left" + }, + { + label: '期末成绩', name: 'TermEndScore', width: 80, align: "left" + }, + { + label: '其他成绩', name: 'OtherScore', 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_slow').on('click', function () { + var query = judgeSelect(); + if (query) { + var keyValue = $('#gridtable').jfGridValue('ScoreId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认缓考该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScore/DoSlow', { keyValue: keyValue, status: 1 }, function () { + refreshGirdData2(); + }); + } + }); + } + } + }); + //取消缓考 + $('#lr_cancelSlow').on('click', function () { + var query = judgeSelect(); + if (query) { + var keyValue = $('#gridtable').jfGridValue('ScoreId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认取消缓考该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScore/DoSlow', { keyValue: keyValue, status: 0 }, function () { + refreshGirdData2(); + }); + } + }); + } + } + }); + }, + 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/StuScore/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#ClassNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetClassNoDataOfAll?lessonNo=' + item.value, + value: 'value', + text: 'text', + }); + } + } + }); + //班级 + $('#ClassNo').lrselect({ + placeholder: "请选择班级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetClassNoDataOfAll', + 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/StuScore/GetList', + headData: headDataFinally, + mainId: 'ScoreId', + isPage: false, + isMultiselect: true, + sidx: 'StuNo', + sord: 'asc' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + }; + refreshGirdData = function () { + page.search(); + }; + refreshGirdData2 = function () { + var query = judgeSelect(); + if (query) { + page.search(query); + } + }; + judgeSelect = function () { + 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.ClassNo == null || query.ClassNo == "") { + learun.alert.warning("请选择班级!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.cshtml new file mode 100644 index 000000000..961fa964a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.cshtml @@ -0,0 +1,35 @@ +@{ ViewBag.Title = "全院学生成绩查看"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+ @*
+  打印 +
*@ +
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.js") \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.js new file mode 100644 index 000000000..64f5f5495 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndexRow.js @@ -0,0 +1,114 @@ +/* * 版 本 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) { + var stuinfo = learun.clientdata.get(['userinfo']).account; + "use strict"; + var page = { + init: function () { + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var p = {}; + p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + p.Semester = $('#Semester').lrselectGet(); + p.StuNo = stuinfo; + page.search(p); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //打印 + $('#lr_print').on('click', function () { + var AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + var Semester = $('#Semester').lrselectGet(); + var StuNo = $.trim($('#StuNo').val()); + if (StuNo == null || StuNo == "") { + learun.alert.warning("请输入学号!"); + return; + } + learun.layerForm({ + id: 'AllStuScoreQueryPrint', + title: '学生成绩单', + url: top.$.rootUrl + '/EducationalAdministration/StuScore/AllStuScoreQueryPrint?StuNo=' + StuNo + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester, + width: 1200, + height: 800, + btn: null + }); + }); + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + $.get({ + url: '/Home/GetYearAndSemesteResult', + dataType:'json', + success: function (ref) { + if (ref.code == 200) { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + setTimeout(page.initGird,1000); + } + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuInfo', + headData: [ + { label: '学号', name: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 200, align: "left" }, + { label: '专业', name: 'MajorName', width: 100, align: "left" }, + { label: '班级', name: 'ClassName', width: 100, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 50, align: "left" }, + { label: '课程分类', name: 'LessonSortName', width: 60, align: "left" }, + { label: '课程类型', name: 'LessonTypeName', width: 100, align: "left" }, + { label: '科目', name: 'LessonName', width: 300, align: "left" }, + { label: '学分', name: 'StudyScore', width: 50, align: "left" }, + { label: '成绩', name: 'Score', width: 100, align: "left" }, + { label: '第一次补考成绩', name: 'ScoreOfNotPass', width: 100, align: "left" }, + { label: '第二次补考成绩', name: 'ScoreOfNotPassTwo', width: 100, align: "left" }, + { label: '专业排名', name: 'RankInMajor', width: 100, align: "left" }, + { label: '班级排名', name: 'RankInClass', width: 100, align: "left" }, + ], + mainId: 'StuNo', + isPage: false, + sidx: '', + sord: '', + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); + param.StuNo = stuinfo; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.js index 9e288d4bb..cbe9135fe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.js @@ -112,7 +112,7 @@ var bootstrap = function ($, learun) { { label: "年级", name: "Grade", width: 40, align: "left" }, { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, { label: '学期', name: 'Semester', width: 40, align: "left" }, - { label: '课程名称', name: 'LessonName', width: 150, align: "left" } + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, //{ // label: '课程名称', name: 'LessonNo', width: 150, align: "left", // formatterAsync: function (callback, value, row, op, $cell) { @@ -126,6 +126,11 @@ var bootstrap = function ($, learun) { // }); // } //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, ]; headDataEdit = [ { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexInTeacher.js index 01187590d..59a4311dc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexInTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexInTeacher.js @@ -117,7 +117,7 @@ var bootstrap = function ($, learun) { { label: "年级", name: "Grade", width: 40, align: "left" }, { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, { label: '学期', name: 'Semester', width: 40, align: "left" }, - { label: '课程名称', name: 'LessonName', width: 150, align: "left" } + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, //{ // label: '课程名称', name: 'LessonNo', width: 150, align: "left", // formatterAsync: function (callback, value, row, op, $cell) { @@ -131,6 +131,11 @@ var bootstrap = function ($, learun) { // }); // } //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, ]; headDataEdit = [ { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.cshtml new file mode 100644 index 000000000..c0d8ca0e7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.cshtml @@ -0,0 +1,66 @@ +@{ ViewBag.Title = "全院学生补考成绩缓考"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.js new file mode 100644 index 000000000..981f5d45e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/SlowIndex.js @@ -0,0 +1,300 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-11-05 15:25 + * 描 述:全院学生补考成绩缓考 + */ +var selectedRow; +var refreshGirdData; +var refreshGirdData2; +var judgeSelect; //判断下拉框是否选择 +var headData; //常规列头 +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: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { + label: "性别", name: "GenderNo", width: 40, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + label: "学习形式", name: "StudyModality", width: 55, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StudyModality', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "异动类型", name: "MoveType", width: 55, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StuChangeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + 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: "Grade", width: 40, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 40, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + //{ + // label: '课程名称', name: 'LessonNo', width: 150, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + // key: value, + // keyId: 'lessonno', + // callback: function (_data) { + // callback(_data['lessonname']); + // } + // }); + // } + //}, + { + label: '是否缓考', name: 'IsSlow', width: 60, align: "left", formatter: function (cellvalue) { + return cellvalue == true ? "是" : "否"; + } + }, + ]; + 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_slow').on('click', function () { + var query = judgeSelect(); + if (query) { + var keyValue = $('#gridtable').jfGridValue('ScoreId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认缓考该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoSlow', { keyValue: keyValue, status: 1 }, function () { + refreshGirdData2(); + }); + } + }); + } + } + }); + //取消缓考 + $('#lr_cancelSlow').on('click', function () { + var query = judgeSelect(); + if (query) { + var keyValue = $('#gridtable').jfGridValue('ScoreId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认取消缓考该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoSlow', { keyValue: keyValue, status: 0 }, function () { + refreshGirdData2(); + }); + } + }); + } + } + }); + }, + 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/StuScoreNotPass/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#ClassNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetClassNoDataOfAll?lessonNo=' + item.value, + value: 'value', + text: 'text', + }); + } + } + }); + //班级 + $('#ClassNo').lrselect({ + placeholder: "请选择班级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetClassNoDataOfAll', + 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/StuScoreNotPass/GetList', + headData: headDataFinally, + mainId: 'ScoreId', + isPage: false, + isMultiselect: true, + sidx: 'StuNo', + sord: 'asc' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + }; + refreshGirdData = function () { + page.search(); + }; + refreshGirdData2 = function () { + var query = judgeSelect(); + if (query) { + page.search(query); + } + }; + judgeSelect = function () { + 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.ClassNo == null || query.ClassNo == "") { + learun.alert.warning("请选择班级!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndexInTeacher.js index ebcbcd69e..37ca1c4b8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndexInTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndexInTeacher.js @@ -457,13 +457,13 @@ var bootstrap = function ($, learun) { $('#LessonNo').lrselect({ placeholder: "请选择课程", allowSearch: true, - url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetLessonNoDataOfAllWithNo', + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetLessonNoDataWithNo', value: 'value', text: 'text', select: function (item) { if (!!item) { $("#ClassNo").lrselectRefresh({ - url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetClassNoDataOfAll?lessonNo=' + item.value, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetClassNoData?lessonNo=' + item.value, value: 'value', text: 'text', }); @@ -474,7 +474,7 @@ var bootstrap = function ($, learun) { $('#ClassNo').lrselect({ placeholder: "请选择班级", allowSearch: true, - url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetClassNoDataOfAll', + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPassTwo/GetClassNoData', value: 'value', text: 'text' }); 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..9185ccdd5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndex.js @@ -0,0 +1,624 @@ +/* * 版 本 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 rowJson; +var columnJson; +var queryJson; +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: 150, 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 () { + 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; + } + } + + rowJson = $('#gridtable').jfGridGet('showData'); + if (rowJson.length <= 0) { + learun.alert.warning("查询结果不存在!"); + return false; + } + columnJson = $('#gridtable').jfGridGet('settingInfo').headData; + //条件 + queryJson = query; + + learun.layerForm({ + id: 'IndexImport', + title: "导入学生成绩", + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/InputScoreIndexImport?type=0', + width: 600, + height: 400, + maxmin: true, + btn: null, + end: function () { + refreshGirdData2(); + } + }); + + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + //} + } + + }); + }, + 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', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataOfAllWithNo?AcademicYearShort=' + item.value + '&Semester=' + $('#Semester').lrselectGet(), + }); + } + } + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetSemesterData', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataOfAllWithNo?AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + item.value, + }); + } + } + }); + //课程 + $('#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 + '&AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + $('#Semester').lrselectGet(), + }); + } + } + }); + //教师 + $('#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/InputScoreIndexImport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.cshtml new file mode 100644 index 000000000..108ec5d4d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.cshtml @@ -0,0 +1,27 @@ +@{ + ViewBag.Title = "Form"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + +@Html.AppendCssFile("/Areas/LR_SystemModule/Views/ExcelImport/ImportForm.css") + +@*线上成绩录入导入*@ +
+
+
上传文件
+
下载模板
+
+
+
+
+ +
+
+

试试将电脑里的文件拖拽到此上传

+
+
+
+
+ +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.js new file mode 100644 index 000000000..e98bd48e9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexImport.js @@ -0,0 +1,195 @@ +/* + * 描 述:附件上传管理 + */ +var gridId = request('gridtable'); +var type = request('type');//1:成绩录入;2:选修成绩录入 +var bootstrap = function ($, learun) { + "use strict"; + + var fileInfo = {}; + + // 触发合并文件碎片 + var mergeFileChunks = function (file) { + var param = {}; + param['type'] = type; + param['__RequestVerificationToken'] = $.lrToken; + param['fileGuid'] = fileInfo[file.id].fileGuid; + param['fileName'] = fileInfo[file.id].name; + param['chunks'] = fileInfo[file.id].chunks; + var queryJson = JSON.stringify(learun.frameTab.currentIframe().queryJson); + + param['queryJson'] = queryJson; + learun.httpAsyncPost(top.$.rootUrl + "/EducationalAdministration/StuScoreOnline/ExecuteImportExcel", param, function (res) { + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); + $fileItem.find('.lr-uploader-progress').remove(); + + if (res.code == learun.httpCode.success) { + if (res.data.Success != '0') { + learun.alert.success('导入成功' + res.data.Success + '条'); + } + // 文件保存成功后 + $fileItem.append('
' + res.data.Success + '/' + res.data.Fail + '
'); + // 如果有失败 + if (res.data.Fail != '0') { + learun.download({ url: top.$.rootUrl + '/LR_SystemModule/ExcelImport/DownImportErrorFile', param: { fileId: fileInfo[file.id].fileGuid, fileName: fileInfo[file.id].name, __RequestVerificationToken: $.lrToken }, method: 'POST' }); + } + } + else { + learun.alert.error(res.info); + $fileItem.append('
'); + } + }); + } + // 触发清楚文件碎片 + var reomveFileChunks = function (file) { + var param = {}; + param['__RequestVerificationToken'] = $.lrToken; + param['fileGuid'] = fileInfo[file.id].fileGuid; + param['chunks'] = fileInfo[file.id].chunks; + learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/Annexes/MergeAnnexesFile", param, function (res) { }); + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); + $fileItem.find('.lr-uploader-progress').remove(); + $fileItem.append('
'); + } + // 删除文件 + var DeleteFile = function (fileId) { + var param = {}; + param['__RequestVerificationToken'] = $.lrToken; + param['fileId'] = fileInfo[fileId].fileGuid; + learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/Annexes/DeleteAnnexesFile", param, function (res) { }); + var file = page.uploader.getFile(fileId); + if (!!file) { + page.uploader.removeFile(file); + } + delete fileInfo[fileId]; + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + fileId); + $fileItem.remove(); + if ($('#lr_form_file_queue_list>div').length == 0) { + $('#lr_form_file_queue .lr-form-file-queue-bg').show(); + } + } + + var page = { + uploader: null, + init: function () { + if (!WebUploader.Uploader.support()) { + alert('Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器'); + throw new Error('WebUploader does not support the browser you are using.'); + } + /*导入模板下载*/ + $('#lr_down_file_btn').on('click', function () { + var columnJson = learun.frameTab.currentIframe().columnJson; + columnJson = JSON.stringify(columnJson.filter(item => item.name !== 'TermEndScore')); + var rowJson = JSON.stringify(learun.frameTab.currentIframe().rowJson); + var fileName = "线上成绩录入数据"; + //if (type == '2') { + // fileName = "选修成绩录入数据"; + //} + //else if (type == '3') { + // fileName = "补考成绩录入"; + //} + //else if (type == '4') { + // fileName = "二次补考成绩录入"; + //} + learun.download({ + method: "POST", + url: '/EducationalAdministration/StuScoreOnline/ExportExcel', + param: { + fileName: fileName, + columnJson: columnJson, + dataJson: rowJson, + //exportField: String(exportField) + } + }); + }); + + page.uploader = WebUploader.create({ + auto: true, + swf: top.$.rootUrl + '/Content/webuploader/Uploader.swf', + // 文件接收服务端。 + server: top.$.rootUrl + "/LR_SystemModule/Annexes/UploadAnnexesFileChunk", + // 选择文件的按钮。可选。 + // 内部根据当前运行是创建,可能是input元素,也可能是flash. + pick: '#lr_add_file_btn', + dnd: '#lr_form_file_queue', + paste: 'document.body', + disableGlobalDnd: true, + accept: { + extensions: "xls,xlsx" + }, + multiple: false, + // 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传! + resize: false, + // 文件分片上传 + chunked: true, + chunkRetry: 3, + prepareNextFile: true, + chunkSize: '1048576', + // 上传参数 + formData: { + __RequestVerificationToken: $.lrToken + } + }); + page.uploader.on('fileQueued', page.fileQueued); + page.uploader.on('uploadStart', page.uploadStart); + page.uploader.on('uploadBeforeSend', page.uploadBeforeSend); + page.uploader.on('uploadProgress', page.uploadProgress); + page.uploader.on('uploadSuccess', page.uploadSuccess); + page.uploader.on('uploadError', page.uploadError); + page.uploader.on('uploadComplete', page.uploadComplete); + page.uploader.on('error', page.error); + + + //$('#lr_form_file_queue').mCustomScrollbar({ // 优化滚动条 + // theme: "minimal-dark" + //}); + + }, + fileQueued: function (file) {// 文件加载到队列 + fileInfo[file.id] = { name: file.name }; + $('#lr_form_file_queue .lr-form-file-queue-bg').hide(); + // 添加一条文件记录 + var $item = $('
'); + $item.append('
'); + $item.append('' + file.name + '(' + learun.countFileSize(file.size) + ')'); + + $('#lr_form_file_queue_list').append($item); + }, + uploadStart: function (file) { + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); + $fileItem.append('
'); + }, + uploadBeforeSend: function (object, data, headers) { + data.chunk = data.chunk || 0; + data.chunks = data.chunks || 1; + fileInfo[data.id].fileGuid = fileInfo[data.id].fileGuid || WebUploader.Base.guid(); + data.fileGuid = fileInfo[data.id].fileGuid; + fileInfo[data.id].chunks = data.chunks; + }, + uploadProgress: function (file, percentage) { + var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); + $fileItem.find('.lr-uploader-progress-bar').css('width', (percentage * 100 + '%')); + }, + uploadSuccess: function (file, res) { + if (res.code == 200) {// 上传成功 + mergeFileChunks(file); + } + else {// 上传失败 + reomveFileChunks(file); + } + }, + uploadError: function (file, code) { + reomveFileChunks(file); + }, + uploadComplete: function (file) { + }, + error: function (type) { + switch (type) { + case 'Q_TYPE_DENIED': + learun.alert.error('当前文件类型不允许上传'); + break; + }; + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.cshtml new file mode 100644 index 000000000..5a80b30cf --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.cshtml @@ -0,0 +1,122 @@ +@{ ViewBag.Title = "全院学生线上成绩录入"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+ + +
+
+ @*比例设置: + 平时成绩占比 0 %, + 期中成绩占比 0 %, + 期末成绩占比 0 %, + 其他成绩占比 0 %*@ +
提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.js new file mode 100644 index 000000000..f438a7fdd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreOnline/InputScoreIndexInTeacher.js @@ -0,0 +1,624 @@ +/* * 版 本 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 rowJson; +var columnJson; +var queryJson; +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: 150, 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 () { + 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; + } + } + + rowJson = $('#gridtable').jfGridGet('showData'); + if (rowJson.length <= 0) { + learun.alert.warning("查询结果不存在!"); + return false; + } + columnJson = $('#gridtable').jfGridGet('settingInfo').headData; + //条件 + queryJson = query; + + learun.layerForm({ + id: 'IndexImport', + title: "导入学生成绩", + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/InputScoreIndexImport?type=0', + width: 600, + height: 400, + maxmin: true, + btn: null, + end: function () { + refreshGirdData2(); + } + }); + + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + //} + } + + }); + }, + 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', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataWithNo?AcademicYearShort=' + item.value + '&Semester=' + $('#Semester').lrselectGet(), + }); + } + } + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetSemesterData', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataWithNo?AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + item.value, + }); + } + } + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetLessonNoDataWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#EmpNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEmpNoData?lessonNo=' + item.value + '&AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + $('#Semester').lrselectGet(), + }); + } + } + }); + //教师 + $('#EmpNo').lrselect({ + placeholder: "请选择教师", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreOnline/GetEmpNoData', + 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/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml new file mode 100644 index 000000000..89f25b5ff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml @@ -0,0 +1,15 @@ +@{ + ViewBag.Title = "初始化线上课程成绩"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js new file mode 100644 index 000000000..22b10b398 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js @@ -0,0 +1,53 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-02-27 11:05 + * 描 述:按条件同步排课数据 + */ +var acceptClick; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + + }, + initData: function () { + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/DoInitScore', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml index 0114ad8b1..f18e7b342 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "选修课课程"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -16,36 +16,40 @@
学期
-
+
-
+
+
学号
+ +
+
+
姓名
+ +
+
+
课程名称
+
+
+
+
建课教师
+ +
+
校区
-
系部
+
院系
专业
-
+
班级
-
-
教师
-
-
-
-
选修课程
-
-
-
-
选课状态
-
-
报名状态
@@ -53,15 +57,21 @@
+
+
提示:请输入学年和学期进行查询
+
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElective/QueryStuSelectResult.js") +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js index 51b1447b5..ed12e538c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js @@ -24,7 +24,7 @@ var bootstrap = function ($, learun) { return; } page.search(queryJson); - }, 330, 400); + }, 330, 500); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -40,34 +40,95 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - $('#ElectiveSelectStatus').lrDataItemSelect({ code: 'ElectiveSelectStatus' }); - $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); - $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); - $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); - $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); - $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); - $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //数据集不选择线上课程信息,选择选课情况里的课程信息 $('#LessonNo').lrselect({ allowSearch: true, - url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=LessonInfo', - param: { strWhere: "1=1 AND LessonSortNo='2' " }, - value: "lessonno", - text: "lessonname" + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetSelectLessonInfo', + value: "LessonNo", + text: "LessonName" + }); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#DeptNo').lrDataSourceSelect({ + code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (item) { + if (!!item) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "deptno='" + item.deptno + "' order by majorno " }, + }); + } else { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + }); + } + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + value: "majorno", + text: "majorname", + select: function (item) { + if (!!item) { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' order by classno " }, + }); + } else { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + value: "classno", + text: "classname" }); + $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); + //初始化线上课程成绩 + $('#lr_initScore').on('click', function () { + learun.layerForm({ + id: 'InitScoreForm', + title: '初始化线上课程成绩', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/InitScoreForm', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(); + } + }); + }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/GetQueryStuSelectResultList', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetQueryStuSelectResultList', headData: [ - { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, - { label: "学期", name: "Semester", width: 60, align: "left" }, + { label: "学年", name: "AcademicYearNo", width: 50, align: "left" }, + { label: "学期", name: "Semester", width: 50, align: "left" }, + { label: "学号", name: "StuNo", width: 120, align: "left" }, + { label: "姓名", name: "StuName", width: 180, 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: "F_SchoolId", width: 200, align: "left", + label: "建课教师", name: "EmpName", width: 100, align: "left" + }, + { + label: "建课学校", name: "F_SchoolId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', @@ -80,7 +141,7 @@ var bootstrap = function ($, learun) { } }, { - label: "系所", name: "DeptNo", width: 100, align: "left", + 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', @@ -118,24 +179,6 @@ var bootstrap = function ($, learun) { }); } }, - { label: "学号", name: "StuNo", width: 100, align: "left" }, - { label: "姓名", name: "StuName", width: 100, align: "left" }, - { - label: "性别", name: "GenderNo", width: 80, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "男" : "女"; - } - }, - { - label: "选课状态", name: "Id", width: 100, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue == null || cellvalue == undefined || cellvalue == "") { - return '未报名'; - } else { - return '已报名'; - } - } - }, { label: "报名状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue, row) { @@ -150,62 +193,7 @@ var bootstrap = function ($, learun) { } } }, - { label: "所选课程号", name: "LessonNo", width: 100, align: "left" }, - { - label: "所选课程名称", name: "LessonName", width: 150, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', - key: row.LessonNo, - keyId: 'lessonno', - callback: function (_data) { - callback(_data['lessonname']); - } - }); - } - }, - { label: "课程学分", name: "StudyScore", width: 100, align: "left" }, - { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, - { - label: "教师姓名", name: "EmpName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: row.EmpNo, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); - } - }, - { - label: "上课节次", name: "LessonSection", width: 150, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue != "" && cellvalue != undefined && cellvalue != null) { - if (cellvalue.indexOf(',') == -1) { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节"; - } else { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节"; - } - } - } - }, - { label: "上课时间", name: "LessonTime", width: 180, align: "left" }, - { - label: "教室名称", name: "ClassRoomName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', - key: row.ClassRoomNo, - keyId: 'classroomno', - callback: function (_data) { - callback(_data['classroomname']); - } - }); - } - }, - { label: "备注", name: "Remark", width: 100, align: "left" }, + ], mainId: 'StuId', isPage: true, @@ -215,7 +203,6 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; - //param.SqlParameter = " and a.ChangeStatus<>1 "; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.cshtml index f7c8f9b3c..1f5db5c37 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "选修课课程"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -16,28 +16,40 @@
学期
-
+
-
+
+
学号
+ +
+
+
姓名
+ +
+
+
课程名称
+
+
+
+
建课教师
+ +
+
校区
-
系部
+
院系
专业
-
+
班级
-
-
选课状态
-
-
报名状态
@@ -45,6 +57,9 @@
+
+
提示:请输入学年和学期进行查询
+
@@ -56,4 +71,4 @@
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElective/QueryStuSelectResultForTeacher.js") +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.js index a773bbc7e..6498b18c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResultForTeacher.js @@ -24,7 +24,7 @@ var bootstrap = function ($, learun) { return; } page.search(queryJson); - }, 300, 400); + }, 330, 500); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -40,12 +40,58 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - $('#ElectiveSelectStatus').lrDataItemSelect({ code: 'ElectiveSelectStatus' }); - $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); + //数据集不选择线上课程信息,选择选课情况里的课程信息 + $('#LessonNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetSelectLessonInfo', + value: "LessonNo", + text: "LessonName" + }); $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); - $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); - $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); - $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + $('#DeptNo').lrDataSourceSelect({ + code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (item) { + if (!!item) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "deptno='" + item.deptno + "' order by majorno " }, + }); + } else { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + }); + } + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + value: "majorno", + text: "majorname", + select: function (item) { + if (!!item) { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' order by classno " }, + }); + } else { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + value: "classno", + text: "classname" + }); + $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -54,12 +100,22 @@ var bootstrap = function ($, learun) { // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/GetQueryStuSelectResultList', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetQueryStuSelectResultList', headData: [ - { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, - { label: "学期", name: "Semester", width: 60, align: "left" }, + { label: "学年", name: "AcademicYearNo", width: 50, align: "left" }, + { label: "学期", name: "Semester", width: 50, align: "left" }, + { label: "学号", name: "StuNo", width: 120, align: "left" }, + { label: "姓名", name: "StuName", width: 180, 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: "EmpName", width: 100, align: "left" + }, { - label: "校区", name: "F_SchoolId", width: 200, align: "left", + label: "建课学校", name: "F_SchoolId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', @@ -72,7 +128,7 @@ var bootstrap = function ($, learun) { } }, { - label: "系所", name: "DeptNo", width: 100, align: "left", + 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', @@ -110,24 +166,6 @@ var bootstrap = function ($, learun) { }); } }, - { label: "学号", name: "StuNo", width: 100, align: "left" }, - { label: "姓名", name: "StuName", width: 100, align: "left" }, - { - label: "性别", name: "GenderNo", width: 80, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "男" : "女"; - } - }, - { - label: "选课状态", name: "Id", width: 100, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue == null || cellvalue == undefined || cellvalue == "") { - return '未报名'; - } else { - return '已报名'; - } - } - }, { label: "报名状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue, row) { @@ -142,62 +180,7 @@ var bootstrap = function ($, learun) { } } }, - { label: "所选课程号", name: "LessonNo", width: 100, align: "left" }, - { - label: "所选课程名称", name: "LessonName", width: 150, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', - key: row.LessonNo, - keyId: 'lessonno', - callback: function (_data) { - callback(_data['lessonname']); - } - }); - } - }, - { label: "课程学分", name: "StudyScore", width: 100, align: "left" }, - { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, - { - label: "教师姓名", name: "EmpName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: row.EmpNo, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); - } - }, - { - label: "上课节次", name: "LessonSection", width: 150, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue != "" && cellvalue != undefined && cellvalue != null) { - if (cellvalue.indexOf(',') == -1) { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节"; - } else { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节"; - } - } - } - }, - { label: "上课时间", name: "LessonTime", width: 180, align: "left" }, - { - label: "教室名称", name: "ClassRoomName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', - key: row.ClassRoomNo, - keyId: 'classroomno', - callback: function (_data) { - callback(_data['classroomname']); - } - }); - } - }, - { label: "备注", name: "Remark", width: 100, align: "left" }, + ], mainId: 'StuId', isPage: true, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.cshtml index 0892af2e6..c1c6e4b61 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.cshtml @@ -13,10 +13,10 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.js index 038692712..a693bad13 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/Index.js @@ -82,8 +82,9 @@ var bootstrap = function ($, learun) { return '微信快捷登录PC端'; } else if (val == 'modifypwdtip') { return '30天未修改密码登录后提示修改'; + }else if (val == 'modifypwdfirstday') { + return '每月1日强制修改密码'; } - } }, { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Interface/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Interface/Form.js index 28169c808..10371ee68 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Interface/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/Interface/Form.js @@ -89,7 +89,9 @@ var bootstrap = function ($, learun) { initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/LR_SystemModule/Interface/GetEntity?keyValue=' + keyValue, function (data) { - $('#form1').lrSetFormData(data); + // $('#form1').lrSetFormData(data); + $('#F_Name').val(data.F_Name); + $('#F_Address').val(data.F_Address); var formatdata = JSON.parse(data.F_FieldsJson); $('#gridtable').jfGridSet('refreshdata', formatdata); }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs index 6bd3ffdec..ed879416d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TimeTableController.cs @@ -148,6 +148,67 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers { return View(); } + + public class WeekDate + { + public int week { get; set; } + public string startdate { get; set; } + public string enddate { get; set; } + public string textweek { get; set; } + } + + [HttpGet] + [AjaxOnly] + public ActionResult GetWeeksData() + { + var weekdatelist = new List(); + var yearsemester = Common.GetSemesterAndYear(); + var arrangelessonlist = arrangeLessonTermIBLL.GetListForTimeTable("{\"AcademicYearNo\":\"" + yearsemester.AcademicYearShort + "\",\"Semester\":\"" + yearsemester.Semester + "\"}").OrderBy(m => m.LessonDate); + if (arrangelessonlist.Any()) + { + var firstday = arrangelessonlist.First(); + var lastday = arrangelessonlist.Last(); + var monday = firstday.LessonDate.Value.AddDays(-Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek) + 1); + var sunday = lastday.LessonDate.Value.AddDays(7 - Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek)); + //总周数 + var weekCount = Math.Ceiling(Convert.ToDouble((sunday - monday).Days+1) / 7); + for (var i = 0; i < weekCount; i++) + { + var wentity = new WeekDate(); + wentity.week = i + 1; + wentity.startdate = monday.AddDays(i * 7).ToString("yyyy-MM-dd"); + wentity.enddate = monday.AddDays(i * 7+6).ToString("yyyy-MM-dd"); + wentity.textweek = "第" + wentity.week + "周 (" + wentity.startdate + "~" + wentity.enddate + ")"; + weekdatelist.Add(wentity); + } + return Success(weekdatelist); + } + else + return Success(new { }); + } + + /// + /// 获取当前日期是第几周 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetCurrentWeek() + { + var yearsemester = Common.GetSemesterAndYear(); + var arrangelessonlist = arrangeLessonTermIBLL.GetListForTimeTable("{\"AcademicYearNo\":\"" + yearsemester.AcademicYearShort + "\",\"Semester\":\"" + yearsemester.Semester + "\"}").OrderBy(m => m.LessonDate); + if (arrangelessonlist.Any()) + { + var firstday = arrangelessonlist.First(); + var lastday = arrangelessonlist.Last(); + var monday = firstday.LessonDate.Value.AddDays(-(Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek) == 0 ? 7 : Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek)) + 1); + var sunday = lastday.LessonDate.Value.AddDays(7 - (Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek) == 0 ? 7 : Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek))); + var currentweek = Util.Time.GetWeekOfDay(monday, sunday); + return Success(currentweek); + } + return Success(1); + } + /// /// 获取表单数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.cshtml index 4a794077d..395274828 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.cshtml @@ -110,7 +110,7 @@
-
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.js index 472359edf..3f9c15b4f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/ClassIndexInEducation.js @@ -105,48 +105,48 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); - } - }); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // page.search(); + // } + //}); //查询 $('#lr_search').on('click', function () { var p = {}; @@ -190,6 +190,26 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width: "250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + } + } + }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); }, search: function (param) { param = param || {}; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.cshtml index 65c711228..3b3d7f665 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.cshtml @@ -111,7 +111,7 @@
-
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js index 56a1d195d..5388ed57f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/Index.js @@ -143,48 +143,69 @@ var bootstrap = function ($, learun) { }); }, bind: function () { - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width: "250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + page.search(); + } } }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // page.search(); + // } + //}); $('#perBtn').on('click', function () { AddPrintContent(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml index 9ad72d93a..947a1ae2d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.cshtml @@ -110,9 +110,8 @@
-
+
-
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js index 4c8301684..e9fb9c6ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducation.js @@ -30,7 +30,7 @@ var bootstrap = function ($, learun) { $('.personT').text(data.schoolName); $('.perSemester').text(data.semester); $('.perFestivalsBox table').html(html); - + function flogs(num, data, obj) { var flog = false; $.each(data, @@ -105,48 +105,49 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - //page.search(); - } - }); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // //page.search(); + // } + //}); + //查询 $('#lr_search').on('click', function () { var p = {}; @@ -295,6 +296,26 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width:"250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + } + } + }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); }, search: function (param) { param = param || {}; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.cshtml index 8237fd685..fa6441fb9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.cshtml @@ -126,7 +126,7 @@
-
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.js index 00e7d75ab..39cb6c0e9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationModify.js @@ -105,48 +105,48 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); - } - }); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // page.search(); + // } + //}); //查询 $('#lr_search').on('click', function () { var p = {}; @@ -200,6 +200,26 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width: "250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + } + } + }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); }, search: function (param) { param = param || {}; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.cshtml index b8b2375d7..5a24f02da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.cshtml @@ -126,7 +126,7 @@
-
+
@*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js index 722d279d3..c0a3f57e2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/IndexInEducationSelect.js @@ -107,48 +107,48 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); - } - }); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // page.search(); + // } + //}); //查询 $('#lr_search').on('click', function () { var p = {}; @@ -225,6 +225,26 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width: "250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + } + } + }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); }, search: function (param) { param = param || {}; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.cshtml index 1097c7a23..cd55c858a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.cshtml @@ -53,7 +53,7 @@
-
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.js index 570c79305..b911b76a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TimeTable/SchoolLesson.js @@ -107,48 +107,48 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - $('#datesearch').lrdate({ - dfdata: [ - { - name: '上周', - begin: function () { return learun.getTime(7); }, - end: function () { - return learun.getTime(1); - } - }, - { - name: '本周', - begin: function () { return learun.getTime(0); }, - end: function () { - return learun.getTime(-6); - } - }, - { - name: '下周', - begin: function () { return learun.getTime(-7); }, - end: function () { - return learun.getTime(-13); - } - }], - // 月 - mShow: false, - premShow: false, - // 季度 - jShow: false, - prejShow: false, - // 年 - ysShow: false, - yxShow: false, - preyShow: false, - yShow: false, - // 默认 - dfvalue: 'currentWeek', - selectfn: function (begin, end) { - startTime = begin; - endTime = end; - page.search(); - } - }); + //$('#datesearch').lrdate({ + // dfdata: [ + // { + // name: '上周', + // begin: function () { return learun.getTime(7); }, + // end: function () { + // return learun.getTime(1); + // } + // }, + // { + // name: '本周', + // begin: function () { return learun.getTime(0); }, + // end: function () { + // return learun.getTime(-6); + // } + // }, + // { + // name: '下周', + // begin: function () { return learun.getTime(-7); }, + // end: function () { + // return learun.getTime(-13); + // } + // }], + // // 月 + // mShow: false, + // premShow: false, + // // 季度 + // jShow: false, + // prejShow: false, + // // 年 + // ysShow: false, + // yxShow: false, + // preyShow: false, + // yShow: false, + // // 默认 + // dfvalue: 'currentWeek', + // selectfn: function (begin, end) { + // startTime = begin; + // endTime = end; + // page.search(); + // } + //}); //查询 $('#lr_search').on('click', function () { var p = {}; @@ -264,6 +264,26 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $("#datesearch").lrselect({ + placeholder: "请选择周次", + width: "250px", + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/TimeTable/GetWeeksData', + value: 'week', + text: 'textweek', + select: function (item) { + if (!!item) { + startTime = item.startdate; + endTime = item.enddate; + } + } + }); + $.get('/PersonnelManagement/TimeTable/GetCurrentWeek', function (ref) { + if (ref.code == "200") { + console.log(ref.data); + $('#datesearch').lrselectSet(ref.data); + } + }.bind(this), "json"); }, search: function (param) { param = param || {}; 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 2ffcf597b..4674635cc 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 @@ + @@ -1031,12 +1032,20 @@ + + + + + + + + @@ -8218,6 +8227,14 @@ + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 9bf35fd50..6ec74a1f8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -146,6 +146,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index 68aa02d5a..92de25cee 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -220,6 +220,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LessonInfoOfElectiveOnlineApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LessonInfoOfElectiveOnlineApi.cs new file mode 100644 index 000000000..eaace65ed --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LessonInfoOfElectiveOnlineApi.cs @@ -0,0 +1,286 @@ +using System; +using Nancy; +using Learun.Util; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Linq; + +namespace Learun.Application.WebApi +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-05 17:06 + /// 描 述:线上选修选课 + /// + public class LessonInfoOfElectiveOnlineApi : BaseNoAuthentication + { + private LessonInfoOfElectiveOnlineIBLL lessonInfoOfElectiveOnlineIbll = new LessonInfoOfElectiveOnlineBLL(); + private StuSelectLessonListOfElectiveOnlineIBLL stuSelectLessonListOfElectiveOnlineIBLL = new StuSelectLessonListOfElectiveOnlineBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + LessonInfoIBLL lessonInfoIbll = new LessonInfoBLL(); + EmpInfoIBLL empInfoIbll = new EmpInfoBLL(); + private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); + + /// + /// 注册接口 + /// + public LessonInfoOfElectiveOnlineApi() + : base("/Learun/LessonInfoOfElectiveOnline") + { + Get["/pagelist"] = GetPageList; + Get["/studentpagelist"] = StudentGetPageList; + Get["/form"] = GetForm; + Post["/Cancel"] = Cancel; + Post["/SignIn"] = SignIn; + Post["/SignInByMobile"] = SignInByMobile; + Post["/GetApplyResult"] = GetApplyResult; + } + + /// + /// 判断队列结果 + /// + /// + /// + private Response GetApplyResult(dynamic _) + { + dynamic parameter = this.GetReqData(); + string keyValue = parameter.keyValue; + string account = parameter.StuNo; + //学员信息 + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); + if (stuInfoBasicEntity == null) + { + return Success(new { msg = "当前学员不存在!" }); + } + //课程信息 + var olpeEntity = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); + if (olpeEntity == null) + { + return Success(new { msg = "当前课程不存在!" }); + } + + //当前学员本学期是否有报名课程:每学期一门 + //var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(account, ""); + //if (sslleEntity != null) + //{ + // if (sslleEntity.OLPEId != keyValue && sslleEntity.Status != 3) + // { + // return Success("已存在报名课程,每学期只能选择一门选修课!如需报名其他课程请先取消。"); + // } + // if (sslleEntity.Status == 1) + // { + // return Success("报名审核中,请耐心等待!"); + // } + // else if (sslleEntity.Status == 2) + // { + // return Success("已存在报名成功的课程,只能选择一门选修课!"); + // } + + //} + //else + //{ + // //所选课程的报名人数是否已满 + // var aa = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(keyValue); + // var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); + // if (aaa >= olpeEntity.StuNumMax) + // { + // return Success("当前课程报名人数已满,请选择其他课程!"); + // } + //} + + //每学期两门(几门根据系统配置文件值确定) + var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(account, keyValue); + if (sslleEntity != null) + { + if (sslleEntity.Status == 1) + { + return Success(new { msg = "当前课程报名审核中,请耐心等待!" }); + } + else if (sslleEntity.Status == 2) + { + return Success(new { msg = "当前课程已报名成功!" }); + } + } + else + { + //所选课程的报名人数是否已满 + var aa = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(keyValue); + var aaa = aa.Count(x => x.Status == 1 || x.Status == 2); + if (aaa >= olpeEntity.StuNumMax) + { + return Success(new { msg = "当前课程报名人数已满,请选择其他课程!" }); + } + //每学期最多两门 + var sslleList = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByStuNo(account); + var sslleListOfNow = sslleList.Where(x => x.AcademicYearNo == olpeEntity.AcademicYearNo && x.Semester == olpeEntity.Semester); + var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); + if (sslleListOfNow1.Count() >= Config.GetValue("OnlineElectiveLessonApplyMax").ToInt()) + { + return Success(new { msg = "每学期最多选择" + Config.GetValue("OnlineElectiveLessonApplyMax").ToInt() + "门线上选修课!" }); + } + //相同时间不能报名 + if (!string.IsNullOrEmpty(olpeEntity.LessonSection) && sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) + { + //相同时间不能报名 + return Success(new { msg = "本学期此时间段已有报名的选修课!" }); + } + + } + + return Fail("正在提交,请等待!"); + } + + #region 获取数据 + + /// + /// 获取页面显示列表分页数据 + /// + /// + /// + public Response GetPageList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = lessonInfoOfElectiveOnlineIbll.GetPageListOfStudent(parameter.pagination, parameter.queryJson).OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonNo).ThenBy(x => x.EmpNo); + var jsonData = new + { + rows = data, + total = parameter.pagination.total, + page = parameter.pagination.page, + records = parameter.pagination.records + }; + return Success(jsonData); + } + public Response StudentGetPageList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = stuSelectLessonListOfElectiveOnlineIBLL.GetPageList(parameter.pagination, parameter.queryJson).OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonNo).ThenBy(x => x.EmpNo); + var jsonData = new + { + rows = data, + total = parameter.pagination.total, + page = parameter.pagination.page, + records = parameter.pagination.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + /// + public Response GetForm(dynamic _) + { + string keyValue = this.GetReqData(); + var Data = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); + + var jsonData = new + { + data = Data, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// + /// + public Response Cancel(dynamic _) + { + dynamic parameter = this.GetReqData(); + string keyValue = parameter.keyValue; + string account = parameter.StuNo; + //学员信息 + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(account); + if (stuInfoBasicEntity == null) + { + return Fail("当前学员不存在!"); + } + //课程信息 + var olpeEntity = lessonInfoOfElectiveOnlineIbll.GetLessonInfoOfElectiveOnlineEntity(keyValue); + if (olpeEntity == null) + { + return Fail("当前课程不存在!"); + } + //当前学员是否已经报名该课程 + var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(account, keyValue); + if (sslleEntity != null) + { + if (sslleEntity.Status != 2) + { + stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(sslleEntity.Id); + return Success("取消成功"); + } + else + { + return Fail("取消失败,当前课程已报名成功!"); + } + } + else + { + return Fail("当前课程未报名,无需取消!"); + } + } + /// + /// 报名 + /// + /// + /// + public Response SignIn(dynamic _) + { + //dynamic parameter = this.GetReqData(); + //string keyValue = parameter.keyValue; + //string account = parameter.StuNo; + + var parameter = this.GetReq(); + string keyValue = parameter.keyValue; + string account = parameter.StuNo; + + SignUpOnlineHelper.Instance.Start(); + //进队列 + SignUpOnlineHelper.AddQueue(account, keyValue); + + return Success("操作成功"); + } + public Response SignInByMobile(dynamic _) + { + dynamic parameter = this.GetReqData(); + string keyValue = parameter.keyValue; + string account = parameter.StuNo; + + SignUpOnlineHelper.Instance.Start(); + //进队列 + SignUpOnlineHelper.AddQueue(account, keyValue); + + return Success("操作成功"); + } + + #endregion + + #region 私有类 + + /// + /// 表单实体类 + /// + private class ReqFormEntity + { + public string keyValue { get; set; } + public string strEntity { get; set; } + } + /// + /// 报名模型 + /// + private class SignModel + { + public string keyValue { get; set; } + public string StuNo { get; set; } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs index b92d60748..88738766e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/TimeTable.cs @@ -22,12 +22,71 @@ namespace Learun.Application.WebApi.Modules Get["/StuList"] = GetStuInfo; Get["/StuLessonInfo"] = GetStuLessonInfo; Get["/timeTableData"] = GetTimeTableData; + Get["/weeklist"] = GetWeeksData; + Get["/currentweek"] = GetCurrentWeek; } private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL(); private StuAttendanceLeaveIBLL stuAttendanceLeaveIBLL = new StuAttendanceLeaveBLL(); private StuAttendanceIBLL stuAttendanceIBLL = new StuAttendanceBLL(); + + public class WeekDate + { + public int week { get; set; } + public string startdate { get; set; } + public string enddate { get; set; } + public string textweek { get; set; } + } + + public Response GetWeeksData(dynamic _) + { + var weekdatelist = new List(); + var yearsemester = Common.GetSemesterAndYear(); + var arrangelessonlist = arrangeLessonTermIBLL.GetListForTimeTable("{\"AcademicYearNo\":\"" + yearsemester.AcademicYearShort + "\",\"Semester\":\"" + yearsemester.Semester + "\"}").OrderBy(m => m.LessonDate); + if (arrangelessonlist.Any()) + { + var firstday = arrangelessonlist.First(); + var lastday = arrangelessonlist.Last(); + var monday = firstday.LessonDate.Value.AddDays(-Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek) + 1); + var sunday = lastday.LessonDate.Value.AddDays(7 - Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek)); + //总周数 + var weekCount = Math.Ceiling(Convert.ToDouble((sunday - monday).Days + 1) / 7); + for (var i = 0; i < weekCount; i++) + { + var wentity = new WeekDate(); + wentity.week = i + 1; + wentity.startdate = monday.AddDays(i * 7).ToString("yyyy-MM-dd"); + wentity.enddate = monday.AddDays(i * 7 + 6).ToString("yyyy-MM-dd"); + wentity.textweek = "第" + wentity.week + "周 (" + wentity.startdate + "~" + wentity.enddate + ")"; + weekdatelist.Add(wentity); + } + return Success(weekdatelist); + } + else + return Success(new { }); + } + + /// + /// 获取当前日期是第几周 + /// + /// + public Response GetCurrentWeek(dynamic _) + { + var yearsemester = Common.GetSemesterAndYear(); + var arrangelessonlist = arrangeLessonTermIBLL.GetListForTimeTable("{\"AcademicYearNo\":\"" + yearsemester.AcademicYearShort + "\",\"Semester\":\"" + yearsemester.Semester + "\"}").OrderBy(m => m.LessonDate); + if (arrangelessonlist.Any()) + { + var firstday = arrangelessonlist.First(); + var lastday = arrangelessonlist.Last(); + var monday = firstday.LessonDate.Value.AddDays(-(Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek) == 0 ? 7 : Convert.ToInt32(firstday.LessonDate.Value.DayOfWeek)) + 1); + var sunday = lastday.LessonDate.Value.AddDays(7 - (Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek) == 0 ? 7 : Convert.ToInt32(lastday.LessonDate.Value.DayOfWeek))); + var currentweek = Util.Time.GetWeekOfDay(monday, sunday); + return Success(new {currentweek}); + } + return Success(new {currentweek=1}); + } + /// /// 课程表【教师功能、学生功能】 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config index 8083ced83..296ae2ea8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/system.config @@ -107,6 +107,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 780383511..f9ac4a56c 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/ArrangeLessonTerm/ArrangeLessonTermBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs index 7b105a54f..0bd240547 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermBLL.cs @@ -43,7 +43,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + public IEnumerable GetListForTimeTable(string queryJson) + { + try + { + return arrangeLessonTermService.GetListForTimeTable(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取列表分页数据 /// 分页参数 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs index 83ae4c390..caa1deec0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermIBLL.cs @@ -48,6 +48,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// IEnumerable GetList(string queryJson); + + IEnumerable GetListForTimeTable(string queryJson); Task AsyncArrangeLessonData(); Task AsyncModifyArrangeLessonData(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index d01125819..b50124011 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -139,6 +139,75 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetListForTimeTable(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + + var strSql = new StringBuilder(); + strSql.Append("SELECT LessonDate,AcademicYearNo,Semester"); + strSql.Append(" FROM ArrangeLessonTerm t where 1=1 "); + + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" AND t.Semester = @Semester "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + strSql.Append(" AND t.LessonNo = @LessonNo "); + } + if (!queryParam["TeachClassNo"].IsEmpty()) + { + dp.Add("TeachClassNo", "%" + queryParam["TeachClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.TeachClassNo like @TeachClassNo "); + } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); + strSql.Append(" AND t.EmpNo = @EmpNo "); + } + if (!queryParam["ClassroomNo"].IsEmpty()) + { + dp.Add("ClassroomNo", queryParam["ClassroomNo"].ToString(), DbType.String); + strSql.Append(" AND t.ClassroomNo = @ClassroomNo "); + } + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + internal IEnumerable GetListByEmpNo(List empNos) { try @@ -1701,16 +1770,18 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les try { //前五年-后五年 - var preYear = DateTime.Now.AddYears(-5).Year; - var nextYear = DateTime.Now.AddYears(5).Year; + var preYear = DateTime.Now.AddYears(-1).Year; + var nextYear = DateTime.Now.AddYears(1).Year; var yearList = new List(); for (int i = preYear; i <= nextYear; i++) { - yearList.Add(string.Format("{0}-{1}", i.ToString().Substring(2), (i + 1).ToString().Substring(2))); + yearList.Add(string.Format("'{0}-{1}'", i.ToString().Substring(2), (i + 1).ToString().Substring(2))); } var aa = new List(); //必修课 - var teacherData = this.BaseRepository("CollegeMIS").FindList(x => yearList.Contains(x.AcademicYearNo)); + //var teacherData = this.BaseRepository("CollegeMIS").FindList(x => yearList.Contains(x.AcademicYearNo)); + var teacherData = this.BaseRepository("CollegeMIS").FindList("select EmpNo,EmpName,F_SchoolId from ArrangeLessonTerm where AcademicYearNo in(" + string.Join(",", yearList) + ") "); + if (!string.IsNullOrEmpty(schoolId)) { teacherData = teacherData.Where(x => x.F_SchoolId == schoolId); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs index e811a1bee..ff1aaab12 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewBLL.cs @@ -18,11 +18,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #region 获取数据 - public List GetClassTree() + public List GetClassTree(string DeptNo) { try { - var list = exam_ArrangeExamTermNewService.GetClassTree(); + var list = exam_ArrangeExamTermNewService.GetClassTree(DeptNo); List treeList = new List(); foreach (var item in list) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs index efe5ab32a..44762844a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewIBLL.cs @@ -15,7 +15,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { #region 获取数据 - List GetClassTree(); + List GetClassTree(string DeptNo); List GetClassRoomTree(string AcademicYearNo, string Semester); IEnumerable GetPageListForClass(Pagination pagination, string queryJson); IEnumerable GetItemPageList(Pagination pagination, string queryJson); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs index 8e5bd6173..06ab46c1a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ArrangeExamTermNew/Exam_ArrangeExamTermNewService.cs @@ -19,11 +19,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public class Exam_ArrangeExamTermNewService : RepositoryFactory { #region 获取数据 - public IEnumerable GetClassTree() + public IEnumerable GetClassTree(string DeptNo) { try { - return this.BaseRepository("CollegeMIS").FindList("select ClassNo,ClassName from Exam_ArrangeExamTermItemNew where ClassNo is not null group by ClassNo,ClassName order by ClassNo"); + return this.BaseRepository("CollegeMIS").FindList($@"select ClassNo,ClassName from Exam_ArrangeExamTermItemNew t + left join Exam_ExamPlan e on t.EPId = e.EPId where ClassNo is not null and e.importdeptno='{DeptNo}' group by ClassNo,ClassName order by ClassNo"); } catch (Exception ex) { @@ -109,6 +110,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND e.ImportDeptNo='' "); + } + else + { + strSql.Append(" AND e.ImportDeptNo ='"+ queryParam["ImportDeptNo"].ToString() + "'"); + } + } strSql.Append(@" group by AcademicYearNo, Semester, ExamDate, ExamTime,LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName,t.EPId having count(StuNo)>0"); @@ -180,6 +192,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append(" AND ( t.ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND t.ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND e.ImportDeptNo='' "); + } + else + { + strSql.Append(" AND e.ImportDeptNo ='"+ queryParam["ImportDeptNo"].ToString() + "' "); + } + + } strSql.Append(@"group by t.lessonName,t.lessonno,t.Examdate,t.examtime,t.EmpName,t.EmpNo,t.ClassroomNo,t.ClassroomName ,l.TeachMajorNo,e.AcademicYearNo ,e.Semester "); return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); } @@ -256,7 +280,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND e.ImportDeptNo='' "); + } + else + { + strSql.Append(" AND e.ImportDeptNo ='" + queryParam["ImportDeptNo"].ToString() + "' "); + } + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), null, pagination); } catch (Exception ex) @@ -329,6 +364,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + strSql.Append(" and e.AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' "); + } + if (!queryParam["Semester"].IsEmpty()) + { + strSql.Append(" and e.Semester='" + queryParam["Semester"].ToString() + "' "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonBLL.cs index cbb044acc..6f55fdbfe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonBLL.cs @@ -181,11 +181,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - public int Import(string AcademicYearNo, string Semester,string ExamTime) + public int Import(string AcademicYearNo, string Semester,string ExamTime,string ImportDeptNo) { try { - return exam_ExamLessonService.Import(AcademicYearNo, Semester, ExamTime); + return exam_ExamLessonService.Import(AcademicYearNo, Semester, ExamTime, ImportDeptNo); } catch (Exception ex) { @@ -201,11 +201,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester,string ImportDeptNo) { try { - return exam_ExamLessonService.DeleteWhere(AcademicYearNo, Semester); + return exam_ExamLessonService.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonIBLL.cs index a6da458d5..b3f697b85 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonIBLL.cs @@ -51,8 +51,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, Exam_ExamLessonEntity entity); - int Import(string AcademicYearNo, string Semester,string ExamTime); - int DeleteWhere(string AcademicYearNo, string Semester); + int Import(string AcademicYearNo, string Semester,string ExamTime,string ImportDeptNo); + int DeleteWhere(string AcademicYearNo, string Semester,string ImportDeptNo); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs index 9c701d454..1428355bd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs @@ -49,6 +49,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); strSql.Append(" AND t.Semester = @Semester "); } + if (!queryParam["ELEnabled"].IsEmpty()) + { + dp.Add("ELEnabled", queryParam["ELEnabled"].ToString(), DbType.String); + strSql.Append(" AND t.ELEnabled = @ELEnabled "); + } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND t.ImportDeptNo='' "); + } + else + { + dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + } + + } if (!queryParam["LessonNo"].IsEmpty()) { dp.Add("LessonNo", "%" + queryParam["LessonNo"].ToString() + "%", DbType.String); @@ -253,10 +271,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int Import(string AcademicYearNo, string Semester, string ExamTime) + public int Import(string AcademicYearNo, string Semester, string ExamTime, string ImportDeptNo) { try { + string sqldept = ""; + if (!string.IsNullOrEmpty(ImportDeptNo)) + { + sqldept = $" and t.DeptNo='{ImportDeptNo}' and LessonTypeId in (select LTId from CdLessonType where LessonTypeCode like 'Professional%') "; + } //导入专业开课计划中是必修的(lessonsortno=1)、考核方式是考试的(ExamType='1',2022.6.23新增) string sql = $@"insert into Exam_ExamLesson([ELId] ,[AcademicYearNo] @@ -265,14 +288,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ,[LessonName] ,[LessonNo] ,[ELOrder] - ,[ELEnabled],ExamTime,LessonTypeId,DeptNo,MajorNo) -select NEWID(),AcademicYearNo,t.Semester,Grade,t.LessonName,t.[LessonNo],0,1,'{ExamTime}',a.lessontypeid,t.DeptNo,t.MajorNo from OpenLessonPlan t + ,[ELEnabled],ExamTime,LessonTypeId,DeptNo,MajorNo,ImportDeptNo) +select NEWID(),AcademicYearNo,t.Semester,Grade,t.LessonName,t.[LessonNo],0,1,'{ExamTime}',a.lessontypeid,t.DeptNo,t.MajorNo,'{ImportDeptNo}' from OpenLessonPlan t left join lessoninfo a on t.lessonno=a.lessonno - where t.ExamType='1' and t.lessonsortno=1 and t.AcademicYearNo='{AcademicYearNo}' and t.Semester='{Semester}' - and t.[LessonNo] not in (select [LessonNo] from Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) + where t.ExamType='1' and t.lessonsortno=1 and t.AcademicYearNo='{AcademicYearNo}' and t.Semester='{Semester}' {sqldept} + and t.[LessonNo] not in (select [LessonNo] from Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}' ) group by t.LessonNo,t.LessonName,t.AcademicYearNo,t.Semester,Grade,a.lessontypeid,t.DeptNo,t.MajorNo "; - + return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) @@ -294,11 +317,11 @@ left join lessoninfo a on t.lessonno=a.lessonno /// /// /// - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - string sql = $"delete Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; + string sql = $"delete Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}'"; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanEntity.cs index 33f884d50..27cfe4541 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanEntity.cs @@ -29,6 +29,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("SEMESTER")] public int? Semester { get; set; } + + [Column("IMPORTDEPTNO")] + public string ImportDeptNo { get; set; } /// /// 排考名称 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs index 92212d000..745d56421 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs @@ -84,6 +84,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EPGenarate", queryParam["EPGenarate"].ToString(), DbType.String); strSql.Append(" AND t.EPGenarate = @EPGenarate "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND t.ImportDeptNo='' "); + } + else + { + dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + } + + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs index 84ce9608a..a739deffd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs @@ -329,7 +329,7 @@ where l.EPLId='{EPLId}' //查询当前考试记录所有考试课程 var lessonList = db.FindList($@"select a.*,b.MajorNo as TeachMajorNo FROM [dbo].[Exam_ExamPlanLesson] a left join [dbo].[Exam_ExamPlan] c on c.epid=a.epid -left join [dbo].[Exam_ExamLesson] b on a.lessonno=b.lessonno and b.AcademicYearNo=c.AcademicYearNo and b.Semester=c.Semester and b.Grade=a.Grade +left join [dbo].[Exam_ExamLesson] b on a.lessonno=b.lessonno and b.AcademicYearNo=c.AcademicYearNo and b.Semester=c.Semester and b.Grade=a.Grade and b.ImportDeptNo=c.ImportDeptNo where a.EPId='{EPId}'"); foreach (var lesson in lessonList) { @@ -337,30 +337,34 @@ where a.EPId='{EPId}'"); var cdLessonType = db.FindEntity(lesson.LessonTypeId); if (cdLessonType != null) { - if (cdLessonType.LessonTypeName.Contains("专业")) + if (cdLessonType.LessonTypeName.Contains("专业") || + cdLessonType.LessonTypeCode.Contains("Professional")) { //专业课添加此专业的所有班级 var addSql = $@"insert into Exam_ExamPlanClass SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t - left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.Grade='{lesson.Grade}' + left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.Grade='{lesson.Grade}' and t.ImportDeptNo='{examPlan.ImportDeptNo}' and t.ESType='{examPlan.PlanType}' and c.majorno='{lesson.TeachMajorNo}' and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}') group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "; db.ExecuteBySql(addSql); } - else if (cdLessonType.LessonTypeName.Contains("公共") || cdLessonType.LessonTypeName.Contains("公开")) + else if (cdLessonType.LessonTypeName.Contains("公共") || + cdLessonType.LessonTypeName.Contains("公开") || + cdLessonType.LessonTypeCode.Contains("OpenLesson")) { //公共课添加所有班级 var addSql = $@"insert into Exam_ExamPlanClass SELECT NEWID(),'{lesson.EPLId}',c.ClassName,t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t - left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.ESType='{examPlan.PlanType}' and t.Grade='{lesson.Grade}' + left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.ESType='{examPlan.PlanType}' and t.Grade='{lesson.Grade}' and t.ImportDeptNo='{examPlan.ImportDeptNo}' and t.ClassNo not in (select ClassNo from [dbo].[Exam_ExamPlanClass] where EPLId='{lesson.EPLId}') group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "; db.ExecuteBySql(addSql); } } - + else + continue; //更新排考安排课程表实排班级数、实排人数和应排班级数、应排人数(如果没有点击【一键安排班级】,应排班级数、应排人数在安排考试页面切换课程时候更新) string sql = $@"update l set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum,ClassNum=t.RealClassNum,StuCount=t.RealStuCount diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs index 4baa5d04c..8bb49c03b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs @@ -130,6 +130,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [NotMapped] public string LessonTypeName { get; set; } /// + /// 课程类型编号 + /// + [NotMapped] + public string LessonTypeCode { get; set; } + /// /// 专业 /// [NotMapped] diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs index 37f74e960..4067a5035 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs @@ -329,7 +329,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { //必修+'('+grade+')' string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) -select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' +select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}') group by LessonNo,grade,LessonName,LessonTypeId,grade"; this.BaseRepository("CollegeMIS").ExecuteBySql(sql); @@ -340,7 +340,7 @@ select NEWID(),'{EPId}',LessonName,LessonNo,LessonTypeId,grade from Exam_ExamLes string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade from StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo - join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' ) t on a.lessonno=t.lessonno + join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' ) t on a.lessonno=t.lessonno --left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) @@ -355,7 +355,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId,Grade) select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId,b.Grade from StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo - join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' ) t on a.lessonno=t.lessonno + join (select l.lessonno,l.LessonTypeId,lt.ltorder from Exam_ExamLesson l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.elenabled=1 and l.AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and l.Semester='{exam_ExamPlan.Semester}' and ImportDeptNo='{exam_ExamPlan.ImportDeptNo}' ) t on a.lessonno=t.lessonno --left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) @@ -546,7 +546,7 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId where t.EPId='{ExamPlanLesson.EPId}' and info.CheckMark=1 "); } var EPLesson = EPLessonList.Where(x => x.EPLId == ExamPlanLesson.EPLId).FirstOrDefault(); - if (EPLessonList.ToList().Exists(x => x.EPLId != entity.EPLId && x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPLesson.ExamLength && x.ExamDate != null && x.ExamDate == entity.ExamDate && x.ExamTime == entity.ExamTime)) + if (EPLessonList.ToList().Exists(x => x.EPLId != entity.EPLId && x.TeachMajorNo == EPLesson.TeachMajorNo&&x.Grade== ExamPlanLesson.Grade && x.ExamLength == EPLesson.ExamLength && x.ExamDate != null && x.ExamDate == entity.ExamDate && x.ExamTime == entity.ExamTime)) { return (false, "同专业同时段只能安排一门课程!"); } @@ -592,8 +592,8 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId return (false, "请先安排考试记录时间!"); } //考试课程数据 - var EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t -join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}' + var EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeCode,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t +join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}' and elesson.ImportDeptNo='{examPlan.ImportDeptNo}' left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId where t.EPId='{EPId}' and elesson.ELEnabled=1 "); // if (examPlan.PlanType == "1") @@ -618,8 +618,9 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId { EPLesson.ExamDate = null; EPLesson.ExamTime = null; - if (!string.IsNullOrEmpty(EPLesson.LessonTypeName) && (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开"))) + if (!string.IsNullOrEmpty(EPLesson.LessonTypeName) && (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开")||EPLesson.LessonTypeCode.Contains("OpenLesson"))) { + //获取公共课时间安排 var EPTimes = EPTimeList.Where(x => x.ExamType == "2" && x.ExamTimeLength == EPLesson.ExamLength).ToList(); foreach (var EPTime in EPTimes) { @@ -627,7 +628,7 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId //不存在同专业同时间段的考试课程,修改考试时间 if (!EPLessonList.ToList().Exists(x => x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && - x.ExamDate == EPTime.ExamDate && x.ExamTime == time)) + x.ExamDate == EPTime.ExamDate && x.ExamTime == time&&x.Grade==EPLesson.Grade)) { EPLesson.ExamDate = EPTime.ExamDate; EPLesson.ExamTime = time; @@ -652,7 +653,7 @@ left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId //不存在同专业同时间段的考试课程,修改考试时间 if (!EPLessonList.ToList().Exists(x => x.TeachMajorNo == EPLesson.TeachMajorNo && x.ExamLength == EPTime.ExamTimeLength && x.ExamDate != null && - x.ExamDate == EPTime.ExamDate && x.ExamTime == time)) + x.ExamDate == EPTime.ExamDate && x.ExamTime == time && x.Grade == EPLesson.Grade)) { EPLesson.ExamDate = EPTime.ExamDate; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs index 7dec2cc0d..e0df6cf63 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs @@ -343,7 +343,7 @@ where l.EPLId='{EPLId}'"; //考场座位数 int? seatCount = 0; var roomListSql = - $"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 "; + $"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ImportDeptNo='{examPlan.ImportDeptNo}' and EREnabled=1 "; if (conflictRoom.Count() > 0) { var classroomNo = string.Join("','", conflictRoom.ToList()); @@ -461,9 +461,9 @@ where l.EPLId='{EPLId}'"; } //查询课程信息 - var lessoninfo = db.FindList($@"select top 1 t.LessonTypeName,l.* from lessoninfo l + var lessoninfo = db.FindList($@"select top 1 t.LessonTypeName,t.LessonTypeCode,l.* from lessoninfo l join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); - if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) + if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")&&!lessoninfo.LessonTypeCode.Contains("OpenLesson")) { //如果是专业课,监考老师不能添加这门课的代课老师 var teachClass = db.FindList( @@ -502,14 +502,23 @@ where l.EPLId='{EPLId}'"; empnos.Add(examRoom.EmpNo); } } - - var sql = $@"select * from Exam_InvigilateTeacher where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ITEnabled=1 "; + //20230614增加已排监考次数算法 + //排过监考的老师顺序往后调整 + //var sql = $@"select * from Exam_InvigilateTeacher where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ImportDeptNo='{examPlan.ImportDeptNo}' and ITEnabled=1 "; + var sql = $@"select aa.EmpName,aa.EmpNo,count(b.EmpNo) as times from Exam_InvigilateTeacher aa + left join(select EPRId, SUBSTRING(a.EmpNo, number, CHARINDEX(',',a.EmpNo + ',',number)-number) as EmpNo + from[Exam_ExamPlanRoom] a with(nolock) ,master..spt_values with(nolock) + where number>= 1 and number"'"+m.EPLId+"'"))}) + ) b on aa.empno = b.empno + where aa.AcademicYearNo = '{examPlan.AcademicYearNo}' and aa.Semester = '{examPlan.Semester}' and aa.ImportDeptNo = '{examPlan.ImportDeptNo}' and aa.ITEnabled = 1"; if (empnos.Count() > 0) { string nos = string.Join("','", empnos); - sql += $" and EmpNo not in ('{nos}')"; + sql += $" and aa.EmpNo not in ('{nos}')"; } - var Exam_InvigilateTeacher = db.FindList(sql).OrderBy(x => Guid.NewGuid()).ToList(); + sql += " group by aa.EmpName,aa.EmpNo order by times"; + var Exam_InvigilateTeacher = db.FindList(sql).OrderBy(x => Guid.NewGuid()).OrderBy(x=>x.times).ToList(); //查询考场 var examPlanRooms = db.FindList(x => x.EPLId == epLesson.EPLId).ToList(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanTime/Exam_ExamPlanTimeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanTime/Exam_ExamPlanTimeEntity.cs index a57c80988..01e2b90ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanTime/Exam_ExamPlanTimeEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanTime/Exam_ExamPlanTimeEntity.cs @@ -45,7 +45,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("EXAMTIMELENGTH")] public double? ExamTimeLength { get; set; } /// - /// 排考名称 + /// 课程类型 /// [Column("EXAMTYPE")] public string ExamType { get; set; } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomBLL.cs index 5f2d6e9f3..40c60d3fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomBLL.cs @@ -162,11 +162,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) + public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns, string ImportDeptNo) { try { - return exam_ExamRoomService.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); + return exam_ExamRoomService.Import(AcademicYearNo, Semester,SeatRows,SeatColumns, ImportDeptNo); } catch (Exception ex) { @@ -182,11 +182,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - return exam_ExamRoomService.DeleteWhere(AcademicYearNo, Semester); + return exam_ExamRoomService.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomIBLL.cs index 104571f48..a648b4432 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomIBLL.cs @@ -50,8 +50,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, Exam_ExamRoomEntity entity); - int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns); - int DeleteWhere(string AcademicYearNo, string Semester); + int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns, string ImportDeptNo); + int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs index 0b12a54a3..5f8f0c500 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs @@ -47,6 +47,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); strSql.Append(" AND t.Semester = @Semester "); } + if (!queryParam["EREnabled"].IsEmpty()) + { + dp.Add("EREnabled", queryParam["EREnabled"].ToString(), DbType.String); + strSql.Append(" AND t.EREnabled = @EREnabled "); + } if (!queryParam["ClassroomNo"].IsEmpty()) { dp.Add("ClassroomNo", "%" + queryParam["ClassroomNo"].ToString() + "%", DbType.String); @@ -57,6 +62,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); strSql.Append(" AND t.ClassroomName Like @ClassroomName "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND t.ImportDeptNo='' "); + } + else + { + dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + } + + } if (!queryParam["EPLId"].IsEmpty()) { var examLesson = this.BaseRepository("CollegeMIS").FindEntity(queryParam["EPLId"].ToString()); @@ -66,6 +84,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); + strSql.Append($" AND t.ImportDeptNo = '{ELEntity.ImportDeptNo}' "); } strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') "); @@ -283,7 +302,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 座位行数 /// 座位列数 /// - public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) + public int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns, string ImportDeptNo) { try { @@ -296,9 +315,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ,[SeatColumns] ,[SeatCount] ,[EROrder] - ,[EREnabled]) -select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1 from ClassroomInfo where CheckMark=1 - and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) + ,[EREnabled],ImportDeptNo) +select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1,'{ImportDeptNo}' from ClassroomInfo where CheckMark=1 + and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}' ) "; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } @@ -321,11 +340,11 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat /// /// /// - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; + string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}'"; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs index 528d9974e..f755babe5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentBLL.cs @@ -192,11 +192,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int ClaerForm(string AcademicYearNo, string Semester, string ESType) + public int ClaerForm(string AcademicYearNo, string Semester, string ESType, string ImportDeptNo) { try { - return exam_ExamStudentService.ClaerForm(AcademicYearNo, Semester, ESType); + return exam_ExamStudentService.ClaerForm(AcademicYearNo, Semester, ESType, ImportDeptNo); } catch (Exception ex) { @@ -217,11 +217,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int ImportForm(string AcademicYearNo, int Semester, string ESType) + public int ImportForm(string AcademicYearNo, int Semester, string ESType, string ImportDeptNo) { try { - return exam_ExamStudentService.ImportForm(AcademicYearNo, Semester, ESType); + return exam_ExamStudentService.ImportForm(AcademicYearNo, Semester, ESType, ImportDeptNo); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs index c0239280f..97dfa62e7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs @@ -24,6 +24,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("CLASSNO")] public string ClassNo { get; set; } + + [Column("DEPTNO")] + public string DeptNo { get; set; } /// /// 学年 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs index acebaafaf..b9d08163e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentIBLL.cs @@ -64,7 +64,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - int ClaerForm(string AcademicYearNo, string Semester, string ESType); + int ClaerForm(string AcademicYearNo, string Semester, string ESType, string ImportDeptNo); /// /// 同步学生考试信息 /// @@ -72,7 +72,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - int ImportForm(string AcademicYearNo, int Semester, string ESType); + int ImportForm(string AcademicYearNo, int Semester, string ESType, string ImportDeptNo); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs index d28bbd245..2568abda4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs @@ -49,11 +49,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); strSql.Append(" AND t.Semester = @Semester "); } + if (!queryParam["ESEnabled"].IsEmpty()) + { + dp.Add("ESEnabled", queryParam["ESEnabled"].ToString(), DbType.String); + strSql.Append(" AND t.ESEnabled = @ESEnabled "); + } if (!queryParam["ClassNo"].IsEmpty()) { dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); strSql.Append(" AND t.ClassNo = @ClassNo "); } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND t.Grade = @Grade "); + } if (!queryParam["StuNo"].IsEmpty()) { dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); @@ -64,6 +74,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); strSql.Append(" AND t.StuName Like @StuName "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND t.ImportDeptNo='' "); + } + else + { + dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + } + + } if (!queryParam["ESType"].IsEmpty()) { dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); @@ -94,6 +117,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); strSql.Append(" FROM Exam_ExamStudent t "); strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); + strSql.Append(" left join Exam_ExamPlan d on t.ImportDeptNo=d.ImportDeptNo "); strSql.Append(" WHERE t.ESEnabled=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -128,6 +152,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); strSql.Append(" AND t.StuName Like @StuName "); } + //if (!queryParam["ImportDeptNo"].IsEmpty()) + //{ + // if (queryParam["ImportDeptNo"].ToString() == "0") + // { + // strSql.Append(" AND t.ImportDeptNo='' "); + // } + // else + // { + // dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + // strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + // } + + //} if (!queryParam["ESType"].IsEmpty()) { dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); @@ -148,7 +185,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var examPlan = this.BaseRepository("CollegeMIS").FindEntity(queryParam["EPId"].ToString()); if (examPlan != null) { - strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' "); + strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' and t.ImportDeptNo='{examPlan.ImportDeptNo}' "); } } strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); @@ -318,18 +355,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int ClaerForm(string AcademicYearNo, string Semester, string ESType) + public int ClaerForm(string AcademicYearNo, string Semester, string ESType, string ImportDeptNo) { try { string sql = ""; if (!string.IsNullOrEmpty(ESType)) { - sql = $"delete Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType= '{ESType}'"; + sql = $"delete Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType= '{ESType}' and ImportDeptNo='{ImportDeptNo}'"; } else { - sql = $"delete Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; + sql = $"delete Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}'"; } return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } @@ -352,25 +389,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int ImportForm(string AcademicYearNo, int Semester, string ESType) + public int ImportForm(string AcademicYearNo, int Semester, string ESType, string ImportDeptNo) { try { + string sqldept = ""; + if (!string.IsNullOrEmpty(ImportDeptNo)) + { + sqldept = $" and DeptNo='{ImportDeptNo}'"; + } StringBuilder strSql = new StringBuilder(); if (ESType == "1") { strSql.Append( - $@"insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade) - select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1,a.Grade -from StuInfoBasic a where CheckMark = '1' and (ChangeStatus is null or len(ChangeStatus)=0 or ChangeStatus='0') and stuno not in -(select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' + $@"insert into Exam_ExamStudent(ESId,ClassNo,DeptNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade,ImportDeptNo) + select newid(), a.classno,DeptNo, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1,a.Grade,'{ImportDeptNo}' +from StuInfoBasic a where CheckMark = '1' and (ChangeStatus is null or len(ChangeStatus)=0 or ChangeStatus='0') {sqldept} and stuno not in +(select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1' and ImportDeptNo='{ImportDeptNo}' )"); } else { - strSql.Append(@" insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade) "); - strSql.Append($"select newid(),a.classno,'{AcademicYearNo}','{Semester}',a.stuno,a.stuname,'{ESType}',1,b.Grade from "); + string sqldept2 = ""; + if (!string.IsNullOrEmpty(ImportDeptNo)) + { + sqldept2 = $" and b.DeptNo='{ImportDeptNo}'"; + } + strSql.Append(@" insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled,Grade,ImportDeptNo) "); + strSql.Append($"select newid(),a.classno,'{AcademicYearNo}','{Semester}',a.stuno,a.stuname,'{ESType}',1,b.Grade,'{ImportDeptNo}' from "); if (ESType == "2") { strSql.Append(" StuScore "); @@ -380,11 +427,11 @@ from StuInfoBasic a where CheckMark = '1' and (ChangeStatus is null or len(Chang strSql.Append(" StuScoreNotPass "); } strSql.Append(@" a left join StuInfoBasic b on b.StuNo=a.StuNo - where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) "); + where 1=1 and a.LessonSortNo='1' and a.Score>=0 and a.Score<60 "); strSql.Append(" and a.AcademicYearNo ='" + AcademicYearNo + "' and a.Semester ='" + Semester + "' "); - strSql.Append(" and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) "); + strSql.Append(" and (b.ChangeStatus<>'1' or len(b.ChangeStatus)=0 or b.ChangeStatus is null) "+ sqldept2); strSql.Append($@" and a.stuno not in -(select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' +(select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' and ImportDeptNo='{ImportDeptNo}' ) "); strSql.Append(" group by a.stuno,a.stuname,a.classno,b.Grade"); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs index 96e333c8d..dd25c1934 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherBLL.cs @@ -173,11 +173,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - public int Import(string AcademicYearNo, string Semester) + public int Import(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - return exam_InvigilateTeacherService.Import(AcademicYearNo, Semester); + return exam_InvigilateTeacherService.Import(AcademicYearNo, Semester, ImportDeptNo); } catch (Exception ex) { @@ -191,11 +191,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - return exam_InvigilateTeacherService.DeleteWhere(AcademicYearNo, Semester); + return exam_InvigilateTeacherService.DeleteWhere(AcademicYearNo, Semester, ImportDeptNo); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs index 5ca90ec91..11393b2f5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherEntity.cs @@ -39,6 +39,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("EMPNO")] public string EmpNo { get; set; } + + [Column("DEPTNO")] + public string DeptNo { get; set; } /// /// 排序号 /// @@ -69,6 +72,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 + + [NotMapped] public int times { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs index 875f5211a..cc2a2a3b7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherIBLL.cs @@ -46,8 +46,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void SaveEntity(string keyValue, Exam_InvigilateTeacherEntity entity); void Lock(string keyValue, int ITEnabled); - int Import(string AcademicYearNo, string Semester); - int DeleteWhere(string AcademicYearNo, string Semester); + int Import(string AcademicYearNo, string Semester, string ImportDeptNo); + int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs index 06988eb79..86e21b4b7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs @@ -50,6 +50,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); strSql.Append(" AND t.Semester = @Semester "); } + if (!queryParam["ITEnabled"].IsEmpty()) + { + dp.Add("ITEnabled", queryParam["ITEnabled"].ToString(), DbType.String); + strSql.Append(" AND t.ITEnabled = @ITEnabled "); + } if (!queryParam["EmpNo"].IsEmpty()) { dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); @@ -60,6 +65,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); strSql.Append(" AND t.EmpName Like @EmpName "); } + if (!queryParam["ImportDeptNo"].IsEmpty()) + { + if (queryParam["ImportDeptNo"].ToString() == "0") + { + strSql.Append(" AND t.ImportDeptNo='' "); + } + else + { + dp.Add("ImportDeptNo", queryParam["ImportDeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.ImportDeptNo = @ImportDeptNo "); + } + + } if (!queryParam["EPLId"].IsEmpty()) { //考试课程数据 @@ -70,6 +88,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); + strSql.Append($" AND t.ImportDeptNo = '{ELEntity.ImportDeptNo}' "); } //同一考试课程下考场的监考老师不重复 var empSql = "SELECT STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE 1=1 "; @@ -79,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } empSql += $@" and EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T - where EPLId ='{queryParam["EPLId"].ToString()}'"; + where EPLId ='{queryParam["EPLId"].ToString()}' and empno is not null "; var obj = this.BaseRepository("CollegeMIS").FindList(empSql).Select(x => x.EmpNo).Distinct().ToList(); if (obj.Count() > 0) { @@ -95,9 +114,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration LessonNo = LessonNo.Split('(')[0]; } //查询课程信息 - var lessoninfo = this.BaseRepository("CollegeMIS").FindList($@"select top 1 t.LessonTypeName,l.* from lessoninfo l + var lessoninfo = this.BaseRepository("CollegeMIS").FindList($@"select top 1 t.LessonTypeName,t.LessonTypeCode,l.* from lessoninfo l join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{LessonNo}' ").FirstOrDefault(); - if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")) + if (lessoninfo != null && !lessoninfo.LessonTypeName.Contains("公共") && !lessoninfo.LessonTypeName.Contains("公开")&&!lessoninfo.LessonTypeCode.Contains("OpenLesson")) { //如果是专业课,监考老师不能添加这门课的代课老师 var teachClass = this.BaseRepository("CollegeMIS").FindList( @@ -349,20 +368,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// /// - public int Import(string AcademicYearNo, string Semester) + public int Import(string AcademicYearNo, string Semester, string ImportDeptNo) { try { + string sqldept = ""; + if (!string.IsNullOrEmpty(ImportDeptNo)) + { + sqldept = $" and DeptNo='{ImportDeptNo}'"; + } string sql = $@"INSERT INTO [dbo].[Exam_InvigilateTeacher] ([ITId] ,[AcademicYearNo] ,[Semester] ,[EmpName] ,[EmpNo] + ,[DeptNo] ,[ITOrder] - ,[ITEnabled]) -select newid(),'{AcademicYearNo}','{Semester}',empname,empno,0,1 from empinfo where checkmark=1 - and empno not in (select empno from Exam_InvigilateTeacher where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}') + ,[ITEnabled],ImportDeptNo) +select newid(),'{AcademicYearNo}','{Semester}',empname,empno,DeptNo,0,1,'{ImportDeptNo}' from empinfo where checkmark=1 and IsHasLesson=1 and IsInActiveStatus=1 {sqldept} + and empno not in (select empno from Exam_InvigilateTeacher where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}') "; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } @@ -385,11 +410,11 @@ select newid(),'{AcademicYearNo}','{Semester}',empname,empno,0,1 from empinfo wh /// /// /// - public int DeleteWhere(string AcademicYearNo, string Semester) + public int DeleteWhere(string AcademicYearNo, string Semester, string ImportDeptNo) { try { - string sql = $"delete Exam_InvigilateTeacher where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; + string sql = $"delete Exam_InvigilateTeacher where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ImportDeptNo='{ImportDeptNo}'"; return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs index 9468ab5b2..33516ddb2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineEntity.cs @@ -291,6 +291,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [NotMapped] public int Status { get; set; } + [NotMapped] + public string Introduction { get; set; } + [NotMapped] + public string resume; #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs index fbe4acb69..eb616ee51 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/LessonInfoOfElectiveOnline/LessonInfoOfElectiveOnlineService.cs @@ -76,7 +76,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration foreach (var item in list) { //模式二:正式选课 - var aa = this.BaseRepository("CollegeMIS").FindList(x => x.OLPEId == item.Id);//todo:改实体,改字段 + var aa = this.BaseRepository("CollegeMIS").FindList(x => x.LIOEOId == item.Id); //已报名人数 item.StuNumOfApply = aa.Where(x => (x.Status == 1 || x.Status == 2)).Count(); //审核通过人数 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SignUpOnlineHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SignUpOnlineHelper.cs new file mode 100644 index 000000000..efe6f6273 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SignUpOnlineHelper.cs @@ -0,0 +1,232 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Learun.Util; +using Microsoft.AspNet.SignalR; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + public class SignUpOnlineHelper + { + + public readonly static SignUpOnlineHelper Instance = new SignUpOnlineHelper(); + public SignUpOnlineHelper() + { } + public static Queue ListQueue = new Queue(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private LessonInfoOfElectiveOnlineIBLL lessonInfoOfElectiveOnlineIBLL = new LessonInfoOfElectiveOnlineBLL(); + private StuSelectLessonListOfElectiveOnlineIBLL stuSelectLessonListOfElectiveOnlineIBLL = new StuSelectLessonListOfElectiveOnlineBLL(); + private Thread t; + + public static void AddQueue(string stuNo, string lioeoId) //入列 + { + StuSelectLessonListOfElectiveOnlineEntity entity = new StuSelectLessonListOfElectiveOnlineEntity(); + entity.StuNo = stuNo; + entity.LIOEOId = lioeoId; + ListQueue.Enqueue(entity); + } + public void Start()//启动 + { + if (t == null) + { + t = new Thread(threadStart); + t.IsBackground = true; + t.Start(); + } + else + { + if (!t.IsAlive) + { + t = new Thread(threadStart); + t.IsBackground = true; + t.Start(); + } + } + } + + private void threadStart() + { + while (true) + { + if (ListQueue.Count > 0) + { + try + { + ScanQueue(); + } + catch (Exception ex) + { + } + } + else + { + //没有任务,休息3秒钟 + Thread.Sleep(3000); + } + } + } + + //要执行的方法 + private void ScanQueue() + { + while (ListQueue.Count > 0) + { + try + { + //从队列中取出 + StuSelectLessonListOfElectiveOnlineEntity entity = ListQueue.Dequeue(); + //处理数据: + + //学员信息 + var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(entity.StuNo); + if (stuInfoBasicEntity == null) + { + //return Fail("当前学员不存在!"); + return; + } + //课程信息 + var olpeEntity = lessonInfoOfElectiveOnlineIBLL.GetLessonInfoOfElectiveOnlineEntity(entity.LIOEOId); + if (olpeEntity == null) + { + //return Fail("当前课程不存在!"); + return; + } + //所选课程的报名人数是否已满 + var aa = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(olpeEntity.Id); + var aaa = aa.Where(x => x.Status == 1 || x.Status == 2).Count(); + if (aaa >= olpeEntity.StuNumMax) + { + //return Fail("当前课程报名人数已满,请选择其他课程!"); + return; + } + + //当前学员本学期是否有报名课程:每学期一门 + //var sslleEntity = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(entity.StuNo, ""); + //if (sslleEntity != null) + //{ + // if (sslleEntity.OLPEId != entity.OLPEId && sslleEntity.Status != 3) + // { + // //return Fail("已存在报名课程,每学期只能选择一门选修课!如需报名其他课程请先取消。"); + // return; + // } + // if (sslleEntity.Status == 1) + // { + // //return Fail("报名审核中,请耐心等待!"); + // return; + // } + // else if (sslleEntity.Status == 2) + // { + // //return Fail("已存在报名成功的课程,只能选择一门选修课!"); + // return; + // } + // else if (sslleEntity.Status == 3)//移除报名失败的数据 + // { + // stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(sslleEntity.Id); + // } + + //} + + + //每学期两门(几门根据系统配置文件值确定) + var sslleList = stuSelectLessonListOfElectiveOnlineIBLL.GetStuSelectLessonListOfElectiveOnlineListByStuNo(entity.StuNo); + var sslleListOfNow = sslleList.Where(x => x.AcademicYearNo == olpeEntity.AcademicYearNo && x.Semester == olpeEntity.Semester); + var sslleListOfNow1 = sslleListOfNow.Where(x => x.Status == 1 || x.Status == 2); + var sslleListOfNow2 = sslleListOfNow.Where(x => x.Status == 3); + if (sslleListOfNow1.Count() >= Config.GetValue("OnlineElectiveLessonApplyMax").ToInt()) + { + //return Fail("每学期最多选择两门选修课!"); + return; + } + else + { + var m = sslleListOfNow1.FirstOrDefault(x => x.LIOEOId == olpeEntity.Id); + if (m != null) + { + if (m.Status == 1) + { + //return Fail("当前课程报名审核中,请耐心等待!"); + return; + } + else if (m.Status == 2) + { + //return Fail("当前课程已报名成功!"); + return; + } + } + } + if (sslleListOfNow2.Count() > 0) + { + foreach (var item in sslleListOfNow2) + { + stuSelectLessonListOfElectiveOnlineIBLL.DeleteEntity(item.Id); + } + } + //相同时间不能报名 + if (!string.IsNullOrEmpty(olpeEntity.LessonSection) && sslleListOfNow1.Where(x => x.LessonSection == olpeEntity.LessonSection).Any()) + { + //相同时间不能报名 + return; + } + //相同课程不能报名 + if (sslleListOfNow1.Where(x => x.LessonNo == olpeEntity.LessonNo).Any()) + { + //相同课程不能报名 + return; + } + //新增报名数据 + var model = new StuSelectLessonListOfElectiveOnlineEntity() + { + LIOEOId = olpeEntity.Id, + NoticeBookNo = stuInfoBasicEntity.NoticeNo, + StuNo = stuInfoBasicEntity.StuNo, + DeptNo = stuInfoBasicEntity.DeptNo, + MajorNo = stuInfoBasicEntity.MajorNo, + ClassNo = stuInfoBasicEntity.ClassNo, + MajorDetailNo = stuInfoBasicEntity.MajorDetailNo, + MajorDetailName = stuInfoBasicEntity.MajorDetailName, + StuName = stuInfoBasicEntity.StuName, + GenderNo = stuInfoBasicEntity.GenderNo, + Grade = stuInfoBasicEntity.Grade, + AcademicYearNo = olpeEntity.AcademicYearNo, + Semester = olpeEntity.Semester, + LessonNo = olpeEntity.LessonNo, + LessonName = olpeEntity.LessonName, + LessonSortNo = olpeEntity.LessonSortNo, + LessonSection = olpeEntity.LessonSection, + LessonTime = olpeEntity.LessonTime, + EmpNo = olpeEntity.EmpNo, + EmpName = olpeEntity.EmpName, + ClassRoomNo = olpeEntity.ClassRoomNo, + ClassRoomName = olpeEntity.ClassRoomName, + StudyScore = olpeEntity.StudyScore, + StartWeek = olpeEntity.StartWeek, + EndWeek = olpeEntity.EndWeek, + StartDate = olpeEntity.StartDate, + EndDate = olpeEntity.EndDate, + CreateTime = DateTime.Now, + Status = 1, + OrdinaryScoreScale = 1, + TermInScoreScale = 1, + TermEndScoreScale = 1, + OtherScoreScale = 1, + F_SchoolId = olpeEntity.F_SchoolId + }; + stuSelectLessonListOfElectiveOnlineIBLL.SaveEntity("", model); + + + } + catch (Exception ex) + { + throw; + } + } + } + + } + + + +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs index 373915d32..4c6b10392 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs @@ -1110,6 +1110,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + public void DoSlow(string keyValue, int status) + { + try + { + stuScoreService.DoSlow(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs index bf927f178..e261630d5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs @@ -318,6 +318,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("F_SCHOOLID")] public string F_SchoolId { get; set; } + /// + /// 缓考标识 + /// + /// + [Column("ISSLOW")] + public bool? IsSlow { get; set; } #endregion @@ -420,6 +426,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [NotMapped] public string LessonSortName { get; set; } + + [NotMapped] + public string LessonTypeName { get; set; } /// /// 专业名称 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs index 1e9961ec7..4d9020b34 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs @@ -253,6 +253,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 已审核:1;未审核:0; void DoCheckScore(string queryJson, int checkMark); + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + void DoSlow(string keyValue, int status); + (DataTable failDt, int snum, int fnum) ExecuteImportExcel(int type, DataTable dt, string fileGuid, string queryJson); #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index c75eb02e4..793e7669f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -2109,6 +2109,31 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad } } + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + public void DoSlow(string keyValue, int status) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsSlow={status} where ScoreId in ({keyValue})"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion /// @@ -2215,7 +2240,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad tableName = queryParam["TableName"].ToString(); } var strSql = new StringBuilder(); - strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,bb.Score,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,lt.LessonTypeName,bb.Score,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); strSql.Append(" from ( "); strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); strSql.Append(" where 1=1 and s.CheckMark='1' "); @@ -2246,6 +2271,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad strSql.Append(" left join LessonInfo li on bb.LessonNo= li.LessonNo and li.CheckMark='1' "); strSql.Append(" left join CdMajor cm on bb.MajorNo= cm.MajorNo and cm.CheckMark='1' "); strSql.Append(" left join ClassInfo ci on bb.ClassNo= ci.ClassNo and ci.CheckMark='1' "); + strSql.Append(" left join CdLessonType lt on li.LessonTypeId=lt.ltid and lt.LTEnabled='1' "); var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs index 9c32a61e4..cbeee83ea 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs @@ -586,6 +586,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + public void DoSlow(string keyValue, int status) + { + try + { + stuScoreNotPassService.DoSlow(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassEntity.cs index 57aa30a58..afb325bb3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassEntity.cs @@ -326,6 +326,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("CLASSROOMNAME")] public string ClassRoomName { get; set; } + /// + /// 缓考标识 + /// + /// + [Column("ISSLOW")] + public bool? IsSlow { get; set; } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs index 242e7759d..32dd7325e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs @@ -172,6 +172,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration (DataTable failDt, int snum, int fnum) ExecuteImportExcelForNotPass(DataTable dt, string fileGuid, string queryJson); + + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + void DoSlow(string keyValue, int status); #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs index 55e6e5fda..558be7c98 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs @@ -582,6 +582,7 @@ StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo where a.LessonSortNo='1' and (b.ChangeStatus is null or len(b.ChangeStatus)=0 or b.ChangeStatus <> '1') and ( (a.Score >= 0 and a.Score<60) or a.Score=(-5) or a.Score=(-10) ) +and ( a.IsSlow is null or a.IsSlow <> 1 ) and a.StuNo not in ( select StuNo from StuScoreNotPass p where p.AcademicYearNo=a.AcademicYearNo and p.Semester=a.Semester and p.LessonNo=a.LessonNo and p.TeachClassNo=a.TeachClassNo and p.LessonSortNo=a.LessonSortNo and p.OpenLessonDeptNo=a.OpenLessonDeptNo and p.OpenLessonMajorNo=a.OpenLessonMajorNo ) @@ -1290,6 +1291,32 @@ order by bb.ScoreId"; } } + + /// + /// 缓考 + /// + /// + /// 缓考:1;取消缓考:0; + /// + public void DoSlow(string keyValue, int status) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsSlow={status} where ScoreId in ({keyValue})"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwo/StuScoreNotPassTwoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwo/StuScoreNotPassTwoService.cs index 9278a7b82..4e44664bf 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwo/StuScoreNotPassTwoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPassTwo/StuScoreNotPassTwoService.cs @@ -627,6 +627,7 @@ StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo where a.LessonSortNo='1' and (b.ChangeStatus is null or len(b.ChangeStatus)=0 or b.ChangeStatus <> '1') and ( (a.Score >= 0 and a.Score<60) or a.Score=(-5) or a.Score=(-10) ) +and ( a.IsSlow is null or a.IsSlow <> 1 ) and a.StuNo not in ( select StuNo from StuScoreNotPassTwo p where p.AcademicYearNo=a.AcademicYearNo and p.Semester=a.Semester and p.LessonNo=a.LessonNo and p.TeachClassNo=a.TeachClassNo and p.LessonSortNo=a.LessonSortNo and p.OpenLessonDeptNo=a.OpenLessonDeptNo and p.OpenLessonMajorNo=a.OpenLessonMajorNo ) 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..5224a3787 --- /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, string AcademicYearNo = "", string Semester = "") + { + try + { + return stuScoreOnlineService.GetEmpNoData(userAccount, userType, lessonNo, AcademicYearNo, Semester); + } + 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..cdd27dabb --- /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, string AcademicYearNo = "", string Semester = ""); + + /// + /// 课程下拉框信息【学生成绩录入可去审核】 + /// + /// + 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..892eb8f4e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreOnline/StuScoreOnlineService.cs @@ -0,0 +1,2483 @@ +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(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 班级学生成绩初始化 + /// + /// + public void DoInitAboutClass(string academicYearNo, string semester, string classNo) + { + try + { + //清空StuSelectLessonList + this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuSelectLessonList where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' "); + //清空StuScoreOnline + this.BaseRepository("CollegeMIS").ExecuteBySql("delete from StuScoreOnline where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "' and ClassNo='" + classNo + "' and LessonSortNo='1' "); + //重置StuSelectLessonList + var lessonData = this.BaseRepository("CollegeMIS").FindList(); + var TeachClassData = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academicYearNo && x.Semester == semester && x.TeachClassNo == classNo); + var classstulist = this.BaseRepository("CollegeMIS").FindList(x => x.ClassNo == classNo); + var stuSelectLessonListEntityData = this.BaseRepository("CollegeMIS").FindList(); + var insertStuSelectLessonListDataList = new List(); + if (TeachClassData.Any()) + { + foreach (var itemteachclass in TeachClassData) + { + foreach (var stu in classstulist) + { + var insertDatastuselect = new StuSelectLessonListEntity(); + insertDatastuselect.NoticeBookNo = stu.NoticeNo; + insertDatastuselect.StuNo = stu.StuNo; + insertDatastuselect.DeptNo = stu.DeptNo; + insertDatastuselect.ClassNo = stu.ClassNo; + insertDatastuselect.MajorNo = stu.MajorNo; + insertDatastuselect.StuName = stu.StuName; + insertDatastuselect.GenderNo = stu.GenderNo != null && stu.GenderNo.Value ? "1" : "0"; + insertDatastuselect.AcademicYearNo = itemteachclass.AcademicYearNo; + insertDatastuselect.Semester = itemteachclass.Semester; + insertDatastuselect.OpenLessonDeptNo = itemteachclass.DeptNo; + insertDatastuselect.OpenLessonMajorNo = itemteachclass.MajorNo; + insertDatastuselect.LessonNo = itemteachclass.LessonNo; + insertDatastuselect.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo)?.LessonName; + insertDatastuselect.PartCode = ""; + insertDatastuselect.OrdinaryScoreScale = 1; + insertDatastuselect.TermInScoreScale = 1; + insertDatastuselect.TermEndScoreScale = 1; + insertDatastuselect.OtherScoreScale = 1; + insertDatastuselect.TeachClassNo = stu.ClassNo; + insertDatastuselect.LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo)?.LessonSortNo; + insertDatastuselect.StuSortNo = "02"; + insertDatastuselect.Grade = stu.Grade; + insertDatastuselect.StudyScore = lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo).StudyScore == null ? 0 : lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo).StudyScore; + insertDatastuselect.TotalStudyHour = lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo).TotalStudyHour == null ? 0 : lessonData.FirstOrDefault(m => m.LessonNo == itemteachclass.LessonNo).TotalStudyHour; + insertDatastuselect.IsInEffect = "1"; + insertDatastuselect.EmpNo = itemteachclass.EmpNo; + insertDatastuselect.IsPitchOn = "1"; + insertDatastuselect.CheckMark = "0"; + insertDatastuselect.InsertTime = DateTime.Now; + if (stuSelectLessonListEntityData.Count(m => m.StuNo == insertDatastuselect.StuNo && + m.AcademicYearNo == insertDatastuselect.AcademicYearNo && + m.Semester == insertDatastuselect.Semester && + m.DeptNo == insertDatastuselect.DeptNo && + m.MajorNo == insertDatastuselect.MajorNo && + m.LessonNo == insertDatastuselect.LessonNo && + m.Grade == insertDatastuselect.Grade && + m.OpenLessonDeptNo == insertDatastuselect.OpenLessonDeptNo && + m.OpenLessonMajorNo == insertDatastuselect.OpenLessonMajorNo) == 0 && insertStuSelectLessonListDataList.Count(m => m.StuNo == insertDatastuselect.StuNo && + m.AcademicYearNo == insertDatastuselect.AcademicYearNo && + m.Semester == insertDatastuselect.Semester && + m.DeptNo == insertDatastuselect.DeptNo && + m.MajorNo == insertDatastuselect.MajorNo && + m.LessonNo == insertDatastuselect.LessonNo && + m.Grade == insertDatastuselect.Grade && + m.OpenLessonDeptNo == insertDatastuselect.OpenLessonDeptNo && + m.OpenLessonMajorNo == insertDatastuselect.OpenLessonMajorNo) == 0) + { + insertStuSelectLessonListDataList.Add(insertDatastuselect); + } + } + } + this.BaseRepository("CollegeMIS").Insert(insertStuSelectLessonListDataList); + } + //重置StuScoreOnline + var strSql = new StringBuilder(); + strSql.Append(@"insert into stuscore(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,OrdinaryScore,TermInScore,TermEndScore,OtherScore,IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx,TestKindNo,IsEditable) +select NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,OpenLessonDeptNo,OpenLessonMajorNo,LessonNo,LessonName,LessonNameEng as LessionNameEn,TeachClassNo,LessonSortNo,StuSortNo,Grade,StudyScore,TotalStudyHour,'0','0','0','0',IsInEffect,Remark,ConflictLessonNo,IsPitchOn,CheckMark,TeachPlanNo as TechPlanNo,EmpNo,PartCode,ScoreRecordStyleNo,TestModeNo,zysx=1,TestKindNo=1,IsEditable=1 from +( +select s.NoticeBookNo,s.StuNo,s.DeptNo,s.MajorNo,s.ClassNo,s.StuName,s.GenderNo,s.AcademicYearNo,s.Semester,s.OpenLessonDeptNo,s.OpenLessonMajorNo,s.LessonNo,s.LessonName,s.LessonNameEng,s.TeachClassNo,s.LessonSortNo,s.StuSortNo,s.Grade,s.StudyScore,s.TotalStudyHour,s.IsInEffect,s.Remark,s.ConflictLessonNo,s.IsPitchOn,s.CheckMark,s.TeachPlanNo,s.EmpNo,s.PartCode,o.ScoreRecordStyleNo,cs.ScoreRecordName,bc.TestModeNo,bc.TestMode +from StuSelectLessonList s +left join OpenLessonPlan o on s.AcademicYearNo=o.AcademicYearNo and s.Semester=o.Semester and s.LessonNo=o.LessonNo +and s.PartCode=o.PartCode and s.OpenLessonMajorNo=o.MajorNo +left join CdScoreRecordStyle cs on o.ScoreRecordStyleNo=cs.ScoreRecordStyleNo +left join BCdTestMode bc on o.CheckStyleNo=bc.TestModeNo +where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.TeachClassNo='" + classNo + @"' and s.LessonSortNo='1' +) as sl +where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Academicyearno + and s.Semester = sl.Semester and s.lessonno = sl.lessonno and s.teachclassno = sl.teachclassno and s.LessonSortNo = '1') "); + this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString()); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 学年下拉框信息【班级成绩查看】 + /// + /// + public IEnumerable GetAcademicYearNoData() + { + try + { + var data = this.BaseRepository("CollegeMIS").FindList("select distinct s.AcademicYearNo as value,s.AcademicYearNo as text from StuScoreOnline s "); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 班级下拉框信息【班级成绩查看】 + /// + /// + public IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.ClassNo as value,c.ClassName as text from stuscore s inner join ClassInfo c on s.ClassNo=c.ClassNo where s.LessonSortNo='1' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 班级下拉框【成绩录入】 + /// + /// + /// + /// + /// + /// + /// + public IEnumerable GetClassNoDataForInput(string userAccount, string userType, string lessonNo, string academicYearShort, string semester) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.ClassNo as value,c.ClassName as text from stuscore s inner join ClassInfo c on s.ClassNo=c.ClassNo where s.LessonSortNo='1' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + + if (!string.IsNullOrEmpty(academicYearShort)) + { + strSql.Append(" and s.AcademicYearNo='" + academicYearShort + "' and s.Semester='" + semester + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 教师下拉框信息【学生成绩录入可去审核】 + /// + /// + public IEnumerable GetEmpNoData(string userAccount, string userType, string lessonNo, string AcademicYearNo = "", string Semester = "") + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.EmpNo as value,c.EmpName as text from StuScoreOnline s inner join EmpInfo c on s.EmpNo=c.EmpNo where 1=1 "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 课程下拉框信息【学生成绩录入可去审核】 + /// + /// + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,s.LessonName as text from StuScoreOnline s where 1=1 "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 课程下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,l.LessonName as text from stuscore s left join LessonInfo l on s.LessonNo=l.LessonNo where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.ClassRoomNo as value,c.ClassroomName as text from stuscore s inner join ClassroomInfo c on s.ClassRoomNo=c.ClassroomNo where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonSection as value,s.LessonSection as text from stuscore s where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(classRoomNo)) + { + strSql.Append(" and s.ClassRoomNo='" + classRoomNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 课程信息【班级成绩查看】 + /// + /// + public IEnumerable GetLessonNoData(string academicYearNo, string semester, string classNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,s.LessonName as text from stuscore s "); + strSql.Append(" where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.ClassNo='" + classNo + "' and s.LessonSortNo='1' "); + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取班级成绩列表 + /// + /// + public IEnumerable GetScoreListByClassNo(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var tableName = "StuScoreOnline"; + if (!queryParam["TableName"].IsEmpty()) + { + tableName = queryParam["TableName"].ToString(); + } + var strSql = new StringBuilder(); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); + strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); + strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); + strSql.Append(" from ( "); + strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 and s.LessonSortNo='1' and s.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus =1) "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" and s.Semester=@Semester "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" and s.ClassNo=@ClassNo "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" and s.StuNo=@StuNo "); + } + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); + strSql.Append(" left join StuScoreOnlineNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); + strSql.Append(" left join StuScoreOnlineNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 获取班级成绩列表(校级奖学金) + /// + /// + public IEnumerable GetScoreListByClassNoForScholarship(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var tableName = "StuScoreOnline"; + if (!queryParam["TableName"].IsEmpty()) + { + tableName = queryParam["TableName"].ToString(); + } + var strSql = new StringBuilder(); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.DeptNo,bb.ClassNo,bb.IdentityCardNo as IdCard,bb.DepositBank,bb.BankCard ,bb.MajorNo,bb.GenderNo,bb.Birthday,bb.NationalityNo,bb.PartyFaceNo,bb.Grade "); + strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); + strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); + strSql.Append(" from ( "); + strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score,sb.DeptNo,sb.IdentityCardNo,sb.DepositBank,sb.BankCard,sb.majorno,sb.GenderNo,sb.Birthday,sb.NationalityNo,sb.PartyFaceNo,sb.Grade from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 and s.LessonSortNo='1' and s.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus =1) "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" and s.Semester=@Semester "); + } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" and s.ClassNo=@ClassNo "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" and s.StuNo=@StuNo "); + } + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,sb.DeptNo,sb.ClassNo,sb.IdentityCardNo,sb.DepositBank,sb.BankCard,sb.majorno,sb.GenderNo,sb.Birthday,sb.NationalityNo,sb.PartyFaceNo,sb.Grade ) as bb "); + strSql.Append(" left join StuScoreOnlineNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); + strSql.Append(" left join StuScoreOnlineNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取学生的补考信息 + /// + /// + /// + public List GetStuGraduateInfo(string queryJson) + { + try + { + var aa = new List(); + + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + if (!queryParam["StuNo"].IsEmpty()) + { + var stuNo = queryParam["StuNo"].ToString(); + var result = GetStuPassInfo(stuNo); + aa.Add(result); + + } + else + { + var classNo = queryParam["ClassNo"].ToString(); + var listStu = this.BaseRepository("CollegeMIS") + .FindList(a => a.ClassNo == classNo); + + foreach (var stuInfo in listStu) + { + aa.Add(GetStuPassInfo(stuInfo?.StuNo)); + } + } + + return aa; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public List GetPassInfo(string queryJson) + { + try + { + var aa = new List(); + + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + if (!queryParam["StuNo"].IsEmpty()) + { + var stuNo = queryParam["StuNo"].ToString(); + //暂时注释 + //var passInfo1 = this.BaseRepository("CollegeMIS") + // .FindList(a => a.StuNo == stuNo); + //foreach (var item in passInfo1) + //{ + // aa.Add(new { item.LessonNo, item.LessonName, item.Score, Type = "第一次补考" }); + //} + //var passInfo2 = this.BaseRepository("CollegeMIS") + // .FindList(a => a.StuNo == stuNo); + //foreach (var item in passInfo2) + //{ + // aa.Add(new { item.LessonNo, item.LessonName, item.Score, Type = "第二次补考" }); + //} + + } + + return aa; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public List GetClassOfMy() + { + try + { + var aa = new List(); + + var userInfo = LoginUserInfo.Get(); + var classList = this.BaseRepository("CollegeMIS") + .FindList(a => a.ClassDiredctorNo == userInfo.account); + foreach (var item in classList) + { + aa.Add(new { text = item.ClassName, value = item.ClassNo }); + } + + return aa; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public object GetStuPassInfo(string stuNo) + { + var stuInfo = this.BaseRepository("CollegeMIS") + .FindEntity(a => a.StuNo == stuNo); + + //暂时注释 + //var notpass1 = this.BaseRepository("CollegeMIS") + // .FindList(a => a.StuNo == stuNo).Count(); + //var notpass2 = this.BaseRepository("CollegeMIS") + // .FindList(a => a.StuNo == stuNo).Count(); + //if ((notpass1 + notpass2) > 0) + if (0 > 0) + { + var result = new + { + StuNo = stuInfo?.StuNo, + StuName = stuInfo?.StuName, + IsNoPass = "是", + FinishSchoolMark = stuInfo?.FinishSchoolMark + }; + return result; + } + else + { + var result = new + { + StuNo = stuInfo?.StuNo, + StuName = stuInfo?.StuName, + IsNoPass = "否", + FinishSchoolMark = stuInfo?.FinishSchoolMark + }; + return result; + } + } + + + /// + /// 获取个人成绩列表 + /// + /// + public IEnumerable GetAllScoreListByStuNo(string stuNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.AcademicYearNo,s.Semester,s.LessonNo,s.LessonName,s.LessonSortNo,MAX(s.Score) as Score from StuScoreOnline s "); + strSql.Append(" where s.StuNo='" + stuNo + "' "); + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonNo,s.LessonName,s.LessonSortNo "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核学生成绩 + /// 主键 + /// + /// + public void CheckStuScoreOnline(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreOnline set CheckMark='1' where ScoreId='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 去审核学生成绩 + /// 主键 + /// + /// + public void UnCheckStuScoreOnline(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreOnline set CheckMark='0' where ScoreId='" + keyValue + "' "); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取个人补考成绩 + /// + /// + public StuScoreOnlineEntity GetScoreNotPassByEntity(StuScoreOnlineEntity entity) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.ScoreId,s.AcademicYearNo,s.Semester,s.LessonNo,s.Score from StuScoreOnlineNotPass s "); + strSql.Append($" where s.AcademicYearNo='{entity.AcademicYearNo}' and s.Semester='{entity.Semester}' and s.StuNo='{entity.StuNo}' and s.LessonNo='{entity.LessonNo}' and s.CheckMark='1' "); + var aa = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + return aa.FirstOrDefault(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取个人二次补考成绩 + /// + /// + public StuScoreOnlineEntity GetScoreNotPassTwoByEntity(StuScoreOnlineEntity entity) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select s.ScoreId,s.AcademicYearNo,s.Semester,s.LessonNo,s.Score from StuScoreOnlineNotPassTwo s "); + strSql.Append($" where s.AcademicYearNo='{entity.AcademicYearNo}' and s.Semester='{entity.Semester}' and s.StuNo='{entity.StuNo}' and s.LessonNo='{entity.LessonNo}' and s.CheckMark='1' "); + var aa = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + return aa.FirstOrDefault(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 开始录入:占用成绩 + /// + /// + public void StartInputScore(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var EmpNo = queryParam["EmpNo"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreOnline set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and 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 SaveInputScore(List list) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + + foreach (var item in list) + { + item.OrdinaryScore = item.OrdinaryScore.HasValue ? item.OrdinaryScore.Value : 0; + item.TermInScore = item.TermInScore.HasValue ? item.TermInScore.Value : 0; + item.TermEndScore = item.TermEndScore.HasValue ? item.TermEndScore.Value : 0; + item.OtherScore = item.OtherScore.HasValue ? item.OtherScore.Value : 0; + item.Score = item.Score.HasValue ? item.Score.Value : 0; + //if (!item.Score.HasValue) + //{ + // item.Score = 0; + //} + //db.ExecuteBySql($"update StuScoreOnline set OrdinaryScore={item.OrdinaryScore},TermInScore={item.TermInScore},TermEndScore={item.TermEndScore},OtherScore={item.OtherScore},Score={item.Score},IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.userId}',ModifyUserName='{loginUserInfo.realName}' where ScoreId='{item.ScoreId}' "); + db.ExecuteBySql($"update StuScoreOnline set OrdinaryScore={item.OrdinaryScore},TermInScore={item.TermInScore},TermEndScore={item.TermEndScore},OtherScore={item.OtherScore},Score={item.Score},Remark='{item.Remark}' where ScoreId='{item.ScoreId}' "); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 提交成绩:取消占用 + /// + /// + public void SaveInputScoreStatus(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var EmpNo = queryParam["EmpNo"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreOnline set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and 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 SaveInputScoreStatus2(string queryJson, string name) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var EmpNo = queryParam["EmpNo"].ToString(); + + var now = DateTime.Now; + var loginUserInfo = new + { + account = name.Split('_')[0], + realName = name.Split('_')[1] + }; + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreOnline set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and LessonNo='{LessonNo}' and EmpNo='{EmpNo}' "); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + public void DoCheckScore(string queryJson, int checkMark) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var EmpNo = queryParam["EmpNo"].ToString(); + + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreOnline set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and EmpNo='" + EmpNo + "' "); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + /// + /// 学生成绩查看含选修 + /// + /// + /// + /// + /// + public IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,s.LessonName+(case s.LessonSortNo when '2' then '(选修)' else '' end) as text from stuscore s "); + strSql.Append(" where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.StuNo='" + stuNo + "' "); + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetScoreListByStuNo(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var tableName = "StuScoreOnline"; + if (!queryParam["TableName"].IsEmpty()) + { + tableName = queryParam["TableName"].ToString(); + } + var strSql = new StringBuilder(); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); + strSql.Append(" ,case when bb.LessonSortNo='2' then bb.Score else (case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end) end as Score "); + strSql.Append(" ,case when bb.LessonSortNo='2' then convert(nvarchar(50),bb.Score)+'(选修)' else (case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end) end as ScoreFormat "); + strSql.Append(" from ( "); + strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 and s.CheckMark='1' "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" and s.Semester=@Semester "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" and s.StuNo=@StuNo "); + } + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); + strSql.Append(" left join StuScoreOnlineNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.LessonSortNo=sp.LessonSortNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo and sp.CheckMark = '1' "); + strSql.Append(" left join StuScoreOnlineNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.LessonSortNo=spt.LessonSortNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo and spt.CheckMark = '1' "); + + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 根据学号/姓名获取学生成绩列表 + /// + /// + /// + public IEnumerable GetScoreListByStuInfo(string queryJson) + { + try + { + //参考写法 + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + var tableName = "StuScoreOnline"; + if (!queryParam["TableName"].IsEmpty()) + { + tableName = queryParam["TableName"].ToString(); + } + var strSql = new StringBuilder(); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,bb.Score,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); + strSql.Append(" from ( "); + strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" where 1=1 and s.CheckMark='1' "); + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" and s.Semester=@Semester "); + } + if (!queryParam["StuNo"].IsEmpty()) + { + dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); + strSql.Append(" and s.StuNo=@StuNo "); + } + if (!queryParam["StuName"].IsEmpty()) + { + dp.Add("StuName", queryParam["StuName"].ToString(), DbType.String); + strSql.Append(" and s.StuName=@StuName "); + } + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo ) as bb "); + strSql.Append(" left join StuScoreOnlineNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.LessonSortNo=sp.LessonSortNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo and sp.CheckMark = '1' "); + strSql.Append(" left join StuScoreOnlineNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.LessonSortNo=spt.LessonSortNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo and spt.CheckMark = '1' "); + strSql.Append(" left join CdLessonSort ls on bb.LessonSortNo= ls.LessonSortNo "); + strSql.Append(" left join LessonInfo li on bb.LessonNo= li.LessonNo and li.CheckMark='1' "); + strSql.Append(" left join CdMajor cm on bb.MajorNo= cm.MajorNo and cm.CheckMark='1' "); + strSql.Append(" left join ClassInfo ci on bb.ClassNo= ci.ClassNo and ci.CheckMark='1' "); + + var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + + //计算专业排名,班级排名 + if (result.Any()) + { + var temp = result.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new StuScoreOnlineEntity() + { + AcademicYearNo = x.Key.AcademicYearNo, + Semester = x.Key.Semester, + StuNo = x.FirstOrDefault().StuNo, + ClassNo = x.FirstOrDefault().ClassNo, + MajorNo = x.FirstOrDefault().MajorNo + }).ToList(); + if (temp.Any()) + { + foreach (var item in temp) + { + //专业排名 + var ml = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.MajorNo == item.MajorNo && x.CheckMark == "1"); + var mlGroup = ml.GroupBy(x => x.StuNo).Select(x => new + { + StuNo = x.Key, + TotalScore = x.Select(y => y.Score).Sum() + }).OrderByDescending(x => x.TotalScore); + if (mlGroup.Any()) + { + var rank = mlGroup.Select(x => x.StuNo).ToList().IndexOf(item.StuNo); + item.RankInMajor = rank + 1; + } + //班级排名 + var cl = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.ClassNo == item.ClassNo && x.CheckMark == "1"); + var clGroup = cl.GroupBy(x => x.StuNo).Select(x => new + { + StuNo = x.Key, + TotalScore = x.Select(y => y.Score).Sum() + }).OrderByDescending(x => x.TotalScore); + if (clGroup.Any()) + { + var rank = clGroup.Select(x => x.StuNo).ToList().IndexOf(item.StuNo); + item.RankInClass = rank + 1; + } + } + } + foreach (var ii in result) + { + ii.RankInMajor = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInMajor; + ii.RankInClass = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInClass; + } + + } + + return result; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 成绩导入--必修课 选修课 + /// + /// 1:必修,2:选修 + /// + /// + /// + /// + public (DataTable failDt, int snum, int fnum) ExecuteImportExcel(int type, DataTable dt, string fileGuid, + string queryJson) + { + return ExecuteImportExcelForRequired(dt, fileGuid, queryJson); + + //if (type == 1) + //{ + // //必修 + // return ExecuteImportExcelForRequired(dt, fileGuid, queryJson); + //} + //else + //{ + // //选修 + // return ExecuteImportExcelForElective(dt, fileGuid, queryJson); + //} + + } + + /// + /// 导入学生成绩--必修课 + /// + /// + /// + private (DataTable failDt, int snum, int fnum) ExecuteImportExcelForRequired(DataTable dt, string fileGuid, string queryJson) + { + //成功记录数 + int snum = 0; + //总记录数 + int num = dt.Rows.Count; + var db = this.BaseRepository("CollegeMIS"); + var msg = ""; + try + { + db.BeginTrans(); + // 创建一个datatable容器用于保存导入失败的数据 + DataTable failDt = new DataTable(); + + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var EmpNo = queryParam["EmpNo"].ToString(); + + //获取成绩比例数据 + //var stuSelectLessonListEntity = db.FindEntity(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.LessonNo == LessonNo && x.EmpNo == EmpNo && x.Status == 2); + //if (stuSelectLessonListEntity != null) + { + //当前班级学生成绩 + var list = GetList(queryJson).ToList(); + if (list.Any()) + { + foreach (DataColumn dc in dt.Columns) + { + failDt.Columns.Add(dc.ColumnName, dc.DataType); + } + failDt.Columns.Add("导入错误", typeof(string)); + dt.Columns.Add("导入错误", typeof(string)); + + foreach (DataRow dr in dt.Rows) + { + try + { + var stuNo_dr = dr["学生学号"].ToString().Trim(); + var stuName_dr = dr["学生姓名"].ToString().Trim(); + var academicYearNo_dr = dr["学年"].ToString().Trim(); + var semester_dr = dr["学期"].ToString().Trim(); + var lessonName_dr = dr["课程名称"].ToString().Trim(); + + if (string.IsNullOrEmpty(stuNo_dr)) + { + dr["导入错误"] = "学生学号不能为空!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (string.IsNullOrEmpty(stuName_dr)) + { + dr["导入错误"] = "学生姓名不能为空!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (string.IsNullOrEmpty(academicYearNo_dr)) + { + dr["导入错误"] = "学年不能为空!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (string.IsNullOrEmpty(semester_dr)) + { + dr["导入错误"] = "学期不能为空!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (string.IsNullOrEmpty(lessonName_dr)) + { + dr["导入错误"] = "课程名称不能为空!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (!academicYearNo_dr.Equals(AcademicYearNo) || !semester_dr.Equals(Semester)) + { + dr["导入错误"] = "学年学期与查询条件不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (!lessonName_dr.Equals(list.FirstOrDefault().LessonName)) + { + dr["导入错误"] = "课程名称与查询条件课程(" + list.FirstOrDefault().LessonName + ")不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + var item = list.FirstOrDefault(x => x.StuNo == stuNo_dr && x.StuName == stuName_dr && x.LessonNo == LessonNo && x.EmpNo == EmpNo); + if (item == null) + { + dr["导入错误"] = "找不到学生学号为" + stuNo_dr + ",学生姓名为" + stuName_dr + "的学生"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + else + { + if (item.CheckMark == "1") + { + dr["导入错误"] = "当前学生成绩已审核!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + } + var TermEndScore = Convert.ToDecimal(string.IsNullOrEmpty(dr["最终核定成绩"].ToString().Trim()) ? "0" : dr["最终核定成绩"].ToString().Trim()); + if (TermEndScore < 0) + { + dr["导入错误"] = "最终核定成绩必须大于0!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + db.ExecuteBySql($"update StuScoreOnline set TermEndScore={TermEndScore},Score={TermEndScore},Remark='{dr["备注"].ToString().Trim()}' where ScoreId='{item.ScoreId}' "); + + } + catch (Exception e) + { + dr["导入错误"] = "出现异常:" + e.Message; + failDt.Rows.Add(dr.ItemArray); + continue; + } + } + db.Commit(); + + // 写入缓存如果有未导入的数据 + if (failDt.Rows.Count > 0) + { + string errordt = failDt.ToJson(); + + cache.Write(cacheKey + fileGuid, errordt, CacheId.excel); + } + snum = (num - failDt.Rows.Count) > 0 ? num - failDt.Rows.Count : 0; + + } + } + + return (failDt, snum, failDt.Rows.Count); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 导入学生成绩--选修课 + /// + /// + /// + private (DataTable failDt, int snum, int fnum) ExecuteImportExcelForElective(DataTable dt, string fileGuid, string queryJson) + { + + //成功记录数 + int snum = 0; + //总记录数 + int num = 0; + var db = this.BaseRepository("CollegeMIS"); + var msg = ""; + try + { + db.BeginTrans(); + + //创建一个datatable容器用于保存导入失败的数据 + DataTable failDt = new DataTable(); + + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var LessonSection = queryParam["LessonSection"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + + var classRoomList = db.FindList(); + var lessonInfoList = db.FindList(); + var lessonInfoEntity = lessonInfoList.FirstOrDefault(x => x.LessonNo == LessonNo && x.CheckMark == true); + var classRoomEntity = classRoomList.FirstOrDefault(x => x.ClassroomNo == ClassRoomNo); + + //成绩比例数据 + var stuSelectLessonListOfElectiveEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.ClassRoomNo == ClassRoomNo && x.LessonSection == LessonSection); + + if (stuSelectLessonListOfElectiveEntity != null) + { + //查询学生成绩数据 + var list = GetList(queryJson).ToList(); + + foreach (DataColumn dc in dt.Columns) + { + failDt.Columns.Add(dc.ColumnName, dc.DataType); + } + failDt.Columns.Add("导入错误", typeof(string)); + dt.Columns.Add("导入错误", typeof(string)); + + foreach (DataRow dr in dt.Rows) + { + try + { + var stuno = dr["学号"].ToString().Trim(); + var academicYearNo_dr = dr["学年"].ToString().Trim(); + var semester_dr = dr["学期"].ToString().Trim(); + var lessoninfo_dr = dr["课程名称"].ToString().Trim(); + var classRoominfo_dr = dr["教室名称"].ToString().Trim(); + var lessonSection_dr = dr["节次"].ToString().Trim(); + //var lessonNo_dr = lessonInfoList.FirstOrDefault(x => x.LessonName == lessoninfo_dr)?.LessonNo; + //var classRoomNo_dr = classRoomList.FirstOrDefault(x => x.ClassroomName == classRoominfo_dr)?.ClassroomNo; + if (!string.IsNullOrEmpty(stuno)) + { + num++; + var item = list.Find(x => x.StuNo == stuno && x.LessonNo == LessonNo && x.ClassRoomNo == ClassRoomNo && x.LessonSection == LessonSection); + if (!academicYearNo_dr.Equals(AcademicYearNo) || !semester_dr.Equals(semester_dr)) + { + dr["导入错误"] = "学年学期与查询条件不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + + if (!lessoninfo_dr.Equals(lessonInfoEntity.LessonName)) + { + dr["导入错误"] = "课程与查询条件课程(" + lessonInfoEntity.LessonName + ")不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (!classRoominfo_dr.Equals(classRoomEntity.ClassroomName)) + { + dr["导入错误"] = "教室与查询条件教室(" + classRoomEntity.ClassroomName + ")不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (!lessonSection_dr.Equals(LessonSection)) + { + dr["导入错误"] = "节次与查询条件节次(" + LessonSection + ")不匹配!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + if (item == null) + { + dr["导入错误"] = "课程:" + lessonInfoEntity.LessonName + "在" + LessonSection + "节次找不到学号为" + stuno + "的学生"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + var OrdinaryScore = Convert.ToDecimal(string.IsNullOrEmpty(dr["平时成绩"].ToString().Trim()) ? "0" : dr["平时成绩"].ToString().Trim()); + var TermInScore = Convert.ToDecimal(string.IsNullOrEmpty(dr["期中成绩"].ToString().Trim()) ? "0" : dr["期中成绩"].ToString().Trim()); + var TermEndScore = Convert.ToDecimal(string.IsNullOrEmpty(dr["期末成绩"].ToString().Trim()) ? "0" : dr["期末成绩"].ToString().Trim()); + var OtherScore = Convert.ToDecimal(string.IsNullOrEmpty(dr["其他成绩"].ToString().Trim()) ? "0" : dr["其他成绩"].ToString().Trim()); + if (OrdinaryScore < 0 || TermInScore < 0 || TermEndScore < 0 || OtherScore < 0) + { + dr["导入错误"] = "成绩必须大于0!"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + + var Score = Math.Round(Convert.ToDouble(OrdinaryScore * (stuSelectLessonListOfElectiveEntity.OrdinaryScoreScale / 100) + + TermInScore * (stuSelectLessonListOfElectiveEntity.TermInScoreScale / 100) + + TermEndScore * (stuSelectLessonListOfElectiveEntity.TermEndScoreScale / 100) + + OtherScore * (stuSelectLessonListOfElectiveEntity.OtherScoreScale / 100)), MidpointRounding.AwayFromZero); + var remark = dr["备注"].ToString().Trim(); + db.ExecuteBySql($"update StuScoreOnline set OrdinaryScore={OrdinaryScore},TermInScore={TermInScore},TermEndScore={TermEndScore},OtherScore={OtherScore},Score={Score},Remark='{remark}' where ScoreId='{item.ScoreId}' "); + } + else + { + break; + } + } + catch (Exception e) + { + dr["导入错误"] = "出现异常:" + e.Message; + failDt.Rows.Add(dr.ItemArray); + continue; + } + } + db.Commit(); + + // 写入缓存如果有未导入的数据 + if (failDt.Rows.Count > 0) + { + string errordt = failDt.ToJson(); + + cache.Write(cacheKey + fileGuid, errordt, CacheId.excel); + } + + snum = (num - failDt.Rows.Count) > 0 ? num - failDt.Rows.Count : 0; + } + return (failDt, snum, failDt.Rows.Count); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs index bfcb33704..24c65153e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs @@ -14,7 +14,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public class StuSelectLessonListOfElectiveOnlineBLL : StuSelectLessonListOfElectiveOnlineIBLL { - private StuSelectLessonListOfElectiveOnlineService stuSelectLessonListOfElectiveService = new StuSelectLessonListOfElectiveOnlineService(); + private StuSelectLessonListOfElectiveOnlineService stuSelectLessonListOfElectiveOnlineService = new StuSelectLessonListOfElectiveOnlineService(); #region 获取数据 @@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetPageList(pagination, queryJson); + return stuSelectLessonListOfElectiveOnlineService.GetPageList(pagination, queryJson); } catch (Exception ex) { @@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntity(keyValue); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntity(keyValue); } catch (Exception ex) { @@ -79,7 +79,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.DeleteEntity(keyValue); + stuSelectLessonListOfElectiveOnlineService.DeleteEntity(keyValue); } catch (Exception ex) { @@ -103,7 +103,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.SaveEntity(keyValue, entity); + stuSelectLessonListOfElectiveOnlineService.SaveEntity(keyValue, entity); } catch (Exception ex) { @@ -130,7 +130,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(stuno, olpeid); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(stuno, olpeid); } catch (Exception ex) { @@ -150,7 +150,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntityByLessonInfo(lessonNo, lessonTime, stuNo); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntityByLessonInfo(lessonNo, lessonTime, stuNo); } catch (Exception ex) { @@ -173,7 +173,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineListByStuNo(stuno); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineListByStuNo(stuno); } catch (Exception ex) { @@ -192,7 +192,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetQueryStuSelectResultList(pagination, queryJson); + return stuSelectLessonListOfElectiveOnlineService.GetQueryStuSelectResultList(pagination, queryJson); } catch (Exception ex) { @@ -210,7 +210,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.Pass(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.Pass(stulist, olpentity); } catch (Exception ex) { @@ -228,7 +228,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.UnPass(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.UnPass(stulist, olpentity); } catch (Exception ex) { @@ -246,7 +246,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.UnPassOfFinish(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.UnPassOfFinish(stulist, olpentity); } catch (Exception ex) { @@ -260,12 +260,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - - public IEnumerable GetAllElectiveLesson(string academicYearNo, string semester) + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + public IEnumerable GetSelectLessonInfo(string academicYearNo, string semester) { try { - return stuSelectLessonListOfElectiveService.GetAllElectiveLesson(academicYearNo, semester); + return stuSelectLessonListOfElectiveOnlineService.GetSelectLessonInfo(academicYearNo, semester); } catch (Exception ex) { @@ -289,7 +294,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(olpeid); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(olpeid); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + public void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) + { + try + { + stuSelectLessonListOfElectiveOnlineService.DoInitScore(entity); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs index 7be9d24be..b5b94a037 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs @@ -71,6 +71,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void Pass(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); void UnPass(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); void UnPassOfFinish(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); - IEnumerable GetAllElectiveLesson(string academicYearNo, string semester); + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + IEnumerable GetSelectLessonInfo(string academicYearNo, string semester); + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity); + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs index f8c1a4ac4..f3eab087f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs @@ -92,7 +92,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("LIOEOId", queryParam["LIOEOId"].ToString(), DbType.String); strSql.Append(" AND t.LIOEOId = @LIOEOId "); } - var list= this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + var list = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); foreach (var item in list) { //模式二:正式选课 @@ -211,7 +211,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { db.ExecuteBySql("update StuSelectLessonListOfElectiveOnline set Status=2 where Id='" + item + "'"); } - olpentity.StuNum += stulist.Length; + olpentity.StuNum = olpentity.StuNum.HasValue ? olpentity.StuNum.Value + stulist.Length : stulist.Length; db.Update(olpentity); db.Commit(); } @@ -266,13 +266,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (model != null) { count++; + //修改StuSelectLessonListOfElectiveOnline状态为报名失败 db.ExecuteBySql("update StuSelectLessonListOfElectiveOnline set Status=3 where Id='" + item + "'"); + //删除StuScoreOnline已生成成绩数据 + db.ExecuteBySql($"delete from StuScoreOnline where StuNo='{model.StuNo}' and StuName='{model.StuName}' and AcademicYearNo='{model.AcademicYearNo}' and Semester='{model.Semester}' and LessonNo='{model.LessonNo}' and LessonName='{model.LessonName}' and EmpNo='{model.EmpNo}' "); } } //修改LessonInfoOfElectiveOnline通过人数 if (count > 0) { - olpentity.StuNum = olpentity.StuNum - count; + olpentity.StuNum = olpentity.StuNum.HasValue ? olpentity.StuNum.Value - count : 0; db.Update(olpentity); } db.Commit(); @@ -405,34 +408,33 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion - + /// + /// 线上选课情况 + /// + /// + /// + /// public IEnumerable GetQueryStuSelectResultList(Pagination pagination, string queryJson) { try { var queryParam = queryJson.ToJObject(); var strSql = new StringBuilder(); - strSql.Append("select a.StuNo,a.StuName,a.GenderNo,a.DeptNo,a.MajorNo,a.F_SchoolId,a.ClassNo,b.remark,b.Status,b.Id,"); + + strSql.Append("select a.StuNo,a.StuName,a.DeptNo,a.MajorNo,a.F_SchoolId,a.ClassNo,b.Status,b.Id,"); strSql.Append("'" + queryParam["AcademicYearNo"].ToString() + "' as AcademicYearNo,'" + queryParam["Semester"].ToString() + "' as Semester,"); - //strSql.Append("b.AcademicYearNo,b.Semester,"); - strSql.Append("c.LessonSection,c.LessonTime,c.StudyScore,c.LessonNo,c.LessonName,c.EmpNo,c.EmpName,c.ClassRoomNo,c.ClassRoomName"); - //strSql.Append(@"c.LessonSection,c.LessonTime,c.StudyScore,c.LessonNo,c.LessonName,c.EmpNo,c.EmpName,c.ClassRoomNo,c.ClassRoomName from stuinfobasic a - //left join StuSelectLessonListOfElectiveOnline - // b on a.stuno = b.stuno left join LessonInfoOfElectiveOnline c - //on b.OLPEId = c.Id AND c.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND c.Semester = '" + queryParam["Semester"].ToString() + "' "); + strSql.Append("b.LessonNo,b.LessonName,b.EmpNo,b.EmpName"); strSql.Append(" from stuinfobasic a"); strSql.Append(" left join StuSelectLessonListOfElectiveOnline b on a.stuno = b.stuno and b.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND b.Semester = '" + queryParam["Semester"].ToString() + "' "); - strSql.Append(" left join LessonInfoOfElectiveOnline c on b.OLPEId = c.Id and c.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND c.Semester = '" + queryParam["Semester"].ToString() + "' "); strSql.Append(" where 1=1 "); - //未选课的学分为空导出报错liang 为了导出数据零时增加了条件 此处暂放待处理 and c.LessonNo is not null //去掉转校、休学 退学的学生 - strSql.Append(" and a.StuNo not in (SELECT distinct StuNo FROM StuInfoBasicChange where stuchangetype in ('06','04','05') and checkstatus=1) "); + strSql.Append(" and a.StuNo not in (SELECT distinct StuNo FROM StuInfoBasic where ChangeStatus=1) "); // 虚拟参数 var dp = new DynamicParameters(new { }); if (!queryParam["StuNo"].IsEmpty()) { - dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); - strSql.Append(" AND a.StuNo = @StuNo "); + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND a.StuNo like @StuNo "); } //if (!queryParam["AcademicYearNo"].IsEmpty()) //{ @@ -462,22 +464,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["LessonNo"].IsEmpty()) { dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); - strSql.Append(" AND c.LessonNo = @LessonNo "); + strSql.Append(" AND b.LessonNo = @LessonNo "); } if (!queryParam["LessonName"].IsEmpty()) { dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); - strSql.Append(" AND c.LessonName Like @LessonName "); + strSql.Append(" AND b.LessonName Like @LessonName "); } if (!queryParam["EmpNo"].IsEmpty()) { dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); - strSql.Append(" AND c.EmpNo = @EmpNo "); + strSql.Append(" AND b.EmpNo = @EmpNo "); } if (!queryParam["EmpName"].IsEmpty()) { dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); - strSql.Append(" AND c.EmpName Like @EmpName "); + strSql.Append(" AND b.EmpName Like @EmpName "); } if (!queryParam["StuName"].IsEmpty()) { @@ -487,7 +489,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["Status"].IsEmpty()) { dp.Add("Status", queryParam["Status"].ToInt(), DbType.Int32); - strSql.Append(" AND Status = @Status "); + strSql.Append(" AND b.Status = @Status "); } if (!queryParam["F_SchoolId"].IsEmpty()) { @@ -531,12 +533,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + public IEnumerable GetSelectLessonInfo(string academicYearNo, string semester) + { + try + { + if (!string.IsNullOrEmpty(academicYearNo) && !string.IsNullOrEmpty(semester)) + { + return this.BaseRepository("CollegeMIS").FindList($"select distinct t.LessonNo,t.LessonName from StuSelectLessonListOfElectiveOnline t where t.AcademicYearNo='{academicYearNo}' and t.Semester='{semester}' "); + } + else + { + return this.BaseRepository("CollegeMIS").FindList("select distinct t.LessonNo,t.LessonName from StuSelectLessonListOfElectiveOnline t where 1=1 "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } - public IEnumerable GetAllElectiveLesson(string academicYearNo, string semester) + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + public void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) { try { - return this.BaseRepository("CollegeMIS").FindList("select * from StuSelectLessonListOfElectiveOnline where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "'"); + string sql = @"insert into StuScoreOnline(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,LessonNo,LessonName,Grade,TermEndScore,Remark,CheckMark,EmpNo,IsEditable,F_SchoolId) +select NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,LessonNo,LessonName,Grade,'0',Remark,0,EmpNo,IsEditable=1,F_SchoolId from +(select s.NoticeBookNo,s.StuNo,s.DeptNo,s.MajorNo,s.ClassNo,s.StuName,s.GenderNo,s.AcademicYearNo,s.Semester,s.LessonNo,s.LessonName,s.Grade,s.Remark,s.EmpNo,s.F_SchoolId +from StuSelectLessonListOfElectiveOnline s +where s.Status='2' +) as sl +where StuNo not in(Select StuNo from StuScoreOnline s where s.AcademicYearNo=sl.AcademicYearNo + and s.Semester=sl.Semester and s.LessonNo=sl.LessonNo and s.LessonName=sl.LessonName and s.EmpNo=sl.EmpNo +and s.AcademicYearNo='" + entity.AcademicYearNo + "' and s.Semester='" + entity.Semester + "') and sl.AcademicYearNo='" + entity.AcademicYearNo + "' and sl.Semester='" + entity.Semester + "'"; + BaseRepository("CollegeMIS").ExecuteBySql(sql); + } catch (Exception ex) { @@ -550,5 +598,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs index 97e966393..0d59b2038 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs @@ -72,6 +72,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration jsEntity.Create(); this.BaseRepository().Insert(jsEntity); } + if (!data.Any(a => a.type == "modifypwdfirstday")) + { + var jsEntity = new TeachSwitchEntity() + { + status = "0", + type = "modifypwdfirstday" + }; + jsEntity.Create(); + this.BaseRepository().Insert(jsEntity); + } + if (!data.Any(a => a.type == "modifypwdtip")) + { + var jsEntity = new TeachSwitchEntity() + { + status = "0", + type = "modifypwdtip" + }; + jsEntity.Create(); + this.BaseRepository().Insert(jsEntity); + } var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 18b381d3e..0ca6f16c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -95,6 +95,11 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Time/Time.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Time/Time.cs index f0eaa54f6..12e7f01aa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Time/Time.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Time/Time.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Globalization; namespace Learun.Util @@ -368,9 +369,10 @@ namespace Learun.Util //当年的第一天是星期几 int firstOfWeek = Convert.ToInt32(firstDay.DayOfWeek); - + if (firstOfWeek == 0) + firstOfWeek = 7; //计算当年第一周的起止日期,可能跨年 - int dayDiff = (-1) * firstOfWeek + 1; + int dayDiff = (-1) * firstOfWeek-1; int dayAdd = 7 - firstOfWeek; firstDate = firstDay.AddDays(dayDiff).Date; @@ -503,6 +505,64 @@ namespace Learun.Util return strDate; } #endregion + + + /// + /// 获取当前日期在指定时间范围内是第几周 + /// + /// + /// + /// + public static int GetWeekOfDay(DateTime start, DateTime end) + { + //总周数 + var weekCount = Math.Ceiling(Convert.ToDouble((end - start).Days / 7)); + //用于存储日期 + var weekDic = new Dictionary(); + + var today = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd")); + + for (var i = 0; i < weekCount; i++) + { + for (var j = 0; j < 7; j++) + { + weekDic.Add(start.AddDays(i * 7 + j), i + 1); + } + } + + return weekDic.ContainsKey(today) ? weekDic[today] : 1; + } + + /// + /// 根据开始日期和结束日期返回这段时间的周数 + /// 过周日算一周 + /// + /// 开始日期 + /// 结束日期 + /// + public static int GetWeekCount(DateTime startTime, DateTime endTime) + { + //获取开始时间的星期一 + int startWeek = Convert.ToInt32(startTime.DayOfWeek); + //因为是以星期一为第一天,所以要判断weeknow等于0时,要向前推6天。 + startWeek = (startWeek == 0 ? (7 - 1) : (startWeek - 1)); + int daydiff = (-1) * startWeek; + string firstDay = startTime.AddDays(daydiff).ToString("yyyy-MM-dd"); + DateTime startMonday = Convert.ToDateTime(firstDay); + //获取结束时间的星期日 + int lastWeek = Convert.ToInt32(endTime.DayOfWeek); + int daydiff1 = 0; + if (lastWeek != 0) + { + daydiff1 = 7 - lastWeek; + } + //本周最后一天 + string lastDay = endTime.AddDays(daydiff1).ToString("yyyy-MM-dd"); + DateTime lastSunday = Convert.ToDateTime(lastDay); + TimeSpan timeSpan = (lastSunday - startMonday); + //返回总周数 + return Convert.ToInt32(timeSpan.Days + 1) / 7; + } /// /// 获取当前日期是星期几 /// diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json index ff1ff458b..d82e8cb8e 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json @@ -745,6 +745,19 @@ "navigationBarTitleText": "查看详情" } }, + //线上课程选课 + { + "path": "pages/EducationalAdministration/LessonInfoOfElectiveOnline/list", + "style": { + "navigationBarTitleText": "线上课程选课" + } + }, + { + "path": "pages/EducationalAdministration/LessonInfoOfElectiveOnline/from", + "style": { + "navigationBarTitleText": "查看详情" + } + }, //学费查询 { "path": "pages/StuPayFee/list", diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTerm/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTerm/list.vue index b7f74ad90..6fa4c72fa 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTerm/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTerm/list.vue @@ -102,10 +102,12 @@ import set from 'lodash/set' import pickBy from 'lodash/pickBy' import mapValues from 'lodash/mapValues' + import common from '@/common/js/common.js' export default { data() { return { + semester:'', // 数据项的数据类型、结构 scheme: { ClassroomName: { @@ -182,6 +184,7 @@ }, async onLoad() { + this.semester = common.judgeDate(); await this.init() }, onUnload() { @@ -217,7 +220,11 @@ // 拉取列表 async fetchList(isConcat = true) { // if (this.page > this.total) { return } - + let AcademicYearNo = '',Semester = ''; + if(this.semester){ + AcademicYearNo = this.semester.substring(2,4) + '-' +this.semester.substring(7,9) + Semester = this.semester.substring(12,13) == '二'?'2':'1' + } const result = await this.HTTP_GET( 'learun/ask/teststulist', { // 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) @@ -228,7 +235,7 @@ sidx: 'ExamDate desc,ExamTime asc,LessonNo asc,ClassroomNo asc', sord: 'DESC' }, - queryJson: JSON.stringify(this.searchData) + queryJson: JSON.stringify({...this.searchData,AcademicYearNo,Semester}) }, '加载数据时出错' ) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTermNew/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTermNew/list.vue index 86708e937..29f25371c 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTermNew/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/ArrangeExamTermNew/list.vue @@ -91,10 +91,12 @@ import set from 'lodash/set' import pickBy from 'lodash/pickBy' import mapValues from 'lodash/mapValues' + import common from '@/common/js/common.js' export default { data() { return { + semester:'', // 数据项的数据类型、结构 scheme: { ClassroomName: { @@ -164,6 +166,7 @@ }, async onLoad() { + this.semester = common.judgeDate(); await this.init() }, onUnload() { @@ -193,7 +196,12 @@ // 拉取列表 async fetchList(isConcat = true) { // if (this.page > this.total) { return } - + let AcademicYearNo = '',Semester = ''; + if(this.semester){ + console.log(this.semester) + AcademicYearNo = this.semester.substring(2,4) + '-' +this.semester.substring(7,9) + Semester = this.semester.substring(12,13) == '二'?'2':'1' + } const result = await this.HTTP_GET( 'learun/ask/testlist', { // 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序) @@ -204,7 +212,7 @@ sidx: 'ExamDate desc,ExamTime asc,LessonNo asc,ClassroomNo asc', sord: 'DESC' }, - queryJson: JSON.stringify(this.searchData) + queryJson: JSON.stringify({...this.searchData,AcademicYearNo,Semester}) }, '加载数据时出错' ) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/from.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/from.vue new file mode 100644 index 000000000..7f3b862a1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/from.vue @@ -0,0 +1,137 @@ + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/list.vue new file mode 100644 index 000000000..8dd9b5e32 --- /dev/null +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/EducationalAdministration/LessonInfoOfElectiveOnline/list.vue @@ -0,0 +1,304 @@ + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO.7z b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO.7z new file mode 100644 index 000000000..afec6f1e3 Binary files /dev/null and b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO.7z differ diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue index e71538603..62976e4d9 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/timeTable/list.vue @@ -6,12 +6,21 @@ {{ semester }} - + + + + @@ -56,6 +65,9 @@ import common from '@/common/js/common.js' export default { data() { return { + timeValue:'', + timeOptions:[], + semester: '', num: 0, user: null, @@ -99,10 +111,8 @@ export default { }, methods: { async init(obj) { - //console.log(obj) let _this = this; _this.todayWeek = common.weekday(obj); - //console.log(_this.todayWeek) _this.semester = common.judgeDate(obj); _this.weekDayTime = 7 * common.oneDayTime(); _this.user = _this.GET_GLOBAL('loginUser'); @@ -126,14 +136,31 @@ export default { _this.semester = common.judgeDate(_this.todayWeek.SundayTime); _this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday); }, - loadData(start, end) { - let param = { StartDate: start, EndDate: end }; - // let param = { StartDate: '2018-11-05', EndDate: '2018-11-11' }; + async loadData(start, end) { + // let param = { StartDate: start, EndDate: end }; let _this = this; _this.LOADING('加载数据中…'); + if(!this.timeValue){ + // 加载下拉框 + let timeOptionRes = await this.HTTP_GET('learun/adms/timetable/weeklist', {}, '加载数据时出错') + if(!timeOptionRes){ + this.HIDE_LOADING(); + return + } + this.timeOptions = timeOptionRes.map(e=>{return {value:e.startdate+'~'+e.enddate,text:e.textweek}}) + // 加载当前周次 + let currentWeekres = await this.HTTP_GET('learun/adms/timetable/currentweek', {}, '加载数据时出错') + if(!currentWeekres){ + this.HIDE_LOADING(); + return + } + let currentweek = currentWeekres.currentweek + let obj = timeOptionRes.find(e=>e.week == currentweek) + this.timeValue = obj.startdate + '~' + obj.enddate + } + let param = { StartDate: this.timeValue.split('~')[0], EndDate: this.timeValue.split('~')[1] }; _this.HTTP_GET('learun/adms/timetable/list', param, '加载数据时出错').then(res => { this.HIDE_LOADING(); - // console.log(res); _this.ProcessingData(res); }); @@ -191,14 +218,10 @@ export default { }, classTap(data) { let _this = this; - // console.log(_this.user) if (_this.user.Description == "教师") { - //console.log("教师"); } else if (_this.user.Description == "学生") { let LeaveType = data.LeaveType; - //console.log(LeaveType); let IsCheck = data.IsCheck; - //console.log(IsCheck); if (LeaveType == "1") { let msg = "请假申请中"; if (IsCheck == "1") { @@ -216,6 +239,13 @@ export default { }, onfun(obj){ this.init(obj); + }, + getTimeOptions(){ + return this.HTTP_GET('learun/adms/timetable/weeklist', {}, '加载数据时出错') + }, + timeChange(e){ + this.timeValue = e + this.loadData() } }, created() { @@ -382,4 +412,11 @@ export default { text-align: center; font-size: 14px; } + +.timeSelectBox .cu-form-group{ + background-color: unset; + border-bottom:none; + width: calc(100% - 80px); + margin: 0 auto; +}