diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/studentSee/studentSee.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/studentSee/studentSee.js index 063f7e75a..8d9290718 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/studentSee/studentSee.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/studentSee/studentSee.js @@ -23,6 +23,7 @@ isScroll: false, init: function ($page) { //获取学年学期列表 + learun.layer.loading(true, '获取数据中'); learun.httpget(config.webapi + "scoreSearch/academicAndSemesterList", {}, (data) => { if (data == null || data.length <= 0) { $('.studSeeSec2 .studSeeSec2Top').hide(); @@ -41,6 +42,8 @@ studentSeeAjax(res.value) } }); + + learun.layer.loading(false); }); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 079358e44..da79f58f3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -163,7 +163,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } - + /// /// 学生成绩录入可去审核页面 @@ -640,9 +640,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers StuId = x.Key.StuId, StuNo = x.Key.StuNo, StuName = x.Key.StuName, - FinishSchoolMark=stuData.FirstOrDefault(a=>a.StuNo==x.Key.StuNo)?.FinishSchoolMark, + FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, TotalScore = x.Select(y => y.Score).Sum(), - LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) }).OrderByDescending(x => x.TotalScore); var result = new List>(); @@ -656,7 +656,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers aaa.Add("TotalScore", item.TotalScore.ToString()); foreach (var lessonInfoItem in item.LessonInfo) { - aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); } result.Add(aaa); @@ -678,8 +678,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers StuNo = x.Key.StuNo, StuName = x.Key.StuName, FinishSchoolMark = stuData.FirstOrDefault(a => a.StuNo == x.Key.StuNo)?.FinishSchoolMark, - TotalScore = x.Where(m=>m.LessonSortNo=="1").Select(y => y.Score).Sum(), - LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) + TotalScore = x.Where(m => m.LessonSortNo == "1").Select(y => y.Score).Sum(), + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) }).OrderByDescending(x => x.TotalScore); var result = new List>(); @@ -693,7 +693,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers aaa.Add("TotalScore", item.TotalScore.ToString()); foreach (var lessonInfoItem in item.LessonInfo) { - aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); } result.Add(aaa); @@ -739,7 +739,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers StuNo = x.Key.StuNo, StuName = x.Key.StuName, TotalScore = x.Select(y => y.Score).Sum(), - LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score, y.ScoreFormat }).OrderBy(y => y.LessonNo) }).OrderByDescending(x => x.TotalScore); var result = new List>(); foreach (var item in aa) @@ -750,7 +750,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers aaa.Add("TotalScore", item.TotalScore.ToString()); foreach (var lessonInfoItem in item.LessonInfo) { - aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); } result.Add(aaa); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs index 2f64c218f..5b3681e63 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs @@ -386,6 +386,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [NotMapped] public string TempId { get; set; } + + /// + /// 成绩格式化(补)(重) + /// + [NotMapped] + public string ScoreFormat { get; set; } + } } 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 b40cb0234..ca55f8fe3 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 @@ -425,7 +425,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { this.BaseRepository("CollegeMIS").ExecuteBySql( @"update StuScore set IsEditable=1,EditUserId='',BeginModifyDate=null - where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='"+LessonNo+"' and EmpNo='" + EmpNo + "'"+(!string.IsNullOrEmpty(TeachClassNo)? " and TeachClassNo='" + TeachClassNo + "'" : "")); + where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and EmpNo='" + EmpNo + "'" + (!string.IsNullOrEmpty(TeachClassNo) ? " and TeachClassNo='" + TeachClassNo + "'" : "")); } catch (Exception ex) { @@ -709,7 +709,35 @@ where AcademicYearNo='" + strAcademicYear + "' and Semester='" + strSemester + " var stuScoreList = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academic && x.Semester == semester && x.StuNo == stuNo && x.CheckMark == "1"); foreach (var scoreEntity in stuScoreList) { - scoreEntity.LessonName = scoreEntity.LessonName + (!string.IsNullOrEmpty(scoreEntity.LessonSortNo)&&scoreEntity.LessonSortNo == "2"?"(选修)":""); + if (scoreEntity.LessonSortNo == "2") + { + scoreEntity.LessonName = scoreEntity.LessonName + "(选修)"; + } + else + { + if (scoreEntity.Score < 60) + { + var notpass = this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == scoreEntity.AcademicYearNo && x.Semester == scoreEntity.Semester && x.StuNo == scoreEntity.StuNo && x.LessonNo == scoreEntity.LessonNo && x.CheckMark == "1"); + if (notpass != null) + { + if (notpass.Score >= 60) + { + scoreEntity.Score = notpass.Score; + } + else + { + var notpasstwo = this.BaseRepository("CollegeMIS").FindEntity(x => x.AcademicYearNo == scoreEntity.AcademicYearNo && x.Semester == scoreEntity.Semester && x.StuNo == scoreEntity.StuNo && x.LessonNo == scoreEntity.LessonNo && x.CheckMark == "1"); + if (notpasstwo != null) + { + if (notpasstwo.Score >= 60) + { + scoreEntity.Score = notpasstwo.Score; + } + } + } + } + } + } } result.ScoreList = stuScoreList.ToList(); //获取排名、综合成绩 @@ -1228,7 +1256,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad tableName = queryParam["TableName"].ToString(); } var strSql = new StringBuilder(); - strSql.Append($"select s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.ClassNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); + strSql.Append(" ,case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end as Score "); + strSql.Append(" ,case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end as ScoreFormat "); + strSql.Append(" from ( "); + strSql.Append($" select s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); strSql.Append(" where 1=1 and s.LessonSortNo='1' "); if (!queryParam["AcademicYearNo"].IsEmpty()) { @@ -1250,7 +1282,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); strSql.Append(" and s.StuNo=@StuNo "); } - strSql.Append(" group by s.LessonNo,s.LessonName,s.StuNo,sb.StuName "); + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.ClassNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); + strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.ClassNo=sp.ClassNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo "); + strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.ClassNo=spt.ClassNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex) @@ -1802,7 +1837,11 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad tableName = queryParam["TableName"].ToString(); } var strSql = new StringBuilder(); - strSql.Append($"select s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); + strSql.Append(" ,case when bb.LessonSortNo='2' then bb.Score else (case when bb.Score >=60 then bb.Score else (case when sp.Score>= 60 then sp.Score else (case when spt.Score>=60 then spt.Score else bb.Score end) end) end) end as Score "); + strSql.Append(" ,case when bb.LessonSortNo='2' then convert(nvarchar(50),bb.Score) else (case when bb.Score >=60 then convert(nvarchar(50),bb.Score) else (case when sp.Score>= 60 then convert(nvarchar(50),sp.Score)+'(补)' else (case when spt.Score>=60 then convert(nvarchar(50),spt.Score)+'(重)' else convert(nvarchar(50),bb.Score) end) end) end) end as ScoreFormat "); + strSql.Append(" from ( "); + strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,Max(s.Score) as Score from {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); strSql.Append(" where 1=1 and s.CheckMark='1' "); if (!queryParam["AcademicYearNo"].IsEmpty()) { @@ -1819,7 +1858,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); strSql.Append(" and s.StuNo=@StuNo "); } - strSql.Append(" group by s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName "); + strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb "); + strSql.Append(" left join StuScoreNotPass sp on bb.AcademicYearNo=sp.AcademicYearNo and bb.Semester=sp.Semester and bb.LessonSortNo=sp.LessonSortNo and bb.LessonNo=sp.LessonNo and bb.LessonName=sp.LessonName and bb.StuNo=sp.StuNo and sp.CheckMark = '1' "); + strSql.Append(" left join StuScoreNotPassTwo spt on bb.AcademicYearNo=spt.AcademicYearNo and bb.Semester=spt.Semester and bb.LessonSortNo=spt.LessonSortNo and bb.LessonNo=spt.LessonNo and bb.LessonName=spt.LessonName and bb.StuNo=spt.StuNo and spt.CheckMark = '1' "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex)