From c430d3e48f351f4bab4629a4ac8a52a87920e6c4 Mon Sep 17 00:00:00 2001 From: liangkun Date: Fri, 2 Sep 2022 14:38:57 +0800 Subject: [PATCH] =?UTF-8?q?h5=E9=80=89=E4=BF=AE=E8=AF=BE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...OpenLessonPlanOfElectiveStudentSelected.js | 2 +- .../StuSelectLessonListOfElectiveEntity.cs | 8 ++++++- .../StuSelectLessonListOfElectiveService.cs | 22 ++++++++++++++++--- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js index 4b0780433..2fd1a7e71 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js @@ -92,7 +92,7 @@ text: 'classroomname' })); _$item.append($('

人数上限:

').dataFormatter({ value: _item.StuNumMax })); - _$item.append($('

已报名人数:

').dataFormatter({ value: _item.StuNum })); + _$item.append($('

已报名人数:

').dataFormatter({ value: _item.StuNumOfApply })); var signstatustxt = ""; if (_item.Status == 1) { signstatustxt = '审核中'; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs index c3fb1967d..bf6e3c9d7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs @@ -216,7 +216,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion #region 扩展字段 [NotMapped] public string LessonTypeId { get; set; } - + /// + /// 已报名人数 + /// + [NotMapped] + public int? StuNumOfApply { get; set; } + [NotMapped] + public int? StuNumMax { get; set; } #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs index 9bff6fd34..a5909fc51 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -29,8 +30,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { var strSql = new StringBuilder(); - strSql.Append("SELECT t.*,leif.LessonTypeId "); - strSql.Append(" FROM StuSelectLessonListOfElective t left join LessonInfo leif on t.LessonNo=leif.LessonNo "); + strSql.Append("SELECT t.*,leif.LessonTypeId,b.StuNumMax,b.StuNum "); + strSql.Append(" FROM StuSelectLessonListOfElective t left join LessonInfo leif on t.LessonNo=leif.LessonNo left join OpenLessonPlanOfElective b on t.OLPEId=b.id "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -91,7 +92,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("OLPEId", queryParam["OLPEId"].ToString(), DbType.String); strSql.Append(" AND t.OLPEId = @OLPEId "); } - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + var list= this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + foreach (var item in list) + { + //模式二:正式选课 + var aa = this.BaseRepository("CollegeMIS").FindList(x => x.OLPEId == item.Id); + //已报名人数 + item.StuNumOfApply = aa.Where(x => (x.Status == 1 || x.Status == 2)).Count(); + + //模式一:预选课 + //var aaa = this.BaseRepository("CollegeMIS").FindList(x => x.OLPEId == item.Id); + ////已报名人数 + //item.StuNumOfApplyPre = aaa.Where(x => (x.Status == 1 || x.Status == 2)).Count(); + + } + + return list; } catch (Exception ex) {