Просмотр исходного кода

班级开课计划 设置教师

临城职教中职
ndbs 2 лет назад
Родитель
Сommit
604cb8900e
6 измененных файлов: 431 добавлений и 8 удалений
  1. +37
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
  2. +1
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js
  3. +1
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js
  4. +47
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
  5. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
  6. +343
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs

+ 37
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs Просмотреть файл

@@ -146,7 +146,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
for (int i = 0; i < entityList.Count; i++) for (int i = 0; i < entityList.Count; i++)
{ {
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s =>
s.MajorNo == entityList[i].MajorNo
s.MajorNo == entityList[i].MajorNo
&& s.F_SchoolId == entityList[i].F_SchoolId && s.F_SchoolId == entityList[i].F_SchoolId
&& s.ClassNo == entityList[i].TeachClassNo && s.ClassNo == entityList[i].TeachClassNo
).ToList(); ).ToList();
@@ -207,7 +207,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
for (int i = 0; i < entityList.Count; i++) for (int i = 0; i < entityList.Count; i++)
{ {
List<string> ssList = StuSelectLesson.GetAllList().Where( List<string> ssList = StuSelectLesson.GetAllList().Where(
y => y.MajorNo == entityList[i].MajorNo
y => y.MajorNo == entityList[i].MajorNo
&& y.F_SchoolId == entityList[i].F_SchoolId && y.F_SchoolId == entityList[i].F_SchoolId
&& y.ClassNo == entityList[i].TeachClassNo && y.ClassNo == entityList[i].TeachClassNo
&& y.LessonNo == entityList[i].LessonNo && y.LessonNo == entityList[i].LessonNo
@@ -223,8 +223,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>(); List<StuSelectLessonListEntity> TeachList = new List<StuSelectLessonListEntity>();
for (int i = 0; i < entityList.Count; i++) for (int i = 0; i < entityList.Count; i++)
{ {
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s =>
s.MajorNo == entityList[i].MajorNo
var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s =>
s.MajorNo == entityList[i].MajorNo
&& s.F_SchoolId == entityList[i].F_SchoolId && s.F_SchoolId == entityList[i].F_SchoolId
&& s.ClassNo == entityList[i].TeachClassNo && s.ClassNo == entityList[i].TeachClassNo
).ToList(); ).ToList();
@@ -275,6 +275,39 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers


return Success("设置成功!"); return Success("设置成功!");
} }

[HttpPost]
[AjaxOnly]
public ActionResult UpTeach(string keyValue, string EmpNo)
{
var entityList = teachClassIBLL.GetTeachListById(keyValue);
if (entityList != null)
{
var res = teachClassIBLL.UpSetTeach(keyValue, EmpNo); //更改当前教师
if (!string.IsNullOrEmpty(res))
{
return Fail(res);
}
}
else
{
return Fail("设置失败");
}

return Success("设置成功!");
}

[HttpPost]
[AjaxOnly]
public ActionResult QzUpTeach(string keyValue, string EmpNo)
{
var entityList = teachClassIBLL.GetTeachListById(keyValue);
if (entityList != null)
{
teachClassIBLL.UpQzSetTeach(keyValue, EmpNo); //更改当前教师
}
return Success("设置成功!");
}
#endregion #endregion
} }
} }

+ 1
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js Просмотреть файл

@@ -24,8 +24,7 @@ var bootstrap = function ($, learun) {
} }
var postData = $('#form').lrGetFormData(); var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo; var EmpNo = postData.EmpNo;
console.log(EmpNo);
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/UpTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
}); });
}; };
page.init(); page.init();


+ 1
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js Просмотреть файл

@@ -24,8 +24,7 @@ var bootstrap = function ($, learun) {
} }
var postData = $('#form').lrGetFormData(); var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo; var EmpNo = postData.EmpNo;
console.log(EmpNo);
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QzUpTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
}); });
}; };
page.init(); page.init();


+ 47
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs Просмотреть файл

@@ -227,6 +227,53 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
} }
} }


/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public string UpSetTeach(string keyValue, string EmpNo)
{
try
{
return teachClassEntity.UpSetTeach(keyValue, EmpNo);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public string UpQzSetTeach(string keyValue, string EmpNo)
{
try
{
return teachClassEntity.UpQzSetTeach(keyValue, EmpNo);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion #endregion


} }


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs Просмотреть файл

@@ -71,6 +71,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyvalue"></param> /// <param name="keyvalue"></param>
/// <param name="EmpNo"></param> /// <param name="EmpNo"></param>
void UpEmpNo(string keyvalue, string EmpNo); void UpEmpNo(string keyvalue, string EmpNo);
string UpSetTeach(string keyvalue, string EmpNo);
string UpQzSetTeach(string keyvalue, string EmpNo);
#endregion #endregion
} }
} }

