Browse Source

全院班级成绩查看增加班级排名和专业排名

娄底高职分支
dao 4 months ago
parent
commit
d5e980b436
9 changed files with 106 additions and 15 deletions
  1. +10
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs
  2. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllScoreQueryIndex.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.cshtml
  4. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.cshtml
  6. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndex.cshtml
  7. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs
  8. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs
  9. +68
    -7
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs

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

@@ -1,4 +1,5 @@
using Hangfire;
using DocumentFormat.OpenXml.Math;
using Hangfire;
using Learun.Application.Base.SystemModule;
using Learun.Application.Organization;
using Learun.Application.TwoDevelopment.EducationalAdministration;
@@ -730,17 +731,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
public ActionResult GetScoreListByClassNo(string queryJson)
{
var data = stuScoreIBLL.GetScoreListByClassNo(queryJson);
var stuData = stuInfoBasicIBLL.GetAllList();
//var stuData = stuInfoBasicIBLL.GetAllList();

var aa = data.GroupBy(x => new { x.StuNo, x.StuName, x.StuId }).Select(x => new
{
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, y.ScoreFormat }).OrderBy(y => y.LessonNo)
}).OrderByDescending(x => x.TotalScore);
var bb=aa.Select(x=>x.StuNo).ToList();
var cc=stuScoreIBLL.GetScoreListByMajor(queryJson).ToList();

var result = new List<Dictionary<string, string>>();
foreach (var item in aa)
@@ -749,8 +753,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
aaa.Add("StuId", item.StuId);
aaa.Add("StuNo", item.StuNo);
aaa.Add("StuName", item.StuName);
aaa.Add("FinishSchoolMark", item.FinishSchoolMark);
//aaa.Add("FinishSchoolMark", item.FinishSchoolMark);
aaa.Add("TotalScore", item.TotalScore.ToString());
aaa.Add("OrderClass", (bb.IndexOf(item.StuNo) + 1).ToString());
aaa.Add("OrderMajor",(cc.IndexOf(item.StuNo)+1).ToString());
foreach (var lessonInfoItem in item.LessonInfo)
{
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat);


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/AllScoreQueryIndex.js View File

@@ -192,6 +192,8 @@ var bootstrap = function ($, learun) {
{ label: '学号', name: 'StuNo', width: 100, align: "left" },
{ label: '姓名', name: 'StuName', width: 100, align: "left" },
{ label: '总分', name: 'TotalScore', width: 100, align: "left" },
{ label: '班级排名', name: 'OrderClass', width: 120, align: "left" },
{ label: '专业排名', name: 'OrderMajor', width: 120, align: "left" },
];
var headDatas = headData.concat(LessonTemp);



+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.cshtml View File

@@ -87,7 +87,7 @@
<div class=" btn-group btn-group-sm" learun-authorize="yes" id="btnBox">
<a id="lr_input" class="btn btn-default"><i class="fa fa-edit">&nbsp;开始录入</i></a>
<a id="lr_save" class="btn btn-default" style="display:none;"><i class="fa fa-edit">&nbsp;提交成绩</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;提交教务处</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;审核成绩</i></a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-lock">&nbsp;去审核成绩</i></a>
<a id="lr_setScale" class="btn btn-default"><i class="fa fa-edit">&nbsp;设置成绩比例</i></a>
</div>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml View File

@@ -89,7 +89,7 @@
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_input" class="btn btn-default"><i class="fa fa-edit">&nbsp;开始录入</i></a>
<a id="lr_save" class="btn btn-default" style="display:none;"><i class="fa fa-edit">&nbsp;提交成绩</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;提交教务处</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;审核成绩</i></a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-lock">&nbsp;去审核成绩</i></a>
<a id="lr_setScale" class="btn btn-default"><i class="fa fa-edit">&nbsp;设置成绩比例</i></a>
<a id="lr_importScore" class="btn btn-default"><i class="fa fa-edit">&nbsp;导入</i></a>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndex.cshtml View File

