Browse Source

Merge branch '西昌分支' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 西昌分支

新疆影视学院高职
ndbs 3 years ago
parent
commit
3e2de82c91
11 changed files with 558 additions and 5 deletions
  1. +43
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs
  2. +5
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/Index.js
  3. +51
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.cshtml
  4. +132
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.js
  5. +39
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.cshtml
  6. +119
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js
  7. +8
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  8. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs
  9. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs
  10. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs
  11. +116
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs

+ 43
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ArrangeExamTermNewController.cs View File

@@ -30,10 +30,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return View();
}
[HttpGet]
public ActionResult IndexForLesson()
{
return View();
}
[HttpGet]
public ActionResult IndexItem()
{
return View();
}

[HttpGet]
public ActionResult IndexForClass()
{
return View();
}
[HttpGet]
public ActionResult SyncByConditionForm()
{
@@ -86,6 +97,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetPageListForLesson(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = arrangeExamTermNewIBLL.GetPageListForLesson(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetItemPageList(string pagination, string queryJson)
@@ -101,6 +128,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetPageListForClass(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = arrangeExamTermNewIBLL.GetPageListForClass(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>


+ 5
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/Index.js View File

@@ -90,7 +90,11 @@ var bootstrap = function ($, learun) {
headData: [
{ label: '学年', name: 'AcademicYearNo', width: 80, align: "left" },
{ label: '学期', name: 'Semester', width: 80, align: "left" },
{ label: '考试日期', name: 'ExamDate', width: 100, align: "left" },
{
label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) {
return learun.formatDate(v, "yyyy-MM-dd");
}
},
{ label: '考试时间', name: 'ExamTime', width: 100, align: "left" },
//{ label: '班级编号', name: 'ClassNo', width: 200, align: "left" },
//{ label: '班级名称', name: 'ClassName', width: 200, align: "left" },


+ 51
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.cshtml View File

@@ -0,0 +1,51 @@
@{
ViewBag.Title = "排考2021新";
Layout = "~/Views/Shared/_Index.cshtml";
}
<div class="lr-layout lr-layout-left-center">
<div class="lr-layout-left">
<div class="lr-layout-wrap">
<div class="lr-layout-title lrlt ">班级信息</div>
<div id="dataTree" class="lr-layout-body"></div>
</div>
</div>
<div class="lr-layout-center">
<div class="lr-layout-wrap">
<div class="lr-layout-title">
<span id="titleinfo" class="lrlt">班级信息</span>
</div>
<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 lr-selectLittle" style="width: 80px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="Semester" type="lrselect" class="lr-select lr-selectLittle" style="width: 80px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="LessonNo" type="lrselect" class="lr-select" style="width: 200px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="ClassRoomNo" type="lrselect" class="lr-select" style="width: 200px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="EmpNo" type="lrselect" class="lr-select" style="width: 200px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="datesearch" class="datetime"></div>
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</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/ArrangeExamTermNew/IndexForClass.js")

+ 132
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForClass.js View File

@@ -0,0 +1,132 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-12-08 12:19
* 描 述:排考2021新
*/
var selectedRow;
var refreshGirdData;

var bootstrap = function ($, learun) {
"use strict";
var datebegin = '';
var dateend = '';
var ClassNo = '';
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
// 初始化左侧树形数据
$('#dataTree').lrtree({
url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/GetClassTree',
nodeClick: function (item) {
ClassNo = item.id;
page.search({ ClassNo: item.id });
}
});
$('.datetime').each(function () {
$(this).lrdate({
dfdata: [
{ name: '清空', begin: function () { return '' }, end: function () { return '' } },
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
],
// 月
mShow: false,
premShow: false,
// 季度
jShow: false,
prejShow: false,
// 年
ysShow: false,
yxShow: false,
preyShow: false,
yShow: false,
// 默认
dfvalue: '0',
selectfn: function (begin, end) {
datebegin = begin;
dateend = end;
}
});
});
// 查询
$('#btn_Search').on('click', function () {
page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() });
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});

$('#AcademicYearNo').lrselect({
placeholder: "学年",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "学期",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
value: 'value',
text: 'text'
});
//课程
//$('#LessonNo').lrselect({
// placeholder: "请选择课程",
// allowSearch: true,
// url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
// value: 'value',
// text: 'text'
//});
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder: '请选择课程' });
$('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname', placeholder: '请选择教室' });
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname', placeholder: '请选择教师' });
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/GetPageListForClass',
headData: [
{ label: '学年', name: 'AcademicYearNo', width: 70, align: "left" },
{ label: '学期', name: 'Semester', width: 60, align: "left" },
{ label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) {
return learun.formatDate(v, "yyyy-MM-dd");
} },
{ label: '考试时间', name: 'ExamTime', width: 120, align: "left" },
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" },
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" },
{ label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" },
{ label: '监考教师姓名', name: 'EmpName', width: 150, align: "left" },
{ label: '教室编号', name: 'ClassRoomNo', width: 100, align: "left" },
{ label: '教室名称', name: 'ClassRoomName', width: 100, align: "left" },
{ label: '班级名称', name: 'ClassName', width: 100, align: "left" },
{ label: '班级人数', name: 'ClassStuNum', width: 60, align: "left" },
{ label: '学号范围', name: 'StuNoRange', width: 200, align: "left" }
],
mainId: 'AETId',
sidx: 'examdate,examtime,lessonno,classroomname ',
sord:'asc',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
param.StartTime = datebegin;
param.EndTime = dateend;
console.log(param);
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 39
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.cshtml View File

@@ -0,0 +1,39 @@
@{
ViewBag.Title = "排考2021新";
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="AcademicYearNo" type="lrselect" class="lr-select lr-selectLittle" style="width: 80px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="Semester" type="lrselect" class="lr-select lr-selectLittle" style="width: 80px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="LessonNo" type="lrselect" class="lr-select" style="width: 200px;"></div>
</div>
<div class="lr-layout-tool-item">
<div id="datesearch" class="datetime"></div>
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</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 class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_arrange" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;排考数据同步</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js")

+ 119
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ArrangeExamTermNew/IndexForLesson.js View File

@@ -0,0 +1,119 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-12-08 12:19
* 描 述:排考2021新
*/
var selectedRow;
var refreshGirdData;

var bootstrap = function ($, learun) {
"use strict";
var datebegin = '';
var dateend = '';
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('.datetime').each(function () {
$(this).lrdate({
dfdata: [
{ name: '清空', begin: function () { return '' }, end: function () { return '' } },
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
],
// 月
mShow: false,
premShow: false,
// 季度
jShow: false,
prejShow: false,
// 年
ysShow: false,
yxShow: false,
preyShow: false,
yShow: false,
// 默认
dfvalue: '0',
selectfn: function (begin, end) {
datebegin = begin;
dateend = end;
}
});
});
// 查询
$('#btn_Search').on('click', function () {
page.search({ AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet()});
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
//排考数据同步
$('#lr_arrange').on('click', function () {
learun.layerForm({
id: 'SyncByConditionForm',
title: '按条件同步排考数据',
url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/SyncByConditionForm',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
$('#AcademicYearNo').lrselect({
placeholder: "学年",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo',
value: 'value',
text: 'text'
});
//学期
$('#Semester').lrselect({
placeholder: "学期",
allowSearch: false,
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
value: 'value',
text: 'text'
});
//课程
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder:'请选择课程' });
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/GetPageListForLesson',
headData: [
{ label: '学年', name: 'AcademicYearNo', width: 80, align: "left" },
{ label: '学期', name: 'Semester', width: 80, align: "left" },
{
label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) {
return learun.formatDate(v, "yyyy-MM-dd");
}
},
{ label: '考试时间', name: 'ExamTime', width: 100, align: "left" },
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" },
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" }
],
mainId: 'AETId',
sidx: 'ExamDate ,ExamTime,LessonNo',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
param.StartTime = datebegin;
param.EndTime = dateend;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 8
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -930,6 +930,8 @@
<Content Include="Areas\AssetManagementSystem\Views\Ass_UserChangeInfo\Index.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Form.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexForLesson.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexForClass.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexItem.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\SyncByConditionForm.js" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonSync\Form.js" />
@@ -7477,6 +7479,8 @@
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\SyncByConditionForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexItem.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexForClass.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexForLesson.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />
@@ -7601,10 +7605,10 @@
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>20472</DevelopmentServerPort>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>20472</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:20873/</IISUrl>
<IISUrl>http://localhost:20873/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermItemNew/ArrangeExamTermItemNewEntity.cs View File

@@ -122,6 +122,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[NotMapped]
public string EndDate { get; set; }

[NotMapped]
public int ClassStuNum { get; set; }
[NotMapped]
public string StuNoRange { get; set; }

#endregion

#region 扩展操作


+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewBLL.cs View File

@@ -196,6 +196,44 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public IEnumerable<ArrangeExamTermItemNewEntity> GetPageListForClass(Pagination pagination, string queryJson)
{
try
{
return arrangeExamTermNewService.GetPageListForClass(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public IEnumerable<ArrangeExamTermNewEntity> GetPageListForLesson(Pagination pagination, string queryJson)
{
try
{
return arrangeExamTermNewService.GetPageListForLesson(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewIBLL.cs View File

@@ -53,5 +53,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion

List<TreeModel> GetClassTree();
IEnumerable<ArrangeExamTermItemNewEntity> GetPageListForClass(Pagination pagination, string queryJson);
IEnumerable<ArrangeExamTermNewEntity> GetPageListForLesson(Pagination pagination, string queryJson);
}
}

+ 116
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeExamTermNew/ArrangeExamTermNewService.cs View File

@@ -295,5 +295,121 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

public IEnumerable<ArrangeExamTermItemNewEntity> GetPageListForClass(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append(@"select AcademicYearNo, Semester, ExamDate, ExamTime, LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName, count(StuNo) as ClassStuNum
from [dbo].[ArrangeExamTermItemNew] where 1=1 ");
var queryParam = queryJson.ToJObject();
if (!queryParam["AcademicYearNo"].IsEmpty())
{
strSql.Append(" and AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' ");
}
if (!queryParam["Semester"].IsEmpty())
{
strSql.Append(" and Semester='" + queryParam["Semester"].ToString() + "' ");
}
if (!queryParam["LessonNo"].IsEmpty())
{
strSql.Append(" and LessonNo='" + queryParam["LessonNo"].ToString() + "' ");
}
if (!queryParam["ClassNo"].IsEmpty())
{
strSql.Append(" and ClassNo='" + queryParam["ClassNo"].ToString() + "' ");
}
if (!queryParam["EmpNo"].IsEmpty())
{
strSql.Append(" and EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' ");
}
if (!queryParam["ClassRoomNo"].IsEmpty())
{
strSql.Append(" and ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' ");
}
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
{
strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) ");
}
strSql.Append(@" group by AcademicYearNo, Semester, ExamDate, ExamTime,LessonNo, LessonName,ClassRoomNo,ClassRoomName,EmpNo, EmpName, ClassNo,ClassName
");

var list= this.BaseRepository("CollegeMIS").FindList<ArrangeExamTermItemNewEntity>(strSql.ToString(), pagination);
var stulist = BaseRepository("CollegeMIS").FindList<ArrangeExamTermItemNewEntity>("select * from ArrangeExamTermItemNew");
foreach (var item in list)
{
if (item.ClassStuNum>0)
{
var stunolist = stulist.Where(m => m.AcademicYearNo == item.AcademicYearNo && m.Semester == item.Semester
&& m.LessonNo == item.LessonNo && m.ExamDate == item.ExamDate && m.ExamTime == item.ExamTime
&& m.ClassRoomNo == item.ClassRoomNo && m.EmpNo == item.EmpNo && m.ClassNo == item.ClassNo).OrderBy(m=>m.StuNo);
if (stunolist.Count()>0)
{
item.StuNoRange = stunolist.First().StuNo+ "~"+stunolist.Last().StuNo;
}
}
}
return list;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public IEnumerable<ArrangeExamTermNewEntity> GetPageListForLesson(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT AcademicYearNo,Semester,ExamDate,ExamTime,LessonNo,LessonName ");
strSql.Append(" FROM ArrangeExamTermNew t where 1=1 ");
var queryParam = queryJson.ToJObject();
var dp = new DynamicParameters(new { });
if (!queryParam["AcademicYearNo"].IsEmpty())
{
strSql.Append(" and t.AcademicYearNo=@AcademicYearNo ");
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String);
}
if (!queryParam["Semester"].IsEmpty())
{
strSql.Append(" and t.Semester=@Semester ");
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String);
}
if (!queryParam["LessonNo"].IsEmpty())
{
strSql.Append(" and t.LessonNo=@LessonNo ");
dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String);
}
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
{
dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime);
dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime);
strSql.Append(" AND ( ExamDate >= @startTime AND ExamDate <= @endTime ) ");
}

strSql.Append(" group by AcademicYearNo,Semester,ExamDate,ExamTime,LessonNo,LessonName");
return this.BaseRepository("CollegeMIS").FindList<ArrangeExamTermNewEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
}
}

Loading…
Cancel
Save