Browse Source

【修改】全院学生成绩查看、学生成绩排名:增加分页,查询条件任意组合查询;

黑龙江艺术高中职
dyy 5 months ago
parent
commit
6f46d965ef
6 changed files with 159 additions and 20 deletions
  1. +20
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs
  2. +10
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js
  3. +7
    -7
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreRank.js
  4. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs
  5. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs
  6. +93
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs

+ 20
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs View File

@@ -863,6 +863,26 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
}
return Success(data);
}
/// <summary>
/// 全院学生成绩查看
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetScorePageListByStuInfo(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = stuScoreIBLL.GetScorePageListByStuInfo(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}

/// <summary>
/// 学生成绩排名


+ 10
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllStuScoreQueryIndex.js View File

@@ -22,10 +22,10 @@ var bootstrap = function ($, learun) {
p.StuNo = $.trim($('#StuNo').val());
p.LessonNo = $.trim($('#LessonNo').lrselectGet());
p.Grade = $.trim($('#Grade').lrselectGet());
if (p.StuNo == null || p.StuNo == "") {
learun.alert.warning("请输入学号!");
return;
}
//if (p.StuNo == null || p.StuNo == "") {
// learun.alert.warning("请输入学号!");
// return;
//}

page.initGird();
page.search(p);
@@ -115,13 +115,13 @@ var bootstrap = function ($, learun) {
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGridLei({
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuInfo',
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScorePageListByStuInfo',
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: 'MajorName', width: 150, align: "left" },
{ label: '班级', name: 'ClassName', width: 130, align: "left" },
{ label: '年级', name: 'Grade', width: 50, align: "left" },
{ label: '学年', name: 'AcademicYearNo', width: 50, align: "left" },
{ label: '学期', name: 'Semester', width: 50, align: "left" },
{ label: '课程分类', name: 'LessonSortName', width: 60, align: "left" },
@@ -135,8 +135,8 @@ var bootstrap = function ($, learun) {
{ label: '班级排名', name: 'RankInClass', width: 100, align: "left" },
],
mainId: 'StuNo',
isPage: false,
sidx: '',
isPage: true,
sidx: 'AcademicYearNo desc,Semester desc,Grade desc,MajorNo,ClassNo,StuNo,LessonSortNo,LessonNo',
sord: '',
onRenderComplete: function (data) {
var studyscoreall = 0;


+ 7
- 7
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreRank.js View File

@@ -20,10 +20,10 @@ var bootstrap = function ($, learun) {
p.AcademicYearNo = $('#AcademicYearNo').lrselectGet();
p.Semester = $('#Semester').lrselectGet();
p.StuNo = $.trim($('#StuNo').val());
if (p.StuNo == null || p.StuNo == "") {
learun.alert.warning("请输入学号!");
return;
}
//if (p.StuNo == null || p.StuNo == "") {
// learun.alert.warning("请输入学号!");
// return;
//}

page.initGird();
page.search(p);
@@ -71,7 +71,7 @@ var bootstrap = function ($, learun) {
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGridLei({
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListRank',
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScorePageListByStuInfo',
headData: [
{ label: '学号', name: 'StuNo', width: 100, align: "left" },
{ label: '姓名', name: 'StuName', width: 200, align: "left" },
@@ -91,8 +91,8 @@ var bootstrap = function ($, learun) {
{ label: '系排名', name: 'RankIndept', width: 100, align: "left" },
],
mainId: 'StuNo',
isPage: false,
sidx: '',
isPage: true,
sidx: 'AcademicYearNo desc,Semester desc,Grade desc,MajorNo,ClassNo,StuNo,LessonSortNo,LessonNo',
sord: '',
onRenderComplete: function (data) {
var studyscoreall = 0;


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs View File

@@ -781,6 +781,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <summary>
/// 根据学号/姓名获取学生成绩列表,带分页
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
public IEnumerable<StuScoreEntity> GetScorePageListByStuInfo(Pagination pagination, string queryJson)
{
try
{
return stuScoreService.GetScorePageListByStuInfo(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 根据学号/姓名获取学生成绩列表


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs View File

@@ -191,6 +191,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="queryJson"></param>
/// <returns></returns>
IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson);
/// <summary>
/// 根据学号/姓名获取学生成绩列表,带分页
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
IEnumerable<StuScoreEntity> GetScorePageListByStuInfo(Pagination pagination, string queryJson);

/// <summary>
/// 根据学号/姓名获取学生成绩列表


+ 93
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs View File

@@ -2245,7 +2245,7 @@ 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,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(" select bb.Grade,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(" 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 {tableName} s left join StuInfoBasic sb on s.StuNo=sb.StuNo ");
strSql.Append(" where 1=1 and s.CheckMark='1' ");
@@ -2354,6 +2354,96 @@ 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> GetScorePageListByStuInfo(Pagination pagination, 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.Grade,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(@" ,(select cc.majorrank from
(select StuNo, SUM(Score) as totalscore, ROW_NUMBER() over(order by SUM(Score) desc) as majorrank
from StuScore c where c.CheckMark = '1' and c.LessonSortNo = '1' and c.MajorNo = bb.MajorNo and c.AcademicYearNo = bb.AcademicYearNo and c.Semester = bb.Semester
group by c.StuNo) cc where cc.StuNo = bb.StuNo) as RankInMajor ");
strSql.Append(@" ,(select cc.majorrank from
(select StuNo, SUM(Score) as totalscore, ROW_NUMBER() over(order by SUM(Score) desc) as majorrank
from StuScore c where c.CheckMark = '1' and c.LessonSortNo = '1' and c.ClassNo = bb.ClassNo and c.AcademicYearNo = bb.AcademicYearNo and c.Semester = bb.Semester
group by c.StuNo) cc where cc.StuNo = bb.StuNo) as RankInClass ");
strSql.Append(@" ,(select cc.majorrank from
(select StuNo, SUM(Score) as totalscore, ROW_NUMBER() over(order by SUM(Score) desc) as majorrank
from StuScore c where c.CheckMark = '1' and c.LessonSortNo = '1' and c.DeptNo = bb.DeptNo and c.AcademicYearNo = bb.AcademicYearNo and c.Semester = bb.Semester
group by c.StuNo) cc where cc.StuNo = bb.StuNo) as RankIndept ");
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,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 ");
}
if (!queryParam["LessonNo"].IsEmpty())
{
dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String);
strSql.Append(" and s.LessonNo=@LessonNo ");
}
if (!queryParam["Grade"].IsEmpty())
{
dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String);
strSql.Append(" and sb.Grade=@Grade ");
}
strSql.Append(" group by sb.Grade,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, pagination);
return result;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}


/// <summary>
/// 根据学号/姓名获取学生成绩列表
@@ -2909,13 +2999,13 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
var kclx = queryParam["LessonType"].ToString();
sql = sql + $" and d.LTId='{kclx}' ";
}
var ls = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(sql).GroupBy(x => new { x.ClassNo, x.LessonNo }).Select(x => new StuScoreEntity { ClassNo = x.Key.ClassNo, LessonNo = x.Key.LessonNo, LessonName = x.FirstOrDefault().LessonName, AcademicYearNo = x.FirstOrDefault().AcademicYearNo, Semester = x.FirstOrDefault().Semester, DeptNo = x.FirstOrDefault().DeptNo, Grade = x.FirstOrDefault().Grade, LessonTypeName = x.FirstOrDefault().LessonTypeName, EmpName = x.FirstOrDefault().EmpName, EmpNo = x.FirstOrDefault().EmpNo, ModifyUserId = x.FirstOrDefault().ModifyUserId, ModifyUserName = x.FirstOrDefault().ModifyUserName, LessonTypeId=x.FirstOrDefault().LessonTypeId,ScoreId=x.FirstOrDefault().ScoreId, CheckMark = x.All(a => a.CheckMark == "1") ? "1" : "0" });
var ls = this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(sql).GroupBy(x => new { x.ClassNo, x.LessonNo }).Select(x => new StuScoreEntity { ClassNo = x.Key.ClassNo, LessonNo = x.Key.LessonNo, LessonName = x.FirstOrDefault().LessonName, AcademicYearNo = x.FirstOrDefault().AcademicYearNo, Semester = x.FirstOrDefault().Semester, DeptNo = x.FirstOrDefault().DeptNo, Grade = x.FirstOrDefault().Grade, LessonTypeName = x.FirstOrDefault().LessonTypeName, EmpName = x.FirstOrDefault().EmpName, EmpNo = x.FirstOrDefault().EmpNo, ModifyUserId = x.FirstOrDefault().ModifyUserId, ModifyUserName = x.FirstOrDefault().ModifyUserName, LessonTypeId = x.FirstOrDefault().LessonTypeId, ScoreId = x.FirstOrDefault().ScoreId, CheckMark = x.All(a => a.CheckMark == "1") ? "1" : "0" });


if (!queryParam["Stat"].IsEmpty())
{
var zt = queryParam["Stat"].ToString();
ls=ls.Where(x=>x.CheckMark==zt);
ls = ls.Where(x => x.CheckMark == zt);
}




Loading…
Cancel
Save