@@ -183,6 +183,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 全院学生成绩查看页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult AllStuScoreQueryIndex() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -715,6 +724,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success(result); | |||
} | |||
/// <summary> | |||
/// 全院学生成绩查看 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetScoreListByStuNo2(string queryJson) | |||
{ | |||
var data = stuScoreIBLL.GetScoreListByStuNo(queryJson); | |||
if (data.Any()) | |||
{ | |||
data = data.OrderByDescending(x => x.AcademicYearNo).ThenByDescending(x => x.Semester).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); | |||
@@ -34,6 +34,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult QueryStuSelectResultForTeacher() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 教务-审核表单页 | |||
/// <summary> | |||
@@ -0,0 +1,36 @@ | |||
@{ 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> | |||
<div class="lr-layout-tool-right"> | |||
<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/AllStuScoreQueryIndex.js") | |||
<script src="~/Content/static/js/LodopFuncs.js"></script> |
@@ -0,0 +1,83 @@ | |||
/* * 版 本 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(); | |||
}); | |||
}, | |||
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/GetScoreListByStuNo2', | |||
headData: [ | |||
{ label: '学号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '姓名', name: 'StuName', width: 200, 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: 300, align: "left" }, | |||
{ label: '总分', name: 'ScoreFormat', width: 100, align: "left" }, | |||
], | |||
mainId: 'StuNo', | |||
isPage: false, | |||
sidx: '', | |||
sord: '', | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,59 @@ | |||
@{ | |||
ViewBag.Title = "选修课课程"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<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="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester" class="form-control"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">校区</div> | |||
<div id="F_SchoolId"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">系部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级</div> | |||
<div id="ClassNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">选课状态</div> | |||
<div id="ElectiveSelectStatus"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">报名状态</div> | |||
<div id="ElectiveSignUpStatus"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<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/StuSelectLessonListOfElective/QueryStuSelectResultForTeacher.js") |
@@ -0,0 +1,218 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2019-05-15 10:33 | |||
* 描 述:选修课课程 | |||
*/ | |||
var weekChina = ["一", "二", "三", "四", "五", "六", "日"]; | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
if ($("#AcademicYearNo").lrselectGet() == "" || $("#AcademicYearNo").lrselectGet() == null || $("#AcademicYearNo").lrselectGet() == undefined) { | |||
top.learun.alert.warning("请先选择学年!"); | |||
return false; | |||
} | |||
if ($("#Semester").lrselectGet() == "" || $("#Semester").lrselectGet() == null || $("#Semester").lrselectGet() == undefined) { | |||
top.learun.alert.warning("请先选择学期!"); | |||
return; | |||
} | |||
page.search(queryJson); | |||
}, 300, 400); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "请选择学年", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "请选择学期", | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#ElectiveSelectStatus').lrDataItemSelect({ code: 'ElectiveSelectStatus' }); | |||
$('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); | |||
$('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); | |||
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); | |||
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); | |||
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/GetQueryStuSelectResultList', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 60, align: "left" }, | |||
{ | |||
label: "校区", name: "F_SchoolId", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', | |||
key: value, | |||
keyId: 'f_companyid', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "系所", name: "DeptNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "学号", name: "StuNo", width: 100, align: "left" }, | |||
{ label: "姓名", name: "StuName", width: 100, align: "left" }, | |||
{ | |||
label: "性别", name: "GenderNo", width: 80, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "男" : "女"; | |||
} | |||
}, | |||
{ | |||
label: "选课状态", name: "Id", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == null || cellvalue == undefined || cellvalue == "") { | |||
return '<span class=\"label label-default\">未报名</span>'; | |||
} else { | |||
return '<span class=\"label label-success\">已报名</span>'; | |||
} | |||
} | |||
}, | |||
{ | |||
label: "报名状态", name: "Status", width: 100, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == 1) { | |||
return '<span class=\"label label-primary\">审核中</span>'; | |||
} else if (cellvalue == 2) { | |||
return '<span class=\"label label-success\">报名成功</span>'; | |||
} else if (cellvalue == 3) { | |||
return '<span class=\"label label-warning\">报名失败</span>'; | |||
} else { | |||
return '<span class=\"label label-default\">未报名</span>'; | |||
} | |||
} | |||
}, | |||
{ label: "所选课程号", name: "LessonNo", width: 100, align: "left" }, | |||
{ | |||
label: "所选课程名称", name: "LessonName", width: 150, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', | |||
key: row.LessonNo, | |||
keyId: 'lessonno', | |||
callback: function (_data) { | |||
callback(_data['lessonname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "课程学分", name: "StudyScore", width: 100, align: "left" }, | |||
{ label: "教师编号", name: "EmpNo", width: 100, align: "left" }, | |||
{ | |||
label: "教师姓名", name: "EmpName", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: row.EmpNo, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "上课节次", name: "LessonSection", width: 150, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue != "" && cellvalue != undefined && cellvalue != null) { | |||
if (cellvalue.indexOf(',') == -1) { | |||
return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节"; | |||
} else { | |||
return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节"; | |||
} | |||
} | |||
} | |||
}, | |||
{ label: "上课时间", name: "LessonTime", width: 180, align: "left" }, | |||
{ | |||
label: "教室名称", name: "ClassRoomName", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', | |||
key: row.ClassRoomNo, | |||
keyId: 'classroomno', | |||
callback: function (_data) { | |||
callback(_data['classroomname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'StuId', | |||
isPage: true, | |||
sidx: 'StuNo', | |||
sord: 'asc' | |||
}); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.EmpNo = learun.clientdata.get(['userinfo']).enCode; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -1050,6 +1050,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\InputScoreIndexInTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\InputScoreIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\Monitor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\AllStuScoreQueryIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreQueryIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\InputScoreIndexOfElectiveInTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\InputScoreIndexOfElective.js" /> | |||
@@ -1057,6 +1058,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\GraduateScoreQueryAllIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\ScoreQueryAllIndexTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\ScoreQueryAllIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuSelectLessonListOfElective\QueryStuSelectResultForTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_DefaultPwdConfig\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_ReceiveDocument\FormView.js" /> | |||
@@ -7677,6 +7679,8 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\FormReturn.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\Index.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\DormitoryReturn\IndexReport.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\AllStuScoreQueryIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuSelectLessonListOfElective\QueryStuSelectResultForTeacher.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -212,6 +212,7 @@ | |||
<Compile Include="Modules\ListenClassRecordApi.cs" /> | |||
<Compile Include="Modules\MpManagementApi.cs" /> | |||
<Compile Include="Modules\PersonnelManagement\EpidemicSituationCopyApi.cs" /> | |||
<Compile Include="Modules\StuScoreApi.cs" /> | |||
<Compile Include="Modules\StuInfoBasicApi.cs" /> | |||
<Compile Include="Modules\StatisticsApi.cs" /> | |||
<Compile Include="Modules\TaiGang\TUserApi.cs" /> | |||
@@ -0,0 +1,112 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Web; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Util; | |||
using Nancy; | |||
using Newtonsoft.Json; | |||
namespace Learun.Application.WebApi.Modules | |||
{ | |||
public class StuScoreApi : BaseNoLoginApi | |||
{ | |||
public StuScoreApi() | |||
: base("/Learun/adms/EducationalAdministration/StuScore") | |||
{ | |||
Get["/scoreListByStuInfo"] = GetScoreListByStuInfo; | |||
} | |||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||
private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); | |||
private CdMajorIBLL cdMajorIBLL = new CdMajorBLL(); | |||
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||
/// <summary> | |||
/// 获取成绩列表 | |||
/// </summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
private Response GetScoreListByStuInfo(dynamic _) | |||
{ | |||
var param = this.GetReq<Model>(); | |||
ScoreListByStuInfo result = new ScoreListByStuInfo(); | |||
var stuInfoBasicEntity = stuInfoBasicIBLL.GetStuInfoBasicEntityByStuNo(param.StuNo); | |||
if (stuInfoBasicEntity != null) | |||
{ | |||
result.StuNo = stuInfoBasicEntity.StuNo; | |||
result.StuName = stuInfoBasicEntity.StuName; | |||
result.MajorNo = stuInfoBasicEntity.MajorNo; | |||
result.ClassNo = stuInfoBasicEntity.ClassNo; | |||
if (!string.IsNullOrEmpty(stuInfoBasicEntity.MajorNo)) | |||
{ | |||
result.MajorName = cdMajorIBLL.GetCdMajorEntityByMajorNo(stuInfoBasicEntity.MajorNo)?.MajorName; | |||
} | |||
if (!string.IsNullOrEmpty(stuInfoBasicEntity.ClassNo)) | |||
{ | |||
result.ClassName = classInfoIBLL.GetClassInfoEntityByClassNo(stuInfoBasicEntity.ClassNo)?.ClassName; | |||
} | |||
} | |||
var queryJson = JsonConvert.SerializeObject(param); | |||
var data = stuScoreIBLL.GetScoreListByStuInfo(queryJson); | |||
var dataTemp = data.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new ScoreList() | |||
{ | |||
AcademicYearNo = x.Key.AcademicYearNo, | |||
Semester = x.Key.Semester, | |||
StuScoreEntityList = x.Select(y => new StuScoreEntity() | |||
{ | |||
AcademicYearNo = y.AcademicYearNo, | |||
Semester = y.Semester, | |||
LessonSortNo = y.LessonSortNo, | |||
LessonSortName = y.LessonSortName, | |||
LessonNo = y.LessonNo, | |||
LessonName = y.LessonName, | |||
StudyScore = y.StudyScore, | |||
Score = y.Score, | |||
ScoreOfNotPass = y.ScoreOfNotPass, | |||
ScoreOfNotPassTwo = y.ScoreOfNotPassTwo | |||
}).OrderBy(a=>a.LessonSortNo).ThenBy(a=>a.LessonNo).ToList() | |||
}).ToList().OrderByDescending(x=>x.AcademicYearNo).ThenByDescending(x=>x.Semester); | |||
result.ScoreList = dataTemp.ToList(); | |||
return Success(result); | |||
} | |||
public class Model | |||
{ | |||
/// <summary> | |||
/// 学年(18-19) | |||
/// </summary> | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// 学期(1) | |||
/// </summary> | |||
public string Semester { get; set; } | |||
/// <summary> | |||
/// 学号 | |||
/// </summary> | |||
public string StuNo { get; set; } | |||
} | |||
public class ScoreListByStuInfo { | |||
public string StuNo { get; set; } | |||
public string StuName { get; set; } | |||
public string MajorNo { get; set; } | |||
public string MajorName { get; set; } | |||
public string ClassNo { get; set; } | |||
public string ClassName { get; set; } | |||
public List<ScoreList> ScoreList { get; set; } | |||
} | |||
public class ScoreList { | |||
public string AcademicYearNo { get; set; } | |||
public string Semester { get; set; } | |||
public List<StuScoreEntity> StuScoreEntityList { get; set; } | |||
} | |||
} | |||
} |
@@ -13,7 +13,7 @@ using Nancy; | |||
namespace Learun.Application.WebApi.Modules | |||
{ | |||
public class TimeTable : BaseApi | |||
public class TimeTable : BaseNoLoginApi | |||
{ | |||
public TimeTable() | |||
: base("/learun/adms/timetable") | |||
@@ -21,6 +21,7 @@ namespace Learun.Application.WebApi.Modules | |||
Get["/list"] = GetList; | |||
Get["/StuList"] = GetStuInfo; | |||
Get["/StuLessonInfo"] = GetStuLessonInfo; | |||
Get["/timeTableData"] = GetTimeTableData; | |||
} | |||
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | |||
private ArrangeLessonTermOfElectiveIBLL arrangeLessonTermOfElectiveIBLL = new ArrangeLessonTermOfElectiveBLL(); | |||
@@ -111,6 +112,68 @@ namespace Learun.Application.WebApi.Modules | |||
} | |||
/// <summary> | |||
/// 全院课程表【按班级分组】 | |||
/// </summary> | |||
/// <param name="_"></param> | |||
/// <returns></returns> | |||
private Response GetTimeTableData(dynamic _) | |||
{ | |||
var param = this.GetReq<TimeParameter>(); | |||
TimeTableData result = new TimeTableData(); | |||
//开始时间 | |||
var startdate = string.IsNullOrEmpty(param.StartDate) ? DateTime.Today : Convert.ToDateTime(param.StartDate); | |||
var startDate = Common.CalculateFirstDateOfWeek(startdate).ToString("yyyy-MM-dd"); | |||
var endDate = Common.CalculateLastDateOfWeek(startdate).ToString("yyyy-MM-dd"); | |||
result.StartDate = startDate; | |||
result.EndDate = endDate; | |||
var semesterAndYear = Common.GetSemesterAndYear(startDate); | |||
result.AcademicYearNo = semesterAndYear.AcademicYearLong; | |||
result.Semester = semesterAndYear.Semester; | |||
//课程表数据 | |||
var timeTableList = new List<Learun.Application.TwoDevelopment.EducationalAdministration.TimeTable>(); | |||
//必修课课程表 | |||
var data = arrangeLessonTermIBLL.GetTimeTableInEducation(startDate, endDate, param.ClassNo, param.EmpNo, ""); | |||
timeTableList.AddRange(data); | |||
//选修课课程表 | |||
var dataOfElective = arrangeLessonTermOfElectiveIBLL.GetTimeTableInEducation(startDate, endDate, param.ClassNo, param.EmpNo, ""); | |||
timeTableList.AddRange(dataOfElective); | |||
var dataTemp = timeTableList.GroupBy(x => new { x.TeachClassNo, x.ClassName, x.LessonSortNo }).Select(x => new ClassDataList() | |||
{ | |||
ClassNo = x.Key.TeachClassNo, | |||
ClassName = x.Key.ClassName, | |||
LessonSortNo = x.Key.LessonSortNo, | |||
TimeTableList = x.Select(y => new TwoDevelopment.EducationalAdministration.TimeTable() | |||
{ | |||
AcademicYear = y.AcademicYear, | |||
Semester = y.Semester, | |||
DeptNo = y.DeptNo, | |||
MajorNo = y.MajorNo, | |||
F_SchoolId = y.F_SchoolId, | |||
LessonNo = y.LessonNo, | |||
LessonName = y.LessonName, | |||
LessonDate = y.LessonDate, | |||
LessonTime = y.LessonTime, | |||
EmpNo = y.EmpNo, | |||
EmpName = y.EmpName, | |||
TeachClassNo = y.TeachClassNo, | |||
ClassName = y.ClassName, | |||
ClassRoomNo = y.ClassRoomNo, | |||
ClassroomName = y.ClassroomName, | |||
LessonSortNo = y.LessonSortNo | |||
}).OrderBy(a => a.LessonTime.Substring(0, 1)).ThenBy(a => a.LessonTime.Substring(1)).ToList() | |||
}).OrderBy(x => x.LessonSortNo).ThenBy(x => x.ClassNo).ToList(); | |||
result.ClassDataList = dataTemp; | |||
return Success(result); | |||
} | |||
/// <summary> | |||
/// 数字转中文 | |||
@@ -166,6 +229,30 @@ namespace Learun.Application.WebApi.Modules | |||
{ | |||
public string StartDate { get; set; } | |||
public string EndDate { get; set; } | |||
/// <summary> | |||
/// 班级编号 | |||
/// </summary> | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// 教师编号 | |||
/// </summary> | |||
public string EmpNo { get; set; } | |||
} | |||
public class TimeTableData | |||
{ | |||
public string AcademicYearNo { get; set; } | |||
public string Semester { get; set; } | |||
public string StartDate { get; set; } | |||
public string EndDate { get; set; } | |||
public List<ClassDataList> ClassDataList { get; set; } | |||
} | |||
public class ClassDataList | |||
{ | |||
public string ClassNo { get; set; } | |||
public string ClassName { get; set; } | |||
public string LessonSortNo { get; set; } | |||
public List<TwoDevelopment.EducationalAdministration.TimeTable> TimeTableList { get; set; } | |||
} | |||
} |
@@ -677,6 +677,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuScoreService.GetScoreListByStuInfo(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public List<object> GetStuGraduateInfo(string queryJson) | |||
{ | |||
try | |||
@@ -388,11 +388,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// 成绩格式化(补)(重) | |||
/// 成绩格式化(补)(重)(选修) | |||
/// </summary> | |||
[NotMapped] | |||
public string ScoreFormat { get; set; } | |||
/// <summary> | |||
/// 补考成绩 | |||
/// </summary> | |||
[NotMapped] | |||
public string ScoreOfNotPass { get; set; } | |||
/// <summary> | |||
/// 二次补考成绩 | |||
/// </summary> | |||
[NotMapped] | |||
public string ScoreOfNotPassTwo { get; set; } | |||
/// <summary> | |||
/// 课程类别名称 | |||
/// </summary> | |||
/// <returns></returns> | |||
[NotMapped] | |||
public string LessonSortName { get; set; } | |||
} | |||
} | |||
@@ -182,6 +182,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListByStuNo(string queryJson); | |||
/// <summary> | |||
/// 根据学号/姓名获取学生成绩列表 | |||
/// </summary> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreEntity> GetScoreListByStuInfo(string queryJson); | |||
/// <summary> | |||
/// 获取个人成绩列表 | |||
@@ -1839,7 +1839,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad | |||
var strSql = new StringBuilder(); | |||
strSql.Append(" select bb.AcademicYearNo,bb.Semester,bb.LessonSortNo,bb.LessonNo,bb.LessonName,bb.StuNo,bb.StuName "); | |||
strSql.Append(" ,case when bb.LessonSortNo='2' then bb.Score else (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) end as Score "); | |||
strSql.Append(" ,case when bb.LessonSortNo='2' then convert(nvarchar(50),bb.Score) else (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) end as ScoreFormat "); | |||
strSql.Append(" ,case when bb.LessonSortNo='2' then convert(nvarchar(50),bb.Score)+'(选修)' else (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) end as ScoreFormat "); | |||
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(" where 1=1 and s.CheckMark='1' "); | |||
@@ -1876,5 +1876,72 @@ 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> GetScoreListByStuInfo(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,li.StudyScore,ls.LessonSortName,bb.Score,sp.Score as ScoreOfNotPass,spt.Score as ScoreOfNotPassTwo "); | |||
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(" 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 ) 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' "); | |||
return this.BaseRepository("CollegeMIS").FindList<StuScoreEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |