From 6294ee5b79b026f1ba4ff02db11b7bf746cadaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=A4=20=E6=A2=81?= Date: Wed, 15 Jun 2022 20:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=8D=95=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScore/StuScoreService.cs | 86 +++++++++++++------ 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index b1bfd504b..d3396434f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -1632,26 +1632,29 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); - var LessonSection = queryParam["LessonSection"].ToString(); - var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - if (!string.IsNullOrEmpty(ClassNo)) + if (!ClassNo.IsEmpty()) { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno+ "' "); } } else { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); } } @@ -1725,26 +1728,29 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); - var LessonSection = queryParam["LessonSection"].ToString(); - var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - if (!string.IsNullOrEmpty(ClassNo)) + if (!ClassNo.IsEmpty()) { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{classno}' "); } } else { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); } } @@ -1819,23 +1825,51 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!ClassNo.IsEmpty()) { - db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); - //教师电子成绩单 - if (checkMark == 0)//撤销 + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) { - db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' and LessonSortNo='1' "); + db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno + "' "); + //教师电子成绩单 + if (checkMark == 0)//撤销 + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + classno + "' and LessonSortNo='1' "); + } + else + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + classno + "' and LessonSortNo='1' "); + } } - else + db.Commit(); + } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) { - db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' and LessonSortNo='1' "); + db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); + //教师电子成绩单 + if (checkMark == 0)//撤销 + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassRoomNo='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'"); + } + else + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and classroomno='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'"); + } } + db.Commit(); } - db.Commit(); + + } catch (Exception ex) {