@@ -111,15 +111,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult SaveForm(string keyValue, string strEntity) | public ActionResult SaveForm(string keyValue, string strEntity) | ||||
{ | { | ||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
classPlanIBLL.DelRelation(keyValue); | |||||
} | |||||
OpenLessonPlanEntity entity = strEntity.ToObject<OpenLessonPlanEntity>(); | OpenLessonPlanEntity entity = strEntity.ToObject<OpenLessonPlanEntity>(); | ||||
if (!string.IsNullOrEmpty(keyValue)) | if (!string.IsNullOrEmpty(keyValue)) | ||||
{ | { | ||||
entity.AmendDate = DateTime.Now; | entity.AmendDate = DateTime.Now; | ||||
} | } | ||||
entity.State = 0; | |||||
entity.IsAllowEdit = true; | entity.IsAllowEdit = true; | ||||
entity.MakeDate = DateTime.Now; | entity.MakeDate = DateTime.Now; | ||||
var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); | var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); | ||||
@@ -146,49 +143,40 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult CourseArranging(string keyValue) | public ActionResult CourseArranging(string keyValue) | ||||
{ | { | ||||
var data = classPlanIBLL.GetClassPlanEntity(keyValue); | |||||
data.State = 1; | |||||
var entity = classPlanIBLL.GetListById(keyValue); | |||||
List<TeachClassEntity> TeachList = new List<TeachClassEntity>(); | List<TeachClassEntity> TeachList = new List<TeachClassEntity>(); | ||||
TeachClassEntity TeachEntity = new TeachClassEntity(); | |||||
List<string> stringList = classInfoIBLL.GetAllClass(). | |||||
Where(x => x.DeptNo == data.DeptNo && x.MajorNo == data.MajorNo && x.Grade == data.Grade) | |||||
.OrderBy(x => x.ClassNo).Select(x => x.ClassNo).ToList(); | |||||
if (stringList.Count > 0) | |||||
for (int i = 0; i < entity.Count; i++) | |||||
{ | { | ||||
var teachInfo = teachClassIBLL.GetAllClass().Where(s => | |||||
s.DeptNo == data.DeptNo && s.MajorNo == data.MajorNo && s.Grade == data.Grade && s.Semester == data.Semester | |||||
&& s.LessonNo == data.LessonNo && s.AcademicYearNo == data.AcademicYearNo).OrderBy(s => s.ID).ToList(); | |||||
if (teachInfo.Count > 0) | |||||
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) | |||||
{ | { | ||||
return Fail("排课失败!已存在此课程信息"); | |||||
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); | |||||
} | |||||
} | } | ||||
for (int i = 0; i < stringList.Count; i++) | |||||
else | |||||
{ | { | ||||
TeachEntity.TeachClassNo = stringList[i]; | |||||
TeachEntity.AcademicYearNo = data.AcademicYearNo; | |||||
TeachEntity.DeptNo = data.DeptNo; | |||||
TeachEntity.MajorNo = data.MajorNo; | |||||
TeachEntity.Grade = data.Grade; | |||||
TeachEntity.Semester = data.Semester; | |||||
TeachEntity.LessonNo = data.LessonNo; | |||||
TeachEntity.StuNum = data.StuNum; | |||||
TeachEntity.EmpNo = data.TeachNo; | |||||
TeachEntity.LessonSortNo = data.LessonSortNo; | |||||
TeachEntity.F_SchoolId = data.F_SchoolId; | |||||
TeachList.Add(TeachEntity); | |||||
return Fail("排课失败!暂无排课班级"); | |||||
} | } | ||||
teachClassIBLL.SaveEntityList(TeachList); | |||||
classPlanIBLL.SaveEntity(keyValue, data); | |||||
return Success("排课成功"); | |||||
} | |||||
else | |||||
{ | |||||
return Fail("排课失败!暂无排课班级"); | |||||
} | } | ||||
teachClassIBLL.SaveEntityList(TeachList); | |||||
classPlanIBLL.SaveEntityList(keyValue, entity); | |||||
return Success("排课成功"); | |||||
} | } | ||||
#endregion | #endregion | ||||
@@ -6,6 +6,7 @@ using System.Collections.Generic; | |||||
using System; | using System; | ||||
using System.Linq; | using System.Linq; | ||||
using DocumentFormat.OpenXml.Office.CustomUI; | using DocumentFormat.OpenXml.Office.CustomUI; | ||||
using List = DocumentFormat.OpenXml.Office2010.ExcelAc.List; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | ||||
{ | { | ||||
@@ -43,6 +44,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 主页面 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult TeachFormQZ() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -128,60 +139,143 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
[HttpPost] | [HttpPost] | ||||
[AjaxOnly] | [AjaxOnly] | ||||
public ActionResult SetTeach(string keyValue, string Teach) | |||||
public ActionResult SetTeach(string keyValue, string EmpNo) | |||||
{ | { | ||||
var entity = teachClassIBLL.GetTeachClassEntity(keyValue); | |||||
entity.EmpNo = Teach; | |||||
teachClassIBLL.SaveEntity(keyValue, entity); | |||||
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); //更改当前教师 | |||||
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => | |||||
s.DeptNo == entity.DeptNo && s.MajorNo == entity.MajorNo && s.F_SchoolId == entity.F_SchoolId && entity.TeachClassNo.Contains(s.ClassNo)) | |||||
.ToList(); | |||||
if (stuDataList.Count < 0) | |||||
return Success("设置成功!"); | |||||
} | |||||
public ActionResult QzSetTeach(string keyValue, string EmpNo) | |||||
{ | |||||
var entityList = teachClassIBLL.GetTeachListById(keyValue); | |||||
string Nid = ""; | |||||
if (entityList.Count > 0) | |||||
{ | { | ||||
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); | |||||
StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); | |||||
for (int i = 0; i < stuDataList.Count; i++) | |||||
for (int i = 0; i < entityList.Count; i++) | |||||
{ | { | ||||
TeachEntity.NoticeBookNo = stuDataList[i].NoticeNo; | |||||
TeachEntity.StuNo = stuDataList[i].StuNo; | |||||
TeachEntity.DeptNo = stuDataList[i].DeptNo; | |||||
TeachEntity.MajorNo = stuDataList[i].MajorNo; | |||||
TeachEntity.ClassNo = stuDataList[i].ClassNo; | |||||
TeachEntity.MajorDetailNo = stuDataList[i].MajorDetailNo; | |||||
TeachEntity.MajorDetailName = stuDataList[i].MajorDetailName; | |||||
TeachEntity.StuName = stuDataList[i].StuName; | |||||
TeachEntity.GenderNo = stuDataList[i].GenderNo.ToString(); | |||||
TeachEntity.AcademicYearNo = entity.AcademicYearNo; | |||||
TeachEntity.Semester = entity.Semester; | |||||
TeachEntity.OpenLessonDeptNo = entity.DeptNo; | |||||
TeachEntity.OpenLessonMajorNo = entity.MajorNo; | |||||
TeachEntity.LessonNo = entity.LessonNo; | |||||
TeachEntity.PartCode = entity.PartCode; | |||||
TeachEntity.OrdinaryScoreScale = 0; | |||||
TeachEntity.TermInScoreScale = 0; | |||||
TeachEntity.TermEndScoreScale = 0; | |||||
TeachEntity.OtherScoreScale = 0; | |||||
TeachEntity.TeachClassNo = entity.TeachClassNo; | |||||
TeachEntity.LessonSortNo = entity.LessonSortNo; | |||||
TeachEntity.StuSortNo = entity.LessonSortNo; | |||||
TeachEntity.Grade = entity.Grade; | |||||
TeachEntity.StudyScore = 2; | |||||
TeachEntity.TotalStudyHour = 2; | |||||
TeachEntity.IsInEffect = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.IsPitchOn = "1"; | |||||
TeachEntity.F_SchoolId = entity.F_SchoolId; | |||||
TeachEntity.InsertTime = DateTime.Now; | |||||
TeachList.Add(TeachEntity); | |||||
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) + ","; | |||||
} | } | ||||
StuSelectLesson.SaveEntityList(TeachList); | |||||
return Success("设置成功!"); | |||||
} | } | ||||
else | |||||
Nid = Nid.TrimEnd(','); | |||||
StuSelectLesson.DeleteEntity(Nid); | |||||
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); | |||||
for (int i = 0; i < entityList.Count; i++) | |||||
{ | { | ||||
return Fail("设置失败!"); | |||||
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 | #endregion | ||||
} | } | ||||
@@ -65,6 +65,10 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (keyValue.indexOf(',') != -1) { | |||||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||||
return; | |||||
} | |||||
var state = $('#gridtable').jfGridValue('State'); | var state = $('#gridtable').jfGridValue('State'); | ||||
if (state == 0) { | if (state == 0) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
@@ -98,9 +102,15 @@ var bootstrap = function ($, learun) { | |||||
// 删除 | // 删除 | ||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
var state = $('#gridtable').jfGridValue('State'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (state == 0) { | |||||
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('是否确认删除该项!', | learun.layerConfirm('是否确认删除该项!', | ||||
function (res) { | function (res) { | ||||
if (res) { | if (res) { | ||||
@@ -127,13 +137,28 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_courses').on('click', function () { | $('#lr_courses').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerConfirm('确定要进行排课么!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/CourseArranging', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
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("不嫩选择已排课的课程计划"); | |||||
} | |||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
@@ -228,6 +253,16 @@ var bootstrap = function ($, learun) { | |||||
{ label: "年级", name: "Grade", width: 50, align: "left" }, | { label: "年级", name: "Grade", width: 50, align: "left" }, | ||||
{ label: "课程编码", name: "LessonNo", width: 200, align: "left" }, | { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, | ||||
{ label: "课程名称", name: "LessonName", 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: "TeachClassNum", width: 100, align: "left" }, | ||||
{ label: "人数", name: "StuNum", width: 80, align: "left" }, | { label: "人数", name: "StuNum", width: 80, align: "left" }, | ||||
{ label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, | { label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, | ||||
@@ -253,6 +288,7 @@ var bootstrap = function ($, learun) { | |||||
], | ], | ||||
mainId: 'ID', | mainId: 'ID', | ||||
sidx: 'MakeDate desc', | sidx: 'MakeDate desc', | ||||
isMultiselect: true, | |||||
isPage: true | isPage: true | ||||
}); | }); | ||||
page.search(); | page.search(); | ||||
@@ -57,7 +57,7 @@ | |||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <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_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> | |||||
<a id="lr_qzteach" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 强制设置教师</a> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -7,6 +7,7 @@ | |||||
var refreshGirdData; | var refreshGirdData; | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
var cddeptname = ''; | |||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
page.inittree(); | page.inittree(); | ||||
@@ -63,9 +64,15 @@ var bootstrap = function ($, learun) { | |||||
// 设置教师 | // 设置教师 | ||||
$('#lr_teach').on('click', function () { | $('#lr_teach').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
var empno = $('#gridtable').jfGridValue('EmpNo'); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
if (empno) { | |||||
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({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '设置教师', | title: '设置教师', | ||||
@@ -77,28 +84,27 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
} else { | } else { | ||||
learun.alert.warning("所选班级已设置教师不能重复设置!!!"); | |||||
learun.alert.warning("所选班级已设置教师,不可重复设置!!!"); | |||||
} | } | ||||
} | } | ||||
}); | }); | ||||
// 强制设置教师 | // 强制设置教师 | ||||
$('#lr_qzteach').on('click', function () { | $('#lr_qzteach').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
var loginInfo = learun.clientdata.get(['userinfo']); | |||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '设置教师', | |||||
url: top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SelectForm?objectId=' + keyValue + '&companyId=' + loginInfo.F_CompanyId + '&departmentId=' + loginInfo.F_DepartmentId + '&category=1', | |||||
width: 800, | |||||
height: 520, | |||||
title: '强制设置教师', | |||||
url: top.$.rootUrl + | |||||
'/EducationalAdministration/ClassPlanTeach/TeachFormQZ?keyValue=' + | |||||
keyValue, | |||||
width: 400, | |||||
height: 300, | |||||
callBack: function (id) { | callBack: function (id) { | ||||
return top[id].acceptClick(); | return top[id].acceptClick(); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
}, | }, | ||||
inittree: function () { | inittree: function () { | ||||
@@ -211,11 +217,11 @@ var bootstrap = function ($, learun) { | |||||
label: "教师", name: "EmpNo", width: 80, align: "left", | label: "教师", name: "EmpNo", width: 80, align: "left", | ||||
formatterAsync: function (callback, value, row, op, $cell) { | formatterAsync: function (callback, value, row, op, $cell) { | ||||
learun.clientdata.getAsync('custmerData', { | learun.clientdata.getAsync('custmerData', { | ||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||||
key: value, | key: value, | ||||
keyId: 'empno', | |||||
keyId: 'f_encode', | |||||
callback: function (_data) { | callback: function (_data) { | ||||
callback(_data['empname']); | |||||
callback(_data['f_realname']); | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
@@ -233,6 +239,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
param.DeptNo = cddeptname; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
@@ -12,36 +12,21 @@ var bootstrap = function ($, learun) { | |||||
init: function () { | init: function () { | ||||
$('.lr-form-wrap').lrscroll(); | $('.lr-form-wrap').lrscroll(); | ||||
page.bind(); | page.bind(); | ||||
//page.initData(); | |||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); | $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); | ||||
//$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'realname' }); | |||||
} | } | ||||
//initData: function () { | |||||
// if (!!keyValue) { | |||||
// $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetFormData?keyValue=' + keyValue, function (data) { | |||||
// for (var id in data) { | |||||
// if (!!data[id].length && data[id].length > 0) { | |||||
// $('#' + id).jfGridSet('refreshdata', data[id]); | |||||
// } | |||||
// else { | |||||
// $('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
// } | |||||
// } | |||||
// }); | |||||
// } | |||||
//} | |||||
}; | }; | ||||
// 保存数据 | // 保存数据 | ||||
acceptClick = function (callBack) { | acceptClick = function (callBack) { | ||||
console.log(keyValue, 111); | |||||
//$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach?keyValue=' + keyValue, function (res) { | |||||
// // 保存成功后才回调 | |||||
// if (!!callBack) { | |||||
// 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(); | 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(); | |||||
} |
@@ -947,6 +947,7 @@ | |||||
<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\TeachFormQZ.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.js" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" /> | ||||
@@ -7467,6 +7468,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\SyncByConditionForm.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\SyncByConditionForm.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexItem.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexItem.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -7591,10 +7593,10 @@ | |||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||||
<WebProjectProperties> | <WebProjectProperties> | ||||
<UseIIS>False</UseIIS> | <UseIIS>False</UseIIS> | ||||
<AutoAssignPort>True</AutoAssignPort> | |||||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||||
<AutoAssignPort>True</AutoAssignPort> | |||||
<DevelopmentServerPort>20472</DevelopmentServerPort> | |||||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | <DevelopmentServerVPath>/</DevelopmentServerVPath> | ||||
<IISUrl>http://localhost:20873/</IISUrl> | |||||
<IISUrl>http://localhost:20873/</IISUrl> | |||||
<NTLMAuthentication>False</NTLMAuthentication> | <NTLMAuthentication>False</NTLMAuthentication> | ||||
<UseCustomServer>False</UseCustomServer> | <UseCustomServer>False</UseCustomServer> | ||||
<CustomServerUrl> | <CustomServerUrl> | ||||
@@ -177,6 +177,50 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <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 | #endregion | ||||
} | } | ||||
} | } |
@@ -58,13 +58,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="Grade">年级</param> | /// <param name="Grade">年级</param> | ||||
/// <param name="Lesson">课程</param> | /// <param name="Lesson">课程</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
OpenLessonPlanEntity GetRepetitions( string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); | |||||
OpenLessonPlanEntity GetRepetitions(string School, string Year, string Semester, string Dept, string Major, string Grade, string Lesson); | |||||
/// <summary> | /// <summary> | ||||
/// 编辑时删除关联数据 | /// 编辑时删除关联数据 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
void DelRelation(string keyValue); | 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 | #endregion | ||||
} | } | ||||
} | } |
@@ -125,47 +125,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | var db = this.BaseRepository("CollegeMIS").BeginTrans(); | ||||
try | try | ||||
{ | { | ||||
var keyvalue = Convert.ToInt32(keyValue); | |||||
var OpList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(t => t.ID == keyvalue); | |||||
if (OpList != null) | |||||
var keyvalue = keyValue.Split(','); | |||||
foreach (var items in keyvalue) | |||||
{ | { | ||||
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) | |||||
var OpList = this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanEntity>(t => t.ID.ToString() == items); | |||||
if (OpList != null) | |||||
{ | { | ||||
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); | |||||
if (StrTeach.Count() > 0) | |||||
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) | |||||
{ | { | ||||
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) | |||||
StrTeach = TeachList.Select(x => x.TeachClassNo).ToList(); | |||||
if (StrTeach.Count() > 0) | |||||
{ | { | ||||
db.Delete<StuSelectLessonListEntity>(m => m.SelectId == Convert.ToInt32(item.SelectId)); | |||||
} | |||||
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); | |||||
foreach (var item in TeachList) | |||||
{ | |||||
db.Delete<TeachClassEntity>(m => m.ID == item.ID); | |||||
} | |||||
} | } | ||||
} | } | ||||
} | } | ||||
db.Delete<OpenLessonPlanEntity>(m => m.ID.ToString() == items); | |||||
} | } | ||||
//this.BaseRepository("CollegeMIS").Delete<OpenLessonPlanEntity>(t => t.ID == keyvalue); | |||||
db.Delete<OpenLessonPlanEntity>(m => m.ID == keyvalue); | |||||
db.Commit(); | db.Commit(); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -315,6 +317,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <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 | #endregion | ||||
} | } | ||||
@@ -140,6 +140,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public IEnumerable<StuSelectLessonListEntity> GetAllList() | |||||
{ | |||||
try | |||||
{ | |||||
return stuSelectLessonListService.GetAllList(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |
@@ -44,6 +44,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="entity">实体</param> | /// <param name="entity">实体</param> | ||||
void SaveEntity(string keyValue, StuSelectLessonListEntity entity); | void SaveEntity(string keyValue, StuSelectLessonListEntity entity); | ||||
void SaveEntityList(List<StuSelectLessonListEntity> entity); | void SaveEntityList(List<StuSelectLessonListEntity> entity); | ||||
IEnumerable<StuSelectLessonListEntity> GetAllList(); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(@" * "); | strSql.Append(@" * "); | ||||
strSql.Append(" FROM Dispatch t "); | |||||
strSql.Append(" FROM StuSelectLessonList t "); | |||||
strSql.Append(" WHERE 1=1 "); | strSql.Append(" WHERE 1=1 "); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
// 虚拟参数 | // 虚拟参数 | ||||
@@ -42,27 +42,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); | dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); | ||||
strSql.Append(" AND t.DisFrom like @keyword "); | strSql.Append(" AND t.DisFrom like @keyword "); | ||||
} | } | ||||
string beginDate = queryParam["StartTime"].ToString(); | |||||
string endDate = queryParam["EndTime"].ToString(); | |||||
if (!string.IsNullOrEmpty(beginDate) && !string.IsNullOrEmpty(endDate)) | |||||
{ | |||||
#region 获取日期(年 月 日) | |||||
string bYaer = beginDate.Substring(0, 4); | |||||
string bMonth = beginDate.Substring(5, 2); | |||||
string bdate = beginDate.Substring(8, 2); | |||||
string eYaer = endDate.Substring(0, 4); | |||||
string eMonth = endDate.Substring(5, 2); | |||||
#endregion | |||||
string edate = endDate.Substring(8, 2); | |||||
strSql.Append(@" and (t.DisYear BETWEEN '" + bYaer + "' and '" + eYaer + "') " + | |||||
"and (t.DisMonth BETWEEN '" + bMonth + "' and '" + eMonth + "') " + | |||||
" and (t.DisDay BETWEEN '" + bdate + "' and '" + edate + "') "); | |||||
} | |||||
if (!queryParam["userId"].IsEmpty()) | |||||
{ | |||||
strSql.Append(" AND t.Id Not in(select DisId from DispatchAudit where AuditUser ='" + queryParam["userId"].ToString() + "') "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(strSql.ToString(), dp, pagination); | return this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListEntity>(strSql.ToString(), dp, pagination); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -112,13 +91,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
public void DeleteEntity(string keyValue) | public void DeleteEntity(string keyValue) | ||||
{ | { | ||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | try | ||||
{ | { | ||||
var keyvalue = Convert.ToInt32(keyValue); | |||||
this.BaseRepository("CollegeMIS").Delete<StuSelectLessonListEntity>(t => t.SelectId == keyvalue); | |||||
//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) | catch (Exception ex) | ||||
{ | { | ||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | if (ex is ExceptionEx) | ||||
{ | { | ||||
throw; | throw; | ||||
@@ -199,7 +187,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
stuLessonList.TermInScoreScale = item.TermInScoreScale; | stuLessonList.TermInScoreScale = item.TermInScoreScale; | ||||
stuLessonList.TermEndScoreScale = item.TermEndScoreScale; | stuLessonList.TermEndScoreScale = item.TermEndScoreScale; | ||||
stuLessonList.OtherScoreScale = item.OtherScoreScale; | stuLessonList.OtherScoreScale = item.OtherScoreScale; | ||||
stuLessonList.TeachClassNo = item.TeachClassNo; | |||||
stuLessonList.LessonSortNo = item.LessonSortNo; | stuLessonList.LessonSortNo = item.LessonSortNo; | ||||
stuLessonList.StuSortNo = item.StuSortNo; | stuLessonList.StuSortNo = item.StuSortNo; | ||||
stuLessonList.Grade = item.Grade; | stuLessonList.Grade = item.Grade; | ||||
@@ -213,6 +200,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
stuLessonList.IsPitchOn = item.IsPitchOn; | stuLessonList.IsPitchOn = item.IsPitchOn; | ||||
stuLessonList.CheckMark = item.CheckMark; | stuLessonList.CheckMark = item.CheckMark; | ||||
stuLessonList.InsertTime = item.InsertTime; | stuLessonList.InsertTime = item.InsertTime; | ||||
stuLessonList.CheckMark = "1"; | |||||
db.Insert(stuLessonList); | db.Insert(stuLessonList); | ||||
} | } | ||||
db.Commit(); | db.Commit(); | ||||
@@ -230,6 +218,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
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 | #endregion | ||||
} | } | ||||
} | } |
@@ -93,29 +93,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
public void Lock(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
teachClassEntity.Lock(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void UnLock(string keyValue) | |||||
public void DeleteEntity(string keyValue) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teachClassEntity.UnLock(keyValue); | |||||
teachClassEntity.DeleteEntity(keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -129,16 +111,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 删除实体数据 | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public void DeleteEntity(string keyValue) | |||||
public void SaveEntity(string keyValue, TeachClassEntity entity) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teachClassEntity.DeleteEntity(keyValue); | |||||
teachClassEntity.SaveEntity(keyValue, entity); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -153,16 +136,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveEntity(string keyValue, TeachClassEntity entity) | |||||
public void SaveEntityList(List<TeachClassEntity> entity) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teachClassEntity.SaveEntity(keyValue, entity); | |||||
teachClassEntity.SaveEntityList(entity); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -176,12 +154,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endregion | |||||
public void SaveEntityList(List<TeachClassEntity> entity) | |||||
#region 扩展数据 | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<TeachClassEntity> GetTeachListById(string keyValue) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teachClassEntity.SaveEntityList(entity); | |||||
return teachClassEntity.GetTeachListById(keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -195,11 +180,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endregion | |||||
#region 扩展数据 | |||||
/// <summary> | /// <summary> | ||||
/// | |||||
/// 查询条件 | |||||
/// </summary> | /// </summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public IEnumerable<TeachClassEntity> GetAllClass() | public IEnumerable<TeachClassEntity> GetAllClass() | ||||
@@ -221,12 +203,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public void SetTeach(string keyValue) | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void UpEmpNo(string keyValue, string EmpNo) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teachClassEntity.SetTeach(keyValue); | |||||
teachClassEntity.UpEmpNo(keyValue, EmpNo); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -30,8 +30,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
void Lock(string keyValue); | |||||
void UnLock(string keyValue); | |||||
/// <summary> | /// <summary> | ||||
/// 删除实体数据 | /// 删除实体数据 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -52,14 +50,27 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#region 扩展数据 | #region 扩展数据 | ||||
/// <summary> | /// <summary> | ||||
/// 设置教师 | |||||
/// 获取ClassTeach表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
List<TeachClassEntity> GetTeachListById(string keyValue); | |||||
/// <summary> | |||||
/// 保存数据 | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue"></param> | |||||
void SetTeach(string keyValue); | |||||
/// <param name="entity"></param> | |||||
void SaveEntityList(List<TeachClassEntity> entity); | void SaveEntityList(List<TeachClassEntity> entity); | ||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
IEnumerable<TeachClassEntity> GetAllClass(); | IEnumerable<TeachClassEntity> GetAllClass(); | ||||
/// <summary> | |||||
/// 保存/修改教师 | |||||
/// </summary> | |||||
/// <param name="keyvalue"></param> | |||||
/// <param name="EmpNo"></param> | |||||
void UpEmpNo(string keyvalue, string EmpNo); | |||||
#endregion | #endregion | ||||
} | } | ||||
} | } |
@@ -115,7 +115,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(keyValue); | |||||
int ID = Convert.ToInt32(keyValue); | |||||
return this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(ID); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -132,65 +133,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
public void Lock(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
//单个启用 | |||||
//this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'"); | |||||
//多个启用 | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
db.ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + item + "'"); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
public void UnLock(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
//单个停用 | |||||
//this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + keyValue + "'"); | |||||
//多个停用 | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
db.ExecuteBySql("update ClassInfo set CheckMark=0 where ClassId='" + item + "'"); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 删除实体数据 | /// 删除实体数据 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -201,14 +143,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | var db = this.BaseRepository("CollegeMIS").BeginTrans(); | ||||
try | try | ||||
{ | { | ||||
//单个删除 | |||||
//this.BaseRepository("CollegeMIS").Delete<TeachClassEntity>(t => t.ClassId == keyValue); | |||||
//多个删除 | |||||
//修改 | |||||
var keyValueArr = keyValue.Split(','); | var keyValueArr = keyValue.Split(','); | ||||
foreach (var item in keyValueArr) | foreach (var item in keyValueArr) | ||||
{ | { | ||||
db.Delete<TeachClassEntity>(t => t.ID == Convert.ToInt32(item)); | |||||
var entity = this.BaseRepository("CollegeMIS").FindEntity<TeachClassEntity>(x => x.ID == Convert.ToInt32(item)); | |||||
if (entity != null) | |||||
{ | |||||
entity.EmpNo = ""; | |||||
db.Update(entity); | |||||
} | |||||
} | } | ||||
db.Commit(); | db.Commit(); | ||||
} | } | ||||
@@ -283,32 +227,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endregion | |||||
public void SetTeach(string keyValue) | |||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public List<TeachClassEntity> GetTeachListById(string keyValue) | |||||
{ | { | ||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | 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(); | |||||
var id = keyValue.Split(','); | |||||
return this.BaseRepository("CollegeMIS") | |||||
.FindList<TeachClassEntity>(x => id.Contains(x.ID.ToString())).ToList(); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | if (ex is ExceptionEx) | ||||
{ | { | ||||
throw; | throw; | ||||
@@ -319,7 +253,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 保存数据 | /// 保存数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -360,6 +293,39 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <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 | |||||
} | } | ||||
} | } |