From 8f8f70bf3168074df8023c92b9c81342c152db6e Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Sun, 29 Sep 2024 15:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=BB=A9=E5=8D=95=E6=89=93=E5=8D=B0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuInfoGraduateController.cs | 9 ++-- .../Controllers/StuScoreController.cs | 47 ++++++++++++++++++- .../Views/StuInfoGraduate/PrintScore.cshtml | 5 +- .../Views/StuScore/AllStuScoreQueryIndex.js | 8 ++-- .../StuScore/StuScoreService.cs | 14 +----- 5 files changed, 59 insertions(+), 24 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoGraduateController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoGraduateController.cs index a479ab36a..535af2ee8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoGraduateController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoGraduateController.cs @@ -59,9 +59,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(new StuInfoGraduateEntity()); } - var Score = stuScoreIBLL.GetScoreListStuNo(StuInfoGraduateEntity.StuNo); + var Score = stuScoreIBLL.GetScoreListStuNo(StuInfoGraduateEntity.StuNo).Where(x => x.AcademicYearNo != null && x.Semester != null); //学习成绩 - StuInfoGraduateEntity.StuScoreList = Score.Where(x => x.AcademicYearNo != null && x.Semester != null && x.Score != null) + StuInfoGraduateEntity.StuScoreList = Score .GroupBy(x => new { x.AcademicYearNo, x.Semester }) .Select(x => new StuScores() { @@ -71,7 +71,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { LessonNo = y.LessonNo, LessonName = y.LessonName, - Score = y.Score + Score = y.Score, + ScoreFormat = y.ScoreFormat }).OrderBy(xx => xx.LessonNo).ToList() }).OrderBy(xx => xx.AcademicYearNo).ThenBy(xx => xx.Semester).ToList(); var result = new @@ -84,7 +85,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers ClassName = classInfoIBLL.GetClassInfoEntityByClassNo(StuInfoGraduateEntity.ClassNo).ClassName, MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(StuInfoGraduateEntity.MajorNo).MajorName, StuInfoGraduateEntity = StuInfoGraduateEntity, - Counts = Score.Count().ToString(), + Counts = Score.GroupBy(x => x.LessonName).Select(x => x.Key).Count().ToString(), }; return Success(result); } 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 d9144c8b3..7db95d19c 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 @@ -10,6 +10,7 @@ using System.Configuration; using System.Data; using System.Linq; using System.Web.Mvc; +using static Learun.Application.TwoDevelopment.EducationalAdministration.StuInfoBasicEntity; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -1274,7 +1275,51 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuScoreIBLL.DoSlow(keyValue, status); return Success("操作成功"); } - + /// + /// 全院学生成绩查看-打印(学生成绩单) + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult DataFilling(string stuNo) + { + //毕业表 + var StuInfoGraduateEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(stuNo); + if (StuInfoGraduateEntity == null) + { + return View(new StuInfoBasicEntity()); + } + var Score = stuScoreIBLL.GetScoreListStuNo(StuInfoGraduateEntity.StuNo).Where(x => x.AcademicYearNo != null && x.Semester != null); + //学习成绩 + StuInfoGraduateEntity.StuScoreClassOneList = Score + .GroupBy(x => new { x.AcademicYearNo, x.Semester }) + .Select(x => new StuScoreClassOne() + { + AcademicYearNo = x.Key.AcademicYearNo, + Semester = x.Key.Semester, + StuScoreList = x.Select(y => new StuScoreEntity() + { + LessonNo = y.LessonNo, + LessonName = y.LessonName, + Score = y.Score, + ScoreFormat = y.ScoreFormat + }).OrderBy(xx => xx.LessonNo).ToList() + }).OrderBy(xx => xx.AcademicYearNo).ThenBy(xx => xx.Semester).ToList(); + var result = new + { + StuNo = StuInfoGraduateEntity.StuNo, + StuName = StuInfoGraduateEntity.StuName, + Crowning = StuInfoGraduateEntity.Crowning, + EduSystem = StuInfoGraduateEntity.EduSystem, + Grade = StuInfoGraduateEntity.Grade, + ClassName = classInfoIBLL.GetClassInfoEntityByClassNo(StuInfoGraduateEntity.ClassNo).ClassName, + MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(StuInfoGraduateEntity.MajorNo).MajorName, + StuInfoGraduateEntity = StuInfoGraduateEntity, + Counts = Score.GroupBy(x => x.LessonName).Select(x => x.Key).Count().ToString(), + }; + return Success(result); + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoGraduate/PrintScore.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoGraduate/PrintScore.cshtml index 541cfe794..540d304a2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoGraduate/PrintScore.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoGraduate/PrintScore.cshtml @@ -49,7 +49,6 @@ cache: false, success: function (res) { if (res.code == 200) { - console.log(res.data) $.ajax({ url: "/OnlineRegistrate/GetDataItemMap?code=" + 'EduSystem', async: false, @@ -90,10 +89,10 @@ if (scoreIndex == -1) { scoreData.push({ 0: e1.LessonName, - [i + 1]: e1.Score + [i + 1]: e1.ScoreFormat }) } else { - scoreData[scoreIndex][i + 1] = e1.Score + scoreData[scoreIndex][i + 1] = e1.ScoreFormat } }) }) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js index 36b09e059..da47d6748 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js @@ -39,10 +39,10 @@ var bootstrap = function ($, learun) { var AcademicYearNo = $('#AcademicYearNo').lrselectGet(); var Semester = $('#Semester').lrselectGet(); var StuNo = $.trim($('#StuNo').val()); - //if (StuNo == null || StuNo == "") { - // learun.alert.warning("请输入学号!"); - // return; - //} + if (StuNo == null || StuNo == "") { + learun.alert.warning("请输入学号!"); + return; + } var LessonNo = $('#LessonNo').lrselectGet(); var Grade = $('#Grade').lrselectGet(); learun.layerForm({ 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 d042bc101..d752fdb66 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 @@ -2916,8 +2916,9 @@ group by c.StuNo) cc where cc.StuNo = bb.StuNo) as RankIndept "); var dp = new DynamicParameters(new { }); var strSql = new StringBuilder(); strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,bb.MajorNo,bb.ClassNo,li.StudyScore,ls.LessonSortName,lt.LessonTypeName,bb.Score,(case when sp.Score>=60 then 60 else sp.score end) as ScoreOfNotPass,(case when spt.Score>=60 then 60 else spt.Score end) as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName "); + strSql.Append(" ,case when bb.Score<60 then (case when sp.Score>0 then '补('+convert(nvarchar(50),sp.Score)+')' else convert(nvarchar(50),bb.Score) end) else convert(nvarchar(50),bb.Score) end as ScoreFormat "); strSql.Append(" from ( "); - strSql.Append($"select sb.Grade,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,Max(s.Score) as Score from StuScore s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); + strSql.Append($"select sb.Grade,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,ISNULL(Max(s.Score),0) as Score from StuScore s left join StuInfoBasic sb on s.StuNo=sb.StuNo "); strSql.Append(" where 1=1 and s.CheckMark='1' and s.StuNo= '" + StuNo + "'"); strSql.Append(" group by sb.Grade,s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo ) 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' "); @@ -2928,17 +2929,6 @@ group by c.StuNo) cc where cc.StuNo = bb.StuNo) as RankIndept "); strSql.Append(" left join ClassInfo ci on bb.ClassNo= ci.ClassNo and ci.CheckMark='1' "); strSql.Append(" left join CdLessonType lt on li.LessonTypeId=lt.ltid and lt.LTEnabled='1' "); var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); - foreach (var item in data) - { - if (item.Score <= 0) - { - item.Score = item.ScoreOfNotPass.ToDecimal(); - } - else if (item.Score <= 0 && item.ScoreOfNotPass.ToDecimal() <= 0) - { - item.Score = item.ScoreOfNotPassTwo.ToDecimal(); - } - } return data; } catch (Exception ex)