@@ -93,7 +93,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
var data = cdDeptIBLL.GetAllList(); | var data = cdDeptIBLL.GetAllList(); | ||||
return Success(data); | return Success(data); | ||||
} | } | ||||
///// <summary> | |||||
///// 获取树形数据 | |||||
///// </summary> | |||||
///// <param name="parentId">父级id</param> | |||||
///// <returns></returns> | |||||
//[HttpGet] | |||||
//[AjaxOnly] | |||||
//public ActionResult GetTree(string parentId) | |||||
//{ | |||||
// var data = cdDeptIBLL.GetTree(parentId); | |||||
// return JsonResult(data); | |||||
//} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -0,0 +1,184 @@ | |||||
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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-08-21 17:28 | |||||
/// 描 述:成绩比例设置 | |||||
/// </summary> | |||||
public class ClassPlanController : MvcControllerBase | |||||
{ | |||||
private ClassPlanIBLL classPlanIBLL = new ClassPlanBLL(); | |||||
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||||
private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Form() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = classPlanIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var ClassPlanData = classPlanIBLL.GetClassPlanEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
ClassPlan = ClassPlanData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
classPlanIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | |||||
{ | |||||
OpenLessonPlanEntity entity = strEntity.ToObject<OpenLessonPlanEntity>(); | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.AmendDate = DateTime.Now; | |||||
} | |||||
entity.State = 0; | |||||
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 扩展数据 | |||||
/// <summary> | |||||
/// 排课 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult CourseArranging(string keyValue) | |||||
{ | |||||
var entity = classPlanIBLL.GetListById(keyValue); | |||||
List<TeachClassEntity> TeachList = new List<TeachClassEntity>(); | |||||
for (int i = 0; i < entity.Count; i++) | |||||
{ | |||||
var lessonList = classInfoIBLL.GetAllClass(). | |||||
Where(x => x.DeptNo == entity[i].DeptNo && x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) | |||||
.OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); | |||||
if (lessonList.Count > 0) | |||||
{ | |||||
for (int j = 0; j < lessonList.Count; j++) | |||||
{ | |||||
TeachClassEntity TeachEntity = new TeachClassEntity(); | |||||
TeachEntity.TeachClassNo = lessonList[j]; | |||||
TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; | |||||
TeachEntity.DeptNo = entity[i].DeptNo; | |||||
TeachEntity.MajorNo = entity[i].MajorNo; | |||||
TeachEntity.Grade = entity[i].Grade; | |||||
TeachEntity.Semester = entity[i].Semester; | |||||
TeachEntity.LessonNo = entity[i].LessonNo; | |||||
TeachEntity.StuNum = entity[i].StuNum; | |||||
TeachEntity.LessonSortNo = entity[i].LessonSortNo; | |||||
TeachEntity.F_SchoolId = entity[i].F_SchoolId; | |||||
TeachList.Add(TeachEntity); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return Fail("排课失败!暂无排课班级"); | |||||
} | |||||
} | |||||
teachClassIBLL.SaveEntityList(TeachList); | |||||
classPlanIBLL.SaveEntityList(keyValue, entity); | |||||
return Success("排课成功"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,282 @@ | |||||
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; | |||||
using List = DocumentFormat.OpenXml.Office2010.ExcelAc.List; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-08-21 17:28 | |||||
/// 描 述:设置教师 | |||||
/// </summary> | |||||
public class ClassPlanTeachController : MvcControllerBase | |||||
{ | |||||
private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); | |||||
private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); | |||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||||
#region 视图功能 | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult Index() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult TeachForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult TeachFormQZ() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetPageList(string pagination, string queryJson) | |||||
{ | |||||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||||
var data = teachClassIBLL.GetPageList(paginationobj, queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = paginationobj.total, | |||||
page = paginationobj.page, | |||||
records = paginationobj.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetFormData(string keyValue) | |||||
{ | |||||
var ClassPlanData = teachClassIBLL.GetTeachClassEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
ClassPlan = ClassPlanData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DeleteForm(string keyValue) | |||||
{ | |||||
teachClassIBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="strEntity">实体</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | |||||
{ | |||||
TeachClassEntity entity = strEntity.ToObject<TeachClassEntity>(); | |||||
teachClassIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 设置教师 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SetTeach(string keyValue, string EmpNo) | |||||
{ | |||||
var entityList = teachClassIBLL.GetTeachListById(keyValue); | |||||
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); | |||||
for (int i = 0; i < entityList.Count; i++) | |||||
{ | |||||
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo | |||||
&& s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId | |||||
&& s.ClassNo == entityList[i].TeachClassNo | |||||
).ToList(); | |||||
if (stuDataList.Count > 0) | |||||
{ | |||||
for (int j = 0; j < stuDataList.Count; j++) | |||||
{ | |||||
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); | |||||
TeachEntity.StuNo = stuDataList[j].StuNo; | |||||
TeachEntity.DeptNo = entityList[i].DeptNo; | |||||
TeachEntity.MajorNo = entityList[i].MajorNo; | |||||
TeachEntity.ClassNo = stuDataList[j].ClassNo; | |||||
TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; | |||||
TeachEntity.MajorDetailName = entityList[i].MajorDetailName; | |||||
TeachEntity.StuName = stuDataList[j].StuName; | |||||
TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; | |||||
TeachEntity.Semester = entityList[i].Semester; | |||||
TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; | |||||
TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; | |||||
TeachEntity.LessonNo = entityList[i].LessonNo; | |||||
TeachEntity.PartCode = entityList[i].PartCode; | |||||
TeachEntity.OrdinaryScoreScale = 0; | |||||
TeachEntity.TermInScoreScale = 0; | |||||
TeachEntity.TermEndScoreScale = 0; | |||||
TeachEntity.OtherScoreScale = 0; | |||||
TeachEntity.TeachClassNo = entityList[i].TeachClassNo; | |||||
TeachEntity.LessonSortNo = entityList[i].LessonSortNo; | |||||
TeachEntity.StuSortNo = entityList[i].LessonSortNo; | |||||
TeachEntity.Grade = entityList[i].Grade; | |||||
TeachEntity.StudyScore = 2; | |||||
TeachEntity.TotalStudyHour = 2; | |||||
TeachEntity.IsInEffect = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.F_SchoolId = entityList[i].F_SchoolId; | |||||
TeachEntity.CheckMark = "1"; | |||||
TeachEntity.InsertTime = DateTime.Now; | |||||
TeachList.Add(TeachEntity); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return Fail("设置失败,未发现相关学生!"); | |||||
} | |||||
} | |||||
StuSelectLesson.SaveEntityList(TeachList); | |||||
teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 | |||||
return Success("设置成功!"); | |||||
} | |||||
public ActionResult QzSetTeach(string keyValue, string EmpNo) | |||||
{ | |||||
var entityList = teachClassIBLL.GetTeachListById(keyValue); | |||||
string Nid = ""; | |||||
if (entityList.Count > 0) | |||||
{ | |||||
for (int i = 0; i < entityList.Count; i++) | |||||
{ | |||||
List<string> ssList = StuSelectLesson.GetAllList().Where( | |||||
y => y.DeptNo == entityList[i].DeptNo | |||||
&& y.MajorNo == entityList[i].MajorNo | |||||
&& y.F_SchoolId == entityList[i].F_SchoolId | |||||
&& y.ClassNo == entityList[i].TeachClassNo | |||||
&& y.LessonNo == entityList[i].LessonNo | |||||
&& y.CheckMark == "1" | |||||
).Select(x => x.SelectId.ToString()).ToList(); | |||||
Nid += string.Join(",", ssList) + ","; | |||||
} | |||||
} | |||||
Nid = Nid.TrimEnd(','); | |||||
StuSelectLesson.DeleteEntity(Nid); | |||||
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); | |||||
for (int i = 0; i < entityList.Count; i++) | |||||
{ | |||||
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo | |||||
&& s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId | |||||
&& s.ClassNo == entityList[i].TeachClassNo | |||||
).ToList(); | |||||
if (stuDataList.Count > 0) | |||||
{ | |||||
for (int j = 0; j < stuDataList.Count; j++) | |||||
{ | |||||
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); | |||||
TeachEntity.StuNo = stuDataList[j].StuNo; | |||||
TeachEntity.DeptNo = entityList[i].DeptNo; | |||||
TeachEntity.MajorNo = entityList[i].MajorNo; | |||||
TeachEntity.ClassNo = stuDataList[j].ClassNo; | |||||
TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; | |||||
TeachEntity.MajorDetailName = entityList[i].MajorDetailName; | |||||
TeachEntity.StuName = stuDataList[j].StuName; | |||||
TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1"; | |||||
TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; | |||||
TeachEntity.Semester = entityList[i].Semester; | |||||
TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; | |||||
TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; | |||||
TeachEntity.LessonNo = entityList[i].LessonNo; | |||||
TeachEntity.PartCode = entityList[i].PartCode; | |||||
TeachEntity.OrdinaryScoreScale = 0; | |||||
TeachEntity.TermInScoreScale = 0; | |||||
TeachEntity.TermEndScoreScale = 0; | |||||
TeachEntity.OtherScoreScale = 0; | |||||
TeachEntity.TeachClassNo = entityList[i].TeachClassNo; | |||||
TeachEntity.LessonSortNo = entityList[i].LessonSortNo; | |||||
TeachEntity.StuSortNo = entityList[i].LessonSortNo; | |||||
TeachEntity.Grade = entityList[i].Grade; | |||||
TeachEntity.StudyScore = 2; | |||||
TeachEntity.TotalStudyHour = 2; | |||||
TeachEntity.IsInEffect = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.F_SchoolId = entityList[i].F_SchoolId; | |||||
TeachEntity.InsertTime = DateTime.Now; | |||||
TeachList.Add(TeachEntity); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
return Fail("设置失败,未发现相关学生!"); | |||||
} | |||||
} | |||||
StuSelectLesson.SaveEntityList(TeachList); | |||||
teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 | |||||
return Success("设置成功!"); | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,112 @@ | |||||
@{ | |||||
ViewBag.Title = "开课计划"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">学校<font face="宋体">*</font></div> | |||||
<div id="F_SchoolId" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">系部<font face="宋体">*</font></div> | |||||
<div id="DeptNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||||
<div id="MajorNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">年级<font face="宋体">*</font></div> | |||||
<div id="Grade" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
<input id="LessonName" type="hidden" /> | |||||
</div> | |||||
@*<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">课程类别码</div> | |||||
<div id="LessonSortNo"></div> | |||||
</div>*@ | |||||
<div class="col-xs-6 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">课程细类码</div> | |||||
<div id="LessonSortDetailNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">开合课</div> | |||||
<input id="StuSortNo" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">拟开教学班数</div> | |||||
<input id="TeachClassNum" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">人数</div> | |||||
<input id="StuNum" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">周课时</div> | |||||
<input id="WeekLessonHour" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-3 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">教室课时</div> | |||||
<input id="WeekHourClassroom" type="text" class="form-control" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-3 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">上机课时</div> | |||||
<input id="PracticeHour" type="text" class="form-control" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-3 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">起始周次</div> | |||||
<input id="StartWeek" type="text" class="form-control" icheckexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-3 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">结束周次</div> | |||||
<input id="EndWeek" type="text" class="form-control" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">负责开课院系</div> | |||||
<div id="TeachDeptNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">学分</div> | |||||
<input id="StudyScore" type="text" class="form-control" checkexpession="NumOrNull" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="ClassPlan"> | |||||
<div class="lr-form-item-title">备注</div> | |||||
<textarea id="Remark" class="form-control" style="height:100px;"></textarea> | |||||
</div> | |||||
<div class="col-xs-2 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">考核方式码</div> | |||||
<input id="CheckStyleNo" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-2 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">成绩记录方式</div> | |||||
<input id="ScoreRecordStyleNo" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-2 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">审查标记</div> | |||||
<input id="CheckMarkDept" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-2 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">审查标记</div> | |||||
<input id="CheckMark" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-2 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">实践课教室类型</div> | |||||
<input id="ClassroomType" type="text" class="form-control" /> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item" data-table="ClassPlan" style="display: none; "> | |||||
<div class="lr-form-item-title">理论课教室类型</div> | |||||
<input id="ClassroomPracticeType" type="text" class="form-control" /> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlan/Form.js") |
@@ -0,0 +1,113 @@ | |||||
/* * 版 本 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 () { | |||||
$('#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' | |||||
}); | |||||
$('#LessonSortDetailNo').lrDataSourceSelect({ code: 'CdLessonSortDetail', value: 'lessonsortdetailno', text: 'lessonsortdetailname' }); | |||||
//年级 | |||||
$('#Grade').lrselect({ | |||||
placeholder: "请选择年级", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', | |||||
value: 'value', | |||||
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: "请选择课程", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', | |||||
value: 'value', | |||||
text: 'text' | |||||
}); | |||||
$('#TeachDeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||||
}, | |||||
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]); | |||||
} | |||||
} | |||||
}); | |||||
} | |||||
$('#StuSortNo').val('02'); | |||||
$('#LessonSortNo').val('2'); | |||||
$('#CheckStyleNo').val('1'); | |||||
$('#ScoreRecordStyleNo').val('1'); | |||||
$('#CheckMark').val('1'); | |||||
$('#ClassroomType').val('1'); | |||||
$('#ClassroomPracticeType').val('99'); | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
var nName = $("#LessonNo").find(".lr-select-placeholder").text(); | |||||
var Narray= nName.split("("); | |||||
$("#LessonName").val(Narray[0]); | |||||
var postData = { | |||||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||||
}; | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,70 @@ | |||||
@{ | |||||
ViewBag.Title = "开课计划"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlt ">学校信息</div> | |||||
<div id="cddeptTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title"> | |||||
<span id="titleinfo" class="lrlt">未选择学校</span> - <span class="lrlt">专业信息</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="multiple_condition_query"> | |||||
<div class="lr-query-formcontent"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">学校</div> | |||||
<div id="F_SchoolId"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">专业</div> | |||||
<div id="MajorNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">学年</div> | |||||
<div id="AcademicYearNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">学期</div> | |||||
<div id="Semester"></div> | |||||
</div> | |||||
@*<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">系部</div> | |||||
<div id="DeptNo"></div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">年级</div> | |||||
<div id="Grade"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">课程</div> | |||||
<div id="LessonNo"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
<a id="lr_courses" class="btn btn-default"><i class="fa fa-print"></i> 排课</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlan/Index.js") |
@@ -0,0 +1,306 @@ | |||||
/* * 版 本 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 cddeptname = ''; | |||||
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/ClassPlan/Form', | |||||
width: 800, | |||||
height: 450, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
// 编辑 | |||||
$('#lr_edit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return; | |||||
} | |||||
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'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var state = $('#gridtable').jfGridValue('State').split(','); | |||||
var allEmpty = true; | |||||
for (var i = 0; i < state.length; i++) { | |||||
if (state[i] != 0) { | |||||
allEmpty = false; | |||||
} | |||||
} | |||||
if (allEmpty) { | |||||
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)) { | |||||
var state = $('#gridtable').jfGridValue('State').split(','); | |||||
var allEmpty = true; | |||||
for (var i = 0; i < state.length; i++) { | |||||
if (state[i] != 0) { | |||||
allEmpty = false; | |||||
} | |||||
} | |||||
if (allEmpty) { | |||||
learun.layerConfirm('确定要进行排课么!', | |||||
function (res) { | |||||
if (res) { | |||||
learun.postForm( | |||||
top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', | |||||
{ keyValue: keyValue }, | |||||
function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} else { | |||||
learun.alert.warning("不嫩选择已排课的课程计划"); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
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/ClassPlan/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" }, | |||||
{ label: "课程名称", name: "LessonName", width: 200, align: "left" }, | |||||
{ | |||||
label: "状态", name: "State", width: 100, align: "left", | |||||
formatter: function (cellvalue, row) { | |||||
if (cellvalue == 0) { | |||||
return '<span class=\"label label-warning\">未排课</span>'; | |||||
} if (cellvalue == 1) { | |||||
return '<span class=\"label label-success\">已排课</span>'; | |||||
} | |||||
} | |||||
}, | |||||
{ label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" }, | |||||
{ label: "人数", name: "StuNum", width: 80, align: "left" }, | |||||
{ label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, | |||||
{ label: "教室课时", name: "WeekHourClassroom", width: 80, align: "left" }, | |||||
{ label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, | |||||
{ label: "起始周次", name: "StartWeek", width: 80, align: "left" }, | |||||
{ label: "结束周次", name: "EndWeek", width: 80, align: "left" }, | |||||
{ | |||||
label: "负责开课院系", name: "TeachDeptNo", 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: "StudyScore", width: 80, align: "left" }, | |||||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||||
], | |||||
mainId: 'ID', | |||||
sidx: 'MakeDate desc', | |||||
isMultiselect: true, | |||||
isPage: true | |||||
}); | |||||
page.search(); | |||||
}, | |||||
search: function (param) { | |||||
param = param || {}; | |||||
param.DeptNo = cddeptname; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,68 @@ | |||||
@{ | |||||
ViewBag.Title = "开课计划"; | |||||
Layout = "~/Views/Shared/_Index.cshtml"; | |||||
} | |||||
<div class="lr-layout lr-layout-left-center" id="lr_layout"> | |||||
<div class="lr-layout-left"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title lrlt ">学校信息</div> | |||||
<div id="cddeptTree" class="lr-layout-body"></div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-center"> | |||||
<div class="lr-layout-wrap"> | |||||
<div class="lr-layout-title"> | |||||
<span id="titleinfo" class="lrlt">未选择学校</span> - <span class="lrlt">专业信息</span> | |||||
</div> | |||||
<div class="lr-layout-tool"> | |||||
<div class="lr-layout-tool-left"> | |||||
<div class="lr-layout-tool-item"> | |||||
<div id="multiple_condition_query"> | |||||
<div class="lr-query-formcontent"> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">学校</div> | |||||
<div id="F_SchoolId"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">专业</div> | |||||
<div id="MajorNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">学年</div> | |||||
<div id="AcademicYearNo"></div> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">学期</div> | |||||
<div id="Semester"></div> | |||||
</div> | |||||
@*<div class="col-xs-6 lr-form-item"> | |||||
<div class="lr-form-item-title">系部</div> | |||||
<div id="DeptNo"></div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">年级</div> | |||||
<div id="Grade"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">课程</div> | |||||
<div id="LessonNo"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-tool-right"> | |||||
<div class=" btn-group btn-group-sm"> | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||||
</div> | |||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<a id="lr_teach" class="btn btn-default"><i class="fa fa-plus"></i> 设置教师</a> | |||||
<a id="lr_qzteach" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 强制设置教师</a> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="lr-layout-body" id="gridtable"></div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js") |
@@ -0,0 +1,250 @@ | |||||
/* * 版 本 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 cddeptname = ''; | |||||
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'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var empno = $('#gridtable').jfGridValue('EmpNo').split(','); | |||||
var allEmpty = true; | |||||
for (var i = 0; i < empno.length; i++) { | |||||
if (empno[i] != '') { | |||||
allEmpty = false; | |||||
} | |||||
} | |||||
if (allEmpty) { | |||||
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'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '强制设置教师', | |||||
url: top.$.rootUrl + | |||||
'/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' + | |||||
keyValue, | |||||
width: 400, | |||||
height: 300, | |||||
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=' + 'teacheruserdata', | |||||
key: value, | |||||
keyId: 'f_encode', | |||||
callback: function (_data) { | |||||
callback(_data['f_realname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
{ 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 || {}; | |||||
param.DeptNo = cddeptname; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||||
} | |||||
}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,11 @@ | |||||
@{ | |||||
ViewBag.Title = "开课计划"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="ClassPlanTeach"> | |||||
<div class="lr-form-item-title">教师<font face="宋体">*</font></div> | |||||
<div id="EmpNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js") |
@@ -0,0 +1,32 @@ | |||||
/* * 版 本 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(); | |||||
}, | |||||
bind: function () { | |||||
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(); | |||||
var EmpNo = postData.EmpNo; | |||||
console.log(EmpNo); | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () { | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -0,0 +1,11 @@ | |||||
@{ | |||||
ViewBag.Title = "开课计划"; | |||||
Layout = "~/Views/Shared/_Form.cshtml"; | |||||
} | |||||
<div class="lr-form-wrap" id="form"> | |||||
<div class="col-xs-12 lr-form-item" data-table="ClassPlanTeach"> | |||||
<div class="lr-form-item-title">教师<font face="宋体">*</font></div> | |||||
<div id="EmpNo" isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
</div> | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js") |
@@ -0,0 +1,32 @@ | |||||
/* * 版 本 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(); | |||||
}, | |||||
bind: function () { | |||||
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); | |||||
} | |||||
}; | |||||
// 保存数据 | |||||
acceptClick = function (callBack) { | |||||
if (!$('body').lrValidform()) { | |||||
return false; | |||||
} | |||||
var postData = $('#form').lrGetFormData(); | |||||
var EmpNo = postData.EmpNo; | |||||
console.log(EmpNo); | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () { | |||||
}); | |||||
}; | |||||
page.init(); | |||||
} |
@@ -1,4 +1,4 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||||
<PropertyGroup> | <PropertyGroup> | ||||
@@ -321,6 +321,8 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\AwardPunishInfoController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\AwardPunishInfoController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateManageController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\CertificateManageController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\CertificateResultController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\CertificateResultController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\ClassPlanController.cs" /> | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\ClassPlanTeachController.cs" /> | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaCodeOfContuctController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\EvaCodeOfContuctController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaDormitoryInteriorController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\EvaDormitoryInteriorController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\EvaHygieveController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\EvaHygieveController.cs" /> | ||||
@@ -976,6 +978,11 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\CertificateResult\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\CertificateResult\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\CertificateResult\Index.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassInfo\FormType.js" /> | <Content Include="Areas\EducationalAdministration\Views\ClassInfo\FormType.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\Index.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\EADateArrange\InitByConditionForm.js" /> | <Content Include="Areas\EducationalAdministration\Views\EADateArrange\InitByConditionForm.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\EmpInfo\FormModify.js" /> | <Content Include="Areas\EducationalAdministration\Views\EmpInfo\FormModify.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\EmpInfo\FormEdit.js" /> | <Content Include="Areas\EducationalAdministration\Views\EmpInfo\FormEdit.js" /> | ||||
@@ -7448,6 +7455,11 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\AwardIndex.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\AwardIndex.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Form.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Form.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Index.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\AwardPunishInfo\Index.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\Index.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.cshtml" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.cshtml" /> | |||||
<None Include="Areas\EducationalAdministration\Views\SchoolNews\Index.cshtml" /> | <None Include="Areas\EducationalAdministration\Views\SchoolNews\Index.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuEnroll\StuTuition.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuEnroll\StuTuition.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuEnroll\IsHelpForm.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuEnroll\IsHelpForm.cshtml" /> | ||||
@@ -0,0 +1,226 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-08-21 17:28 | |||||
/// 描 述:成绩比例设置 | |||||
/// </summary> | |||||
public class ClassPlanBLL : ClassPlanIBLL | |||||
{ | |||||
private ClassPlanService classPlanService = new ClassPlanService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return classPlanService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public OpenLessonPlanEntity GetClassPlanEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return classPlanService.GetClassPlanEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
classPlanService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, OpenLessonPlanEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
classPlanService.SaveEntity(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <param name="School"></param> | |||||
/// <param name="Year"></param> | |||||
/// <param name="Semester"></param> | |||||
/// <param name="Dept"></param> | |||||
/// <param name="Major"></param> | |||||
/// <param name="Grade"></param> | |||||
/// <param name="Lesson"></param> | |||||
/// <returns></returns> | |||||
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); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DelRelation(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
classPlanService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<OpenLessonPlanEntity> GetListById(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return classPlanService.GetListById(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity) | |||||
{ | |||||
try | |||||
{ | |||||
classPlanService.SaveEntityList(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,79 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-08-21 17:28 | |||||
/// 描 述:成绩比例设置 | |||||
/// </summary> | |||||
public interface ClassPlanIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
OpenLessonPlanEntity GetClassPlanEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
void SaveEntity(string keyValue, OpenLessonPlanEntity entity); | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <param name="ID">主键</param> | |||||
/// <param name="School">校区</param> | |||||
/// <param name="Year">学年</param> | |||||
/// <param name="Semester">学期</param> | |||||
/// <param name="Dept">系部</param> | |||||
/// <param name="Major">专业</param> | |||||
/// <param name="Grade">年级</param> | |||||
/// <param name="Lesson">课程</param> | |||||
/// <returns></returns> | |||||
OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); | |||||
/// <summary> | |||||
/// 编辑时删除关联数据 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
void DelRelation(string keyValue); | |||||
/// <summary> | |||||
/// 获取TeachClass表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
List<OpenLessonPlanEntity> GetListById(string keyValue); | |||||
void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,378 @@ | |||||
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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-11-29 11:43 | |||||
/// 描 述:开课计划 | |||||
/// </summary> | |||||
public class ClassPlanService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" * "); | |||||
strSql.Append(" FROM OpenLessonPlan 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<OpenLessonPlanEntity>(strSql.ToString(), dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public OpenLessonPlanEntity GetClassPlanEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(keyValue.ToInt()); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var keyvalue = keyValue.Split(','); | |||||
foreach (var items in keyvalue) | |||||
{ | |||||
var OpList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(t => t.ID.ToString() == items); | |||||
if (OpList != null) | |||||
{ | |||||
var TeachList = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>( | |||||
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<string> StrTeach = null; | |||||
if (TeachList.Count > 0) | |||||
{ | |||||
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); | |||||
if (StrTeach.Count() > 0) | |||||
{ | |||||
var LessonList = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>( | |||||
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<StuSelectLessonListEntity>(m => m.SelectId == Convert.ToInt32(item.SelectId)); | |||||
} | |||||
foreach (var item in TeachList) | |||||
{ | |||||
db.Delete<TeachClassEntity>(m => m.ID == item.ID); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
db.Delete<OpenLessonPlanEntity>(m => m.ID.ToString() == items); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
public void SaveEntity(string keyValue, OpenLessonPlanEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
entity.Modify(keyValue); | |||||
this.BaseRepository("CollegeMIS").Update(entity); | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
this.BaseRepository("CollegeMIS").Insert(entity); | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <param name="ID">主键</param> | |||||
/// <param name="School">校区</param> | |||||
/// <param name="Year">学年</param> | |||||
/// <param name="Semester">学期</param> | |||||
/// <param name="Dept">系部</param> | |||||
/// <param name="Major">专业</param> | |||||
/// <param name="Grade">年级</param> | |||||
/// <param name="Lesson">课程</param> | |||||
/// <returns></returns> | |||||
public OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, | |||||
string Major, string Grade, string Lesson) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>( | |||||
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<OpenLessonPlanEntity>(t => t.ID == keyvalue); | |||||
if (OpList != null) | |||||
{ | |||||
var TeachList = this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>( | |||||
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<string> StrTeach = null; | |||||
if (TeachList.Count > 0) | |||||
{ | |||||
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); | |||||
if (StrTeach.Count > 0) | |||||
{ | |||||
var LessonList = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>( | |||||
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<StuSelectLessonListEntity>(m => m.SelectId == Convert.ToInt32(item.SelectId)); | |||||
} | |||||
foreach (var item in TeachList) | |||||
{ | |||||
db.Delete<TeachClassEntity>(m => m.ID == item.ID); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<OpenLessonPlanEntity> GetListById(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
var id = keyValue.Split(','); | |||||
return this.BaseRepository("CollegeMIS") | |||||
.FindList<OpenLessonPlanEntity>(x => id.Contains(x.ID.ToString())).ToList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void SaveEntityList(string keyValue, List<OpenLessonPlanEntity> entity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var keyvalue = keyValue.Split(','); | |||||
foreach (var item in keyvalue) | |||||
{ | |||||
var entityList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(x => x.ID.ToString() == item); | |||||
entityList.State = 1; | |||||
db.Update(entityList); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -270,6 +270,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
[Column("ISALLOWEDIT")] | [Column("ISALLOWEDIT")] | ||||
public bool? IsAllowEdit { get; set; } | public bool? IsAllowEdit { get; set; } | ||||
/// <summary> | |||||
/// 排课标识 | |||||
/// </summary> | |||||
[Column("STATE")] | |||||
public int? State { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -305,6 +311,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
[NotMapped] | [NotMapped] | ||||
public string MajorName { get; set; } | public string MajorName { get; set; } | ||||
/// <summary> | |||||
/// 教师 | |||||
/// </summary> | |||||
[NotMapped] | |||||
public string TeachNo { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } | ||||
@@ -0,0 +1,164 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-06-01 11:49 | |||||
/// 描 述:收文报告 | |||||
/// </summary> | |||||
public class StuSelectLessonListBLL : StuSelectLessonListIBLL | |||||
{ | |||||
private StuSelectLessonListService stuSelectLessonListService = new StuSelectLessonListService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<StuSelectLessonListEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return stuSelectLessonListService.GetPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取Dispatch表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
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 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
stuSelectLessonListService.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
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<StuSelectLessonListEntity> entity) | |||||
{ | |||||
try | |||||
{ | |||||
stuSelectLessonListService.SaveEntityList(entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public IEnumerable<StuSelectLessonListEntity> GetAllList() | |||||
{ | |||||
try | |||||
{ | |||||
return stuSelectLessonListService.GetAllList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,53 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-06-01 11:49 | |||||
/// 描 述:收文报告 | |||||
/// </summary> | |||||
public interface StuSelectLessonListIBLL | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<StuSelectLessonListEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取Dispatch表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
StuSelectLessonListEntity GetListEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
void SaveEntity(string keyValue, StuSelectLessonListEntity entity); | |||||
void SaveEntityList(List<StuSelectLessonListEntity> entity); | |||||
IEnumerable<StuSelectLessonListEntity> GetAllList(); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,242 @@ | |||||
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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2021-06-01 11:49 | |||||
/// 描 述:收文报告 | |||||
/// </summary> | |||||
public class StuSelectLessonListService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">分页参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<StuSelectLessonListEntity> GetPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT "); | |||||
strSql.Append(@" * "); | |||||
strSql.Append(" FROM StuSelectLessonList 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 "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(strSql.ToString(), dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取Dispatch表实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
public StuSelectLessonListEntity GetListEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindEntity<StuSelectLessonListEntity>(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
//this.BaseRepository("CollegeMIS").Delete<StuInfoBasicEntity>(t => t.StuId == keyValue); | |||||
//多个删除 | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
db.Delete<StuSelectLessonListEntity>(t => t.SelectId.ToString() == item); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity">实体</param> | |||||
/// <returns></returns> | |||||
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<StuSelectLessonListEntity> 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.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; | |||||
stuLessonList.CheckMark = "1"; | |||||
db.Insert(stuLessonList); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public IEnumerable<StuSelectLessonListEntity> GetAllList() | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(m => m.CheckMark == "1"); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,233 @@ | |||||
using Learun.Util; | |||||
using System; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-01-29 11:08 | |||||
/// 描 述:班级信息管理 | |||||
/// </summary> | |||||
public class TeachClassBLL : TeachClassIBLL | |||||
{ | |||||
private TeachClassService teachClassEntity = new TeachClassService(); | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<TeachClassEntity> 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); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public TeachClassEntity GetTeachClassEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return teachClassEntity.GetTeachClassEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="classNo">班级编号</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
#endregion | |||||
#region 提交数据 | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
teachClassEntity.DeleteEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
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<TeachClassEntity> entity) | |||||
{ | |||||
try | |||||
{ | |||||
teachClassEntity.SaveEntityList(entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<TeachClassEntity> GetTeachListById(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
return teachClassEntity.GetTeachListById(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 查询条件 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public IEnumerable<TeachClassEntity> GetAllClass() | |||||
{ | |||||
try | |||||
{ | |||||
return teachClassEntity.GetAllClass(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void UpEmpNo(string keyValue, string EmpNo) | |||||
{ | |||||
try | |||||
{ | |||||
teachClassEntity.UpEmpNo(keyValue, EmpNo); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,76 @@ | |||||
using Learun.Util; | |||||
using System.Data; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-01-29 11:08 | |||||
/// 描 述:班级信息管理 | |||||
/// </summary> | |||||
public interface TeachClassIBLL | |||||
{ | |||||
#region 获取数据 | |||||
bool GetAny(); | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<TeachClassEntity> GetPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
TeachClassEntity GetTeachClassEntity(string keyValue); | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
void DeleteEntity(string keyValue); | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
void SaveEntity(string keyValue, TeachClassEntity entity); | |||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 获取ClassTeach表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
List<TeachClassEntity> GetTeachListById(string keyValue); | |||||
/// <summary> | |||||
/// 保存数据 | |||||
/// </summary> | |||||
/// <param name="entity"></param> | |||||
void SaveEntityList(List<TeachClassEntity> entity); | |||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
IEnumerable<TeachClassEntity> GetAllClass(); | |||||
/// <summary> | |||||
/// 保存/修改教师 | |||||
/// </summary> | |||||
/// <param name="keyvalue"></param> | |||||
/// <param name="EmpNo"></param> | |||||
void UpEmpNo(string keyvalue, string EmpNo); | |||||
#endregion | |||||
} | |||||
} |
@@ -0,0 +1,331 @@ | |||||
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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-01-29 11:08 | |||||
/// 描 述:班级信息管理 | |||||
/// </summary> | |||||
public class TeachClassService : RepositoryFactory | |||||
{ | |||||
#region 获取数据 | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<TeachClassEntity> 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<TeachClassEntity>(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<TeachClassEntity>().ToList().Count > 0 ? true : false; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public TeachClassEntity GetTeachClassEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
int ID = Convert.ToInt32(keyValue); | |||||
return this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(ID); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void DeleteEntity(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
//修改 | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
var entity = this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(x => x.ID == Convert.ToInt32(item)); | |||||
if (entity != null) | |||||
{ | |||||
entity.EmpNo = ""; | |||||
db.Update(entity); | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
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<TeachClassEntity> GetAllClass() | |||||
{ | |||||
try | |||||
{ | |||||
return this.BaseRepository("CollegeMIS").FindList<TeachClassEntity>(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<TeachClassEntity> GetTeachListById(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
var id = keyValue.Split(','); | |||||
return this.BaseRepository("CollegeMIS") | |||||
.FindList<TeachClassEntity>(x => id.Contains(x.ID.ToString())).ToList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <param name="entity"></param> | |||||
public void SaveEntityList(List<TeachClassEntity> 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); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 保存或修改教师 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="EmpNo"></param> | |||||
public void UpEmpNo(string keyValue, string EmpNo) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var keyarray = keyValue.Split(','); | |||||
foreach (var item in keyarray) | |||||
{ | |||||
var entityList = this.GetTeachClassEntity(item); | |||||
entityList.EmpNo = EmpNo; | |||||
db.Update(entityList); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -144,6 +144,9 @@ | |||||
<Compile Include="EducationalAdministration\CertificateResult\CertificateResultEntity.cs" /> | <Compile Include="EducationalAdministration\CertificateResult\CertificateResultEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\CertificateResult\CertificateResultIBLL.cs" /> | <Compile Include="EducationalAdministration\CertificateResult\CertificateResultIBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\CertificateResult\CertificateResultService.cs" /> | <Compile Include="EducationalAdministration\CertificateResult\CertificateResultService.cs" /> | ||||
<Compile Include="EducationalAdministration\ClassPlan\ClassPlanBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\ClassPlan\ClassPlanIBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\ClassPlan\ClassPlanService.cs" /> | |||||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeBLL.cs" /> | <Compile Include="EducationalAdministration\EADateArrange\EADateArrangeBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeEntity.cs" /> | <Compile Include="EducationalAdministration\EADateArrange\EADateArrangeEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\EADateArrange\EADateArrangeIBLL.cs" /> | <Compile Include="EducationalAdministration\EADateArrange\EADateArrangeIBLL.cs" /> | ||||
@@ -228,6 +231,9 @@ | |||||
<Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreEntity.cs" /> | <Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreIBLL.cs" /> | <Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreIBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreService.cs" /> | <Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePre\StuSelectLessonListOfElectivePreService.cs" /> | ||||
<Compile Include="EducationalAdministration\StuSelectLessonList\StuSelectLessonListBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\StuSelectLessonList\StuSelectLessonListIBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\StuSelectLessonList\StuSelectLessonListService.cs" /> | |||||
<Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerBLL.cs" /> | <Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerEntity.cs" /> | <Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerIBLL.cs" /> | <Compile Include="EducationalAdministration\StuVolunteer\StuVolunteerIBLL.cs" /> | ||||
@@ -245,6 +251,9 @@ | |||||
<Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceIBLL.cs" /> | <Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceIBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceService.cs" /> | <Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceService.cs" /> | ||||
<Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceEntity.cs" /> | <Compile Include="EducationalAdministration\TeachAttendance\TeachAttendanceEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\TeachClass\TeachClassBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\TeachClass\TeachClassIBLL.cs" /> | |||||
<Compile Include="EducationalAdministration\TeachClass\TeachClassService.cs" /> | |||||
<Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialBLL.cs" /> | <Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialBLL.cs" /> | ||||
<Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialEntity.cs" /> | <Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialEntity.cs" /> | ||||
<Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialIBLL.cs" /> | <Compile Include="EducationalAdministration\TeachingMaterial\TeachingMaterialIBLL.cs" /> | ||||
@@ -1817,6 +1826,9 @@ | |||||
<Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" /> | <Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\cs\Microsoft.DependencyValidation.Analyzers.resources.dll" /> | ||||
<Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\Microsoft.DependencyValidation.Analyzers.dll" /> | <Analyzer Include="..\..\..\packages\Microsoft.DependencyValidation.Analyzers.0.10.0\analyzers\dotnet\Microsoft.DependencyValidation.Analyzers.dll" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | |||||
<Folder Include="EducationalAdministration\ClassPlanTeach\" /> | |||||
</ItemGroup> | |||||
<ItemGroup /> | <ItemGroup /> | ||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> | <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> | ||||