diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 7a2499caa..079358e44 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -79,6 +79,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } /// + /// 个人成绩查看 + /// + /// + [HttpGet] + public ActionResult StuScoreQueryIndex() + { + var logininfo = LoginUserInfo.Get(); + ViewBag.StuNo = logininfo.account; + return View(); + } + /// /// 毕业证资格审核(班主任) /// /// @@ -597,6 +608,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(data); } + /// + /// 根据StuNo查询班级课程 + /// + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataFromStuNo(string academicYearNo, string semester, string StuNo) + { + var data = stuScoreIBLL.GetLessonNoDataFromStuNo(academicYearNo, semester, StuNo).OrderBy(x => x.value); + + return Success(data); + } + /// /// 获取班级成绩列表 /// @@ -638,6 +665,43 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(result); } + [HttpGet] + [AjaxOnly] + public ActionResult GetScoreListByStuNo(string queryJson) + { + var data = stuScoreIBLL.GetScoreListByStuNo(queryJson); + 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, + TotalScore = x.Where(m=>m.LessonSortNo=="1").Select(y => y.Score).Sum(), + LessonInfo = x.Select(y => new { y.LessonNo, y.LessonName, y.Score }).OrderBy(y => y.LessonNo) + }).OrderByDescending(x => x.TotalScore); + + var result = new List>(); + foreach (var item in aa) + { + var aaa = new Dictionary(); + aaa.Add("StuId", item.StuId); + aaa.Add("StuNo", item.StuNo); + aaa.Add("StuName", item.StuName); + aaa.Add("FinishSchoolMark", item.FinishSchoolMark); + aaa.Add("TotalScore", item.TotalScore.ToString()); + foreach (var lessonInfoItem in item.LessonInfo) + { + aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.Score.ToString()); + } + + result.Add(aaa); + } + + return Success(result); + } + public ActionResult GetScoreCharts(string AcademicYearNo, string Semester, string ClassNo, string LessonNo) { var data = stuScoreIBLL.GetScoreCharts(AcademicYearNo, Semester, ClassNo, LessonNo); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.cshtml new file mode 100644 index 000000000..e546cdf54 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.cshtml @@ -0,0 +1,202 @@ +@{ ViewBag.Title = "个人成绩查看"; Layout = "~/Views/Shared/_Index.cshtml"; } + + +
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.js") + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.js new file mode 100644 index 000000000..9a228a46e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/StuScoreQueryIndex.js @@ -0,0 +1,104 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-14 11:02 + * 描 述:个人成绩查看 + */ +var selectedRow; +var refreshGirdData; +//课程列 +var LessonTemp = []; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + //page.initGird(); + page.bind(); + page.bindSelect(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var p = {}; + p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + p.Semester = $('#Semester').lrselectGet(); + p.StuNo = StuNo; + if (p.AcademicYearNo == null || p.AcademicYearNo == "") { + learun.alert.warning("请选择学年!"); + return; + } + if (p.Semester == null || p.Semester == "") { + learun.alert.warning("请选择学期!"); + return; + } + $.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataFromStuNo', p, + function (data) { + var temparr = []; + for (var i = 0; i < data.length; i++) { + var item = {}; + item.label = data[i].text; + item.name = data[i].value; + item.width = 150; + item.align = "left"; + temparr.push(item); + } + LessonTemp = temparr; + + 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 () { + var headData = [ + { label: '学号', name: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { label: '总分', name: 'TotalScore', width: 100, align: "left" }, + ]; + var headDatas = headData.concat(LessonTemp); + + $("#gridtable")[0].dfop = undefined; + $('#gridtable').lrAuthorizeJfGridLei({ + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetScoreListByStuNo', + headData: headDatas, + mainId: 'StuNo', + isPage: false, + sidx: 'TotalScore', + sord: 'desc' + }); + + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 3af8213ac..5ddbcdbe1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -960,6 +960,7 @@ + @@ -6794,6 +6795,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs index ce39ac260..9fc249220 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs @@ -657,6 +657,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public IEnumerable GetScoreListByStuNo(string queryJson) + { + try + { + return stuScoreService.GetScoreListByStuNo(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public List GetStuGraduateInfo(string queryJson) { try @@ -985,7 +1005,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - + public IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) + { + try + { + return stuScoreService.GetLessonNoDataFromStuNo(academicYearNo, semester, stuNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs index 0d8f1dba3..1943c15b9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs @@ -176,6 +176,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// IEnumerable GetScoreListByClassNo(string queryJson); + /// + /// 获取学生成绩 + /// + /// + /// + IEnumerable GetScoreListByStuNo(string queryJson); /// /// 获取个人成绩列表 @@ -238,5 +244,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void DoCheckScore(string queryJson, int checkMark); #endregion + + IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index 838b73f1f..b40cb0234 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -707,8 +707,11 @@ where AcademicYearNo='" + strAcademicYear + "' and Semester='" + strSemester + " //获取已审核成绩列表 var stuScoreList = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academic && x.Semester == semester && x.StuNo == stuNo && x.CheckMark == "1"); + foreach (var scoreEntity in stuScoreList) + { + scoreEntity.LessonName = scoreEntity.LessonName + (!string.IsNullOrEmpty(scoreEntity.LessonSortNo)&&scoreEntity.LessonSortNo == "2"?"(选修)":""); + } result.ScoreList = stuScoreList.ToList(); - //获取排名、综合成绩 var aa = this.BaseRepository("CollegeMIS").FindList(x => x.AcademicYearNo == academic && x.Semester == semester && x.ClassNo == classNo && x.CheckMark == "1" && x.LessonSortNo == "1"); var aaa = aa.GroupBy(x => x.StuNo).Select(x => new @@ -1753,5 +1756,83 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad } #endregion + + /// + /// 学生成绩查看含选修 + /// + /// + /// + /// + /// + public IEnumerable GetLessonNoDataFromStuNo(string academicYearNo, string semester, string stuNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,s.LessonName+(case s.LessonSortNo when '2' then '(选修)' else '' end) as text from stuscore s "); + strSql.Append(" where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.StuNo='" + stuNo + "' "); + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetScoreListByStuNo(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 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 "); + } + strSql.Append(" group by s.LessonSortNo,s.LessonNo,s.LessonName,s.StuNo,sb.StuName "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.DataSync/MainService.cs b/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.DataSync/MainService.cs index 3754233d6..c8580ab01 100644 --- a/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.DataSync/MainService.cs +++ b/Learun.Framework.Ultimate V7/Quanjiang.DigitalScholl.DataSync/MainService.cs @@ -255,37 +255,6 @@ namespace Quanjiang.DigitalScholl.DataSync } } } - - if (ciItemCollection.Contains("导入导出")) - { - var sourceinter = sourcedb.FindList(); - var targetinter = targetdb.FindList(); - foreach (var tItemEntity in sourceinter) - { - if (!targetinter.Any(m => m.F_Id == tItemEntity.F_Id)) - { - targetdb.Insert(tItemEntity); - } - } - var sourceinter1 = sourcedb.FindList(); - var targetinter1 = targetdb.FindList(); - foreach (var tItemEntity in sourceinter1) - { - if (!targetinter1.Any(m => m.F_Id == tItemEntity.F_Id)) - { - targetdb.Insert(tItemEntity); - } - } - var sourceinter2 = sourcedb.FindList(); - var targetinter2 = targetdb.FindList(); - foreach (var tItemEntity in sourceinter2) - { - if (!targetinter2.Any(m => m.F_Id == tItemEntity.F_Id)) - { - targetdb.Insert(tItemEntity); - } - } - } if (ciItemCollection.Contains("桌面主题")) { //主题色块 @@ -321,6 +290,39 @@ namespace Quanjiang.DigitalScholl.DataSync } } } + if (ciItemCollection.Contains("导入导出")) + { + var sourceinter = sourcedb.FindList(); + var targetinter = targetdb.FindList(); + foreach (var tItemEntity in sourceinter) + { + if (!targetinter.Any(m => m.F_Id == tItemEntity.F_Id)) + { + targetdb.Insert(tItemEntity); + } + } + var sourceinter1 = sourcedb.FindList(); + var targetinter1 = targetdb.FindList(); + foreach (var tItemEntity in sourceinter1) + { + if (!targetinter1.Any(m => m.F_Id == tItemEntity.F_Id)) + { + targetdb.Insert(tItemEntity); + } + var sourceinter2 = sourcedb.FindList(m => m.F_ImportId == tItemEntity.F_Id); + var targetinter2 = targetdb.FindList(m => m.F_ImportId == tItemEntity.F_Id); + if (targetinter2 != null) + { + foreach (var sourcEntity in sourceinter2) + { + if (!targetinter2.Any(m => m.F_Id == sourcEntity.F_Id || m.F_ColName == sourcEntity.F_ColName)) + { + targetdb.Insert(sourcEntity); + } + } + } + } + } targetdb.Commit(); return true; }