|
|
@@ -343,83 +343,37 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
/// <param name="AcademicYearNo"></param> |
|
|
|
/// <param name="Semester"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public int ImportForm(string AcademicYearNo, string Semester, string ESType) |
|
|
|
public int ImportForm(string AcademicYearNo, int Semester, string ESType) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var historyStu = this.BaseRepository("CollegeMIS").FindList<Exam_ExamStudentEntity>(); |
|
|
|
int XQ = Convert.ToInt32(Semester); |
|
|
|
List<Exam_ExamStudentEntity> AddLStuist = new List<Exam_ExamStudentEntity>(); |
|
|
|
StringBuilder strSql = new StringBuilder(); |
|
|
|
if (ESType == "1") |
|
|
|
{ |
|
|
|
var StuInfoBasic = this.BaseRepository("CollegeMIS") |
|
|
|
.FindList<StuInfoBasicEntity>(x => x.CheckMark == "1"); |
|
|
|
foreach (var item in StuInfoBasic) |
|
|
|
{ |
|
|
|
var stuList = new Exam_ExamStudentEntity |
|
|
|
{ |
|
|
|
ESId = Guid.NewGuid().ToString(), |
|
|
|
ClassNo = item.ClassNo, |
|
|
|
AcademicYearNo = AcademicYearNo, |
|
|
|
Semester = XQ, |
|
|
|
StuNo = item.StuNo, |
|
|
|
StuName = item.StuName, |
|
|
|
ESType = "1", |
|
|
|
ESEnabled = true |
|
|
|
}; |
|
|
|
if (historyStu.Count(x => x.StuNo == stuList.StuNo && x.StuName == stuList.StuName && x.AcademicYearNo == AcademicYearNo && x.Semester == XQ && x.ESType == "1") == AddLStuist.Count(s => s.StuNo == stuList.StuNo && s.StuName == stuList.StuName && s.AcademicYearNo == AcademicYearNo && s.Semester == XQ && s.ESType == "1")) |
|
|
|
{ |
|
|
|
AddLStuist.Add(stuList); |
|
|
|
} |
|
|
|
} |
|
|
|
strSql.Append( |
|
|
|
$@"insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled) |
|
|
|
select newid(), a.classno, '{AcademicYearNo}', '{Semester}', a.stuno, a.stuname, '{ESType}', 1 from StuInfoBasic a where CheckMark = '1' and stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo = '{AcademicYearNo}' and Semester = '{Semester}' and ESType = '1')"); |
|
|
|
} |
|
|
|
else if (ESType == "2") |
|
|
|
else |
|
|
|
{ |
|
|
|
var StuScoreNotPass = this.BaseRepository("CollegeMIS") |
|
|
|
.FindList<StuScoreNotPassEntity>(x => x.CheckMark == "1"); |
|
|
|
foreach (var item in StuScoreNotPass) |
|
|
|
strSql.Append(@" insert into Exam_ExamStudent(ESId,ClassNo,AcademicYearNo,Semester,StuNo,StuName,ESType,ESEnabled) "); |
|
|
|
strSql.Append($"select newid(),a.classno,'{AcademicYearNo}','{Semester}',a.stuno,a.stuname,'{ESType}',1 from "); |
|
|
|
if (ESType == "2") |
|
|
|
{ |
|
|
|
var stuList = new Exam_ExamStudentEntity |
|
|
|
{ |
|
|
|
ESId = Guid.NewGuid().ToString(), |
|
|
|
ClassNo = item.ClassNo, |
|
|
|
AcademicYearNo = AcademicYearNo, |
|
|
|
Semester = XQ, |
|
|
|
StuNo = item.StuNo, |
|
|
|
StuName = item.StuName, |
|
|
|
ESType = "2", |
|
|
|
ESEnabled = true |
|
|
|
}; |
|
|
|
if (historyStu.Count(x => x.StuNo == stuList.StuNo && x.StuName == stuList.StuName && x.AcademicYearNo == AcademicYearNo && x.Semester == XQ && x.ESType == "2") == AddLStuist.Count(s => s.StuNo == stuList.StuNo && s.StuName == stuList.StuName && s.AcademicYearNo == AcademicYearNo && s.Semester == XQ && s.ESType == "2")) |
|
|
|
{ |
|
|
|
AddLStuist.Add(stuList); |
|
|
|
} |
|
|
|
strSql.Append(" StuScore "); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (ESType == "3") |
|
|
|
{ |
|
|
|
var StuScoreNotPassTwo = this.BaseRepository("CollegeMIS") |
|
|
|
.FindList<StuScoreNotPassTwoEntity>(x => x.CheckMark == "1"); |
|
|
|
foreach (var item in StuScoreNotPassTwo) |
|
|
|
else |
|
|
|
{ |
|
|
|
var stuList = new Exam_ExamStudentEntity |
|
|
|
{ |
|
|
|
ESId = Guid.NewGuid().ToString(), |
|
|
|
ClassNo = item.ClassNo, |
|
|
|
AcademicYearNo = AcademicYearNo, |
|
|
|
Semester = XQ, |
|
|
|
StuNo = item.StuNo, |
|
|
|
StuName = item.StuName, |
|
|
|
ESType = "3", |
|
|
|
ESEnabled = true |
|
|
|
}; |
|
|
|
if (historyStu.Count(x => x.StuNo == stuList.StuNo && x.StuName == stuList.StuName && x.AcademicYearNo == AcademicYearNo && x.Semester == XQ && x.ESType == "3") == AddLStuist.Count(s => s.StuNo == stuList.StuNo && s.StuName == stuList.StuName && s.AcademicYearNo == AcademicYearNo && s.Semester == XQ && s.ESType == "3")) |
|
|
|
{ |
|
|
|
AddLStuist.Add(stuList); |
|
|
|
} |
|
|
|
strSql.Append(" StuScoreNotPass "); |
|
|
|
} |
|
|
|
} |
|
|
|
return this.BaseRepository("CollegeMIS").Insert(AddLStuist); |
|
|
|
strSql.Append(@" a left join StuInfoBasic b on b.StuNo=a.StuNo |
|
|
|
where 1=1 and a.LessonSortNo='1' and ((a.Score>=0 and a.Score<60) or a.Score=(-5) or a.Score=(-10)) "); |
|
|
|
strSql.Append(" and a.AcademicYearNo ='" + AcademicYearNo + "' and a.Semester ='" + Semester + "' "); |
|
|
|
strSql.Append(" and (b.AbmormityMoveMark<>'1' or len(b.AbmormityMoveMark)=0 or b.AbmormityMoveMark is null) "); |
|
|
|
strSql.Append($@" and a.stuno not in (select stuno from Exam_ExamStudent where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ESType='{ESType}' ) "); |
|
|
|
strSql.Append(" group by a.stuno,a.stuname,a.classno"); |
|
|
|
} |
|
|
|
return this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString()); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|