@@ -3,6 +3,8 @@ using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
@@ -16,6 +18,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class Exam_ArrangeExamTermNewController : MvcControllerBase | |||
{ | |||
private Exam_ArrangeExamTermNewIBLL exam_ArrangeExamTermNewIBLL = new Exam_ArrangeExamTermNewBLL(); | |||
private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); | |||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | |||
#region 视图功能 | |||
@@ -26,7 +30,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -35,7 +39,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -51,6 +55,44 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
public ActionResult SeatForm() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 场次安排 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult IndexClassRoom() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult TeachingQualityIndex() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult TeachingQualityPrint() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -69,14 +111,23 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
[HttpGet] | |||
public ActionResult GetClassTree() | |||
{ | |||
return Success(exam_ArrangeExamTermNewIBLL.GetClassTree()); | |||
} | |||
/// <summary> | |||
/// 考场数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetClassRoomTree(string AcademicYearNo, string Semester) | |||
{ | |||
return Success(exam_ArrangeExamTermNewIBLL.GetClassRoomTree(AcademicYearNo, Semester)); | |||
} | |||
[HttpGet] | |||
public ActionResult GetItemPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
@@ -90,6 +141,33 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 教学质量监测 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetLessonList(string academicYearNo, string semester, string classNo) | |||
{ | |||
var data = exam_ArrangeExamTermNewIBLL.GetLessonList(academicYearNo, semester, classNo).OrderBy(x => x.value); | |||
return Success(data); | |||
} | |||
public ActionResult GetTeachingQualityPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = exam_ArrangeExamTermNewIBLL.GetTeachingQualityPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -120,12 +198,74 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity( keyValue ); | |||
var jsonData = new { | |||
var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
ArrangeExamTermNew = ArrangeExamTermNewData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <param name="ClassRoomNo"></param> | |||
/// <param name="AcademicYearNo"></param> | |||
/// <param name="Semester"></param> | |||
/// <returns></returns> | |||
public ActionResult GetSeatData(string ClassRoomNo, string AcademicYearNo, int? Semester, string LessonNo, string EmpNo, string ExamDate, string ExamTime) | |||
{ | |||
var data = exam_ExamRoomIBLL.GetEntityByClassroomNo(ClassRoomNo, AcademicYearNo, Semester); | |||
var studata = exam_ArrangeExamTermNewIBLL.GetStuList(AcademicYearNo, Semester, ClassRoomNo, LessonNo, EmpNo, ExamDate, ExamTime).OrderBy(x => x.SitNumber); | |||
var StuList = new List<EaxmStuList>(); | |||
var EaxmStartTime = ""; | |||
var EaxmEndTime = ""; | |||
var teach = ""; | |||
foreach (var item in studata) | |||
{ | |||
var list = new EaxmStuList | |||
{ | |||
SitNumber = item.SitNumber, | |||
StuName = item.StuName, | |||
StuNo = item.StuNo | |||
}; | |||
StuList.Add(list); | |||
var times = item.ExamTime.Split('-'); | |||
for (int i = 0; i < times.Count(); i++) | |||
{ | |||
if (i == 0) | |||
{ | |||
EaxmStartTime = item.ExamDate.Value.ToString("yyyy-MM-dd") + " " + times[i] + " ~ "; | |||
} | |||
else | |||
{ | |||
EaxmEndTime = item.ExamDate.Value.ToString("yyyy-MM-dd") + " " + times[i]; | |||
} | |||
} | |||
teach = item.EmpName; | |||
} | |||
var dataOne = new { tClassroomName = data.ClassroomName, AcademicYearNo, Semester, data.SeatRows, data.SeatColumns, teach, EaxmStartTime, EaxmEndTime }; | |||
var result = new { dataOne, StuList }; | |||
return Success(result); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetScreeningPlan(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = exam_ArrangeExamTermNewIBLL.ScreeningPlan(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -154,7 +294,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
Exam_ArrangeExamTermNewEntity entity = strEntity.ToObject<Exam_ArrangeExamTermNewEntity>(); | |||
exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue,entity); | |||
exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
@@ -162,5 +302,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
} | |||
#endregion | |||
public class EaxmStuList | |||
{ | |||
public string StuName { get; set; } | |||
public string StuNo { get; set; } | |||
public string SitNumber { get; set; } | |||
} | |||
} | |||
} |
@@ -3,6 +3,7 @@ using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
@@ -16,6 +17,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public class Exam_ExamRoomController : MvcControllerBase | |||
{ | |||
private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); | |||
private Exam_ExamRoomDetailIBLL exam_ExamRoomDetailIBLL = new Exam_ExamRoomDetailBLL(); | |||
#region 视图功能 | |||
@@ -46,7 +48,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
[HttpGet] | |||
public ActionResult FormSeat() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -88,6 +94,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ActionResult GetClassRoomDetailData(string classroomNo, string AcademicYearNo, int? Semester) | |||
{ | |||
var Exam_ExamRoomData = exam_ExamRoomIBLL.GetEntityByClassroomNo(classroomNo, AcademicYearNo, Semester); | |||
var Exam_ExamRoomDetailData = exam_ExamRoomDetailIBLL.GetList().Where(x => x.ClassRoomNo == classroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester).OrderBy(x => x.ECOrder); | |||
var data = new { Exam_ExamRoomData, Exam_ExamRoomDetailData }; | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -113,7 +133,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[AjaxOnly] | |||
public ActionResult Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) | |||
{ | |||
int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); | |||
int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester, SeatRows, SeatColumns); | |||
exam_ExamRoomIBLL.SeatEntity(AcademicYearNo, Semester); | |||
return Success("导入" + res + "条数据!"); | |||
} | |||
/// <summary> | |||
@@ -139,9 +160,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
Exam_ExamRoomEntity entity = strEntity.ToObject<Exam_ExamRoomEntity>(); | |||
//判断考场编号有无重复 | |||
var model = exam_ExamRoomIBLL.GetEntityByClassroomNo(entity.ClassroomNo,entity.AcademicYearNo,entity.Semester); | |||
var model = exam_ExamRoomIBLL.GetEntityByClassroomNo(entity.ClassroomNo, entity.AcademicYearNo, entity.Semester); | |||
if (model != null && string.IsNullOrEmpty(keyValue)) | |||
{ | |||
return Fail("考场编号重复!"); | |||
@@ -173,7 +194,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
exam_ExamRoomIBLL.Lock(keyValue, EREnabled); | |||
return Success("操作成功!"); | |||
} | |||
/// <summary> | |||
/// 座位保存允许做人 | |||
/// </summary> | |||
/// <param name="ClassroomNo"></param> | |||
/// <param name="AcademicYearNo"></param> | |||
/// <param name="Semester"></param> | |||
/// <param name="list"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveDetailForm(string ClassroomNo, string AcademicYearNo, int Semester, List<Exam_ExamRoomDetailEntity> list) | |||
{ | |||
exam_ExamRoomDetailIBLL.SaveSaveDetailEntity(ClassroomNo, AcademicYearNo, Semester, list); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,113 @@ | |||
using DocumentFormat.OpenXml.Math; | |||
using Hangfire; | |||
using Learun.Application.Base.SystemModule; | |||
using Learun.Application.Organization; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using Learun.Util; | |||
using Newtonsoft.Json; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Configuration; | |||
using System.Data; | |||
using System.IO; | |||
using System.Linq; | |||
using System.Web.Mvc; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousController : MvcControllerBase | |||
{ | |||
private StuScoreOfPreviousIBLL stuScoreOfPreviousIBLL = new StuScoreOfPreviousBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 导入 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult ImportForm() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = stuScoreOfPreviousIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 学年下拉框信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetAcademicYearNoData() | |||
{ | |||
var data = stuScoreOfPreviousIBLL.GetAcademicYearNoData(); | |||
return Success(data); | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入下载模板 | |||
/// </summary> | |||
/// <returns></returns> | |||
public ActionResult DownTemplate() | |||
{ | |||
FileStreamResult result = null; | |||
try | |||
{ | |||
var path = Server.MapPath("~/Content/excel/"); | |||
var pathoffull = path + "StuScoreOfPreviousImport.xls"; | |||
FileStream fsread = fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.ReadWrite); | |||
result = File(fsread, "application/ms-excel", "往年成绩导入模版.xls"); | |||
return result; | |||
} | |||
catch (Exception ex) | |||
{ | |||
return null; | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,52 @@ | |||
@{ | |||
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="datesearch"></div> | |||
</div> | |||
<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"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">监考老师</div> | |||
<div id="EmpNo"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">考场</div> | |||
<div id="ClassRoomNo"></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> | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/IndexClassRoom.js") |
@@ -0,0 +1,154 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-04-22 16:00 | |||
* 描 述:排考安排 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var logbegin = ''; | |||
var logend = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#datesearch').lrdate({ | |||
dfdata: [ | |||
{ 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, | |||
// 默认 | |||
selectfn: function (begin, end) { | |||
logbegin = begin; | |||
logend = end; | |||
page.search(); | |||
} | |||
}); | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' }); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); | |||
$('#ClassRoomNo').lrselect({ | |||
placeholder: "课程", | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#lr_view').on('click', function () { | |||
var AcademicYearNo = $('#gridtable').jfGridValue('AcademicYearNo'); | |||
var Semester = $('#gridtable').jfGridValue('Semester'); | |||
var ClassRoomNo = $('#gridtable').jfGridValue('ClassroomNo'); | |||
var LessonNo = $('#gridtable').jfGridValue('LessonNo'); | |||
var EmpNo = $('#gridtable').jfGridValue('EmpNo'); | |||
var ExamDate = $('#gridtable').jfGridValue('ExamDate'); | |||
ExamDate = learun.formatDate(ExamDate, "yyyy-MM-dd"); | |||
var ExamTime = $('#gridtable').jfGridValue('ExamTime'); | |||
if (learun.checkrow(ClassRoomNo)) { | |||
learun.layerForm({ | |||
id: 'SeatForm', | |||
title: '排考座位表', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/SeatForm?' + $.param({ | |||
AcademicYearNo, Semester, ClassRoomNo, LessonNo, EmpNo, ExamDate, ExamTime | |||
}), | |||
width: 1200, | |||
height: 800, | |||
btn: null | |||
}); | |||
} | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetScreeningPlan', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ | |||
label: "专业", name: "TeachMajorNo", width: 160, 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: "ClassroomNo", width: 100, align: "left" }, | |||
{ label: "考场名称", name: "ClassroomName", width: 100, align: "left" }, | |||
{ label: "科目编号", name: "LessonNo", width: 100, align: "left" }, | |||
{ label: "科目名称", name: "LessonName", width: 100, align: "left" }, | |||
{ | |||
label: "考试日期", name: "ExamDate", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return learun.formatDate(cellvalue, 'yyyy-MM-dd'); | |||
} | |||
}, | |||
{ label: "考试时间", name: "ExamTime", width: 100, align: "left" }, | |||
{ label: "考场人数", name: "ClassRoomNum", width: 100, align: "left" }, | |||
{ label: "监考老师名称", name: "EmpName", width: 200, align: "left" }, | |||
{ label: "监考老师编号", name: "EmpNo", width: 200, align: "left", ishide: true }, | |||
{ label: "起止考号", name: "kh", width: 100, align: "left", ishide: true }, | |||
], | |||
//mainId: 'EPIId', | |||
isPage: true, | |||
sidx: 'AcademicYearNo desc,Semester desc,examtime desc,TeachMajorNo desc,examdate desc,lessonno desc,classroomname desc', | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = logbegin; | |||
param.EndTime = logend; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -41,6 +41,7 @@ | |||
<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> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -23,7 +23,7 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassTree', | |||
nodeClick: function (item) { | |||
ClassNo = item.id; | |||
page.search({ ClassNo: item.id }); | |||
page.search({ ClassNo: item.id, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
} | |||
}); | |||
$('.datetime').each(function () { | |||
@@ -89,6 +89,10 @@ var bootstrap = function ($, learun) { | |||
$('#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: '请选择教师' }); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
@@ -96,9 +100,11 @@ var bootstrap = function ($, learun) { | |||
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: '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" }, | |||
@@ -112,7 +118,7 @@ var bootstrap = function ($, learun) { | |||
], | |||
mainId: 'AETId', | |||
sidx: 'examdate,examtime,lessonno,classroomname ', | |||
sord:'asc', | |||
sord: 'asc', | |||
isPage: true | |||
}); | |||
page.search(); | |||
@@ -5,14 +5,14 @@ | |||
<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 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> | |||
<span id="titleinfo" class="lrlt">考场信息</span> | |||
</div> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
@@ -25,9 +25,9 @@ | |||
<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 class="lr-layout-tool-item"> | |||
<div id="ClassRoomNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
</div> | |||
</div>*@ | |||
<div class="lr-layout-tool-item"> | |||
<div id="EmpNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
</div> | |||
@@ -41,6 +41,8 @@ | |||
<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> | |||
@*<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a>*@ | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -11,7 +11,9 @@ var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var datebegin = ''; | |||
var dateend = ''; | |||
var ClassNo = ''; | |||
//var ClassNo = ''; | |||
var ClassRoomNo = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
@@ -20,10 +22,11 @@ var bootstrap = function ($, learun) { | |||
bind: function () { | |||
// 初始化左侧树形数据 | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassTree', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree', | |||
nodeClick: function (item) { | |||
ClassNo = item.id; | |||
page.search({ ClassNo: item.id }); | |||
ClassRoomNo = item.id; | |||
page.search({ ClassRoomNo: item.id, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
$('#titleinfo').html(item.text); | |||
} | |||
}); | |||
$('.datetime').each(function () { | |||
@@ -56,7 +59,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
page.search({ ClassRoomNo: ClassRoomNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
@@ -78,30 +81,93 @@ var bootstrap = function ($, learun) { | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//课程 | |||
//$('#LessonNo').lrselect({ | |||
// placeholder: "请选择课程", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', | |||
// value: 'value', | |||
// text: 'text' | |||
//}); | |||
$('#AcademicYearNo').bind('change', function () { | |||
ClassRoomNo= '' | |||
var AcademicYearNo = ''; | |||
var Semester = ''; | |||
if ($('#AcademicYearNo').lrselectGet()) { | |||
AcademicYearNo = $('#AcademicYearNo').lrselectGet() | |||
} | |||
if ($('#Semester').lrselectGet()) { | |||
var Semester = $('#Semester').lrselectGet(); | |||
} | |||
if (Semester != '' && AcademicYearNo != '') { | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, | |||
nodeClick: function (item) { | |||
ClassRoomNo = item.value; | |||
page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
} | |||
}); | |||
} | |||
}); | |||
$('#Semester').bind('change', function () { | |||
ClassRoomNo = '' | |||
var AcademicYearNo = ''; | |||
var Semester = ''; | |||
if ($('#AcademicYearNo').lrselectGet()) { | |||
AcademicYearNo = $('#AcademicYearNo').lrselectGet() | |||
} | |||
if ($('#Semester').lrselectGet()) { | |||
var Semester = $('#Semester').lrselectGet(); | |||
} | |||
if (Semester != '' && AcademicYearNo != '') { | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, | |||
nodeClick: function (item) { | |||
ClassRoomNo = item.value; | |||
page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
} | |||
}); | |||
} | |||
}); | |||
$('#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: '请选择教师' }); | |||
$('#lr_view').on('click', function () { | |||
var AcademicYearNo = $('#AcademicYearNo').lrselectGet() || ''; | |||
var Semester = $('#Semester').lrselectGet() || ''; | |||
var LessonNo = $('#LessonNo').lrselectGet() || ''; | |||
if (AcademicYearNo == '' && Semester == '' || LessonNo == '' ) { | |||
learun.alert.warning("请选择学年,学期以及课程"); | |||
return; | |||
} | |||
if (!ClassRoomNo) { | |||
learun.alert.warning("请选择考场"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'SeatForm', | |||
title: '排考座位表', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/SeatForm?' + $.param({ ClassRoomNo, AcademicYearNo, Semester, LessonNo }), | |||
width: 1200, | |||
height: 800, | |||
btn: null | |||
}); | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetItemPageList', | |||
headData: [ | |||
{ label: '学年', name: 'AcademicYearNo', width: 70, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 60, align: "left" }, | |||
{ label: '学年', name: 'AcademicYearNo', width: 60, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 50, align: "left" }, | |||
{ label: '学生编号', name: 'StuNo', width: 130, align: "left" }, | |||
{ label: '学生姓名', name: 'StuName', width: 100, align: "left" }, | |||
{ label: '学籍号', name: 'StuCode', width: 130, align: "left" }, | |||
{ | |||
label: '考试日期', name: 'ExamDate', width: 100, align: "left", formatter: function (v) { | |||
label: '考试日期', name: 'ExamDate', width: 90, align: "left", | |||
formatter: function (v) { | |||
return learun.formatDate(v, "yyyy-MM-dd"); | |||
} | |||
}, | |||
{ label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, | |||
{ label: '考试时间', name: 'ExamTime', width: 90, align: "left" }, | |||
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, | |||
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" }, | |||
{ label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" }, | |||
@@ -109,12 +175,11 @@ var bootstrap = function ($, learun) { | |||
{ label: '教室编号', name: 'ClassroomNo', width: 100, align: "left" }, | |||
{ label: '教室名称', name: 'ClassroomName', width: 100, align: "left" }, | |||
{ label: '班级名称', name: 'ClassName', width: 100, align: "left" }, | |||
{ label: '学生编号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '学生姓名', name: 'StuName', width: 200, align: "left" }, | |||
{ label: '座位编号', name: 'SitNumber', width: 100, aligndd: "left" } | |||
{ label: '座位编号', name: 'SitNumber', width: 80, aligndd: "left" }, | |||
{ label: '考号', name: 'kh', width: 140, align: "left", ishide: true }, | |||
], | |||
mainId: 'AETId', | |||
sidx: 'ExamDate asc, LessonNo asc,ClassRoomNo asc,ClassNo asc,SitNumber asc', | |||
sidx: ' AcademicYearNo desc,Semester desc,ExamDate desc, LessonNo desc,ClassRoomNo desc,ClassRoomNo desc,SitNumber asc ', | |||
isPage: true | |||
}); | |||
page.search(); | |||
@@ -123,7 +188,7 @@ var bootstrap = function ($, learun) { | |||
param = param || {}; | |||
param.StartTime = datebegin; | |||
param.EndTime = dateend; | |||
console.log(param); | |||
param.ClassRoomNo = ClassRoomNo; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -0,0 +1,116 @@ | |||
@{ | |||
ViewBag.Title = "考场信息-查看"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<link href="~/Content/css/UserCenter/user.css" rel="stylesheet" /> | |||
<div id="app" style="padding:20px;"> | |||
<div class="title" style="font-size:18px;color:#333;lineHeight:50px;textAlign:center;position:relative;"> | |||
{{dataOne.tClassroomName}}排考座位表 | |||
<div class="btn btn-primary no-print" style="position:absolute;right:0;top:6px" v-on:click="printClick">打 印</div> | |||
</div> | |||
<div class="desc" style="display:flex;justifyContent:space-between;color:#666;padding:10px;"> | |||
<span>监考老师:{{dataOne.teach}}</span> | |||
<span>考试时间:{{dataOne.EaxmStartTime}}{{dataOne.EaxmEndTime}}</span> | |||
</div> | |||
<ul class="StuList" style="overflow:scroll;height:600px"> | |||
<li v-for="item in SeatList" :key="item.SitNumber" :style="{width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center'}"> | |||
<div class="content" style="border:1px solid #ccc;padding:6px;"> | |||
<div>{{item.StuName||'-'}}</div> | |||
{{item.SitNumber}} | |||
</div> | |||
</li> | |||
</ul> | |||
<div style="color:#333;font-size:14px;text-align:center;line-height:80px" v-if="isEmpty">暂无数据</div> | |||
</div> | |||
<script> | |||
var vm = new Vue({ | |||
el: "#app", | |||
data() { | |||
return { | |||
StuList: [], | |||
SeatList: [], | |||
dataOne: {}, | |||
StuListColumns: [], | |||
width: '10%', | |||
isEmpty: false, | |||
} | |||
}, | |||
created() { | |||
this.getData() | |||
}, | |||
methods: { | |||
getData: function () { | |||
$.ajax({ | |||
url: '/EducationalAdministration/Exam_ArrangeExamTermNew/GetSeatData', | |||
data: { | |||
ClassRoomNo: request('ClassRoomNo'), AcademicYearNo: request('AcademicYearNo'), Semester: request('Semester'), LessonNo: request('LessonNo'), EmpNo: request('EmpNo'), ExamDate: request('ExamDate'), ExamTime: request('ExamTime') | |||
}, | |||
type: "Post", | |||
dataType: "json", | |||
async: true, | |||
cache: false, | |||
success: (res) => { | |||
if (res.code == 200) { | |||
let SeatList = [] | |||
this.StuList = res.data.StuList || [] | |||
this.dataOne = res.data.dataOne | |||
//多少列 | |||
let cols = this.dataOne.SeatColumns | |||
//多少行 | |||
let rows = this.dataOne.SeatRows | |||
//总座位数 | |||
let total = cols * rows | |||
//初始化座位 | |||
for (let i = 0; i < total; i++) { | |||
let SitNumber = i + 1 | |||
if (String(SitNumber).length == 1) SitNumber = '00' + String(SitNumber); | |||
if (String(SitNumber).length == 2) SitNumber = '0' + String(SitNumber) | |||
SeatList.push({ | |||
SitNumber, | |||
StuName: '', | |||
StuNo:'' | |||
}) | |||
} | |||
//列的宽度 | |||
this.width = 100 / cols + '%' | |||
function arrayToMatrix(arr, size) { | |||
var matrix = [], index = 0; | |||
for (var i = 0; i < arr.length; i += size) { | |||
let pushArr = arr.slice(i, i + size) | |||
if (index % 2 !== 0) pushArr.reverse(); | |||
index += 1 | |||
matrix.push(pushArr); | |||
} | |||
return matrix; | |||
} | |||
SeatList = arrayToMatrix(SeatList, rows) | |||
for (let row = 0; row < rows; row++) { | |||
for (let col = 0; col < cols; col++) { | |||
let item = SeatList[col][row] | |||
let obj = this.StuList.find(e => e.SitNumber == item.SitNumber) | |||
this.SeatList.push(obj || item) | |||
} | |||
} | |||
} | |||
}, | |||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||
}, | |||
beforeSend: function () { | |||
}, | |||
complete: function () { | |||
} | |||
}) | |||
}, | |||
printClick() { | |||
$('.btn').css('display', 'none') | |||
$('.StuList').css('overflow', 'unset') | |||
$('.StuList').css('height', 'auto') | |||
$('#app').jqprint({ noPrintSelector: ".no-print", }) | |||
$('.StuList').css('height', '600px') | |||
$('.StuList').css('overflow', 'scroll') | |||
$('.btn').css('display', 'block') | |||
} | |||
}, | |||
}) | |||
</script> |
@@ -0,0 +1,54 @@ | |||
@{ | |||
/**/ | |||
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="ClassNo" 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> 查询</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> | |||
@*<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>打印</a>*@ | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/TeachingQualityIndex.js") |
@@ -0,0 +1,324 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-12-08 12:19 | |||
* 描 述:排考2021新 | |||
*/ | |||
var selectedRow; | |||
var refreshGirdData; | |||
//课程列 | |||
var LessonTemp = []; | |||
var EmpInfo = [] | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var datebegin = ''; | |||
var dateend = ''; | |||
//var ClassNo = ''; | |||
var ClassRoomNo = ''; | |||
var page = { | |||
init: function () { | |||
//page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 初始化左侧树形数据 | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree', | |||
nodeClick: function (item) { | |||
ClassRoomNo = item.id; | |||
page.search({ ClassRoomNo: item.id, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
$('#titleinfo').html(item.text); | |||
} | |||
}); | |||
$('.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; | |||
} | |||
}); | |||
}); | |||
//打印 | |||
$('#lr_print').on('click', function () { | |||
var p = {}; | |||
p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); | |||
p.Semester = $('#Semester').lrselectGet(); | |||
p.ClassNo = $('#ClassNo').lrselectGet(); | |||
if (p.AcademicYearNo == null || p.AcademicYearNo == "") { | |||
learun.alert.warning("请选择学年!"); | |||
return; | |||
} | |||
if (p.Semester == null || p.Semester == "") { | |||
learun.alert.warning("请选择学期!"); | |||
return; | |||
} | |||
if (p.ClassNo == null || p.ClassNo == "") { | |||
learun.alert.warning("请选择班级!"); | |||
return; | |||
} | |||
let query = JSON.parse(JSON.stringify(p)) | |||
query.StartTime = datebegin; | |||
query.EndTime = dateend; | |||
query.ClassRoomNo = ClassRoomNo; | |||
query.EmpNo = $('#EmpNo').lrselectGet() | |||
learun.layerForm({ | |||
id: 'TeachingQualityPrint', | |||
title: '教学质量检测考生统计表', | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/TeachingQualityPrint?' + $.param({ params: JSON.stringify(p), query: JSON.stringify(query), ClassNo: p.ClassNo }), | |||
width: 1320, | |||
height: 900, | |||
btn: null | |||
}); | |||
}); | |||
// 查询 | |||
$('#btn_Search').on('click', async function () { | |||
var p = {}; | |||
p.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); | |||
p.Semester = $('#Semester').lrselectGet(); | |||
p.ClassNo = $('#ClassNo').lrselectGet(); | |||
p.LessonNo = $('#LessonNo').lrselectGet(); | |||
p.ClassRoomNo = ClassRoomNo; | |||
p.EmpNo = $('#EmpNo').lrselectGet(); | |||
if (p.AcademicYearNo == null || p.AcademicYearNo == "") { | |||
learun.alert.warning("请选择学年!"); | |||
return; | |||
} | |||
if (p.Semester == null || p.Semester == "") { | |||
learun.alert.warning("请选择学期!"); | |||
return; | |||
} | |||
if (p.ClassNo == null || p.ClassNo == "") { | |||
learun.alert.warning("请选择班级!"); | |||
return; | |||
} | |||
//获取教师 | |||
await new Promise((resolve) => { | |||
learun.clientdata.getAllAsync('sourceData', { | |||
code: 'EmpInfo', | |||
callback: function (dataes) { | |||
EmpInfo = dataes.map(e => { return { value: e.empno, text: e.empname } }) | |||
resolve() | |||
} | |||
}); | |||
}) | |||
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetLessonList', p, | |||
function (data) { | |||
console.log(data) | |||
var temparr = []; | |||
for (var i = 0; i < data.length; i++) { | |||
var item = {}; | |||
let obj = EmpInfo.find(e => e.value == data[i].text) | |||
item.label = data[i].value; | |||
item.name = data[i].text; | |||
item.formatterAsync = function (callback, value, row, op, $cell) { | |||
callback(obj ? obj.text : '') | |||
} | |||
item.width = 150; | |||
item.align = "left"; | |||
temparr.push(item); | |||
} | |||
LessonTemp = temparr; | |||
page.initGird(); | |||
//page.search({ ClassRoomNo: ClassRoomNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
page.search(p); | |||
}); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
$('#ClassNo').lrDataSourceSelect({ | |||
placeholder: "请选择班级", | |||
code: 'bjsj', value: 'classno', text: 'classname' | |||
}); | |||
$('#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' | |||
}); | |||
$('#AcademicYearNo').bind('change', function () { | |||
ClassRoomNo = '' | |||
var AcademicYearNo = ''; | |||
var Semester = ''; | |||
if ($('#AcademicYearNo').lrselectGet()) { | |||
AcademicYearNo = $('#AcademicYearNo').lrselectGet() | |||
} | |||
if ($('#Semester').lrselectGet()) { | |||
var Semester = $('#Semester').lrselectGet(); | |||
} | |||
if (Semester != '' && AcademicYearNo != '') { | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, | |||
nodeClick: function (item) { | |||
ClassRoomNo = item.value; | |||
page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
} | |||
}); | |||
} | |||
}); | |||
$('#Semester').bind('change', function () { | |||
ClassRoomNo = '' | |||
var AcademicYearNo = ''; | |||
var Semester = ''; | |||
if ($('#AcademicYearNo').lrselectGet()) { | |||
AcademicYearNo = $('#AcademicYearNo').lrselectGet() | |||
} | |||
if ($('#Semester').lrselectGet()) { | |||
var Semester = $('#Semester').lrselectGet(); | |||
} | |||
if (Semester != '' && AcademicYearNo != '') { | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetClassRoomTree?AcademicYearNo = ' + AcademicYearNo + ' &Semester=' + Semester, | |||
nodeClick: function (item) { | |||
ClassRoomNo = item.value; | |||
page.search({ ClassRoomNo: item.value, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
} | |||
}); | |||
} | |||
}); | |||
$('#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 () { | |||
var headData = [ | |||
{ | |||
label: '学校', name: 'F_SchoolId', width: 190, 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: 'AcademicYearNo', width: 60, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 50, align: "left" }, | |||
{ label: '姓名', name: 'StuName', width: 100, align: "left" }, | |||
{ label: '学生编号', name: 'StuNo', width: 130, align: "left" }, | |||
{ label: '学籍号', name: 'StuCode', width: 130, align: "left" }, | |||
{ | |||
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: 'ExamDate', width: 90, align: "left", | |||
formatter: function (v) { | |||
return learun.formatDate(v, "yyyy-MM-dd"); | |||
} | |||
}, | |||
{ label: '考试时间', name: 'ExamTime', width: 90, 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: 'SitNumber', width: 80, aligndd: "left" }, | |||
//{ label: '任课教师', width: 130, align: "center", children: LessonTemp }, | |||
...LessonTemp, | |||
{ label: '考号', name: 'kh', width: 140, align: "left", ishide: true }, | |||
]; | |||
//var headDatas = headData.concat(LessonTemp); | |||
$("#gridtable")[0].dfop = undefined; | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetTeachingQualityPageList', | |||
headData, | |||
mainId: 'AETId', | |||
sidx: ' AcademicYearNo desc,Semester desc,ExamDate desc, LessonNo desc,ClassRoomNo desc,ClassRoomNo desc,SitNumber asc ', | |||
isPage: true | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = datebegin; | |||
param.EndTime = dateend; | |||
param.ClassRoomNo = ClassRoomNo; | |||
param.EmpNo = $('#EmpNo').lrselectGet() | |||
param.ClassNo = $('#ClassNo').lrselectGet() | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,65 @@ | |||
@{ | |||
ViewBag.Title = "排考2021新"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<link href="~/Content/css/print.css" rel="stylesheet" /> | |||
<div class="pages" id="printPage"> | |||
@* .page 一个纸张页*@ | |||
<div class="page page1"> | |||
<div class="pageContent"> | |||
<div style="text-align:right" class="no-print"> | |||
<div style="display:inline-block;font-size:14px;">单页条数: <input class="form-control" id="rowsInput" style="width:50px;display:inline-block"/> </div> | |||
<div style="position:relative;display:inline-block"> | |||
<a id="lr_columns" class="btn btn-default"> | |||
列显示 | |||
</a> | |||
<ul id="columns" style="display:none"> | |||
<li style="width:100%;"><input type="checkbox" value="allSelected" name="columns" /> <span>全选</span></li> | |||
<li><input type="checkbox" value="F_SchoolId" name="columns" /> <span>学校</span></li> | |||
<li><input type="checkbox" value="AcademicYearNo" name="columns" /> <span>学年</span></li> | |||
<li style="width:100%;display:flex;justify-content:right;border-bottom:0"><button id="cancelBtn"> 取消 </button> <button id="confirmBtn"> 确定 </button> </li> | |||
</ul> | |||
<style> | |||
#columns { | |||
width: 320px; | |||
position: absolute; | |||
top: 35px; | |||
right: 0px; | |||
background: #fff; | |||
border: 1px solid #ccc; | |||
padding: 8px; | |||
z-index: 1000; | |||
overflow: hidden; | |||
text-align:left; | |||
font-size:14px; | |||
} | |||
#columns li { | |||
width: 50%; | |||
float: left; | |||
border-bottom:1px solid #ccc; | |||
padding:4px; | |||
display:flex; | |||
align-items:center; | |||
line-height:24px | |||
} | |||
input[type=checkbox]{ | |||
margin:0; | |||
cursor:pointer | |||
} | |||
</style> | |||
</div> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>打印</a> | |||
</div> | |||
<div class="printTitle">教学质量检测考生统计表</div> | |||
<div class="lr-layout-body" id="gridtablePage1"></div> | |||
</div> | |||
</div> | |||
<style> | |||
body{ | |||
zoom:92%; | |||
} | |||
</style> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/TeachingQualityPrint.js") |
@@ -0,0 +1,364 @@ | |||
/* * 版 本 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 params = '{}', query = '{}'; | |||
//课程 | |||
var LessonTemp = []; | |||
//教师 | |||
var EmpInfo = []; | |||
//第几页 | |||
var pageNum = 1; | |||
var rows = 26 | |||
var headData = [ | |||
{ | |||
label: '学校', name: 'F_SchoolId', width: 190, align: "center", | |||
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: 'AcademicYearNo', width: 60, align: "center", ishide: true }, | |||
{ label: '学期', name: 'Semester', width: 50, align: "center", ishide: true }, | |||
{ label: '姓名', name: 'StuName', width: 100, align: "center" }, | |||
{ label: '学生编号', name: 'StuNo', width: 130, align: "center", ishide: true }, | |||
{ label: '学籍号', name: 'StuCode', width: 150, align: "center" }, | |||
{ | |||
label: "系所", name: "DeptNo", width: 100, align: "center", ishide: true, | |||
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: "center", | |||
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: "center", | |||
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: 'ExamDate', width: 90, align: "center", ishide: true, | |||
formatter: function (v) { | |||
return learun.formatDate(v, "yyyy-MM-dd"); | |||
} | |||
}, | |||
{ label: '考试时间', name: 'ExamTime', width: 90, align: "center" }, | |||
{ label: '课程编号', name: 'LessonNo', width: 100, align: "center", ishide: true }, | |||
{ label: '课程名称', name: 'LessonName', width: 200, align: "center", ishide: true }, | |||
{ label: '监考教师编号', name: 'EmpNo', width: 130, align: "center", ishide: true }, | |||
{ label: '监考教师姓名', name: 'EmpName', width: 130, align: "center"}, | |||
{ label: '教室编号', name: 'ClassroomNo', width: 100, align: "center", ishide: true }, | |||
{ label: '教室名称', name: 'ClassroomName', width: 100, align: "center", ishide: true }, | |||
{ label: '班级名称', name: 'ClassName', width: 100, align: "center", ishide: true }, | |||
{ label: '座位编号', name: 'SitNumber', width: 80, aligndd: "center", ishide: true }, | |||
{ label: '任课教师', name: 'rkjs', width: 130, align: "center", children: LessonTemp }, | |||
{ label: '考号', name: 'kh', width: 140, align: "center", ishide: false }, | |||
]; | |||
var page = { | |||
init: async function () { | |||
if (request('rows')) { | |||
rows = request('rows') | |||
} | |||
//获取教师 | |||
await new Promise((resolve) => { | |||
learun.clientdata.getAllAsync('sourceData', { | |||
code: 'EmpInfo', | |||
callback: function (dataes) { | |||
EmpInfo = dataes.map(e => { return { value: e.empno, text: e.empname } }) | |||
resolve() | |||
} | |||
}); | |||
}) | |||
params = request('params') || '{}' | |||
query = request('query') || '{}' | |||
////获取班级text | |||
//learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
// key: JSON.parse(query).ClassNo, | |||
// keyId: request('ClassNo'), | |||
// callback: function (_data) { | |||
// $('.printTitle').text(_data.classname+'教学质量检测考生统计表') | |||
// } | |||
//}); | |||
//获取课程 | |||
$.lrSetFormWithParam(top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetLessonList', JSON.parse(params), | |||
function (data) { | |||
var temparr = []; | |||
for (var i = 0; i < data.length; i++) { | |||
let obj = EmpInfo.find(e => e.value == data[i].text ) | |||
var item = {}; | |||
item.label = data[i].value; | |||
item.name = data[i].text; | |||
item.width = 130; | |||
item.formatterAsync = function (callback, value, row, op, $cell) { | |||
callback(obj ? obj.text : '') | |||
} | |||
item.align = "center"; | |||
temparr.push(item); | |||
} | |||
LessonTemp = temparr; | |||
for (let i = 0; i < headData.length; i++) { | |||
if (headData[i].name == 'rkjs') { | |||
headData[i].children = LessonTemp | |||
break; | |||
} | |||
} | |||
page.initGird(); | |||
page.search() | |||
}); | |||
//page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
//打印 | |||
$('#lr_print').on('click', function () { | |||
$('#printPage').jqprint() | |||
}); | |||
$('#rowsInput').val(rows) | |||
$('#rowsInput').blur(e => { | |||
if (/^\+?[1-9]\d*$/.test($('#rowsInput').val())) { | |||
rows = $('#rowsInput').val() | |||
let obj = getQueryString() | |||
obj.rows = rows | |||
let url = location.href.split('?')[0] | |||
location.href = url + '?' + $.param(obj) | |||
return | |||
} | |||
function getQueryString() { | |||
var qs = location.search.substr(1), // 获取url中"?"符后的字串 | |||
args = {}, // 保存参数数据的对象 | |||
items = qs.length ? qs.split("&") : [], // 取得每一个参数项 | |||
item = null, | |||
len = items.length; | |||
for (var i = 0; i < len; i++) { | |||
item = items[i].split("="); | |||
var name = decodeURIComponent(item[0]), | |||
value = decodeURIComponent(item[1]); | |||
if (name) { | |||
args[name] = value; | |||
} | |||
} | |||
return args; | |||
} | |||
$('#rowsInput').val(rows) | |||
}) | |||
function deepClone(obj) { | |||
var copy; | |||
// Handle number, boolean, string, null and undefined | |||
if (null == obj || "object" != typeof obj) return obj; | |||
// Handle Date | |||
if (obj instanceof Date) { | |||
copy = new Date(); | |||
copy.setTime(obj.getTime()); | |||
return copy; | |||
} | |||
// Handle Array | |||
if (obj instanceof Array) { | |||
copy = []; | |||
for (var i = 0, len = obj.length; i < len; i++) { | |||
copy[i] = deepClone(obj[i]); | |||
} | |||
return copy; | |||
} | |||
// Handle Object | |||
if (obj instanceof Object) { | |||
copy = {}; | |||
for (var attr in obj) { | |||
if (obj.hasOwnProperty(attr)) copy[attr] = deepClone(obj[attr]); | |||
} | |||
return copy; | |||
} | |||
throw new Error("Unable to copy obj! Its type isn't supported."); | |||
} | |||
//列选择 | |||
$('#lr_columns').on('click', function () { | |||
if($('#columns').css('display') == 'block')return | |||
let currentHeadData = deepClone(headData) | |||
$('#columns').empty() | |||
$('#columns').show() | |||
//全选 | |||
$('#columns').append(`<li style="width:100%;"><input type="checkbox" value="allSelected" name="columns" /> <span>全选</span></li>`) | |||
$('#columns input[value=allSelected]').click(e => { | |||
$.each($('#columns input[type=checkbox]'), function (index, value) { | |||
if ($('#columns input[value=allSelected]')[0].checked) { | |||
if (!$(value).is(":checked")) { | |||
$(value).prop('checked', true) | |||
} | |||
} else { | |||
if ($(value).is(":checked")) { | |||
$(value).prop('checked', false) | |||
} | |||
} | |||
}); | |||
}) | |||
//字段列表 | |||
currentHeadData.forEach(e => { | |||
$('#columns').append(`<li><input type="checkbox" value="${e.name}" name="columns" ${ e.ishide?'':'checked'} /> <span>${e.label}</span></li>`) | |||
}) | |||
$('#columns input[type=checkbox]').change(e => { | |||
for (let i = 0; i < currentHeadData.length; i++){ | |||
if (currentHeadData[i].name == $(e.currentTarget).attr('value')) { | |||
currentHeadData[i].ishide = currentHeadData[i].ishide ? false : true | |||
} | |||
} | |||
//判断全选 | |||
let isAllSelected = true | |||
for (let i = 0; i < $('#columns input[type=checkbox]').length; i++) { | |||
if (i == 0) continue | |||
if (!$('#columns input[type=checkbox]')[i].checked) { | |||
isAllSelected = false | |||
break | |||
} | |||
} | |||
$('#columns input[value=allSelected]').prop('checked', isAllSelected) | |||
}) | |||
//判断全选 | |||
let isAllSelected = true | |||
for (let i = 0; i < $('#columns input[type=checkbox]').length; i++) { | |||
if (i == 0) continue | |||
if (!$('#columns input[type=checkbox]')[i].checked) { | |||
isAllSelected = false | |||
break | |||
} | |||
} | |||
$('#columns input[value=allSelected]').prop('checked', isAllSelected) | |||
//确定取消 | |||
$('#columns').append(`<li style="width:100%;display:flex;justify-content:right;border-bottom:0"><button id="cancelBtn"> 取消 </button> <button id="confirmBtn"> 确定 </button> </li>`) | |||
$('#cancelBtn').click(e => { | |||
$('#columns').css('display','none') | |||
}) | |||
$('#confirmBtn').click(e => { | |||
headData = null | |||
headData = deepClone(currentHeadData) | |||
$('#columns').css('display', 'none') | |||
for (let t = 1; t < pageNum; t++) { | |||
$("#gridtablePage" + t)[0].dfop = undefined | |||
} | |||
pageNum = 1 | |||
page.setHeadData() | |||
}) | |||
//点击其他地方关闭 | |||
$(document).bind("click", function (e) { | |||
if ($(e.target).closest("#columns").length == 0 && $(e.target).closest("#lr_columns").length == 0) { | |||
$("#columns").hide() | |||
} | |||
}) | |||
}); | |||
}, | |||
setHeadData: function () { | |||
let id = '#gridtablePage' + pageNum | |||
$(id).lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetTeachingQualityPageList', | |||
headData, | |||
mainId: 'AETId', | |||
sidx: ' AcademicYearNo desc,Semester desc,ExamDate desc, LessonNo desc,ClassRoomNo desc,ClassRoomNo desc,SitNumber asc ', | |||
isPage: true, | |||
rows, | |||
onRenderComplete: function (list) { | |||
if (list.length == rows) { | |||
pageNum += 1 | |||
//$('#printPage').append( | |||
// `<div class="page page` + pageNum + `"> | |||
// <div class="pageContent"> | |||
// <div class="printTitle">教学质量检测考生统计表</div> | |||
// <div class="lr-layout-body" id="gridtablePage` + pageNum + `"></div> | |||
// </div> | |||
// </div>` | |||
//) | |||
page.setHeadData() | |||
} else { | |||
if (!list.length) { | |||
$('.page' + pageNum).remove() | |||
} | |||
} | |||
} | |||
}); | |||
page.search(); | |||
}, | |||
initGird: function () { | |||
let id = '#gridtablePage' + pageNum | |||
$(id).jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ArrangeExamTermNew/GetTeachingQualityPageList', | |||
headData, | |||
mainId: 'AETId', | |||
sidx: ' AcademicYearNo desc,Semester desc,ExamDate desc, LessonNo desc,ClassRoomNo desc,ClassRoomNo desc,SitNumber asc ', | |||
isPage: true, | |||
rows, | |||
onRenderComplete: function (list) { | |||
if (list.length == rows) { | |||
pageNum += 1 | |||
$('#printPage').append( | |||
`<div class="page page` + pageNum +`"> | |||
<div class="pageContent"> | |||
<div class="printTitle">教学质量检测考生统计表</div> | |||
<div class="lr-layout-body" id="gridtablePage` + pageNum + `"></div> | |||
</div> | |||
</div>` | |||
) | |||
page.initGird() | |||
} else { | |||
if (!list.length) { | |||
$('.page' + pageNum).remove() | |||
} | |||
} | |||
} | |||
}); | |||
page.search(); | |||
}, | |||
search: function () { | |||
$('#gridtablePage' + pageNum).jfGridSet('reload', { queryJson: query }, { page: pageNum }); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -44,9 +44,10 @@ var bootstrap = function ($, learun) { | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, | |||
{ label: "考场名称", name: "ClassroomName", width: 200, align: "left" }, | |||
{ label: "座位行数", name: "SeatRows", width: 100, align: "left" }, | |||
{ label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, | |||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | |||
{ label: "座位行数", name: "SeatRows", width: 60, align: "left" }, | |||
{ label: "座位列数", name: "SeatColumns", width: 60, align: "left" }, | |||
{ label: "考场座位数", name: "SeatCount", width: 60, align: "left" }, | |||
{ label: "可用座位数", name: "ActualNum", width: 60, align: "left" }, | |||
//{ | |||
// label: "是否启用", name: "EREnabled", width: 100, align: "left", | |||
// formatter: function (cellvalue) { | |||
@@ -14,7 +14,8 @@ | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom"> | |||
<div class="lr-form-item-title">考场座位数</div> | |||
<input id="SeatCount" readonly="readonly" type="text" class="form-control"> | |||
<input id="ActualNum" readonly="readonly" type="text" class="form-control"> | |||
<input id="SeatCount" hidden> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">监考老师</div> | |||
@@ -134,6 +134,7 @@ var bootstrap = function ($, learun) { | |||
} else { | |||
$("#ClassroomName").val(temprow.ClassroomName); | |||
$('#ClassroomNo').val(temprow.ClassroomNo); | |||
$('#ActualNum').val(temprow.ActualNum); | |||
$('#SeatCount').val(temprow.SeatCount); | |||
} | |||
}); | |||
@@ -225,6 +225,7 @@ var bootstrap = function ($, learun) { | |||
{ label: "考场名称", name: "ClassroomName", width: 100, align: "left" }, | |||
{ label: "考场编号", name: "ClassroomNo", width: 100, align: "left" }, | |||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | |||
{ label: "可用座位数", name: "ActualNum", width: 100, align: "left" }, | |||
{ label: "监考老师编号", name: "EmpNo", width: 150, align: "left" }, | |||
{ label: "监考老师姓名", name: "EmpName", width: 100, align: "left" }, | |||
], | |||
@@ -0,0 +1,130 @@ | |||
@{ | |||
ViewBag.Title = "考场信息-查看"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div id="app" style="padding:20px;"> | |||
<div class="title" style="font-size:18px;color:#333;lineHeight:50px;textAlign:center;position:relative;"> | |||
{{dataOne.tClassroomName}}排考座位表 | |||
<div class="btn btn-primary no-print" style="position:absolute;right:0;top:6px" v-on:click="printClick">打 印</div> | |||
</div> | |||
@*<div class="desc" style="display:flex;justifyContent:space-between;color:#666;padding:10px;"> | |||
<span>监考老师:{{dataOne.teach}}</span> | |||
<span>考试时间:{{dataOne.EaxmStartTime}}{{dataOne.EaxmEndTime}}</span> | |||
</div>*@ | |||
<ul class="SeatList" style="overflow:scroll;height:600px"> | |||
<li v-for="(item,index) in SeatList" :ECEnabled="item.ECEnabled" :key="item.ECOrder" :style="{color:'#fff',width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center'}"> | |||
<div class="content" v-on:click="itemClick(item.ECOrder)" :style="{border:'1px solid #ccc',padding:'6px',cursor:'pointer',background:item.ECEnabled?'#409EFF':'#909399'}"> | |||
<div>{{item.ECEnabled?'正常':'禁用'}}</div> | |||
{{item.ECOrder}} | |||
</div> | |||
</li> | |||
</ul> | |||
<div style="color:#333;font-size:14px;text-align:center;line-height:80px" v-if="isEmpty">暂无数据</div> | |||
</div> | |||
<script> | |||
var acceptClick; | |||
var vm = new Vue({ | |||
el: "#app", | |||
data() { | |||
return { | |||
SeatList: [], | |||
SeatList_:[], | |||
dataOne: {}, | |||
StuListColumns: [], | |||
width: '10%', | |||
isEmpty: false, | |||
} | |||
}, | |||
created() { | |||
this.getData() | |||
}, | |||
mounted() { | |||
acceptClick = this.submit | |||
}, | |||
methods: { | |||
getData: function () { | |||
$.ajax({ | |||
url: '/EducationalAdministration/Exam_ExamRoom/GetClassRoomDetailData', | |||
data: { | |||
ClassRoomNo: request('ClassRoomNo'), AcademicYearNo: request('AcademicYearNo'), Semester: request('Semester') | |||
}, | |||
type: "Post", | |||
dataType: "json", | |||
async: true, | |||
cache: false, | |||
success: (res) => { | |||
console.log(res, "data") | |||
if (res.code == 200) { | |||
let SeatList = res.data.Exam_ExamRoomDetailData || [] | |||
this.SeatList_ = JSON.parse(JSON.stringify(SeatList)) | |||
this.dataOne = res.data.Exam_ExamRoomData || {} | |||
if (!SeatList.length) { | |||
this.isEmpty = true | |||
return | |||
} | |||
//多少列 | |||
let cols = this.dataOne.SeatColumns | |||
//多少行 | |||
let rows = this.dataOne.SeatRows | |||
//列的宽度 | |||
this.width = 100 / this.dataOne.SeatColumns + '%' | |||
function arrayToMatrix(arr, size) { | |||
var matrix = [], index = 0; | |||
for (var i = 0; i < arr.length; i += size) { | |||
let pushArr = arr.slice(i, i + size) | |||
if (index % 2 !== 0) pushArr.reverse(); | |||
index += 1 | |||
matrix.push(pushArr); | |||
} | |||
return matrix; | |||
} | |||
SeatList = arrayToMatrix(SeatList, rows) | |||
for (let row = 0; row < rows; row++) { | |||
for (let col = 0; col < cols; col++) { | |||
this.SeatList.push(SeatList[col][row]) | |||
} | |||
} | |||
} | |||
}, | |||
error: function (XMLHttpRequest, textStatus, errorThrown) { | |||
}, | |||
beforeSend: function () { | |||
}, | |||
complete: function () { | |||
} | |||
}) | |||
}, | |||
itemClick(ECOrder) { | |||
//保存接口 | |||
//传参学年学期,考场编号+名称 +list(ECorder,EcEnbaled)空就是fasle 允许有人就是true | |||
let obj = this.SeatList_.find(e => e.ECOrder == ECOrder) | |||
obj.ECEnabled = !obj.ECEnabled | |||
let obj1 = this.SeatList.find(e => e.ECOrder == ECOrder) | |||
obj1.ECEnabled = !obj1.ECEnabled | |||
}, | |||
submit(callBack) { | |||
var postData = { | |||
ClassRoomNo: request('ClassRoomNo'), AcademicYearNo: request('AcademicYearNo'), Semester: Number(request('Semester')), | |||
list: this.SeatList_ | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/SaveDetailForm?keyValue=' + request('keyValue'), postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}, | |||
printClick() { | |||
$('.btn').css('display', 'none') | |||
$('.SeatList').css('overflow', 'unset') | |||
$('.SeatList').css('height', 'auto') | |||
$('#app').jqprint({ noPrintSelector: ".no-print", }) | |||
$('.SeatList').css('height', '600px') | |||
$('.SeatList').css('overflow', 'scroll') | |||
$('.btn').css('display', 'block') | |||
} | |||
}, | |||
}) | |||
</script> |
@@ -45,6 +45,7 @@ | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_importByBasic" class="btn btn-default"><i class="fa fa-plus"></i> 从教室导入</a> | |||
<a id="lr_emptyWhere" class="btn btn-default"><i class="fa fa-trash-o"></i> 按条件清空数据</a> | |||
<a id="lr_seat" class="btn btn-default"><i class="fa fa-plus"></i> 座位</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -59,6 +59,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录已启用!"); | |||
return false; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
@@ -87,7 +92,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
}); | |||
// 按条件清空数据 | |||
$('#lr_emptyWhere').on('click', function () { | |||
learun.layerForm({ | |||
@@ -111,6 +116,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/DeleteForm', { keyValue: keyValue }, function () { | |||
@@ -147,6 +157,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录中包含已停用项目!"); | |||
return; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认停用选中记录!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Lock', { keyValue: keyValue, EREnabled: 0 }, function () { | |||
@@ -156,7 +171,35 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
$('#lr_seat').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ERId'); | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
//if (IsEdit.indexOf('false') != -1) { | |||
// learun.alert.warning("选中记录中包含不可编辑项目!"); | |||
// return; | |||
//} | |||
if (learun.checkrow(keyValue)) { | |||
var AcademicYearNo = $('#gridtable').jfGridValue('AcademicYearNo'); | |||
var Semester = $('#gridtable').jfGridValue('Semester'); | |||
var classroomNo = $('#gridtable').jfGridValue('ClassroomNo'); | |||
learun.layerForm({ | |||
id: 'form_seat', | |||
title: '座位', | |||
width: 1200, | |||
height: 800, | |||
btn: IsEdit.indexOf('false') != -1 ? [] : ['确认', '关闭'], | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormSeat?keyValue=' + keyValue + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester + '&ClassRoomNo=' + classroomNo, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -170,12 +213,20 @@ var bootstrap = function ($, learun) { | |||
{ label: "座位行数", name: "SeatRows", width: 100, align: "left" }, | |||
{ label: "座位列数", name: "SeatColumns", width: 100, align: "left" }, | |||
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" }, | |||
{ label: "实际考试人数", name: "ActualNum", width: 100, align: "left" }, | |||
{ | |||
label: "是否启用", name: "EREnabled", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
{ | |||
label: "是否可编辑", name: "IsEdit", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<span class=\"label label-success\">可编辑</span>" : "<span class=\"label label-danger\">不可编辑</span>"; | |||
} | |||
}, | |||
], | |||
mainId: 'ERId', | |||
isMultiselect: true, | |||
@@ -134,6 +134,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OrdinaryScore > 150) { | |||
row.OrdinaryScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -145,6 +148,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermInScore > 150) { | |||
row.TermInScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -156,6 +162,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -167,6 +176,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OtherScore > 150) { | |||
row.OtherScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -138,6 +138,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OrdinaryScore > 150) { | |||
row.OrdinaryScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -149,6 +152,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermInScore > 150) { | |||
row.TermInScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -160,6 +166,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -171,6 +180,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OtherScore > 150) { | |||
row.OtherScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -138,6 +138,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OrdinaryScore > 150) { | |||
row.OrdinaryScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -149,6 +152,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermInScore > 150) { | |||
row.TermInScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -160,6 +166,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -171,6 +180,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OtherScore > 150) { | |||
row.OtherScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -138,6 +138,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OrdinaryScore > 150) { | |||
row.OrdinaryScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -149,6 +152,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermInScore > 150) { | |||
row.TermInScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -160,6 +166,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -171,6 +180,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.OtherScore > 150) { | |||
row.OtherScore = parseFloat('0'); | |||
} | |||
row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -134,6 +134,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(0); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -137,6 +137,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(0); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -134,6 +134,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(0); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -137,6 +137,9 @@ var bootstrap = function ($, learun) { | |||
type: 'input', | |||
inputType: 'number', | |||
change: function (row, rownum) { | |||
if (row.TermEndScore > 150) { | |||
row.TermEndScore = parseFloat('0'); | |||
} | |||
row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(0); | |||
$('#gridtable').jfGridSet('updateRow', rownum); | |||
}, | |||
@@ -0,0 +1,24 @@ | |||
@{ | |||
ViewBag.Title = "Form"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<link href="~/Content/webuploader/webuploader.css" rel="stylesheet" /> | |||
<script src="~/Content/webuploader/webuploader.nolog.min.js"></script> | |||
@Html.AppendCssFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.css") | |||
<div class="lr-form-layout lr-form-layout-top-bottom"> | |||
<div class="lr-form-layout-header"> | |||
<div id="lr_add_file_btn"><i class="fa fa-cloud-upload"></i><span class="lrlt">上传文件</span></div> | |||
<div class="webuploader-pick" id="lr_down_file_btn"><i class="fa fa-download"></i><span class="lrlt">下载模板</span></div> | |||
</div> | |||
<div class="lr-form-layout-body"> | |||
<div class="lr-form-file-queue-wrap" id="lr_form_file_queue"> | |||
<div class="lr-form-file-queue" id="lr_form_file_queue_list"> | |||
</div> | |||
<div class="lr-form-file-queue-bg"> | |||
<h1><span class="lrlt">试试将电脑里的文件拖拽到此上传</span></h1> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/ImportForm.js") |
@@ -0,0 +1,136 @@ | |||
.lr-form-layout-body { | |||
padding:0 5px 5px 5px; | |||
} | |||
.lr-form-file-queue-wrap { | |||
position:relative; | |||
width:100%; | |||
height:100%; | |||
border:1px solid #ddd; | |||
border-radius:4px; | |||
} | |||
.lr-form-file-queue { | |||
position:relative; | |||
} | |||
.lr-form-file-queue { | |||
position:relative; | |||
} | |||
.lr-form-file-queue-item { | |||
position:relative; | |||
width:100%; | |||
height:50px; | |||
border-bottom:1px solid #ddd; | |||
padding-left:60px; | |||
} | |||
.lr-file-image { | |||
position:absolute; | |||
top:5px; | |||
left:5px; | |||
} | |||
.lr-file-image img { | |||
width:40px; | |||
height:40px; | |||
} | |||
.lr-file-name{ | |||
line-height:50px; | |||
} | |||
.lr-msg { | |||
position:absolute; | |||
top:0; | |||
right:5px; | |||
font-size: 25px; | |||
line-height:50px; | |||
} | |||
.lr-msg .fa-check-circle{ | |||
color: #5cb85c; | |||
} | |||
.lr-msg .fa-exclamation-circle { | |||
color: #b94a48; | |||
} | |||
.lr-msg2 { | |||
position:absolute; | |||
top:0; | |||
right:5px; | |||
line-height:50px; | |||
} | |||
.lr-msg2 span { | |||
color:#333; | |||
font-size:14px; | |||
margin-right:5px; | |||
} | |||
.lr-tool-bar { | |||
position:absolute; | |||
top:0; | |||
right:35px; | |||
font-size: 25px; | |||
line-height:50px; | |||
color:#666; | |||
cursor:pointer; | |||
} | |||
.lr-tool-bar > i { | |||
margin-left:8px; | |||
} | |||
.lr-tool-bar .fa-minus-circle { | |||
color: #b94a48; | |||
} | |||
.lr-tool-bar .fa-cloud-download { | |||
color: #3498db; | |||
} | |||
.lr-uploader-progress { | |||
position:absolute; | |||
bottom:2px; | |||
left:60px; | |||
height:4px; | |||
width:500px; | |||
width:calc(100% - 90px); | |||
} | |||
.lr-uploader-progress-bar { | |||
position:relative; | |||
height:100%; | |||
background-color:#039cfd; | |||
border-radius:4px; | |||
} | |||
.lr-form-file-queue-bg { | |||
position:absolute; | |||
top:50%; | |||
left:50%; | |||
width:300px; | |||
height:30px; | |||
line-height:30px; | |||
margin:-15px 0 0 -150px; | |||
} | |||
.lr-form-file-queue-bg h1 { | |||
color: #666; | |||
font-size: 20px; | |||
font-family: Microsoft Yahei; | |||
padding-bottom: 2px; | |||
margin: 0; | |||
} | |||
#lr_down_file_btn { | |||
position:absolute; | |||
right:5px; | |||
background:#fff; | |||
border:1px solid #ddd; | |||
color:#333; | |||
} | |||
#lr_down_file_btn:hover { | |||
color:#337ab7; | |||
} | |||
/*对百度插件的样式重写*/ | |||
.webuploader-container { | |||
position:absolute; | |||
} | |||
.webuploader-pick { | |||
padding:8px 15px; | |||
background-color:#039cfd; | |||
} | |||
.webuploader-pick-hover { | |||
background-color:#027dcb; | |||
} |
@@ -0,0 +1,158 @@ | |||
/* | |||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:陈彬彬 | |||
* 日 期:2024-10-16 11:02 | |||
* 描 述:导入往年成绩管理 | |||
*/ | |||
var id = request('id'); | |||
var keyVaule = ''; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var fileInfo = {}; | |||
// 触发合并文件碎片 | |||
var mergeFileChunks = function (file) { | |||
var param = {}; | |||
param['__RequestVerificationToken'] = $.lrToken; | |||
param['fileId'] = fileInfo[file.id].fileGuid; | |||
param['chunks'] = fileInfo[file.id].chunks; | |||
param['ext'] = file.ext; | |||
param['templateId'] = id; | |||
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/ExcelImport/StuScoreOfPreviousImport", param, function (res) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress').remove(); | |||
if (res.code == learun.httpCode.success) { | |||
if (res.data.Success != '0') { | |||
learun.alert.success('导入成功' + res.data.Success + '条'); | |||
} | |||
// 文件保存成功后 | |||
$fileItem.append('<div class="lr-msg2"><span>' + res.data.Success + '</span><span>/</span><span style="color:#b94a48;" >' + res.data.Fail + '</span></div>'); | |||
// 如果有失败 | |||
if (res.data.Fail != '0') | |||
{ | |||
learun.download({ url: top.$.rootUrl + '/LR_SystemModule/ExcelImport/DownImportErrorFile', param: { fileId: fileInfo[file.id].fileGuid, fileName: fileInfo[file.id].name, __RequestVerificationToken: $.lrToken }, method: 'POST' }); | |||
} | |||
} | |||
else { | |||
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>'); | |||
} | |||
}); | |||
} | |||
// 触发清楚文件碎片 | |||
var reomveFileChunks = function (file) { | |||
var param = {}; | |||
param['__RequestVerificationToken'] = $.lrToken; | |||
param['fileGuid'] = fileInfo[file.id].fileGuid; | |||
param['chunks'] = fileInfo[file.id].chunks; | |||
learun.httpAsyncPost(top.$.rootUrl + "/LR_SystemModule/Annexes/MergeAnnexesFile", param, function (res) { }); | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress').remove(); | |||
$fileItem.append('<div class="lr-msg"><i class="fa fa-exclamation-circle"></i></div>'); | |||
} | |||
var page = { | |||
uploader: null, | |||
init: function () { | |||
/*模板下载*/ | |||
$('#lr_down_file_btn').on('click', function () { | |||
learun.download({ url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/DownTemplate', param: { keyValue: id, __RequestVerificationToken: $.lrToken }, method: 'POST' }); | |||
}); | |||
if (!WebUploader.Uploader.support()) { | |||
alert('Web Uploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器'); | |||
throw new Error('WebUploader does not support the browser you are using.'); | |||
} | |||
page.uploader = WebUploader.create({ | |||
auto: true, | |||
swf: top.$.rootUrl + '/Content/webuploader/Uploader.swf', | |||
// 文件接收服务端。 | |||
server: top.$.rootUrl + "/LR_SystemModule/Annexes/UploadAnnexesFileChunk", | |||
// 选择文件的按钮。可选。 | |||
// 内部根据当前运行是创建,可能是input元素,也可能是flash. | |||
pick: '#lr_add_file_btn', | |||
dnd: '#lr_form_file_queue', | |||
paste: 'document.body', | |||
disableGlobalDnd: true, | |||
accept: { | |||
extensions: "xls,xlsx" | |||
}, | |||
multiple: true, | |||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传! | |||
resize: false, | |||
// 文件分片上传 | |||
chunked: true, | |||
chunkRetry: 3, | |||
prepareNextFile: true, | |||
chunkSize: '1048576', | |||
// 上传参数 | |||
formData: { | |||
__RequestVerificationToken: $.lrToken | |||
} | |||
}); | |||
page.uploader.on('fileQueued', page.fileQueued); | |||
page.uploader.on('uploadStart', page.uploadStart); | |||
page.uploader.on('uploadBeforeSend', page.uploadBeforeSend); | |||
page.uploader.on('uploadProgress', page.uploadProgress); | |||
page.uploader.on('uploadSuccess', page.uploadSuccess); | |||
page.uploader.on('uploadError', page.uploadError); | |||
page.uploader.on('uploadComplete', page.uploadComplete); | |||
page.uploader.on('error', page.error); | |||
$('#lr_form_file_queue').lrscroll(); | |||
}, | |||
fileQueued: function (file) {// 文件加载到队列 | |||
fileInfo[file.id] = { name: file.name }; | |||
$('#lr_form_file_queue .lr-form-file-queue-bg').hide(); | |||
// 添加一条文件记录 | |||
var $item = $('<div class="lr-form-file-queue-item" id="lr_filequeue_' + file.id + '" ></div>'); | |||
$item.append('<div class="lr-file-image"><img src="' + top.$.rootUrl + '/Content/images/filetype/' + file.ext + '.png"></div>'); | |||
$item.append('<span class="lr-file-name">' + file.name + '(' + learun.countFileSize(file.size) + ')</span>'); | |||
$('#lr_form_file_queue_list').append($item); | |||
}, | |||
uploadStart: function (file) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.append('<div class="lr-uploader-progress"><div class="lr-uploader-progress-bar" style="width:0%;"></div></div>'); | |||
}, | |||
uploadBeforeSend: function (object, data, headers) { | |||
data.chunk = data.chunk || 0; | |||
data.chunks = data.chunks || 1; | |||
fileInfo[data.id].fileGuid = fileInfo[data.id].fileGuid || WebUploader.Base.guid(); | |||
data.fileGuid = fileInfo[data.id].fileGuid; | |||
fileInfo[data.id].chunks = data.chunks; | |||
}, | |||
uploadProgress: function (file, percentage) { | |||
var $fileItem = $('#lr_form_file_queue_list').find('#lr_filequeue_' + file.id); | |||
$fileItem.find('.lr-uploader-progress-bar').css('width', (percentage * 100 + '%')); | |||
}, | |||
uploadSuccess: function (file, res) { | |||
if (res.code == 200) {// 上传成功 | |||
mergeFileChunks(file); | |||
} | |||
else {// 上传失败 | |||
reomveFileChunks(file); | |||
} | |||
}, | |||
uploadError: function (file, code) { | |||
reomveFileChunks(file); | |||
}, | |||
uploadComplete: function (file) { | |||
}, | |||
error: function (type) { | |||
switch (type) { | |||
case 'Q_TYPE_DENIED': | |||
learun.alert.error('当前文件类型不允许上传'); | |||
break; | |||
}; | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,45 @@ | |||
@{ | |||
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"> | |||
<div id="LessonSortNo" type="lrselect" class="lr-select"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<input id="keyword" 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 class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="importBtn" class="btn btn-default"><i class="fa fa-plus"></i> 导入</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreOfPrevious/Index.js") |
@@ -0,0 +1,137 @@ | |||
/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2024-10-16 11:02 | |||
* 描 述:往年成绩管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
//学年 | |||
$('#AcademicYearNo').lrselect({ | |||
placeholder: "学年", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/GetAcademicYearNoData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//学期 | |||
$('#Semester').lrselect({ | |||
placeholder: "学期", | |||
allowSearch: false, | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', | |||
value: 'value', | |||
text: 'text' | |||
}); | |||
//课程类型 | |||
$('#LessonSortNo').lrselect({ | |||
placeholder: "课程类型", | |||
allowSearch: false, | |||
data: [{ id: "1", text: "必修课" }, { id: "2", text: "选修课" }] | |||
}); | |||
//查询 | |||
$('#btn_Search').on('click', function () { | |||
var param = { | |||
AcademicYearNo: $("#AcademicYearNo").lrselectGet(), | |||
Semester: $("#Semester").lrselectGet(), | |||
LessonSortNo: $("#LessonSortNo").lrselectGet(), | |||
keyword: $("#keyword").val() | |||
}; | |||
page.search(param); | |||
}); | |||
//导入弹窗 | |||
$('#importBtn').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form_import', | |||
title: '导入数据', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/ImportForm', | |||
width: 600, | |||
height: 400, | |||
btn: null | |||
}); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuScoreOfPrevious/GetPageList', | |||
headData: [ | |||
{ 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: "DeptNo", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left" | |||
}, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left" | |||
}, | |||
{ label: "年级", name: "Grade", width: 100, align: "left" }, | |||
{ label: '学年', name: 'AcademicYearNo', width: 100, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 80, align: "left" }, | |||
{ | |||
label: '课程类型', name: 'LessonSortNo', width: 100, align: "left", formatter: function (cellvalue) { | |||
return cellvalue == "1" ? "必修课" : "选修课"; | |||
} | |||
}, | |||
{ label: '课程编号', name: 'LessonNo', width: 150, align: "left" }, | |||
{ label: '课程名称', name: 'LessonName', width: 150, align: "left" }, | |||
{ label: '学分', name: 'StudyScore', width: 100, align: "left" }, | |||
{ | |||
label: '平时成绩', name: 'OrdinaryScore', width: 100, align: "left" | |||
}, | |||
{ label: '期中成绩', name: 'TermInScore', width: 100, align: "left" }, | |||
{ | |||
label: '期末成绩', name: 'TermEndScore', width: 100, align: "left" | |||
}, | |||
{ label: '总成绩', name: 'Score', width: 100, align: "left" }, | |||
{ label: '教师编号', name: 'EmpNo', width: 100, align: "left" }, | |||
{ label: '上课节次', name: 'LessonSection', width: 100, align: "left" }, | |||
{ label: '教室编号', name: 'ClassRoomNo', width: 100, align: "left" }, | |||
{ label: '教室名称', name: 'ClassRoomName', width: 100, align: "left" }, | |||
{ label: '编辑日期', name: 'ModifyDate', width: 150, align: "left" }, | |||
{ label: '编辑用户', name: 'ModifyUserName', width: 100, align: "left" }, | |||
{ | |||
label: "审核状态", name: "CheckMark", width: 80, align: "center", | |||
formatter: function (cellvalue) { | |||
return cellvalue == "1" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>"; | |||
} | |||
}, | |||
], | |||
mainId: 'ScoreId', | |||
isPage: true, | |||
sidx: 'AcademicYearNo desc,Semester desc,LessonNo,StuNo', | |||
sord: "" | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -22,6 +22,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
private ExcelImportIBLL excelImportIBLL = new ExcelImportBLL(); | |||
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); | |||
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | |||
private StuScoreOfPreviousIBLL stuScoreOfPreviousIBLL = new StuScoreOfPreviousBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 导入模板管理页面 | |||
@@ -289,7 +290,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
} | |||
} | |||
/// <summary> | |||
/// | |||
/// 课表导入 | |||
/// </summary> | |||
/// <param name="fileId"></param> | |||
/// <param name="chunks"></param> | |||
@@ -317,6 +318,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
return Fail("导入数据失败!"); | |||
} | |||
} | |||
/// <summary> | |||
/// 往年成绩管理导入 | |||
/// </summary> | |||
/// <param name="fileId"></param> | |||
/// <param name="chunks"></param> | |||
/// <param name="ext"></param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
public ActionResult StuScoreOfPreviousImport(string fileId, int chunks, string ext) | |||
{ | |||
UserInfo userInfo = LoginUserInfo.Get(); | |||
string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); | |||
if (!string.IsNullOrEmpty(path)) | |||
{ | |||
DataTable dt = ExcelHelper.ExcelImport(path); | |||
var res = stuScoreOfPreviousIBLL.StuScoreOfPreviousImport(dt, fileId); | |||
var data = new | |||
{ | |||
Success = res.Split('|')[0], | |||
Fail = res.Split('|')[1] | |||
}; | |||
return JsonResult(data); | |||
} | |||
else | |||
{ | |||
return Fail("导入数据失败!"); | |||
} | |||
} | |||
/// <summary> | |||
/// 下载文件(导入文件未被导入的数据) | |||
/// </summary> | |||
@@ -23,7 +23,8 @@ | |||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> | |||
<RestorePackages>true</RestorePackages> | |||
<UseGlobalApplicationHostFile /> | |||
<Use64BitIISExpress /> | |||
<Use64BitIISExpress> | |||
</Use64BitIISExpress> | |||
<SccProjectName> | |||
</SccProjectName> | |||
<SccLocalPath> | |||
@@ -109,9 +110,6 @@ | |||
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention"> | |||
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<SpecificVersion>False</SpecificVersion> | |||
</Reference> | |||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> | |||
<Private>True</Private> | |||
@@ -378,6 +376,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuGraduateConditionController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuGrantController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuInfoBasicChangeController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreOfPreviousController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreNotPassController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_DefaultPwdConfigController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_PsychologicalCounseController.cs" /> | |||
@@ -1015,6 +1014,12 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTermAttemperChild\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTermAttemperChild\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.css" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\IndexClassRoom.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityPrint.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuGraduateCondition\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuGraduateCondition\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\GraduateCardDeregistrate.js" /> | |||
@@ -7999,6 +8004,13 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeLessonTermAttemperChild\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\AllStuScoreQueryIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScore\AllStuScoreQueryPrint.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\SeatForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityPrint.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\IndexClassRoom.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreOfPrevious\ImportForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamRoom\FormSeat.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考试课程表 | |||
/// </summary> | |||
public class Exam_ExamRoomDetailMap : EntityTypeConfiguration<Exam_ExamRoomDetailEntity> | |||
{ | |||
public Exam_ExamRoomDetailMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("Exam_ExamRoomDetail"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousMap : EntityTypeConfiguration<StuScoreOfPreviousEntity> | |||
{ | |||
public StuScoreOfPreviousMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("STUSCOREOFPREVIOUS"); | |||
//主键 | |||
this.HasKey(t => t.ScoreId); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -85,6 +85,7 @@ | |||
<Compile Include="EducationalAdministration\ExamSubjectMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ArrangeExamTermItemNewMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ArrangeExamTermNewMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoomDetailMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamLessonMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanClassMap.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLessonMap.cs" /> | |||
@@ -110,6 +111,7 @@ | |||
<Compile Include="EducationalAdministration\StuInfoBasicChangeMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoFreshMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoFreshOnlineServiceMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPreviousMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPassMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuSelectLessonListOfElectivePreMap.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_DefaultPwdConfigMap.cs" /> | |||
@@ -53,6 +53,44 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 考场 | |||
/// </summary> | |||
/// <returns></returns> | |||
public List<TreeModel> GetClassRoomTree(string AcademicYearNo, string Semester) | |||
{ | |||
try | |||
{ | |||
var list = exam_ArrangeExamTermNewService.GetClassRoomTree(AcademicYearNo, Semester); | |||
List<TreeModel> treeList = new List<TreeModel>(); | |||
foreach (var item in list) | |||
{ | |||
TreeModel node = new TreeModel | |||
{ | |||
id = item.ClassroomNo, | |||
text = item.ClassroomName, | |||
value = item.ClassroomNo, | |||
showcheck = false, | |||
checkstate = 0, | |||
isexpand = true, | |||
parentId = "0" | |||
}; | |||
treeList.Add(node); | |||
} | |||
return treeList.ToTree(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetPageListForClass(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
@@ -72,6 +110,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> ScreeningPlan(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ArrangeExamTermNewService.ScreeningPlan(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetItemPageList(Pagination pagination, string queryJson) | |||
{ | |||
@@ -91,6 +147,62 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetTeachingQualityPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ArrangeExamTermNewService.GetTeachingQualityPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<WebHelper.YearGrade> GetLessonList(string academicYearNo, string semester, string classNo) | |||
{ | |||
try | |||
{ | |||
return exam_ArrangeExamTermNewService.GetLessonList(academicYearNo, semester, classNo); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo, string LessonNo, string EmpNo, string ExamDate, string ExamTime) | |||
{ | |||
try | |||
{ | |||
return exam_ArrangeExamTermNewService.GetStuList(AcademicYearNo, Semester, ClassRoomNo, LessonNo, EmpNo, ExamDate, ExamTime); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -1,6 +1,7 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using System; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
@@ -16,8 +17,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
#region 获取数据 | |||
List<TreeModel> GetClassTree(); | |||
List<TreeModel> GetClassRoomTree(string AcademicYearNo, string Semester); | |||
IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetPageListForClass(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 场次安排表 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
IEnumerable<Exam_ArrangeExamTermItemNewEntity> ScreeningPlan(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetItemPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetTeachingQualityPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 教学质量监测 | |||
/// </summary> | |||
/// <param name="academicYearNo"></param> | |||
/// <param name="semester"></param> | |||
/// <param name="classNo"></param> | |||
/// <returns></returns> | |||
IEnumerable<WebHelper.YearGrade> GetLessonList(string academicYearNo, string semester, string classNo); | |||
IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo, string LessonNo, string EmpNo, string ExamDate | |||
, string ExamTime); | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -23,7 +23,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>("select ClassNo,ClassName from Exam_ArrangeExamTermItemNew where ClassNo is not null group by ClassNo,ClassName order by ClassNo"); | |||
return this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(@"select ClassNo,ClassName from Exam_ArrangeExamTermItemNew where ClassNo is not null and ClassName is not null group by ClassNo,ClassName order by ClassNo"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 考场数据去重 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomEntity> GetClassRoomTree(string AcademicYearNo, string Semester) | |||
{ | |||
try | |||
{ | |||
var sql = @" select e.ClassroomNo,e.ClassroomName from Exam_ArrangeExamTermItemNew e join ( | |||
select ClassroomNo, ClassroomName from Exam_ExamRoom where 1 = 1 "; | |||
if (!AcademicYearNo.IsEmpty()) | |||
{ | |||
sql += $" and AcademicYearNo ='{AcademicYearNo}' "; | |||
} | |||
if (!Semester.IsEmpty()) | |||
{ | |||
sql += $" and Semester ={Semester} "; | |||
} | |||
sql += @" ) a on e.ClassroomName=a.ClassroomName and e.ClassroomNo =a.ClassroomNo | |||
group by e.ClassroomNo,e.ClassroomName"; | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomEntity>(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -107,6 +143,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 场次安排 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> ScreeningPlan(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select t.lessonName,t.lessonno,t.Examdate,t.examtime,t.EmpName,t.EmpNo,t.ClassroomNo,t.ClassroomName,l.TeachMajorNo,e.AcademicYearNo ,e.Semester,count(*) as ClassRoomNum | |||
from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId | |||
left join LessonInfo l on l.LessonNo = t.LessonNo where 1=1 and t.ClassNo is not null "); | |||
var queryParam = queryJson.ToJObject(); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and e.AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
strSql.Append(" and e.Semester='" + queryParam["Semester"].ToString() + "' "); | |||
} | |||
if (!queryParam["LessonNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.LessonNo like '%" + queryParam["LessonNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["EmpNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["ClassRoomNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND ( t.ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND t.ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
} | |||
strSql.Append(@"group by t.lessonName,t.lessonno,t.Examdate,t.examtime,t.EmpName,t.EmpNo,t.ClassroomNo,t.ClassroomName ,l.TeachMajorNo,e.AcademicYearNo ,e.Semester "); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ArrangeExamTermItemNewEntity>(strSql.ToString(), pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取排考详情 | |||
/// </summary> | |||
@@ -118,7 +209,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select t.*,e.AcademicYearNo,e.Semester from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId where 1=1 and t.ClassNo is not null "); | |||
strSql.Append(@"select t.*,e.AcademicYearNo,e.Semester,s.StuCode from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId "); | |||
strSql.Append(@" left join stuinfobasic s on s.StuNo=t.StuNo where 1=1 and t.ClassNo is not null "); | |||
var queryParam = queryJson.ToJObject(); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
@@ -132,10 +224,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
strSql.Append(" and t.LessonNo like '%" + queryParam["LessonNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["LessonName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.LessonName like '%" + queryParam["LessonName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassNo='" + queryParam["ClassNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["ClassName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassName like'%" + queryParam["ClassName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.StuNo='" + queryParam["StuNo"].ToString() + "' "); | |||
@@ -144,10 +244,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
strSql.Append(" and t.EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["EmpName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.EmpName like '%" + queryParam["EmpName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["ClassRoomNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["ClassRoomName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassRoomName like '%" + queryParam["ClassRoomName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
@@ -168,6 +276,110 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 获取排考详情 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetTeachingQualityPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select t.*,e.AcademicYearNo,e.Semester,s.StuCode,s.DeptNo,s.MajorNo,s.StuId from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId "); | |||
strSql.Append(@" left join stuinfobasic s on s.StuNo=t.StuNo where 1=1 and t.ClassNo is not null "); | |||
var queryParam = queryJson.ToJObject(); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and e.AcademicYearNo='" + queryParam["AcademicYearNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
strSql.Append(" and e.Semester='" + queryParam["Semester"].ToString() + "' "); | |||
} | |||
if (!queryParam["LessonNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.LessonNo like '%" + queryParam["LessonNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["LessonName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.LessonName like '%" + queryParam["LessonName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassNo='" + queryParam["ClassNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["ClassName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassName like'%" + queryParam["ClassName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.StuNo='" + queryParam["StuNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["EmpNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.EmpNo like '%" + queryParam["EmpNo"].ToString() + "%' "); | |||
} | |||
if (!queryParam["EmpName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.EmpName like '%" + queryParam["EmpName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["ClassRoomNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassRoomNo='" + queryParam["ClassRoomNo"].ToString() + "' "); | |||
} | |||
if (!queryParam["ClassRoomName"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.ClassRoomName like '%" + queryParam["ClassRoomName"].ToString() + "%' "); | |||
} | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ArrangeExamTermItemNewEntity>(strSql.ToString(), null, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 课程信息【班级成绩查看】 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<WebHelper.YearGrade> GetLessonList(string academicYearNo, string semester, string classNo) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("select distinct s.LessonName as value,s.EmpNo as text from stuscore s "); | |||
strSql.Append(" where s.AcademicYearNo='" + academicYearNo + "' and s.Semester='" + semester + "' and s.ClassNo='" + classNo + "' and s.LessonSortNo='1' "); | |||
return this.BaseRepository("CollegeMIS").FindList<WebHelper.YearGrade>(strSql.ToString()).Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); | |||
//data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -180,18 +392,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.EPIId, | |||
t.LessonNo, | |||
t.LessonName, | |||
t.ExamDate, | |||
t.ExamTime, | |||
t.EmpNo, | |||
t.EmpName, | |||
t.ClassroomNo, | |||
t.ClassroomName | |||
"); | |||
strSql.Append(" FROM Exam_ArrangeExamTermNew t "); | |||
strSql.Append(@" t.*,e.AcademicYearNo,e.Semester "); | |||
strSql.Append(" FROM Exam_ArrangeExamTermNew t join Exam_ExamPlan e on t.EPId=e.EPId "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -231,6 +433,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("ClassroomName", "%" + queryParam["ClassroomName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.ClassroomName Like @ClassroomName "); | |||
} | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ArrangeExamTermNewEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -270,6 +476,34 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 获取排考详情 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ArrangeExamTermItemNewEntity> GetStuList(string AcademicYearNo, int? Semester, string ClassRoomNo, string LessonNo, string EmpNo, string ExamDate, string ExamTime) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select t.*,e.AcademicYearNo,e.Semester from Exam_ArrangeExamTermItemNew t join Exam_ExamPlan e on t.EPId=e.EPId where 1=1 and t.ClassNo is not null | |||
and e.AcademicYearNo ='" + AcademicYearNo + "' and e.Semester='" + Semester + "' and EmpNo='" + EmpNo | |||
+ "' and Classroomno= '" + ClassRoomNo + "' and LessonNo = '" + LessonNo + "' AND ExamDate >= '" + ExamDate + "' AND ExamTime <= '" + ExamTime + "' "); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ArrangeExamTermItemNewEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -153,6 +153,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
try | |||
{ | |||
var Entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(keyValue); | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =1 where AcademicYearNo='{Entity.AcademicYearNo}' and Semester='{Entity.Semester}' "); | |||
this.BaseRepository("CollegeMIS").Delete<Exam_ExamPlanEntity>(t => t.EPId == keyValue); | |||
} | |||
catch (Exception ex) | |||
@@ -349,7 +351,17 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
//排考安排考场 | |||
var planRoomData = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId).ToList(); | |||
#region 允许有空的考场 | |||
var newclassroomno = new List<Exam_ExamPlanRoomEntity>(); | |||
foreach (var item in planRoomData) | |||
{ | |||
if (item.SeatCount != item.ActualNum) | |||
{ | |||
newclassroomno.Add(item); | |||
} | |||
} | |||
var ClassroomNoDisable = string.Join("','", newclassroomno.Select(x => x.ClassroomNo)); | |||
#endregion | |||
//添加排考安排数据 | |||
foreach (var planRoom in planRoomData) | |||
{ | |||
@@ -384,7 +396,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
item.EmpNo = planRoom.EmpNo; | |||
item.ClassroomName = planRoom.ClassroomName; | |||
item.ClassroomNo = planRoom.ClassroomNo; | |||
item.F_SchoolId = LoginUserInfo.Get().userId; | |||
item.F_SchoolId = LoginUserInfo.Get().companyId; | |||
item.SitNumber = sealNumArr[n].ToString().PadLeft(3, '0'); | |||
itemList.Add(item); | |||
} | |||
@@ -396,8 +408,35 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
string stuSql = $"select * from Exam_ExamStudent where ESEnabled=1 and AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ESType='{examPlan.PlanType}' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}' and LessonNo='{planLesson.LessonNo}')"; | |||
//所有考生 | |||
var stuInfoList = db.FindList<Exam_ExamStudentEntity>(stuSql).ToList(); | |||
//从此获取到 同学年学期考场禁用+本次考试并且可以做编号 | |||
var DisableNumber = db.FindList<Exam_ExamRoomDetailEntity> | |||
(x => x.ECEnabled == true && x.AcademicYearNo == examPlan.AcademicYearNo && x.Semester == examPlan.Semester && ClassroomNoDisable.Contains(x.ClassRoomNo)).ToList(); | |||
foreach (var item in DisableNumber) | |||
{ | |||
item.ECSOrder = item.ECOrder.ToString().PadLeft(3, '0'); | |||
} | |||
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); | |||
List<Exam_ArrangeExamTermItemNewEntity> newitemList = itemList.Where(x => ClassroomNoDisable.Contains(x.ClassroomNo)).ToList(); | |||
foreach (var item in newitemList) | |||
{ | |||
itemList.Remove(item); | |||
} | |||
int s = 0; | |||
if (itemList.Count() > 0) | |||
{ | |||
for (int i = 0; i < DisableNumber.Count(); i++) | |||
{ | |||
for (int j = 0; j < newitemList.Count(); j++) | |||
{ | |||
if (DisableNumber[i].ECSOrder == newitemList[j].SitNumber && DisableNumber[i].ClassRoomNo == newitemList[j].ClassroomNo) | |||
{ | |||
itemList.Add(newitemList[j]); | |||
s = s + 1; | |||
} | |||
} | |||
} | |||
} | |||
var a = s; | |||
if (itemList.Count >= stuInfoList.Count()) | |||
{ | |||
//随机安排座位 | |||
@@ -507,6 +546,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
entity.EPStuCount = 0; | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =0 where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' "); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -56,6 +56,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <returns></returns> | |||
[Column("EMPNAME")] | |||
public string EmpName { get; set; } | |||
/// <summary> | |||
/// ActualNum | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ACTUALNUM")] | |||
public int? ActualNum { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -341,8 +341,9 @@ where l.EPLId='{EPLId}'"; | |||
} | |||
//考场座位数 | |||
int? seatCount = 0; | |||
var roomListSql = | |||
int? seatCount = 0; | |||
int? ActualNum = 0; | |||
var roomListSql = | |||
$"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 "; | |||
if (conflictRoom.Count() > 0) | |||
{ | |||
@@ -365,16 +366,19 @@ where l.EPLId='{EPLId}'"; | |||
EPRoom.ClassroomName = room.ClassroomName; | |||
EPRoom.ClassroomNo = room.ClassroomNo; | |||
EPRoom.SeatCount = room.SeatCount; | |||
EPRoom.ActualNum = room.ActualNum; | |||
db.Insert(EPRoom); | |||
seatCount += room.SeatCount; | |||
if (seatCount >= examLesson.RealStuCount) | |||
ActualNum += room.ActualNum; | |||
room.IsEdit = false; | |||
if (ActualNum >= examLesson.RealStuCount) | |||
{ | |||
break; | |||
} | |||
} | |||
db.Update(examRoomList); | |||
db.ExecuteBySql( | |||
$"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'"); | |||
$"update Exam_ExamPlanLesson set SeatCount='{seatCount}',SeatCount='{seatCount}'ActualNum='{ActualNum}' where EPLId='{examLesson.EPLId}'"); | |||
} | |||
} | |||
@@ -166,7 +166,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomService.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); | |||
return exam_ExamRoomService.Import(AcademicYearNo, Semester, SeatRows, SeatColumns); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -200,6 +200,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public void SeatEntity(string AcademicYearNo, string Semester) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomService.SeatEntity(AcademicYearNo, Semester); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -64,6 +64,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
[Column("ERENABLED")] | |||
public bool? EREnabled { get; set; } | |||
/// <summary> | |||
/// Isedit | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISEDIT")] | |||
public bool? IsEdit { get; set; } | |||
/// <summary> | |||
/// 实际考试人数 | |||
/// </summary> | |||
[Column("ACTUALNUM")] | |||
public int? ActualNum { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -73,6 +84,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
public void Create() | |||
{ | |||
this.ERId = Guid.NewGuid().ToString(); | |||
this.IsEdit = true; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
@@ -52,7 +52,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns); | |||
int DeleteWhere(string AcademicYearNo, string Semester); | |||
void SeatEntity(string AcademicYearNo, string Semester); | |||
#endregion | |||
} | |||
@@ -296,8 +296,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
,[SeatColumns] | |||
,[SeatCount] | |||
,[EROrder] | |||
,[EREnabled]) | |||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1 from ClassroomInfo where CheckMark=1 | |||
,[EREnabled] | |||
,[IsEdit] | |||
,[ActualNum] | |||
) | |||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1,1,{SeatRows}*{SeatColumns} from ClassroomInfo where CheckMark=1 | |||
and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) | |||
"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
@@ -325,7 +328,7 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat | |||
{ | |||
try | |||
{ | |||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; | |||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and IsEdit = 'true';delete Exam_ExamRoomdetail where AcademicYearNo ='" + AcademicYearNo + "' and Semester='" + Semester + "' and EcEnabled = 1 ;"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
@@ -340,6 +343,58 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 考场座位表 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void SeatEntity(string AcademicYearNo, string Semester) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
var intSemester = Convert.ToInt32(Semester); | |||
var room = db.FindList<Exam_ExamRoomEntity>().Where(x => x.AcademicYearNo == AcademicYearNo && x.Semester == intSemester).ToList(); | |||
List<Exam_ExamRoomDetailEntity> entityList = new List<Exam_ExamRoomDetailEntity>(); | |||
if (room.Count() > 0) | |||
{ | |||
for (int i = 0; i < room.Count(); i++) | |||
{ | |||
for (int j = 0; j < room[i].SeatCount; j++) | |||
{ | |||
var entity = new Exam_ExamRoomDetailEntity(); | |||
entity.AcademicYearNo = AcademicYearNo; | |||
entity.Semester = intSemester; | |||
entity.ClassRoomNo = room[i].ClassroomNo; | |||
entity.ClassRoomName = room[i].ClassroomName; | |||
entity.ECOrder = j + 1; | |||
entity.ECEnabled = true; | |||
entity.Create(); | |||
entityList.Add(entity); | |||
} | |||
room[i].IsEdit = true; | |||
room[i].ActualNum = room[i].SeatCount; | |||
} | |||
} | |||
db.Insert(entityList); | |||
db.Update(room); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -0,0 +1,185 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public class Exam_ExamRoomDetailBLL : Exam_ExamRoomDetailIBLL | |||
{ | |||
private Exam_ExamRoomDetailService exam_ExamRoomDetailService = new Exam_ExamRoomDetailService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomDetailService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomDetailService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList() | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomDetailService.GetList(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamRoomDetailEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return exam_ExamRoomDetailService.GetEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomDetailService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomDetailService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveSaveDetailEntity(string ClassroomNo, string AcademicYearNo, int Semester, List<Exam_ExamRoomDetailEntity> entity) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomDetailService.SaveSaveDetailEntity(ClassroomNo, AcademicYearNo, Semester, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,138 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-15 18:12 | |||
/// 描 述:排考安排考场表 | |||
/// </summary> | |||
public class Exam_ExamRoomDetailEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ID | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ID")] | |||
public string ID { get; set; } | |||
/// <summary> | |||
/// ClassRoomNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNO")] | |||
public string ClassRoomNo { get; set; } | |||
/// <summary> | |||
/// ClassRoomName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNAME")] | |||
public string ClassRoomName { get; set; } | |||
/// <summary> | |||
/// ECEmpNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ECEMPNO")] | |||
public string ECEmpNo { get; set; } | |||
/// <summary> | |||
/// ECEmpName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ECEMPNAME")] | |||
public string ECEmpName { get; set; } | |||
/// <summary> | |||
/// AcademicYearNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ACADEMICYEARNO")] | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// Semester | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("Semester")] | |||
public int? Semester { get; set; } | |||
/// <summary> | |||
/// StuNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUNO")] | |||
public string StuNo { get; set; } | |||
/// <summary> | |||
/// Grade | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
/// <summary> | |||
/// DeptNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("DEPTNO")] | |||
public string DeptNo { get; set; } | |||
/// <summary> | |||
/// MajorNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// ClassNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSNO")] | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// ECOrder | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ECORDER")] | |||
public int? ECOrder { get; set; } | |||
/// <summary> | |||
/// ECEnabled | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ECENABLED")] | |||
public bool? ECEnabled { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.ID = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.ID = keyValue; | |||
} | |||
#endregion | |||
/// <summary> | |||
/// 考试日期 | |||
/// </summary> | |||
[NotMapped] | |||
public DateTime? ExamDate { get; set; } | |||
/// <summary> | |||
/// 考试时间 | |||
/// </summary> | |||
[NotMapped] | |||
public string ExamTime { get; set; } | |||
/// <summary> | |||
/// ECSOrder | |||
/// </summary> | |||
[NotMapped] | |||
public string ECSOrder { get; set; } | |||
} | |||
} | |||
@@ -0,0 +1,54 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public interface Exam_ExamRoomDetailIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson); | |||
IEnumerable<Exam_ExamRoomDetailEntity> GetList(); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Exam_ExamRoomDetailEntity GetEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity); | |||
void SaveSaveDetailEntity(string ClassroomNo, string AcademicYearNo, int Semester, List<Exam_ExamRoomDetailEntity> entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,285 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public class Exam_ExamRoomDetailService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM Exam_ExamRoomDetail t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.EPLId = @EPLId "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomDetailEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM Exam_ExamRoomDetail t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.EPLId = @EPLId "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomDetailEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList() | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" t.* "); | |||
strSql.Append(" FROM Exam_ExamRoomDetail t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomDetailEntity>(strSql.ToString()); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamPlanLesson表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamRoomDetailEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamRoomDetailEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
var entity = new Exam_ExamPlanRoomEntity(); | |||
if (keyValue.Contains(",")) | |||
{ | |||
entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanRoomEntity>((keyValue.Split(','))[0]); | |||
keyValue = string.Join("','", keyValue.Split(',')); | |||
} | |||
else | |||
{ | |||
entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanRoomEntity>(keyValue); | |||
} | |||
string sql = $"delete from Exam_ExamPlanRoom where EPRId in ('{keyValue}')"; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveSaveDetailEntity(string ClassroomNo, string AcademicYearNo, int Semester, List<Exam_ExamRoomDetailEntity> entity) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
var del = db.FindList<Exam_ExamRoomDetailEntity>(x => x.ClassRoomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | |||
foreach (var item in del) | |||
{ | |||
db.Delete(item); | |||
} | |||
List<Exam_ExamRoomDetailEntity> enList = new List<Exam_ExamRoomDetailEntity>(); | |||
if (entity.Count() > 0) | |||
{ | |||
entity.OrderBy(x => x.ECOrder); | |||
for (int i = 0; i < entity.Count(); i++) | |||
{ | |||
var insertEntity = new Exam_ExamRoomDetailEntity | |||
{ | |||
ClassRoomNo = entity[i].ClassRoomNo, | |||
ClassRoomName = entity[i].ClassRoomName, | |||
AcademicYearNo = AcademicYearNo, | |||
Semester = Semester, | |||
ECEnabled = entity[i].ECEnabled, | |||
ECOrder = i + 1 | |||
}; | |||
insertEntity.Create(); | |||
enList.Add(insertEntity); | |||
} | |||
} | |||
db.Insert(enList); | |||
//修改实际考试人数 | |||
var Update = db.FindEntity<Exam_ExamRoomEntity>(x => x.ClassroomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester); | |||
Update.ActualNum = enList.Where(x => x.ECEnabled == true).Count(); | |||
db.Update(Update); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,98 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOfPreviousService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousBLL : StuScoreOfPreviousIBLL | |||
{ | |||
private StuScoreOfPreviousService stuScoreOfPreviousService = new StuScoreOfPreviousService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuScoreOfPreviousService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 学年下拉框信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData() | |||
{ | |||
try | |||
{ | |||
return stuScoreOfPreviousService.GetAcademicYearNoData(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
public string StuScoreOfPreviousImport(DataTable dt, string fileId) | |||
{ | |||
try | |||
{ | |||
return stuScoreOfPreviousService.StuScoreOfPreviousImport(dt, fileId); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,344 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// ScoreId | |||
/// </summary> | |||
/// <returns></returns> | |||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | |||
[Column("SCOREID")] | |||
public int? ScoreId { get; set; } | |||
/// <summary> | |||
/// 通知书号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("NOTICEBOOKNO")] | |||
public string NoticeBookNo { get; set; } | |||
/// <summary> | |||
/// 学号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUNO")] | |||
public string StuNo { get; set; } | |||
/// <summary> | |||
/// 学生所在系部 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("DEPTNO")] | |||
public string DeptNo { get; set; } | |||
/// <summary> | |||
/// 学生所在专业号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MAJORNO")] | |||
public string MajorNo { get; set; } | |||
/// <summary> | |||
/// 行政班号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSNO")] | |||
public string ClassNo { get; set; } | |||
/// <summary> | |||
/// 姓名 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUNAME")] | |||
public string StuName { get; set; } | |||
/// <summary> | |||
/// GenderNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("GENDERNO")] | |||
public string GenderNo { get; set; } | |||
/// <summary> | |||
/// 学年度 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ACADEMICYEARNO")] | |||
public string AcademicYearNo { get; set; } | |||
/// <summary> | |||
/// 学期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SEMESTER")] | |||
public string Semester { get; set; } | |||
/// <summary> | |||
/// 开课系部码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OPENLESSONDEPTNO")] | |||
public string OpenLessonDeptNo { get; set; } | |||
/// <summary> | |||
/// 开课专业码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OPENLESSONMAJORNO")] | |||
public string OpenLessonMajorNo { get; set; } | |||
/// <summary> | |||
/// 课程号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNO")] | |||
public string LessonNo { get; set; } | |||
/// <summary> | |||
/// 课程名称 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNAME")] | |||
public string LessonName { get; set; } | |||
/// <summary> | |||
/// LessonNameEn | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONNAMEEN")] | |||
public string LessonNameEn { get; set; } | |||
/// <summary> | |||
/// 教学班号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TEACHCLASSNO")] | |||
public string TeachClassNo { get; set; } | |||
/// <summary> | |||
/// 课程类别码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONSORTNO")] | |||
public string LessonSortNo { get; set; } | |||
/// <summary> | |||
/// 学生类别 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUSORTNO")] | |||
public string StuSortNo { get; set; } | |||
/// <summary> | |||
/// 年级 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("GRADE")] | |||
public string Grade { get; set; } | |||
/// <summary> | |||
/// 学分 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("STUDYSCORE")] | |||
public decimal? StudyScore { get; set; } | |||
/// <summary> | |||
/// 总学时 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TOTALSTUDYHOUR")] | |||
public decimal? TotalStudyHour { get; set; } | |||
/// <summary> | |||
/// 专业属性 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ZYSX")] | |||
public string zysx { get; set; } | |||
/// <summary> | |||
/// 考核(试)方式码(关联表BCdTestMode) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTMODENO")] | |||
public string TestModeNo { get; set; } | |||
/// <summary> | |||
/// ScoreRecordStyleNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCORERECORDSTYLENO")] | |||
public string ScoreRecordStyleNo { get; set; } | |||
/// <summary> | |||
/// 平时成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ORDINARYSCORE")] | |||
public decimal? OrdinaryScore { get; set; } | |||
/// <summary> | |||
/// 期中成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TERMINSCORE")] | |||
public decimal? TermInScore { get; set; } | |||
/// <summary> | |||
/// 期末成绩 学期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TERMENDSCORE")] | |||
public decimal? TermEndScore { get; set; } | |||
/// <summary> | |||
/// OtherScore | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("OTHERSCORE")] | |||
public decimal? OtherScore { get; set; } | |||
/// <summary> | |||
/// 总评成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCORE")] | |||
public decimal? Score { get; set; } | |||
/// <summary> | |||
/// 绩点 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("SCOREPOINT")] | |||
public decimal? ScorePoint { get; set; } | |||
/// <summary> | |||
/// 考试日期 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTDATE")] | |||
public DateTime? TestDate { get; set; } | |||
/// <summary> | |||
/// 是否有效 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISINEFFECT")] | |||
public string IsInEffect { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("REMARK")] | |||
public string Remark { get; set; } | |||
/// <summary> | |||
/// 冲突课程代码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CONFLICTLESSONNO")] | |||
public string ConflictLessonNo { get; set; } | |||
/// <summary> | |||
/// 是否重修成绩 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISRESTUDY")] | |||
public string IsReStudy { get; set; } | |||
/// <summary> | |||
/// 审查标志 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CHECKMARK")] | |||
public string CheckMark { get; set; } | |||
/// <summary> | |||
/// 是否选中 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISPITCHON")] | |||
public string IsPitchOn { get; set; } | |||
/// <summary> | |||
/// 教师号 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EMPNO")] | |||
public string EmpNo { get; set; } | |||
/// <summary> | |||
/// 专业教学计划编码 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TECHPLANNO")] | |||
public string TechPlanNo { get; set; } | |||
/// <summary> | |||
/// 考试性质码(关联表CdTestKind) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("TESTKINDNO")] | |||
public string TestKindNo { get; set; } | |||
/// <summary> | |||
/// 课程区别码(此编码针对同一课程编号,同一门课程、不同课时、学分的情况而加,由系统自动产生以区分此类课程) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("PARTCODE")] | |||
public string PartCode { get; set; } | |||
/// <summary> | |||
/// LessonSection | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("LESSONSECTION")] | |||
public string LessonSection { get; set; } | |||
/// <summary> | |||
/// ClassRoomNo | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNO")] | |||
public string ClassRoomNo { get; set; } | |||
/// <summary> | |||
/// ClassRoomName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("CLASSROOMNAME")] | |||
public string ClassRoomName { get; set; } | |||
/// <summary> | |||
/// IsEditable | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISEDITABLE")] | |||
public string IsEditable { get; set; } | |||
/// <summary> | |||
/// EditUserId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("EDITUSERID")] | |||
public string EditUserId { get; set; } | |||
/// <summary> | |||
/// ModifyDate | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYDATE")] | |||
public DateTime? ModifyDate { get; set; } | |||
[Column("BEGINMODIFYDATE")] | |||
public DateTime? BeginModifyDate { get; set; } | |||
/// <summary> | |||
/// ModifyUserId | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYUSERID")] | |||
public string ModifyUserId { get; set; } | |||
/// <summary> | |||
/// ModifyUserName | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("MODIFYUSERNAME")] | |||
public string ModifyUserName { get; set; } | |||
/// <summary> | |||
/// 学校主键 | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("F_SCHOOLID")] | |||
public string F_SchoolId { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(int? keyValue) | |||
{ | |||
this.ScoreId = keyValue; | |||
} | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,44 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
using static Learun.Application.TwoDevelopment.EducationalAdministration.StuScoreOfPreviousService; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public interface StuScoreOfPreviousIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 学年下拉框信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData(); | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
string StuScoreOfPreviousImport(DataTable dt, string fileId); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,357 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Net.Http; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
using Newtonsoft.Json; | |||
using Learun.Cache.Base; | |||
using Learun.Cache.Factory; | |||
using Learun.Application.Organization; | |||
using Learun.Application.Base.SystemModule; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2024-10-16 11:02 | |||
/// 描 述:往年成绩管理 | |||
/// </summary> | |||
public class StuScoreOfPreviousService : RepositoryFactory | |||
{ | |||
private ICache cache = CacheFactory.CaChe(); | |||
private string cacheKey = "Learun_adms_excelError_"; | |||
#region 构造函数和属性 | |||
private string fieldSql; | |||
public StuScoreOfPreviousService() | |||
{ | |||
fieldSql = @"t.*"; | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// <param name="pagination">分页参数</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
public IEnumerable<StuScoreOfPreviousEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(fieldSql); | |||
strSql.Append(" FROM StuScoreOfPrevious t where 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["keyword"].IsEmpty()) | |||
{ | |||
strSql.Append(" and (t.stuno like @keyword or t.stuname like @keyword )"); | |||
dp.Add("keyword", "%" + queryParam["keyword"].ToString() + "%", DbType.String); | |||
} | |||
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["LessonSortNo"].IsEmpty()) | |||
{ | |||
strSql.Append(" and t.LessonSortNo = @LessonSortNo "); | |||
dp.Add("LessonSortNo", queryParam["LessonSortNo"].ToString(), DbType.String); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<StuScoreOfPreviousEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 学年下拉框信息 | |||
/// </summary> | |||
/// <returns></returns> | |||
public IEnumerable<WebHelper.YearGrade> GetAcademicYearNoData() | |||
{ | |||
try | |||
{ | |||
var data = this.BaseRepository("CollegeMIS").FindList<WebHelper.YearGrade>("select distinct s.AcademicYearNo as value,s.AcademicYearNo as text from StuScoreOfPrevious s "); | |||
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); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 拓展数据 | |||
/// <summary> | |||
/// 导入 | |||
/// </summary> | |||
/// <param name="dt"></param> | |||
/// <param name="fileId"></param> | |||
/// <returns></returns> | |||
public string StuScoreOfPreviousImport(DataTable dt, string fileId) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
int snum = 0; | |||
int fnum = 0; | |||
//插入时间 | |||
var Insertdate = DateTime.Now; | |||
if (dt.Rows.Count > 0) | |||
{ | |||
DataTable failDt = new DataTable(); | |||
dt.Columns.Add("导入错误", typeof(string)); | |||
foreach (DataColumn dc in dt.Columns) | |||
{ | |||
failDt.Columns.Add(dc.ColumnName, dc.DataType); | |||
} | |||
IEnumerable<StuScoreOfPreviousEntity> StuScoreOfPreviousHistory = db.FindList<StuScoreOfPreviousEntity>("select * from StuScoreOfPrevious"); | |||
var StuScoreOfPreviousinsert = new List<StuScoreOfPreviousEntity>(); | |||
// 循环遍历导入 | |||
foreach (DataRow dr in dt.Rows) | |||
{ | |||
try | |||
{ | |||
#region 必填项空验证 | |||
if (dr["学号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学号不能为空")); | |||
} | |||
if (dr["学生姓名"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学生姓名不能为空")); | |||
} | |||
if (dr["系部编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("系部编号不能为空")); | |||
} | |||
if (dr["专业编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("专业编号不能为空")); | |||
} | |||
if (dr["班级编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("班级编号不能为空")); | |||
} | |||
if (dr["性别"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("性别不能为空")); | |||
} | |||
if (dr["学年"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学年不能为空")); | |||
} | |||
if (dr["学期"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("学期不能为空")); | |||
} | |||
if (dr["课程编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程编号不能为空")); | |||
} | |||
if (dr["课程名称"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程名称不能为空")); | |||
} | |||
if (dr["课程类型"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("课程类型不能为空")); | |||
} | |||
if (dr["年级"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("年级不能为空")); | |||
} | |||
if (dr["总成绩"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("总成绩不能为空")); | |||
} | |||
if (dr["教师编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("教师编号不能为空")); | |||
} | |||
if (dr["校区"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("校区不能为空")); | |||
} | |||
#endregion | |||
#region 选择性必填判断 | |||
if (dr["课程类型"].ToString() == "1") | |||
{ | |||
if (dr["开课系部编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的开课系部编号不能为空")); | |||
} | |||
if (dr["开课专业编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的开课专业编号不能为空")); | |||
} | |||
if (dr["教学班级编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("必修课的教学班级编号不能为空")); | |||
} | |||
} | |||
else if (dr["课程类型"].ToString() == "2") | |||
{ | |||
if (dr["上课节次"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的上课节次不能为空")); | |||
} | |||
if (dr["教室编号"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的教室编号不能为空")); | |||
} | |||
if (dr["教室名称"].ToString().IsEmpty()) | |||
{ | |||
throw (new Exception("选修课的教室名称不能为空")); | |||
} | |||
} | |||
#endregion | |||
//基础数据 | |||
var empinfoEntity = db.FindList<EmpInfoEntity>($"select * from EmpInfo where EmpNo='" + dr["教师编号"].ToString().Trim() + "' and CheckMark=1 "); | |||
var CompanyEntity = BaseRepository().FindList<CompanyEntity>(x => x.F_EnabledMark == 1).ToList().FirstOrDefault(); | |||
if (empinfoEntity.Count() <= 0) | |||
throw (new Exception("查无此教师")); | |||
var dataItemDetailEntity = BaseRepository().FindEntity<DataItemDetailEntity>($@"select dd.F_ItemName,dd.F_ItemValue from LR_Base_DataItem d left join LR_Base_DataItemDetail dd on d.F_ItemId=dd.F_ItemId | |||
where d.F_ItemCode = 'usersex' and dd.F_EnabledMark = 1 and dd.F_DeleteMark = 0 and dd.F_ItemName = '{dr["性别"].ToString()}' ", null); | |||
if (dataItemDetailEntity == null) | |||
{ | |||
throw (new Exception("数据字典找不到对应值")); | |||
} | |||
//写入要导入替换的数据 | |||
StuScoreOfPreviousEntity stuScoreOfPreviousEntity = new StuScoreOfPreviousEntity | |||
{ | |||
StuNo = dr["学号"].ToString(), | |||
StuName = dr["学生姓名"].ToString(), | |||
DeptNo = dr["系部编号"].ToString(), | |||
MajorNo = dr["专业编号"].ToString(), | |||
ClassNo = dr["班级编号"].ToString(), | |||
GenderNo = dataItemDetailEntity.F_ItemValue, | |||
AcademicYearNo = dr["学年"].ToString(), | |||
Semester = dr["学期"].ToString(), | |||
OpenLessonDeptNo = dr["开课系部编号"].ToString(), | |||
OpenLessonMajorNo = dr["开课专业编号"].ToString(), | |||
LessonNo = dr["课程编号"].ToString(), | |||
LessonName = dr["课程名称"].ToString(), | |||
TeachClassNo = dr["教学班级编号"].ToString(), | |||
LessonSortNo = dr["课程类型"].ToString(), | |||
Grade = dr["年级"].ToString(), | |||
StudyScore = dr["学分"].ToDecimal(), | |||
zysx = "1", | |||
TestModeNo = "1", | |||
ScoreRecordStyleNo = "1", | |||
OrdinaryScore = dr["平时成绩"].ToDecimal(), | |||
TermInScore = dr["期中成绩"].ToDecimal(), | |||
TermEndScore = dr["期末成绩"].ToDecimal(), | |||
OtherScore = dr["其他成绩"].ToDecimal(), | |||
Score = dr["总成绩"].ToDecimal(), | |||
IsInEffect = "1", | |||
Remark = dr["备注"].ToString(), | |||
CheckMark = "1", | |||
IsPitchOn = "1", | |||
EmpNo = dr["教师编号"].ToString(), | |||
TestKindNo = "1", | |||
LessonSection = dr["上课节次"].ToString(), | |||
ClassRoomNo = dr["教室编号"].ToString(), | |||
ClassRoomName = dr["教室名称"].ToString(), | |||
IsEditable = "1", | |||
ModifyDate = Insertdate, | |||
ModifyUserId = LoginUserInfo.Get().userId, | |||
ModifyUserName = LoginUserInfo.Get().realName, | |||
F_SchoolId = CompanyEntity.F_CompanyId | |||
}; | |||
#region 判断是否重复 | |||
if (StuScoreOfPreviousHistory.Count(m => m.AcademicYearNo == stuScoreOfPreviousEntity.AcademicYearNo && m.Semester == stuScoreOfPreviousEntity.Semester | |||
&& m.LessonNo == stuScoreOfPreviousEntity.LessonNo && m.StuNo == stuScoreOfPreviousEntity.StuNo | |||
&& m.LessonSortNo == stuScoreOfPreviousEntity.LessonSortNo && m.EmpNo == stuScoreOfPreviousEntity.EmpNo | |||
&& m.F_SchoolId == stuScoreOfPreviousEntity.F_SchoolId) == 0 | |||
&& StuScoreOfPreviousinsert.Count(m => m.AcademicYearNo == stuScoreOfPreviousEntity.AcademicYearNo && m.Semester == stuScoreOfPreviousEntity.Semester | |||
&& m.LessonNo == stuScoreOfPreviousEntity.LessonNo && m.StuNo == stuScoreOfPreviousEntity.StuNo | |||
&& m.LessonSortNo == stuScoreOfPreviousEntity.LessonSortNo && m.EmpNo == stuScoreOfPreviousEntity.EmpNo | |||
&& m.F_SchoolId == stuScoreOfPreviousEntity.F_SchoolId) == 0) | |||
{ | |||
StuScoreOfPreviousinsert.Add(stuScoreOfPreviousEntity); | |||
snum++; | |||
} | |||
else | |||
{ | |||
throw (new Exception("当前数据重复")); | |||
} | |||
#endregion | |||
} | |||
catch (Exception ex) | |||
{ | |||
fnum++; | |||
dr["导入错误"] = ex.Message; | |||
failDt.Rows.Add(dr.ItemArray); | |||
} | |||
} | |||
//执行导入 | |||
db.Insert(StuScoreOfPreviousinsert); | |||
db.Commit(); | |||
if (failDt.Rows.Count > 0) | |||
{ | |||
string errordt = failDt.ToJson(); | |||
cache.Write<string>(cacheKey + fileId, errordt, CacheId.excel); | |||
} | |||
} | |||
return snum + "|" + fnum; | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -183,6 +183,10 @@ | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomIBLL.cs" /> | |||
@@ -289,6 +293,10 @@ | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuInfoGraduate\StuInfoGraduateService.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreOfPrevious\StuScoreOfPreviousService.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuScoreNotPass\StuScoreNotPassIBLL.cs" /> | |||