@@ -121,6 +121,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 全院班级成绩查看页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult StuScoreRank() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 新版成绩录入 | |||
/// </summary> | |||
/// <returns></returns> | |||
@@ -855,6 +864,23 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(data); | |||
} | |||
/// <summary> | |||
/// 学生成绩排名 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetScoreListRank(string queryJson) | |||
{ | |||
var data = stuScoreIBLL.GetScoreListRank(queryJson); | |||
if (data.Any()) | |||
{ | |||
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).ThenBy(x => x.LessonSortNo).ThenBy(x => x.LessonNo); | |||
} | |||
return Success(data); | |||
} | |||
public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) | |||
{ | |||
var data = stuScoreIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); | |||
@@ -0,0 +1,50 @@ | |||
@{ ViewBag.Title = "全院学生成绩查看"; Layout = "~/Views/Shared/_Index.cshtml"; } | |||
<style> | |||
.lr-select { | |||
width: 150px; | |||
} | |||
</style> | |||
<div class="lr-layout"> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="AcademicYearNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="Semester" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<input id="StuNo" type="text" class="form-control" placeholder="请输入学号" /> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> 查询</a> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<label>应修学分总计:</label> | |||
<span id="spanstudyscoreall">0</span> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<label>已取得学分:</label> | |||
<span id="spanstudyscore">0</span> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-check-circle"></i> 打印</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScore/StuScoreRank.js") |
@@ -0,0 +1,126 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-06-14 11:02 | |||
* 描 述:全院学生成绩查看 | |||
*/ | |||
var selectedRow; | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.bind(); | |||
page.bindSelect(); | |||
}, | |||
bind: function () { | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
var p = {}; | |||
p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); | |||
p.Semester = $('#Semester').lrselectGet(); | |||
p.StuNo = $.trim($('#StuNo').val()); | |||
if (p.StuNo == null || p.StuNo == "") { | |||
learun.alert.warning("请输入学号!"); | |||
return; | |||
} | |||
page.initGird(); | |||
page.search(p); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
//打印 | |||
$('#lr_print').on('click', function () { | |||
var AcademicYearNo = $('#AcademicYearNo').lrselectGet(); | |||
var Semester = $('#Semester').lrselectGet(); | |||
var StuNo = $.trim($('#StuNo').val()); | |||
if (StuNo == null || StuNo == "") { | |||
learun.alert.warning("请输入学号!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'AllStuScoreQueryPrint', | |||
title: '学生成绩单', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/AllStuScoreQueryPrint?StuNo=' + StuNo + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester, | |||
width: 1200, | |||
height: 800, | |||
btn: null | |||
}); | |||
}); | |||
}, | |||
bindSelect: function () { | |||
//学年 | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListRank', | |||
headData: [ | |||
{ label: '学号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '姓名', name: 'StuName', width: 200, 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: 'LessonTypeName', width: 100, align: "left" }, | |||
{ label: '科目', name: 'LessonName', width: 300, 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" }, | |||
{ label: '系排名', name: 'RankIndept', width: 100, align: "left" }, | |||
], | |||
mainId: 'StuNo', | |||
isPage: false, | |||
sidx: '', | |||
sord: '', | |||
onRenderComplete: function (data) { | |||
var studyscoreall = 0; | |||
var studyscore = 0; | |||
for (var i = 0; i < data.length; i++) { | |||
if (!!data[i].LessonSortNo && data[i].LessonSortNo == "1") { | |||
if (!!data[i].StudyScore) { | |||
studyscoreall += data[i].StudyScore; | |||
} | |||
} | |||
if (!!data[i].Score && data[i].Score >= 60) { | |||
studyscore += data[i].StudyScore; | |||
} | |||
} | |||
$("#spanstudyscoreall").html(studyscoreall + 10); | |||
$("#spanstudyscore").html(studyscore); | |||
} | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -1044,6 +1044,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOnline\InputScoreIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOnline\InputScoreIndexImport.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOnline\Monitor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreRank.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\SlowIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreQueryIndexRow.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuSelectLessonListOfElectiveOnline\AuditForm.js" /> | |||
@@ -8296,6 +8297,7 @@ | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Form.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\Index.cshtml" /> | |||
<Content Include="Areas\LR_NewWorkFlow\Views\StampPersonal\StampDetailIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreRank.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -782,6 +782,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreEntity> GetScoreListRank(string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuScoreService.GetScoreListRank(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public List<object> GetStuGraduateInfo(string queryJson) | |||
{ | |||
try | |||
@@ -440,6 +440,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[NotMapped] | |||
public int RankInMajor { get; set; } | |||
/// <summary> | |||
/// 系排名 | |||
/// </summary> | |||
[NotMapped] | |||
public int RankIndept { get; set; } | |||
/// <summary> | |||
/// 班级排名 | |||
/// </summary> | |||
[NotMapped] | |||
@@ -192,6 +192,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson); | |||
/// <summary> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListRank(string queryJson); | |||
/// <summary> | |||
/// 获取个人成绩列表 | |||
/// <summary> | |||
@@ -2339,6 +2339,139 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||
} | |||
} | |||
/// <summary> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreEntity> GetScoreListRank(string queryJson) | |||
{ | |||
try | |||
{ | |||
//参考写法 | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
var tableName = "StuScore"; | |||
if (!queryParam["TableName"].IsEmpty()) | |||
{ | |||
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,bb.MajorNo,bb.ClassNo,bb.DeptNo,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(" from ( "); | |||
strSql.Append($"select s.AcademicYearNo,s.Semester,s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName,s.MajorNo,s.ClassNo,s.DeptNo,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()) | |||
{ | |||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||
strSql.Append(" and s.AcademicYearNo=@AcademicYearNo "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||
strSql.Append(" and s.Semester=@Semester "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | |||
strSql.Append(" and s.StuNo=@StuNo "); | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
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,s.MajorNo,s.ClassNo,s.DeptNo ) 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' "); | |||
strSql.Append(" left join CdLessonType lt on li.LessonTypeId=lt.ltid and lt.LTEnabled='1' "); | |||
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, | |||
DeptNo = x.FirstOrDefault().DeptNo, | |||
}).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; | |||
} | |||
//系排名 | |||
var dl = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.LessonSortNo == "1" && x.DeptNo == item.DeptNo && x.CheckMark == "1"); | |||
var dlGroup = dl.GroupBy(x => x.StuNo).Select(x => new | |||
{ | |||
StuNo = x.Key, | |||
TotalScore = x.Select(y => y.Score).Sum() | |||
}).OrderByDescending(x => x.TotalScore); | |||
if (dlGroup.Any()) | |||
{ | |||
var rank = dlGroup.Select(x => x.StuNo).ToList().IndexOf(item.StuNo); | |||
item.RankIndept = 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; | |||
ii.RankIndept = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankIndept; | |||
} | |||
} | |||
return result; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 成绩导入--必修课 选修课 | |||
/// </summary> | |||