diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
index 165ac917c..23f447650 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
@@ -234,14 +234,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
///
public ActionResult QzSetTeach(string keyValue, string EmpNo)
{
- var entityList = teachClassIBLL.GetTeachListById(keyValue).ToList();
- foreach (var item in entityList)
- {
- teachClassIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade, item.LessonSortNo);
- stuScoreIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade, item.LessonSortNo);
- }
-
- teachClassIBLL.UpEmpNo(keyValue, EmpNo);
+ teachClassIBLL.DoQzSetTeach(keyValue, EmpNo);
return Success("设置成功!");
}
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
index 66f93adae..4250355c1 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
@@ -99,10 +99,10 @@ var bootstrap = function ($, learun) {
return false;
}
var EmpNoMain = $('#gridtable').jfGridValue('EmpNoMain');
- if (EmpNoMain) {
- learun.alert.warning("已完成强制设置!");
- return false;
- }
+ //if (EmpNoMain) {
+ // learun.alert.warning("已完成强制设置!");
+ // return false;
+ //}
learun.layerForm({
id: 'form',
title: '强制设置教师',
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
index fd5272107..992b9344c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
@@ -321,6 +321,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ ///
+ /// 强制设置录成绩教师
+ ///
+ ///
+ /// 已选择的录成绩教师
+ public void DoQzSetTeach(string keyValue, string EmpNo)
+ {
+ try
+ {
+ teachClassEntity.DoQzSetTeach(keyValue, EmpNo);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs
index a47faafc5..7aaf360ba 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs
@@ -140,6 +140,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public string LessonSortDetailNo { get; set; }
[NotMapped]
public decimal? ClassHour { get; set; }
+ [NotMapped]
+ public string ExamType { get; set; }
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
index 3500b1a37..af3e0eb8a 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
@@ -82,6 +82,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
IEnumerable GetEmpNoData(string keyValue);
+ ///
+ /// 强制设置录成绩教师
+ ///
+ ///
+ /// 已选择的录成绩教师
+ void DoQzSetTeach(string keyValue, string EmpNo);
#endregion
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
index 3996a2ed1..27748d52b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
@@ -32,8 +32,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
- strSql.Append(@" t.*,le.LessonName ");
- strSql.Append(" FROM TeachClass t left join LessonInfo le on t.LessonNo=le.LessonNo ");
+ strSql.Append(@" t.*,op.ExamType,op.LessonName ");
+ strSql.Append(" FROM TeachClass t ");
+ strSql.Append(" left join openlessonplan op on op.academicyearno=t.academicyearno and op.semester=t.semester and op.DeptNo=t.DeptNo and op.majorno =t.majorno ");
+ strSql.Append(" and op.grade =t.grade and op.lessonno =t.lessonno and op.F_SchoolId =t.F_SchoolId ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
@@ -76,7 +78,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
if (!queryParam["ClassNo"].IsEmpty())
{
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String);
- strSql.Append(" AND t.ClassNo = @ClassNo ");
+ strSql.Append(" AND t.TeachClassNo = @ClassNo ");
}
if (!queryParam["EmpNo"].IsEmpty())
{
@@ -732,7 +734,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
int ID = Convert.ToInt32(keyValue);
var teachclassEntity = this.BaseRepository("CollegeMIS").FindEntity(ID);
- return this.BaseRepository("CollegeMIS").FindList($"select * from EmpInfo e where EmpNo in ({teachclassEntity.EmpNo}) ");
+ return this.BaseRepository("CollegeMIS").FindList($"select * from EmpInfo e where EmpNo in ('{teachclassEntity.EmpNo.Replace(",", "','")}') ");
}
catch (Exception ex)
{
@@ -747,6 +749,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///
+ /// 强制设置录成绩教师
+ ///
+ ///
+ /// 已选择的录成绩教师
+ public void DoQzSetTeach(string keyValue, string EmpNo)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ foreach (var item in keyValue.Split(','))
+ {
+ var entityList = this.GetTeachClassEntity(item);
+ if (entityList != null && entityList.EmpNoMain != EmpNo)
+ {
+ //选课
+ var ssllstr = $"update StuSelectLessonList set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade = '{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' ";
+ db.ExecuteBySql(ssllstr);
+ //成绩
+ var ssstr = $"update StuScore set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade='{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' ";
+ db.ExecuteBySql(ssstr);
+ //教师成绩单
+ var ercstr = $"update EmpReportCard set EmpNo='{EmpNo}',EmpName=(select EmpName from EmpInfo where EmpNo='{EmpNo}') where AcademicYearNo='{entityList.AcademicYearNo}' and Semester='{entityList.Semester}' and LessonNo='{entityList.LessonNo}' and ClassNo='{entityList.TeachClassNo}' and EmpNo='{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and LessonSortNo='{entityList.LessonSortNo}' ";
+ db.ExecuteBySql(ercstr);
+ //开课计划
+ entityList.EmpNoMain = EmpNo;
+ entityList.SetUserId = LoginUserInfo.Get().userId;
+ entityList.SetTime = DateTime.Now;
+ db.Update(entityList);
+ }
+ }
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
#endregion
}
}