Pārlūkot izejas kodu

【修改】全院学校成绩查看:增加专业排名列、班级排名列;

西昌缴费二期
dyy pirms 2 gadiem
vecāks
revīzija
a7c7a60dcb
4 mainītis faili ar 89 papildinājumiem un 14 dzēšanām
  1. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs
  2. +14
    -7
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js
  3. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs
  4. +57
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs

+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs Parādīt failu

@@ -731,12 +731,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetScoreListByStuNo2(string queryJson)
public ActionResult GetScoreListByStuInfo(string queryJson)
{
var data = stuScoreIBLL.GetScoreListByStuNo(queryJson);
var data = stuScoreIBLL.GetScoreListByStuInfo(queryJson);
if (data.Any())
{
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonNo);
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x=>x.LessonSortNo).ThenBy(x => x.LessonNo);
}
return Success(data);


+ 14
- 7
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js Parādīt failu

@@ -53,15 +53,22 @@ var bootstrap = function ($, learun) {
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGridLei({
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuNo2',
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuInfo',
headData: [
{ label: '学号', name: 'StuNo', width: 100, align: "left" },
{ label: '姓名', name: 'StuName', width: 100, align: "left" },
{ label: '学年', name: 'AcademicYearNo', width: 100, align: "left" },
{ label: '学期', name: 'Semester', width: 100, align: "left" },
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" },
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" },
{ label: '总分', name: 'ScoreFormat', width: 100, align: "left" },
{ label: '姓名', name: 'StuName', width: 150, align: "left" },
{ label: '专业', name: 'MajorName', width: 100, align: "left" },
{ label: '班级', name: 'ClassName', width: 100, align: "left" },
{ label: '学年', name: 'AcademicYearNo', width: 50, align: "left" },
{ label: '学期', name: 'Semester', width: 50, align: "left" },
{ label: '科目类型', name: 'LessonSortName', width: 60, align: "left" },
{ label: '科目', name: 'LessonName', width: 200, align: "left" },
{ label: '学分', name: 'StudyScore', width: 50, align: "left" },
{ label: '成绩', name: 'Score', width: 100, align: "left" },
{ label: '第一次补考成绩', name: 'ScoreOfNotPass', width: 100, align: "left" },
{ label: '第二次补考成绩', name: 'ScoreOfNotPassTwo', width: 100, align: "left" },
{ label: '专业排名', name: 'RankInMajor', width: 100, align: "left" },
{ label: '班级排名', name: 'RankInClass', width: 100, align: "left" },
],
mainId: 'StuNo',
isPage: false,


+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreEntity.cs Parādīt failu

@@ -409,6 +409,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <returns></returns>
[NotMapped]
public string LessonSortName { get; set; }
/// <summary>
/// 专业名称
/// </summary>
[NotMapped]
public string MajorName { get; set; }
/// <summary>
/// 专业排名
/// </summary>
[NotMapped]
public int RankInMajor { get; set; }
/// <summary>
/// 班级排名
/// </summary>
[NotMapped]
public int RankInClass { get; set; }


}


+ 57
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs Parādīt failu

@@ -1896,9 +1896,9 @@ 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 bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName,li.StudyScore,ls.LessonSortName,bb.Score,sp.Score as ScoreOfNotPass,spt.Score as ScoreOfNotPassTwo ");
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,bb.Score,sp.Score as ScoreOfNotPass,spt.Score as ScoreOfNotPassTwo,cm.MajorName,ci.ClassName ");
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($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,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())
{
@@ -1920,13 +1920,66 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
dp.Add("StuName", queryParam["StuName"].ToString(), DbType.String);
strSql.Append(" and s.StuName=@StuName ");
}
strSql.Append(" group by s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName ) as bb ");
strSql.Append(" group by 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' ");
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' ");
strSql.Append(" left join CdLessonSort ls on bb.LessonSortNo= ls.LessonSortNo ");
strSql.Append(" left join LessonInfo li on bb.LessonNo= li.LessonNo and li.CheckMark='1' ");
strSql.Append(" left join CdMajor cm on bb.MajorNo= cm.MajorNo and cm.CheckMark='1' ");
strSql.Append(" left join ClassInfo ci on bb.ClassNo= ci.ClassNo and ci.CheckMark='1' ");

return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp);
var result = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp);
//计算专业排名,班级排名
if (result.Any())
{
var temp = result.GroupBy(x=>new { x.AcademicYearNo,x.Semester}).Select(x => new StuScoreEntity()
{
AcademicYearNo=x.Key.AcademicYearNo,
Semester=x.Key.Semester,
StuNo=x.FirstOrDefault().StuNo,
ClassNo=x.FirstOrDefault().ClassNo,
MajorNo=x.FirstOrDefault().MajorNo
}).ToList();
if (temp.Any())
{
foreach (var item in temp)
{
//专业排名
var ml = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.MajorNo == item.MajorNo && x.CheckMark == "1");
var mlGroup = ml.GroupBy(x => x.StuNo).Select(x => new
{
StuNo = x.Key,
TotalScore = x.Select(y => y.Score).Sum()
}).OrderByDescending(x => x.TotalScore);
if (mlGroup.Any())
{
var rank = mlGroup.Select(x => x.StuNo).ToList().IndexOf(item.StuNo);
item.RankInMajor = rank + 1;
}
//班级排名
var cl = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.ClassNo == item.ClassNo && x.CheckMark == "1");
var clGroup = cl.GroupBy(x => x.StuNo).Select(x => new
{
StuNo = x.Key,
TotalScore = x.Select(y => y.Score).Sum()
}).OrderByDescending(x => x.TotalScore);
if (clGroup.Any())
{
var rank = clGroup.Select(x => x.StuNo).ToList().IndexOf(item.StuNo);
item.RankInClass = rank + 1;
}
}
}
foreach (var ii in result)
{
ii.RankInMajor = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInMajor;
ii.RankInClass = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInClass;
}
}

return result;
}
catch (Exception ex)
{


Notiek ielāde…
Atcelt
Saglabāt