diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs index 247825127..2476f2cae 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs @@ -4,6 +4,8 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; using System; +using System.Linq; +using DocumentFormat.OpenXml.Office.CustomUI; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -17,6 +19,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class ClassPlanController : MvcControllerBase { private ClassPlanIBLL classPlanIBLL = new ClassPlanBLL(); + private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); + private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); #region 视图功能 @@ -38,6 +42,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + #endregion #region 获取数据 @@ -106,17 +111,86 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult SaveForm(string keyValue, string strEntity) { + if (!string.IsNullOrEmpty(keyValue)) + { + classPlanIBLL.DelRelation(keyValue); + } OpenLessonPlanEntity entity = strEntity.ToObject(); if (!string.IsNullOrEmpty(keyValue)) { entity.AmendDate = DateTime.Now; } + entity.IsAllowEdit = true; entity.MakeDate = DateTime.Now; + var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); + if (model != null) + { + if (keyValue != model.ID.ToString()) + { + return Fail("此课程已重复!不可再次添加此课程"); + } + } classPlanIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion + #region 扩展数据 + /// + /// 排课 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult CourseArranging(string keyValue) + { + var data = classPlanIBLL.GetClassPlanEntity(keyValue); + data.State = 1; + + List TeachList = new List(); + TeachClassEntity TeachEntity = new TeachClassEntity(); + + List stringList = classInfoIBLL.GetAllClass(). + Where(x => x.DeptNo == data.DeptNo && x.MajorNo == data.MajorNo && x.Grade == data.Grade) + .OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); + if (stringList.Count > 0) + { + var teachInfo = teachClassIBLL.GetAllClass().Where(s => + s.DeptNo == data.DeptNo && s.MajorNo == data.MajorNo && s.Grade == data.Grade && s.Semester == data.Semester + && s.LessonNo == data.LessonNo && s.AcademicYearNo == data.AcademicYearNo).OrderBy(s => s.ID).ToList(); + + if (teachInfo.Count > 0) + { + return Fail("排课失败!已存在此课程信息"); + } + for (int i = 0; i < stringList.Count; i++) + { + TeachEntity.TeachClassNo = stringList[i]; + TeachEntity.AcademicYearNo = data.AcademicYearNo; + TeachEntity.DeptNo = data.DeptNo; + TeachEntity.MajorNo = data.MajorNo; + TeachEntity.Grade = data.Grade; + TeachEntity.Semester = data.Semester; + TeachEntity.LessonNo = data.LessonNo; + TeachEntity.StuNum = data.StuNum; + TeachEntity.EmpNo = data.TeachNo; + TeachEntity.LessonSortNo = data.LessonSortNo; + TeachEntity.F_SchoolId = data.F_SchoolId; + TeachList.Add(TeachEntity); + } + teachClassIBLL.SaveEntityList(TeachList); + classPlanIBLL.SaveEntity(keyValue, data); + + return Success("排课成功"); + } + else + { + return Fail("排课失败!暂无排课班级"); + } + } + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs new file mode 100644 index 000000000..89d9c3ae2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs @@ -0,0 +1,188 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using System; +using System.Linq; +using DocumentFormat.OpenXml.Office.CustomUI; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-21 17:28 + /// 描 述:设置教师 + /// + public class ClassPlanTeachController : MvcControllerBase + { + private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); + private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult TeachForm() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = teachClassIBLL.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 ClassPlanData = teachClassIBLL.GetTeachClassEntity(keyValue); + var jsonData = new + { + ClassPlan = ClassPlanData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + teachClassIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + TeachClassEntity entity = strEntity.ToObject(); + teachClassIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + #endregion + + #region 扩展数据 + + /// + /// 设置教师 + /// + /// + /// + [HttpPost] + [AjaxOnly] + + public ActionResult SetTeach(string keyValue, string Teach) + { + var entity = teachClassIBLL.GetTeachClassEntity(keyValue); + entity.EmpNo = Teach; + teachClassIBLL.SaveEntity(keyValue, entity); + + var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => + s.DeptNo == entity.DeptNo && s.MajorNo == entity.MajorNo && s.F_SchoolId == entity.F_SchoolId && entity.TeachClassNo.Contains(s.ClassNo)) + .ToList(); + if (stuDataList.Count < 0) + { + List TeachList = new List(); + StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); + for (int i = 0; i < stuDataList.Count; i++) + { + TeachEntity.NoticeBookNo = stuDataList[i].NoticeNo; + TeachEntity.StuNo = stuDataList[i].StuNo; + TeachEntity.DeptNo = stuDataList[i].DeptNo; + TeachEntity.MajorNo = stuDataList[i].MajorNo; + TeachEntity.ClassNo = stuDataList[i].ClassNo; + TeachEntity.MajorDetailNo = stuDataList[i].MajorDetailNo; + TeachEntity.MajorDetailName = stuDataList[i].MajorDetailName; + TeachEntity.StuName = stuDataList[i].StuName; + TeachEntity.GenderNo = stuDataList[i].GenderNo.ToString(); + TeachEntity.AcademicYearNo = entity.AcademicYearNo; + TeachEntity.Semester = entity.Semester; + TeachEntity.OpenLessonDeptNo = entity.DeptNo; + TeachEntity.OpenLessonMajorNo = entity.MajorNo; + TeachEntity.LessonNo = entity.LessonNo; + TeachEntity.PartCode = entity.PartCode; + TeachEntity.OrdinaryScoreScale = 0; + TeachEntity.TermInScoreScale = 0; + TeachEntity.TermEndScoreScale = 0; + TeachEntity.OtherScoreScale = 0; + TeachEntity.TeachClassNo = entity.TeachClassNo; + TeachEntity.LessonSortNo = entity.LessonSortNo; + TeachEntity.StuSortNo = entity.LessonSortNo; + TeachEntity.Grade = entity.Grade; + TeachEntity.StudyScore = 2; + TeachEntity.TotalStudyHour = 2; + TeachEntity.IsInEffect = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.IsPitchOn = "1"; + TeachEntity.F_SchoolId = entity.F_SchoolId; + TeachEntity.InsertTime = DateTime.Now; + TeachList.Add(TeachEntity); + } + StuSelectLesson.SaveEntityList(TeachList); + return Success("设置成功!"); + } + else + { + return Fail("设置失败!"); + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml index 0cc1700b6..9f664a33d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml @@ -15,15 +15,15 @@
学期*
-
+
系部*
-
+
专业*
-
+
年级*
@@ -32,15 +32,15 @@
- *@
年级
@@ -59,6 +59,7 @@  新增  编辑  删除 +  排课
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js index 1def00728..e6a26ebb9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js @@ -18,7 +18,7 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 250, 400); - $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_shortname' }); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -35,32 +35,6 @@ var bootstrap = function ($, learun) { text: 'text' }); $('#Semester').lrDataItemSelect({ code: 'Semester' }); - //$('#DeptNo').lrselect({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - // value: 'deptno', - // text: 'deptname', - // maxHeight: 200, - // select: function(item) { - // var NDeptNo = $("#DeptNo").lrselectGet(); - // if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { - // $('#MajorNo').lrselectRefresh({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', - // param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, - // value: "majorno", - // text: "majorname", - // maxHeight: 200 - // }); - // } else { - // $('#MajorNo').lrselectRefresh({ - // url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', - // param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, - // value: "majorno", - // text: "majorname", - // maxHeight: 200 - // }); - // } - // } - //}); $("#MajorNo").lrselect(); $('#LessonNo').lrselect({ placeholder: "请选择课程", @@ -81,7 +55,7 @@ var bootstrap = function ($, learun) { title: '新增', url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/Form', width: 800, - height: 400, + height: 450, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -91,25 +65,71 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { - learun.layerForm({ - id: 'form', - title: '编辑', - url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/Form?keyValue=' + keyValue, - width: 800, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); + var state = $('#gridtable').jfGridValue('State'); + if (state == 0) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/Form?keyValue=' + keyValue, + width: 800, + height: 450, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } else { + learun.layerConfirm('是否确认修改,修改后可能会造成不可弥补的错误!!!', function (res) { + if (res) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/Form?keyValue=' + keyValue, + width: 800, + height: 450, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + } } }); // 删除 $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var state = $('#gridtable').jfGridValue('State'); + if (learun.checkrow(keyValue)) { + if (state == 0) { + learun.layerConfirm('是否确认删除该项!', + function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/DeleteForm', + { keyValue: keyValue }, + function () { + refreshGirdData(); + }); + } + + }); + } else { + learun.layerConfirm('是否确认删除该项,删除数据后不可恢复!!!', function (item) { + if (item) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + } + }); + //排课 + $('#lr_courses').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认删除该项!', function (res) { + learun.layerConfirm('确定要进行排课么!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/DeleteForm', { keyValue: keyValue }, function () { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -206,6 +226,7 @@ var bootstrap = function ($, learun) { } }, { label: "年级", name: "Grade", width: 50, align: "left" }, + { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, { label: "课程名称", name: "LessonName", width: 200, align: "left" }, { label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" }, { label: "人数", name: "StuNum", width: 80, align: "left" }, @@ -231,7 +252,7 @@ var bootstrap = function ($, learun) { { label: "备注", name: "Remark", width: 100, align: "left" }, ], mainId: 'ID', - sidx: 'ID desc', + sidx: 'MakeDate desc', isPage: true }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml new file mode 100644 index 000000000..876285af0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml @@ -0,0 +1,68 @@ +@{ + ViewBag.Title = "开课计划"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
学校信息
+
+
+
+
+
+
+ 未选择学校 - 专业信息 +
+
+
+
+
+
+
+
学校
+
+
+
+
专业
+
+
+
+
学年
+
+
+
+
学期
+
+
+ @*
+
系部
+
+
*@ +
+
年级
+
+
+
+
课程
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js new file mode 100644 index 000000000..b4169e320 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js @@ -0,0 +1,243 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-11-29 11:43 + * 描 述:开课计划 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.inittree(); + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 250, 400); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //年级 + $('#Grade').lrselect({ + placeholder: "请选择年级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', + value: 'value', + text: 'text' + }); + $('#Semester').lrDataItemSelect({ code: 'Semester' }); + $("#MajorNo").lrselect(); + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + maxHeight: 200 + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm', + width: 800, + height: 450, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 设置教师 + $('#lr_teach').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var empno = $('#gridtable').jfGridValue('EmpNo'); + if (learun.checkrow(keyValue)) { + if (empno) { + learun.layerForm({ + id: 'form', + title: '设置教师', + url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/TeachForm?keyValue=' + keyValue, + width: 400, + height: 300, + callBack: function (id) { + return top[id].acceptClick(); + } + }); + } else { + learun.alert.warning("所选班级已设置教师不能重复设置!!!"); + } + } + + }); + // 强制设置教师 + $('#lr_qzteach').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var loginInfo = learun.clientdata.get(['userinfo']); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '设置教师', + url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SelectForm?objectId=' + keyValue + '&companyId=' + loginInfo.F_CompanyId + '&departmentId=' + loginInfo.F_DepartmentId + '&category=1', + width: 800, + height: 520, + callBack: function (id) { + return top[id].acceptClick(); + } + }); + } + + }); + }, + inittree: function () { + $('#cddeptTree').lrtree({ + url: top.$.rootUrl + '/EducationalAdministration/CdDept/GetTree', + param: { parentId: '0' }, + nodeClick: page.treeNodeClick + }); + //$('#cddeptTree').lrtreeSet('setValue', '53298b7a-404c-4337-aa7f-80b2a4ca6681'); + }, + treeNodeClick: function (item) { + cddeptname = item.id; + $('#titleinfo').text(item.text); + page.search(); + var NDeptNo = item.id; + if (NDeptNo != null && NDeptNo != "" && NDeptNo != undefined) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: " 1=1 and CheckMark=1 and deptno in (" + NDeptNo + ")" }, + value: "majorno", + text: "majorname", + maxHeight: 200 + }); + } else { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: " 1=1 and CheckMark=1 and deptno ='' " }, + value: "majorno", + text: "majorname", + maxHeight: 200 + }); + } + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/GetPageList', + headData: [ + { + 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', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, + { + label: "学期", name: "Semester", width: 50, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'Semester', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + 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: 'id', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "年级", name: "Grade", width: 50, align: "left" }, + { + label: "课程", name: "LessonNo", width: 200, 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: "StuNum", width: 80, align: "left" }, + { label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, + { label: "课程区别码", name: "PartCode", width: 80, align: "left" }, + { label: "班级", name: "TeachClassNo", width: 80, align: "left" }, + { + label: "教师", name: "EmpNo", width: 80, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: value, + keyId: 'empno', + callback: function (_data) { + callback(_data['empname']); + } + }); + } + }, + { label: "合上班", name: "RelatedClassNo", width: 80, align: "left" }, + { label: "拟开教学班数", name: "LessonSortNo", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + sidx: 'ID desc', + isMultiselect: true, + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.cshtml new file mode 100644 index 000000000..f8e88904f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.cshtml @@ -0,0 +1,11 @@ +@{ + ViewBag.Title = "开课计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
教师*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js new file mode 100644 index 000000000..8961f0b68 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js @@ -0,0 +1,47 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-11-29 11:43 + * 描 述:开课计划 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + //page.initData(); + }, + bind: function () { + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'realname' }); + } + //initData: function () { + // if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + // } + //} + }; + // 保存数据 + acceptClick = function (callBack) { + console.log(keyValue, 111); + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach?keyValue=' + keyValue, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + //}); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 941f3661d..74170f27a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -1,4 +1,4 @@ - + @@ -319,6 +319,7 @@ + @@ -946,6 +947,7 @@ + @@ -1079,6 +1081,7 @@ + @@ -7460,6 +7463,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs index 1489602ef..2f7754595 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs @@ -120,5 +120,63 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion + + #region 扩展数据 + /// + /// 去重 + /// + /// + /// + /// + /// + /// + /// + /// + /// + public OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, + string Major, string Grade, string Lesson) + { + try + { + return classPlanService.GetRepetitions(School, Year, Semester, Dept, Major, Grade, Lesson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 删除实体数据 + /// + /// 主键 + public void DelRelation(string keyValue) + { + try + { + classPlanService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs index 6ba71a1e2..f8b0f7f18 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs @@ -44,5 +44,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void SaveEntity(string keyValue, OpenLessonPlanEntity entity); #endregion + #region 扩展数据 + + /// + /// 去重 + /// + /// 主键 + /// 校区 + /// 学年 + /// 学期 + /// 系部 + /// 专业 + /// 年级 + /// 课程 + /// + OpenLessonPlanEntity GetRepetitions( string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); + + /// + /// 编辑时删除关联数据 + /// + /// + void DelRelation(string keyValue); + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs index 184b03de9..71604f5b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs @@ -122,13 +122,55 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { var keyvalue = Convert.ToInt32(keyValue); - this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyvalue); + var OpList = this.BaseRepository("CollegeMIS").FindEntity(t => t.ID == keyvalue); + if (OpList != null) + { + var TeachList = this.BaseRepository("CollegeMIS").FindList( + x => x.DeptNo == OpList.DeptNo && + x.MajorNo == OpList.MajorNo && + x.Grade == OpList.Grade && + x.Semester == OpList.Semester && + x.LessonNo == OpList.LessonNo && + x.AcademicYearNo == OpList.AcademicYearNo + ).ToList(); + List StrTeach = null; + if (TeachList.Count > 0) + { + StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); + if (StrTeach.Count() > 0) + { + var LessonList = this.BaseRepository("CollegeMIS").FindList( + y => y.DeptNo == OpList.DeptNo && + y.MajorNo == OpList.MajorNo && + y.Grade == OpList.Grade && + y.Semester == OpList.Semester && + y.LessonNo == OpList.LessonNo && + y.AcademicYearNo == OpList.AcademicYearNo && + StrTeach.Contains(y.ClassNo) + ); + foreach (var item in LessonList) + { + db.Delete(m => m.SelectId == Convert.ToInt32(item.SelectId)); + } + + foreach (var item in TeachList) + { + db.Delete(m => m.ID == item.ID); + } + } + } + } + //this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyvalue); + db.Delete(m => m.ID == keyvalue); + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; @@ -175,5 +217,105 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + + #region 扩展数据 + /// + /// 去重 + /// + /// 主键 + /// 校区 + /// 学年 + /// 学期 + /// 系部 + /// 专业 + /// 年级 + /// 课程 + /// + public OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, + string Major, string Grade, string Lesson) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity( + x => x.F_SchoolId == School + && x.AcademicYearNo == Year + && x.Semester == Semester + && x.DeptNo == Dept + && x.MajorNo == Major + && x.Grade == Grade + && x.LessonNo == Lesson + ); + + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } + + public void DelRelation(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var keyvalue = Convert.ToInt32(keyValue); + var OpList = this.BaseRepository("CollegeMIS").FindEntity(t => t.ID == keyvalue); + if (OpList != null) + { + var TeachList = this.BaseRepository("CollegeMIS").FindList( + x => x.DeptNo == OpList.DeptNo && + x.MajorNo == OpList.MajorNo && + x.Grade == OpList.Grade && + x.Semester == OpList.Semester && + x.LessonNo == OpList.LessonNo && + x.AcademicYearNo == OpList.AcademicYearNo + ).ToList(); + List StrTeach = null; + if (TeachList.Count > 0) + { + StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); + if (StrTeach.Count > 0) + { + var LessonList = this.BaseRepository("CollegeMIS").FindList( + y => y.DeptNo == OpList.DeptNo && + y.MajorNo == OpList.MajorNo && + y.Grade == OpList.Grade && + y.Semester == OpList.Semester && + y.LessonNo == OpList.LessonNo && + y.AcademicYearNo == OpList.AcademicYearNo && + StrTeach.Contains(y.ClassNo) + ); + foreach (var item in LessonList) + { + db.Delete(m => m.SelectId == Convert.ToInt32(item.SelectId)); + } + + foreach (var item in TeachList) + { + db.Delete(m => m.ID == item.ID); + } + } + } + + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs index 2f3a5cfc6..0ebadc6b6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs @@ -270,6 +270,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("ISALLOWEDIT")] public bool? IsAllowEdit { get; set; } + /// + /// 排课标识 + /// + [Column("STATE")] + public int? State { get; set; } #endregion #region 扩展操作 @@ -305,6 +310,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[NotMapped] public string MajorName { get; set; } + /// + /// 教师 + /// + [NotMapped] + public string TeachNo { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs new file mode 100644 index 000000000..34845643b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListBLL.cs @@ -0,0 +1,145 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-01 11:49 + /// 描 述:收文报告 + /// + public class StuSelectLessonListBLL : StuSelectLessonListIBLL + { + private StuSelectLessonListService stuSelectLessonListService = new StuSelectLessonListService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return stuSelectLessonListService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Dispatch表实体数据 + /// + /// 主键 + /// + public StuSelectLessonListEntity GetListEntity(string keyValue) + { + try + { + return stuSelectLessonListService.GetListEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + stuSelectLessonListService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, StuSelectLessonListEntity entity) + { + try + { + stuSelectLessonListService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + public void SaveEntityList(List entity) + { + try + { + stuSelectLessonListService.SaveEntityList(entity); + } + 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/StuSelectLessonList/StuSelectLessonListIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs new file mode 100644 index 000000000..b645826a9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListIBLL.cs @@ -0,0 +1,50 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-01 11:49 + /// 描 述:收文报告 + /// + public interface StuSelectLessonListIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Dispatch表实体数据 + /// + /// 主键 + /// + StuSelectLessonListEntity GetListEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, StuSelectLessonListEntity entity); + void SaveEntityList(List entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs new file mode 100644 index 000000000..8626a5efd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs @@ -0,0 +1,235 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-06-01 11:49 + /// 描 述:收文报告 + /// + public class StuSelectLessonListService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" * "); + strSql.Append(" FROM Dispatch t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["keyword"].IsEmpty()) + { + dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + strSql.Append(" AND t.DisFrom like @keyword "); + } + string beginDate = queryParam["StartTime"].ToString(); + string endDate = queryParam["EndTime"].ToString(); + if (!string.IsNullOrEmpty(beginDate) && !string.IsNullOrEmpty(endDate)) + { + #region 获取日期(年 月 日) + string bYaer = beginDate.Substring(0, 4); + string bMonth = beginDate.Substring(5, 2); + string bdate = beginDate.Substring(8, 2); + string eYaer = endDate.Substring(0, 4); + string eMonth = endDate.Substring(5, 2); + #endregion + string edate = endDate.Substring(8, 2); + strSql.Append(@" and (t.DisYear BETWEEN '" + bYaer + "' and '" + eYaer + "') " + + "and (t.DisMonth BETWEEN '" + bMonth + "' and '" + eMonth + "') " + + " and (t.DisDay BETWEEN '" + bdate + "' and '" + edate + "') "); + + } + if (!queryParam["userId"].IsEmpty()) + { + strSql.Append(" AND t.Id Not in(select DisId from DispatchAudit where AuditUser ='" + queryParam["userId"].ToString() + "') "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Dispatch表实体数据 + /// + /// 主键 + /// + public StuSelectLessonListEntity GetListEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + var keyvalue = Convert.ToInt32(keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.SelectId == keyvalue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, StuSelectLessonListEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var keyvalue = Convert.ToInt32(keyValue); + entity.Modify(keyvalue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 扩展数据 + public void SaveEntityList(List entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + foreach (var item in entity) + { + StuSelectLessonListEntity stuLessonList = new StuSelectLessonListEntity(); + stuLessonList.F_SchoolId = item.F_SchoolId; + stuLessonList.NoticeBookNo = item.NoticeBookNo; + stuLessonList.StuNo = item.StuNo; + stuLessonList.DeptNo = item.DeptNo; + stuLessonList.MajorNo = item.MajorNo; + stuLessonList.ClassNo = item.ClassNo; + stuLessonList.MajorDetailNo = item.MajorDetailNo; + stuLessonList.MajorDetailName = item.MajorDetailName; + stuLessonList.StuName = item.StuName; + stuLessonList.TeachClassNo = item.TeachClassNo; + stuLessonList.GenderNo = item.GenderNo; + stuLessonList.AcademicYearNo = item.AcademicYearNo; + stuLessonList.Semester = item.Semester; + stuLessonList.OpenLessonDeptNo = item.OpenLessonDeptNo; + stuLessonList.OpenLessonMajorNo = item.OpenLessonMajorNo; + stuLessonList.LessonNo = item.LessonNo; + stuLessonList.LessonName = item.LessonName; + stuLessonList.PartCode = item.PartCode; + stuLessonList.LessonNameEng = item.LessonNameEng; + stuLessonList.OrdinaryScoreScale = item.OrdinaryScoreScale; + stuLessonList.TermInScoreScale = item.TermInScoreScale; + stuLessonList.TermEndScoreScale = item.TermEndScoreScale; + stuLessonList.OtherScoreScale = item.OtherScoreScale; + stuLessonList.TeachClassNo = item.TeachClassNo; + stuLessonList.LessonSortNo = item.LessonSortNo; + stuLessonList.StuSortNo = item.StuSortNo; + stuLessonList.Grade = item.Grade; + stuLessonList.StudyScore = item.StudyScore; + stuLessonList.TotalStudyHour = item.TotalStudyHour; + stuLessonList.IsInEffect = item.IsInEffect; + stuLessonList.Remark = item.Remark; + stuLessonList.ConflictLessonNo = item.ConflictLessonNo; + stuLessonList.EmpNo = item.EmpNo; + stuLessonList.TeachPlanNo = item.TeachPlanNo; + stuLessonList.IsPitchOn = item.IsPitchOn; + stuLessonList.CheckMark = item.CheckMark; + stuLessonList.InsertTime = item.InsertTime; + db.Insert(stuLessonList); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs new file mode 100644 index 000000000..31e11e250 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs @@ -0,0 +1,247 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-01-29 11:08 + /// 描 述:班级信息管理 + /// + public class TeachClassBLL : TeachClassIBLL + { + private TeachClassService teachClassEntity = new TeachClassService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return teachClassEntity.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public bool GetAny() + { + try + { + return teachClassEntity.GetAny(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取ClassInfo表实体数据 + /// 主键 + /// + /// + public TeachClassEntity GetTeachClassEntity(string keyValue) + { + try + { + return teachClassEntity.GetTeachClassEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取ClassInfo表实体数据 + /// 班级编号 + /// + /// + + #endregion + + #region 提交数据 + public void Lock(string keyValue) + { + try + { + teachClassEntity.Lock(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void UnLock(string keyValue) + { + try + { + teachClassEntity.UnLock(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + try + { + teachClassEntity.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, TeachClassEntity entity) + { + try + { + teachClassEntity.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + public void SaveEntityList(List entity) + { + try + { + teachClassEntity.SaveEntityList(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 扩展数据 + /// + /// + /// + /// + public IEnumerable GetAllClass() + { + try + { + return teachClassEntity.GetAllClass(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + public void SetTeach(string keyValue) + { + try + { + teachClassEntity.SetTeach(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs new file mode 100644 index 000000000..b69b5bca8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs @@ -0,0 +1,65 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-01-29 11:08 + /// 描 述:班级信息管理 + /// + public interface TeachClassIBLL + { + #region 获取数据 + bool GetAny(); + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取ClassInfo表实体数据 + /// 主键 + /// + /// + TeachClassEntity GetTeachClassEntity(string keyValue); + #endregion + + #region 提交数据 + void Lock(string keyValue); + void UnLock(string keyValue); + /// + /// 删除实体数据 + /// 主键 + /// + /// + void DeleteEntity(string keyValue); + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + void SaveEntity(string keyValue, TeachClassEntity entity); + + + #endregion + + #region 扩展数据 + + /// + /// 设置教师 + /// + /// + void SetTeach(string keyValue); + + void SaveEntityList(List entity); + + IEnumerable GetAllClass(); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs new file mode 100644 index 000000000..f48bd9059 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs @@ -0,0 +1,365 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-01-29 11:08 + /// 描 述:班级信息管理 + /// + public class TeachClassService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" * "); + strSql.Append(" FROM TeachClass t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + strSql.Append(" AND t.F_SchoolId = @F_SchoolId "); + } + 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["Grade"].IsEmpty()) + { + dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Grade Like @Grade "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + strSql.Append(" AND t.LessonNo = @LessonNo "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + internal bool GetAny() + { + try + { + return this.BaseRepository("CollegeMIS").FindList().ToList().Count > 0 ? true : false; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取ClassInfo表实体数据 + /// 主键 + /// + /// + public TeachClassEntity GetTeachClassEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + public void Lock(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //单个启用 + //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'"); + + //多个启用 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + item + "'"); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void UnLock(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //单个停用 + //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + keyValue + "'"); + + //多个停用 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + item + "'"); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 删除实体数据 + /// 主键 + /// + /// + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //单个删除 + //this.BaseRepository("CollegeMIS").Delete(t => t.ClassId == keyValue); + + //多个删除 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.Delete(t => t.ID == Convert.ToInt32(item)); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveEntity(string keyValue, TeachClassEntity entity) + { + try + { + var keyvalue = Convert.ToInt32(keyValue); + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyvalue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + + #endregion + + #region 扩展数据 + public IEnumerable GetAllClass() + { + try + { + return this.BaseRepository("CollegeMIS").FindList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + public void SetTeach(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //foreach (var item in List) + //{ + // TeachClassEntity Teach = new TeachClassEntity(); + // Teach.TeachClassNo = item.TeachClassNo; + // Teach.AcademicYearNo = item.AcademicYearNo; + // Teach.DeptNo = item.DeptNo; + // Teach.MajorNo = item.MajorNo; + // Teach.Grade = item.Grade; + // Teach.Semester = item.Semester; + // Teach.LessonNo = item.LessonNo; + // Teach.StuNum = item.StuNum; + // Teach.LessonSortNo = item.LessonSortNo; + // Teach.F_SchoolId = item.F_SchoolId; + // db.Insert(Teach); + //} + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存数据 + /// + /// 主键 + /// + public void SaveEntityList(List List) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + foreach (var item in List) + { + TeachClassEntity Teach = new TeachClassEntity(); + Teach.TeachClassNo = item.TeachClassNo; + Teach.AcademicYearNo = item.AcademicYearNo; + Teach.DeptNo = item.DeptNo; + Teach.MajorNo = item.MajorNo; + Teach.Grade = item.Grade; + Teach.Semester = item.Semester; + Teach.LessonNo = item.LessonNo; + Teach.StuNum = item.StuNum; + Teach.LessonSortNo = item.LessonSortNo; + Teach.F_SchoolId = item.F_SchoolId; + db.Insert(Teach); + } + db.Commit(); + } + 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/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 354e3b0ce..e63556a18 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 @@ -211,6 +211,9 @@ + + + @@ -228,6 +231,9 @@ + + +