@@ -87,7 +87,7 @@
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_input" class="btn btn-default"><i class="fa fa-edit">&nbsp;开始录入</i></a>
<a id="lr_save" class="btn btn-default" style="display:none;"><i class="fa fa-edit">&nbsp;提交成绩</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;提交教务处</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;审核成绩</i></a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-lock">&nbsp;去审核成绩</i></a>
</div>
</div>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPassTwo/InputScoreIndex.cshtml View File

@@ -89,7 +89,7 @@
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_input" class="btn btn-default"><i class="fa fa-edit">&nbsp;开始录入</i></a>
<a id="lr_save" class="btn btn-default" style="display:none;"><i class="fa fa-edit">&nbsp;提交成绩</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;提交教务处</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;审核成绩</i></a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-lock">&nbsp;去审核成绩</i></a>
</div>
</div>


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

@@ -1101,5 +1101,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration

}
}

public IEnumerable<string> GetScoreListByMajor(string queryJson)
{
try
{
return stuScoreService.GetScoreListByMajor(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
}
}

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

@@ -176,6 +176,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
IEnumerable<StuScoreEntity> GetScoreListByClassNo(string queryJson);


IEnumerable<string> GetScoreListByMajor(string queryJson);
/// <summary>
/// 获取学生成绩
/// </summary>


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

@@ -1119,7 +1119,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
/// 课程下拉框信息【学生成绩录入可去审核】
/// </summary>
/// <returns></returns>
public IEnumerable<WebHelper.YearGrade> GetLessonNoDataOfAll(string userAccount, string userType,string AcademicYearNo="",string Semester="")
public IEnumerable<WebHelper.YearGrade> GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "")
{
try
{
@@ -1135,7 +1135,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
}
if (!string.IsNullOrEmpty(AcademicYearNo))
{
strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='"+Semester+"' ");
strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' ");
}
var data = this.BaseRepository("CollegeMIS").FindList<WebHelper.YearGrade>(strSql.ToString());
data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value);
@@ -1349,6 +1349,67 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
}
}
}

public IEnumerable<string> GetScoreListByMajor(string queryJson)
{
try
{
//参考写法
var queryParam = queryJson.ToJObject();
if (queryParam["AcademicYearNo"].IsEmpty() || queryParam["Semester"].IsEmpty() || queryParam["ClassNo"].IsEmpty())
{
return new List<string>();
}
var xn = queryParam["AcademicYearNo"].ToString();
var xq = queryParam["Semester"].ToString();
var bj = queryParam["ClassNo"].ToString();
var ssentity = this.BaseRepository("CollegeMIS").FindEntity<StuScoreEntity>(x => x.AcademicYearNo == xn && x.Semester == xq && x.ClassNo == bj);
if(ssentity == null) return new List<string>();

var majorNo = ssentity.MajorNo;
// 虚拟参数
var dp = new DynamicParameters(new { });
var tableName = "StuScore";

var strSql = new StringBuilder();
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' and s.MajorNo='{majorNo}' ");
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 ");
}
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 ");

var lst= this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp);
var gp = lst.GroupBy(x => x.StuNo).Select(x => new { x.Key,TotalScore=x.Sum(a=>a.Score)}).OrderByDescending(x => x.TotalScore);
var rs=gp.Select(x=>x.Key).ToList();
return rs;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取学生的补考信息
/// </summary>
@@ -1682,7 +1743,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity<ClassInfoEntity>(x => x.ClassNo == classno);
if (classInfoEntity != null)
{
this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno+ "' ");
this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno + "' ");
}
}
else
@@ -1792,7 +1853,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
}
}

}
catch (Exception ex)
{
@@ -1897,17 +1958,17 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad
//教师电子成绩单
if (checkMark == 0)//撤销
{
db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassRoomNo='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'");
db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassRoomNo='" + classroomno + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "'");
}
else
{
db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and classroomno='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'");
db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and classroomno='" + classroomno + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "'");
}
}
db.Commit();
}

}
catch (Exception ex)
{


Loading…
Cancel
Save