+ 343
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs Просмотреть файл

@@ -1,4 +1,5 @@
using Dapper; using Dapper;
using Learun.Application.Organization;
using Learun.DataBase.Repository; using Learun.DataBase.Repository;
using Learun.Util; using Learun.Util;
using System; using System;
@@ -326,6 +327,348 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
} }
} }
} }
/// <summary>
/// 修改教师和成绩
/// </summary>
/// <param name="keyValue"></param>
/// <param name="EmpNo"></param>
public string UpSetTeach(string keyValue, string EmpNo)
{
string Result = "";
var db = BaseRepository("CollegeMIS").BeginTrans();
try
{
#region 获取班级开课计划的数据
var IdList = keyValue.Split(',');
var TeachClassList = BaseRepository("CollegeMIS").FindList<TeachClassEntity>(x => IdList.Contains(x.ID.ToString())).ToList();
foreach (var item in IdList)//修改TeachClass表
{
var entityList = GetTeachClassEntity(item);
entityList.EmpNo = EmpNo;
db.Update(entityList);
}
#endregion

List<StuSelectLessonListEntity> stuLessonList = new List<StuSelectLessonListEntity>();
for (int i = 0; i < TeachClassList.Count; i++)
{
var LessonData = db.FindList<LessonInfoEntity>().Where(x => x.LessonNo == TeachClassList[i].LessonNo).FirstOrDefault();

var stuDataList = db.FindList<StuInfoBasicEntity>().Where(s =>
s.DeptNo == TeachClassList[i].DeptNo && s.MajorNo == TeachClassList[i].MajorNo &&
s.F_SchoolId == TeachClassList[i].F_SchoolId &&
s.ClassNo == TeachClassList[i].TeachClassNo && s.CheckMark == "1");
var DeleteStuSelectLesson = db.FindList<StuSelectLessonListEntity>().Where(
x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo &&
x.LessonNo == TeachClassList[i].LessonNo &&
x.Semester == TeachClassList[i].Semester &&
x.F_SchoolId == TeachClassList[i].F_SchoolId &&
x.DeptNo == TeachClassList[i].DeptNo &&
x.MajorNo == TeachClassList[i].MajorNo &&
x.ClassNo == TeachClassList[i].TeachClassNo &&
x.Grade == TeachClassList[i].Grade &&
x.OpenLessonDeptNo == TeachClassList[i].DeptNo &&
x.OpenLessonMajorNo == TeachClassList[i].MajorNo &&
x.LessonSortNo == "1").ToList();
if (DeleteStuSelectLesson.Count > 0)
{
db.Delete(DeleteStuSelectLesson);
}
if (stuDataList != null)
{
#region 修改StuSelectLessonList表

foreach (var item in stuDataList)
{
var StuSelectLessonEntity = new StuSelectLessonListEntity
{
StuNo = item.StuNo,
DeptNo = TeachClassList[i].DeptNo,
MajorNo = TeachClassList[i].MajorNo,
ClassNo = item.ClassNo,
GenderNo = item.GenderNo == true ? "0" : "1",
MajorDetailNo = TeachClassList[i].MajorDetailNo,
MajorDetailName = TeachClassList[i].MajorDetailName,
StuName = item.StuName,
AcademicYearNo = TeachClassList[i].AcademicYearNo,
Semester = TeachClassList[i].Semester,
OpenLessonDeptNo = TeachClassList[i].DeptNo,
OpenLessonMajorNo = TeachClassList[i].MajorNo,
LessonNo = TeachClassList[i].LessonNo,
LessonName = LessonData.LessonName,
PartCode = TeachClassList[i].PartCode,
OrdinaryScoreScale = 0,
TermInScoreScale = 0,
TermEndScoreScale = 0,
OtherScoreScale = 0,
TeachClassNo = TeachClassList[i].TeachClassNo,
LessonSortNo = TeachClassList[i].LessonSortNo,
StuSortNo = TeachClassList[i].LessonSortNo,
Grade = item.Grade,
StudyScore = 2,
TotalStudyHour = 2,
IsInEffect = "1",
IsPitchOn = "1",
F_SchoolId = TeachClassList[i].F_SchoolId,
CheckMark = "1",
InsertTime = DateTime.Now
};
stuLessonList.Add(StuSelectLessonEntity);
db.Insert(StuSelectLessonEntity);
}
#endregion
var ScoreList = db.FindList<StuScoreEntity>().Where(x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo && x.Semester == TeachClassList[i].Semester && x.DeptNo == TeachClassList[i].DeptNo && x.MajorNo == TeachClassList[i].MajorNo && x.ClassNo == TeachClassList[i].TeachClassNo && x.LessonSortNo == TeachClassList[i].LessonSortNo && x.LessonNo == TeachClassList[i].LessonNo);
var DeleteStuScore = db.FindList<StuScoreEntity>().Where(
x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo &&
x.LessonNo == TeachClassList[i].LessonNo &&
x.Semester == TeachClassList[i].Semester &&
x.F_SchoolId == TeachClassList[i].F_SchoolId &&
x.DeptNo == TeachClassList[i].DeptNo &&
x.MajorNo == TeachClassList[i].MajorNo &&
x.ClassNo == TeachClassList[i].TeachClassNo &&
x.Grade == TeachClassList[i].Grade &&
x.OpenLessonDeptNo == TeachClassList[i].DeptNo &&
x.OpenLessonMajorNo == TeachClassList[i].MajorNo &&
x.LessonSortNo == "1" && x.CheckMark == "1").ToList();
if (DeleteStuScore.Count > 0)
{
return Result = "成绩已审核不可设置教师";
}
db.Delete(DeleteStuScore);


if (ScoreList != null)
{
#region 添加StuScore表
foreach (var item in stuDataList)
{
var stuScoreEntity = new StuScoreEntity
{
StuNo = item.StuNo,
DeptNo = item.DeptNo,
MajorNo = item.MajorNo,
ClassNo = item.ClassNo,
StuName = item.StuName,
EmpNo = EmpNo,
GenderNo = item.GenderNo == true ? "0" : "1",
AcademicYearNo = TeachClassList[i].AcademicYearNo,
Semester = TeachClassList[i].Semester,
OpenLessonDeptNo = TeachClassList[i].DeptNo,
OpenLessonMajorNo = TeachClassList[i].MajorNo,
LessonNo = TeachClassList[i].LessonNo,
LessonName = LessonData.LessonName,
PartCode = TeachClassList[i].PartCode,
StuSortNo = item.TestStuSortNo,
TeachClassNo = TeachClassList[i].TeachClassNo,
LessonSortNo = TeachClassList[i].LessonSortNo,
Grade = TeachClassList[i].Grade,
StudyScore = 2,
TotalStudyHour = 2,
IsInEffect = "1",
IsPitchOn = "1",
F_SchoolId = TeachClassList[i].F_SchoolId,
CheckMark = "0",
TestKindNo = "1",
IsEditable = "1",
OrdinaryScore = 0,
TermInScore = 0,
TermEndScore = 0,
OtherScore = 0

};
db.Insert(stuScoreEntity);
}
#endregion
}
}

}
db.Commit();
return Result = "设置教师成功";
}
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 string UpQzSetTeach(string keyValue, string EmpNo)
{
string Result = "";
var db = BaseRepository("CollegeMIS").BeginTrans();
try
{
#region 获取班级开课计划的数据
var IdList = keyValue.Split(',');
var TeachClassList = BaseRepository("CollegeMIS").FindList<TeachClassEntity>(x => IdList.Contains(x.ID.ToString())).ToList();
foreach (var item in IdList)//修改TeachClass表
{
var entityList = GetTeachClassEntity(item);
entityList.EmpNo = EmpNo;
db.Update(entityList);
}
#endregion

List<StuSelectLessonListEntity> stuLessonList = new List<StuSelectLessonListEntity>();
for (int i = 0; i < TeachClassList.Count; i++)
{
var LessonData = db.FindList<LessonInfoEntity>().Where(x => x.LessonNo == TeachClassList[i].LessonNo).FirstOrDefault();

var stuDataList = db.FindList<StuInfoBasicEntity>().Where(s =>
s.DeptNo == TeachClassList[i].DeptNo && s.MajorNo == TeachClassList[i].MajorNo &&
s.F_SchoolId == TeachClassList[i].F_SchoolId &&
s.ClassNo == TeachClassList[i].TeachClassNo && s.CheckMark == "1");
var DeleteStuSelectLesson = db.FindList<StuSelectLessonListEntity>().Where(
x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo &&
x.LessonNo == TeachClassList[i].LessonNo &&
x.Semester == TeachClassList[i].Semester &&
x.F_SchoolId == TeachClassList[i].F_SchoolId &&
x.DeptNo == TeachClassList[i].DeptNo &&
x.MajorNo == TeachClassList[i].MajorNo &&
x.ClassNo == TeachClassList[i].TeachClassNo &&
x.Grade == TeachClassList[i].Grade &&
x.OpenLessonDeptNo == TeachClassList[i].DeptNo &&
x.OpenLessonMajorNo == TeachClassList[i].MajorNo &&
x.LessonSortNo == "1").ToList();
if (DeleteStuSelectLesson.Count > 0)
{
db.Delete(DeleteStuSelectLesson);
}
if (stuDataList != null)
{
#region 修改StuSelectLessonList表

foreach (var item in stuDataList)
{
var StuSelectLessonEntity = new StuSelectLessonListEntity
{
StuNo = item.StuNo,
DeptNo = TeachClassList[i].DeptNo,
MajorNo = TeachClassList[i].MajorNo,
ClassNo = item.ClassNo,
GenderNo = item.GenderNo == true ? "0" : "1",
MajorDetailNo = TeachClassList[i].MajorDetailNo,
MajorDetailName = TeachClassList[i].MajorDetailName,
StuName = item.StuName,
AcademicYearNo = TeachClassList[i].AcademicYearNo,
Semester = TeachClassList[i].Semester,
OpenLessonDeptNo = TeachClassList[i].DeptNo,
OpenLessonMajorNo = TeachClassList[i].MajorNo,
LessonNo = TeachClassList[i].LessonNo,
LessonName = LessonData.LessonName,
PartCode = TeachClassList[i].PartCode,
OrdinaryScoreScale = 0,
TermInScoreScale = 0,
TermEndScoreScale = 0,
OtherScoreScale = 0,
TeachClassNo = TeachClassList[i].TeachClassNo,
LessonSortNo = TeachClassList[i].LessonSortNo,
StuSortNo = TeachClassList[i].LessonSortNo,
Grade = item.Grade,
StudyScore = 2,
TotalStudyHour = 2,
IsInEffect = "1",
IsPitchOn = "1",
F_SchoolId = TeachClassList[i].F_SchoolId,
CheckMark = "1",
InsertTime = DateTime.Now
};
stuLessonList.Add(StuSelectLessonEntity);
db.Insert(StuSelectLessonEntity);
}
#endregion
var ScoreList = db.FindList<StuScoreEntity>().Where(x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo && x.Semester == TeachClassList[i].Semester && x.DeptNo == TeachClassList[i].DeptNo && x.MajorNo == TeachClassList[i].MajorNo && x.ClassNo == TeachClassList[i].TeachClassNo && x.LessonSortNo == TeachClassList[i].LessonSortNo && x.LessonNo == TeachClassList[i].LessonNo);
var DeleteStuScore = db.FindList<StuScoreEntity>().Where(
x => x.AcademicYearNo == TeachClassList[i].AcademicYearNo &&
x.LessonNo == TeachClassList[i].LessonNo &&
x.Semester == TeachClassList[i].Semester &&
x.F_SchoolId == TeachClassList[i].F_SchoolId &&
x.DeptNo == TeachClassList[i].DeptNo &&
x.MajorNo == TeachClassList[i].MajorNo &&
x.ClassNo == TeachClassList[i].TeachClassNo &&
x.Grade == TeachClassList[i].Grade &&
x.OpenLessonDeptNo == TeachClassList[i].DeptNo &&
x.OpenLessonMajorNo == TeachClassList[i].MajorNo &&
x.LessonSortNo == "1" && x.CheckMark == "0").ToList();
if (DeleteStuScore.Count > 0)
{
db.Delete(DeleteStuScore);

}
if (ScoreList != null)
{
#region 添加StuScore表
foreach (var item in stuDataList)
{
var stuScoreEntity = new StuScoreEntity
{
StuNo = item.StuNo,
DeptNo = item.DeptNo,
MajorNo = item.MajorNo,
ClassNo = item.ClassNo,
StuName = item.StuName,
EmpNo = EmpNo,
GenderNo = item.GenderNo == true ? "0" : "1",
AcademicYearNo = TeachClassList[i].AcademicYearNo,
Semester = TeachClassList[i].Semester,
OpenLessonDeptNo = TeachClassList[i].DeptNo,
OpenLessonMajorNo = TeachClassList[i].MajorNo,
LessonNo = TeachClassList[i].LessonNo,
LessonName = LessonData.LessonName,
PartCode = TeachClassList[i].PartCode,
StuSortNo = item.TestStuSortNo,
TeachClassNo = TeachClassList[i].TeachClassNo,
LessonSortNo = TeachClassList[i].LessonSortNo,
Grade = TeachClassList[i].Grade,
StudyScore = 2,
TotalStudyHour = 2,
IsInEffect = "1",
IsPitchOn = "1",
F_SchoolId = TeachClassList[i].F_SchoolId,
CheckMark = "0",
TestKindNo = "1",
IsEditable = "1",
OrdinaryScore = 0,
TermInScore = 0,
TermEndScore = 0,
OtherScore = 0

};
db.Insert(stuScoreEntity);
}
#endregion
}
}

}
db.Commit();
return Result = "设置教师成功";
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion #endregion
} }
} }

Загрузка…
Отмена
Сохранить