From bfc272df34268484055e0423de703cde547abc2f Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Mon, 1 Aug 2022 17:02:00 +0800
Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8A=A1=E7=AE=A1=E7=90=86=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E4=B8=93=E4=B8=9A=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=92=8C?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BF=A1=E6=81=AF=E8=A1=A8=E7=9A=84=E5=85=B3?=
=?UTF-8?q?=E8=81=94?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Views/Exam_ExamLesson/Index.js | 26 ++++++++
.../Exam_ExamLesson/Exam_ExamLessonEntity.cs | 10 ++-
.../Exam_ExamLesson/Exam_ExamLessonService.cs | 11 ++--
.../Exam_ExamPlanLessonEntity.cs | 6 ++
.../Exam_ExamPlanLessonService.cs | 65 ++++++++++---------
5 files changed, 81 insertions(+), 37 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js
index 73cdded1b..7bf9f6303 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.js
@@ -228,6 +228,32 @@ var bootstrap = function ($, learun) {
}
}
},
+ {
+ label: "课程类型", name: "LessonTypeId", width: 150, align: "left",
+ formatterAsync: function (callback, value, row, op, $cell) {
+ learun.clientdata.getAsync('custmerData', {
+ url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonType',
+ key: value,
+ keyId: 'ltid',
+ callback: function (_data) {
+ callback(_data['lessontypename']);
+ }
+ });
+ }
+ },
+ {
+ label: "专业", name: "DeptNo", width: 150, 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: "ELOrder", width: 100, align: "left" },
{
label: "是否启用", name: "ELEnabled", width: 100, align: "left",
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonEntity.cs
index 189a34140..4618e15e7 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonEntity.cs
@@ -35,16 +35,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[Column("SEMESTER")]
public int? Semester { get; set; }
///
- /// 课程类型名称
+ /// 课程名称
///
[Column("LESSONNAME")]
public string LessonName { get; set; }
+
///
- /// 课程类型编号
+ /// 课程编号
///
[Column("LESSONNO")]
public string LessonNo { get; set; }
///
+ /// 课程类型
+ ///
+ [Column("LESSONTYPEID")]
+ public string LessonTypeId { get; set; }
+ ///
/// 年级
///
[Column("GRADE")]
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs
index baf720dae..9c701d454 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamLesson/Exam_ExamLessonService.cs
@@ -265,11 +265,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
,[LessonName]
,[LessonNo]
,[ELOrder]
- ,[ELEnabled],ExamTime)
-select NEWID(),AcademicYearNo,Semester,Grade,LessonName,[LessonNo],0,1,'{ExamTime}' from OpenLessonPlan where ExamType='1' and lessonsortno=1 and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'
- and [LessonNo] not in (select [LessonNo] from Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' )
- group by LessonNo,LessonName,AcademicYearNo,Semester,Grade
+ ,[ELEnabled],ExamTime,LessonTypeId,DeptNo,MajorNo)
+select NEWID(),AcademicYearNo,t.Semester,Grade,t.LessonName,t.[LessonNo],0,1,'{ExamTime}',a.lessontypeid,t.DeptNo,t.MajorNo from OpenLessonPlan t
+left join lessoninfo a on t.lessonno=a.lessonno
+ where t.ExamType='1' and t.lessonsortno=1 and t.AcademicYearNo='{AcademicYearNo}' and t.Semester='{Semester}'
+ and t.[LessonNo] not in (select [LessonNo] from Exam_ExamLesson where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' )
+ group by t.LessonNo,t.LessonName,t.AcademicYearNo,t.Semester,Grade,a.lessontypeid,t.DeptNo,t.MajorNo
";
+
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
catch (Exception ex)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
index 347d527c6..c2e3971d9 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonEntity.cs
@@ -40,6 +40,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
[Column("LESSONNO")]
public string LessonNo { get; set; }
+ ///
+ /// LessonNo
+ ///
+ [Column("LESSONTYPEID")]
+ public string LessonTypeId { get; set; }
+
///
/// 考试日期
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
index 043ebbcf5..86eb859b4 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
@@ -230,17 +230,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var sql = $@"select distinct t.EPLId,t.LessonName,a.ltorder,t.LessonNo from Exam_ExamPlanLesson t
- join (select l.lessonno,l.LessonTypeId,lt.ltorder from [dbo].[LessonInfo] l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.checkmark=1) a
- on t.LessonNo=a.lessonno
+ join CdLessonType a
+ on t.LessonTypeId=a.ltid
where EPId='{EPId}' order by a.ltorder, t.LessonNo";
- var examplan = this.BaseRepository("CollegeMIS").FindEntity(EPId);
- if (examplan.PlanType == "1")
- {
- sql = $@"select distinct t.EPLId,t.LessonName,a.ltorder,t.LessonNo from Exam_ExamPlanLesson t
- join (select l.lessonno,l.LessonTypeId,lt.ltorder from [dbo].[LessonInfo] l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.checkmark=1) a
- on SUBSTRING(t.LessonNo,0,CHARINDEX('(',t.LessonNo))=a.lessonno
- where EPId='{EPId}' order by a.ltorder, t.LessonNo";
- }
+ // var examplan = this.BaseRepository("CollegeMIS").FindEntity(EPId);
+ // if (examplan.PlanType == "1")
+ // {
+ // sql = $@"select distinct t.EPLId,t.LessonName,a.ltorder,t.LessonNo from Exam_ExamPlanLesson t
+ //join (select l.lessonno,l.LessonTypeId,lt.ltorder from [dbo].[Exam_ExamLesson] l left join CdLessonType lt on l.LessonTypeId=lt.ltid where l.ELEnabled=1) a
+ //on SUBSTRING(t.LessonNo,0,CHARINDEX('(',t.LessonNo))=a.lessonno
+ // where EPId='{EPId}' order by a.ltorder, t.LessonNo";
+ // }
return this.BaseRepository("CollegeMIS").FindTable(sql);
}
@@ -328,36 +328,38 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
if (exam_ExamPlan.PlanType == "1")
{
//必修
- string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo)
-select NEWID(),'{EPId}',LessonName+'('+grade+')',LessonNo+'('+grade+')' from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}'
+ string sql = $@"insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId)
+select NEWID(),'{EPId}',LessonName+'('+grade+')',LessonNo+'('+grade+')',LessonTypeId from Exam_ExamLesson where ELEnabled=1 and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}'
and LessonNo+'('+grade+')' not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}')
- group by LessonNo,grade,LessonName";
+ group by LessonNo,grade,LessonName,LessonTypeId";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
else if (exam_ExamPlan.PlanType == "2")
{
//补考
- string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo)
- select NEWID(),'{EPId}',a.lessonname,a.LessonNo
+ string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId)
+ select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId
from StuScore a left join StuInfoBasic b on b.StuNo=a.StuNo
+left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno
where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10))
and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null)
and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}'
- and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}')
- group by LessonNo,lessonname";
+ and a.LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}')
+ group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
else if (exam_ExamPlan.PlanType == "3")
{
//重修
- string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo)
- select NEWID(),'{EPId}',a.lessonname,a.LessonNo
+ string sql = $@" insert into Exam_ExamPlanLesson(EPLId,EPId,LessonName,LessonNo,LessonTypeId)
+ select NEWID(),'{EPId}',a.lessonname,a.LessonNo,t.LessonTypeId
from StuScoreNotPass a left join StuInfoBasic b on b.StuNo=a.StuNo
+left join (select l.lessonno,l.LessonTypeId,lt.ltorder from lessoninfo l left join CdLessonType lt on l.LessonTypeId=lt.ltid ) t on a.lessonno=t.lessonno
where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10))
and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null)
and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}'
and LessonNo not in (select LessonNo from Exam_ExamPlanLesson where EPId='{EPId}')
- group by LessonNo,lessonname";
+ group by t.ltorder,a.LessonNo,a.lessonname,t.LessonTypeId ";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
@@ -588,19 +590,20 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId
return (false, "请先安排考试记录时间!");
}
//考试课程数据
- var EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,info.TeachMajorNo,t.* from Exam_ExamPlanLesson t
-join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo
-left join LessonInfo info on t.LessonNo=info.LessonNo
-left join CdLessonType ltype on info.LessonTypeId=ltype.LTId
- where t.EPId='{EPId}' and info.CheckMark=1 ");
+ var EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t
+join Exam_ExamLesson elesson on t.LessonNo=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}'
+--left join Exam_ExamLesson info on left(t.LessonNo,charindex('(',t.LessonNo)-1)=info.LessonNo
+left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId
+ where t.EPId='{EPId}' and elesson.ELEnabled=1 ");
if (examPlan.PlanType == "1")
{
//必修
- EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,info.TeachMajorNo,t.* from Exam_ExamPlanLesson t
-join Exam_ExamLesson elesson on left(t.LessonNo,charindex('(',t.LessonNo)-1)=elesson.LessonNo
-left join LessonInfo info on left(t.LessonNo,charindex('(',t.LessonNo)-1)=info.LessonNo
-left join CdLessonType ltype on info.LessonTypeId=ltype.LTId
- where t.EPId='{EPId}' and info.CheckMark=1 ");
+ EPLessonList = db.FindList($@" select distinct elesson.ExamTime as ExamLength,ltype.LessonTypeName,elesson.MajorNo as TeachMajorNo,t.* from Exam_ExamPlanLesson t
+join Exam_ExamLesson elesson on left(t.LessonNo,charindex('(',t.LessonNo)-1)=elesson.LessonNo and [AcademicYearNo]='{examPlan.AcademicYearNo}' and [Semester]='{examPlan.Semester}'
+--left join Exam_ExamLesson info on left(t.LessonNo,charindex('(',t.LessonNo)-1)=info.LessonNo
+left join CdLessonType ltype on elesson.LessonTypeId=ltype.LTId
+ where t.EPId='{EPId}' and elesson.ELEnabled=1
+ ");
}
if (EPLessonList.ToList().Exists(x => x.ExamLength == null || x.ExamLength <= 0))
@@ -615,7 +618,7 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId
{
EPLesson.ExamDate = null;
EPLesson.ExamTime = null;
- if (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开"))
+ if (!string.IsNullOrEmpty(EPLesson.LessonTypeName) && (EPLesson.LessonTypeName.Contains("公共") || EPLesson.LessonTypeName.Contains("公开")))
{
var EPTimes = EPTimeList.Where(x => x.ExamType == "2" && x.ExamTimeLength == EPLesson.ExamLength).ToList();
foreach (var EPTime in EPTimes)