Bläddra i källkod

【修改】班级开课计划:强制修改教师方法整合;

娄底高职分支
dyy 3 veckor sedan
förälder
incheckning
4f2365fef7
6 ändrade filer med 89 tillägg och 16 borttagningar
  1. +1
    -8
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs
  2. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
  3. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs
  4. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs
  5. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs
  6. +52
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs

+ 1
- 8
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs Visa fil

@@ -234,14 +234,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
/// <returns></returns>
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


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js Visa fil

@@ -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: '强制设置教师',


+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs Visa fil

@@ -321,6 +321,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 强制设置录成绩教师
/// </summary>
/// <param name="keyValue"></param>
/// <param name="EmpNo">已选择的录成绩教师</param>
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

}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs Visa fil

@@ -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



+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs Visa fil

@@ -82,6 +82,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
IEnumerable<EmpInfoEntity> GetEmpNoData(string keyValue);
/// <summary>
/// 强制设置录成绩教师
/// </summary>
/// <param name="keyValue"></param>
/// <param name="EmpNo">已选择的录成绩教师</param>
void DoQzSetTeach(string keyValue, string EmpNo);
#endregion
}
}

+ 52
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs Visa fil

@@ -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<TeachClassEntity>(ID);
return this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>($"select * from EmpInfo e where EmpNo in ({teachclassEntity.EmpNo}) ");
return this.BaseRepository("CollegeMIS").FindList<EmpInfoEntity>($"select * from EmpInfo e where EmpNo in ('{teachclassEntity.EmpNo.Replace(",", "','")}') ");
}
catch (Exception ex)
{
@@ -747,6 +749,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 强制设置录成绩教师
/// </summary>
/// <param name="keyValue"></param>
/// <param name="EmpNo">已选择的录成绩教师</param>
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
}
}

Laddar…
Avbryt
Spara