@@ -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> | |||
/// 学生成绩排名 | |||
@@ -30,6 +30,10 @@ | |||
<div class="lr-form-item-title">系部</div> | |||
<div id="DeptNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">高/中职</div> | |||
<div id="GZ" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo" type="lrselect" class="lr-select"></div> | |||
@@ -17,6 +17,11 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 360, 400); | |||
$('#GZ').lrselect({ | |||
data: [{ text: "高职", value: "G" }, { text: "中职", value: "Z" }], | |||
text: "text", | |||
value: "value" | |||
}) | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -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; | |||
@@ -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; | |||
@@ -36,7 +36,7 @@ | |||
<div class="lr-form-item-title">电子邮箱</div> | |||
<input id="F_Email" type="text" class="form-control" isvalid="yes" checkexpession="EmailOrNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">照片</div> | |||
<div id="F_Photo"></div> | |||
</div> | |||
@@ -2274,15 +2274,26 @@ group by AcademicYearNo,Semester,DeptNo,MajorNo,LessonNo,TeachClassNo,EmpNo,Les | |||
var status = (queryParam["status"] == null ? "0" : queryParam["status"].ToString()).ToInt(); | |||
string starttime = queryParam["StartTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["StartTime"].ToString(); | |||
string endtime = queryParam["EndTime"].IsEmpty() ? DateTime.Now.Date.ToString() : queryParam["EndTime"].ToString(); | |||
var notimeSql = string.Empty; | |||
var notimeSql2 = string.Empty; | |||
if (!queryParam["noTime"].IsEmpty()) | |||
{ | |||
foreach (var item in queryParam["noTime"].ToString().Split('&')) | |||
{ | |||
notimeSql += $" and lessondate not between '{item.Split(',')[0]}' and '{item.Split(',')[1]}'"; | |||
notimeSql2 += $" and clocktime not between '{item.Split(',')[0]}' and '{item.Split(',')[1]}'"; | |||
} | |||
} | |||
strSql.Append("select a.*,b.jobrank as zhiwu,b.ProfessionalTitle as zhicheng,b.F_DepartmentId as dept,b.feestandard,b.Weekcourses,ta.actcourses as monthactcourses,ta.actcourses-(" + weeks + "*b.Weekcourses) as zhesuan_monthactcourses, "); | |||
strSql.Append(" case when ta.actcourses is null then 0 when b.jobrank in(5,6) then (ta.actcourses-" + weeks + "*b.Weekcourses)*b.feestandard "); | |||
strSql.Append(" when b.jobrank in(1,2,3,4) then (case when ta.actcourses<=(" + weeks + "*b.weekcourses)/2 then ta.actcourses*b.feestandard else " + weeks + "*b.weekcourses*b.feestandard/2 end) "); | |||
strSql.Append(" else 0 end as actfeestandard "); | |||
strSql.Append("from "); | |||
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' group by a.empno,a.empname ) a "); | |||
strSql.Append("left join (select count(*) as actcourses,EmpNo from (select ff.EmpNo,ff.LessonDate,ff.LessonTime from (select aall.* from (select EmpNo,ALTId from Teach_attendance where LessonSortNo='1' and clocktime between '" + starttime + "' and '" + endtime + "' group by EmpNo,ALTId) ee left join ArrangeLessonTerm aall on aall.ALTId=ee.ALTId) ff group by ff.EmpNo,ff.LessonDate,ff.LessonTime) gg group by gg.EmpNo ) ta on ta.empno=a.empno "); | |||
strSql.Append("(select count(*) as courses,a.empno,a.empname from ArrangeLessonTerm a where lessondate between '" + starttime + "' and '" + endtime + "' " + notimeSql + " group by a.empno,a.empname ) a "); | |||
strSql.Append("left join (select count(*) as actcourses,EmpNo from (select ff.EmpNo,ff.LessonDate,ff.LessonTime from (select aall.* from (select EmpNo,ALTId from Teach_attendance where LessonSortNo='1' and clocktime between '" + starttime + "' and '" + endtime + "' " + notimeSql2 + " group by EmpNo,ALTId) ee left join ArrangeLessonTerm aall on aall.ALTId=ee.ALTId) ff group by ff.EmpNo,ff.LessonDate,ff.LessonTime) gg group by gg.EmpNo ) ta on ta.empno=a.empno "); | |||
strSql.Append("left join empinfo b on a.empno=b.empno "); | |||
strSql.Append("where a.empno is not null and (b.IsInActiveStatus="+status+" or (0="+status+ " and b.IsInActiveStatus!=2)) "); | |||
strSql.Append("where a.empno is not null and (b.IsInActiveStatus=" + status + " or (0=" + status + " and b.IsInActiveStatus!=2)) "); | |||
if (!string.IsNullOrEmpty(deptNo)) | |||
{ | |||
strSql.Append("and b.F_DepartmentId='" + deptNo + "' "); | |||
@@ -95,6 +95,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.LessonName Like @LessonName "); | |||
} | |||
if (!queryParam["GZ"].IsEmpty()) | |||
{ | |||
dp.Add("GZ", queryParam["GZ"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.MajorNo Like @GZ "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -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> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
@@ -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> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
@@ -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); | |||
} | |||