Browse Source

h5选修课修正

新疆影视学院高职
liangkun 2 years ago
parent
commit
c430d3e48f
3 changed files with 27 additions and 5 deletions
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js
  2. +7
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs
  3. +19
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Mobile/www/pages/EducationalAdministration/OpenLessonPlanOfElectiveStudentSelected/OpenLessonPlanOfElectiveStudentSelected.js View File

@@ -92,7 +92,7 @@
text: 'classroomname'
}));
_$item.append($('<p class="lr-ellipsis"><span>人数上限:</span></p>').dataFormatter({ value: _item.StuNumMax }));
_$item.append($('<p class="lr-ellipsis"><span>已报名人数:</span></p>').dataFormatter({ value: _item.StuNum }));
_$item.append($('<p class="lr-ellipsis"><span>已报名人数:</span></p>').dataFormatter({ value: _item.StuNumOfApply }));
var signstatustxt = "";
if (_item.Status == 1) {
signstatustxt = '<span class="circle bgcyellow">审核中</span>';


+ 7
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs View File

@@ -216,7 +216,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion
#region 扩展字段
[NotMapped] public string LessonTypeId { get; set; }

/// <summary>
/// 已报名人数
/// </summary>
[NotMapped]
public int? StuNumOfApply { get; set; }
[NotMapped]
public int? StuNumMax { get; set; }
#endregion
}
}


+ 19
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs View File

@@ -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<StuSelectLessonListOfElectiveEntity>(strSql.ToString(), dp, pagination);
var list= this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectiveEntity>(strSql.ToString(), dp, pagination);
foreach (var item in list)
{
//模式二:正式选课
var aa = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectiveEntity>(x => x.OLPEId == item.Id);
//已报名人数
item.StuNumOfApply = aa.Where(x => (x.Status == 1 || x.Status == 2)).Count();

//模式一:预选课
//var aaa = this.BaseRepository("CollegeMIS").FindList<StuSelectLessonListOfElectivePreEntity>(x => x.OLPEId == item.Id);
////已报名人数
//item.StuNumOfApplyPre = aaa.Where(x => (x.Status == 1 || x.Status == 2)).Count();

}

return list;
}
catch (Exception ex)
{


Loading…
Cancel
Save