@@ -155,6 +155,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
var data = await arrangeExamTermIBLL.AsyncArrangeExamDataNew(entity); | |||
return Success(data); | |||
} | |||
[HttpGet] | |||
public ActionResult GetClassTree() | |||
{ | |||
return Success(arrangeExamTermNewIBLL.GetClassTree()); | |||
} | |||
public ActionResult GetLessonData() | |||
{ | |||
return Success(arrangeExamTermNewIBLL.GetClassTree()); | |||
} | |||
#endregion | |||
} | |||
@@ -2,25 +2,34 @@ | |||
ViewBag.Title = "排考2021新"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<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 lr-layout-wrap-notitle "> | |||
<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 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 id="LessonNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="ClassRoomNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
<div id="ClassRoomNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="EmpNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
<div id="EmpNo" type="lrselect" class="lr-select" style="width: 200px;"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch" class="datetime"></div> | |||
@@ -11,12 +11,21 @@ var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var datebegin = ''; | |||
var dateend = ''; | |||
var ClassNo = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 初始化左侧树形数据 | |||
$('#dataTree').lrtree({ | |||
url: top.$.rootUrl + '/EducationalAdministration/ArrangeExamTermNew/GetClassTree', | |||
nodeClick: function (item) { | |||
ClassNo = item.id; | |||
page.search({ ClassNo: item.id }); | |||
} | |||
}); | |||
$('.datetime').each(function () { | |||
$(this).lrdate({ | |||
dfdata: [ | |||
@@ -47,7 +56,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
// 查询 | |||
$('#btn_Search').on('click', function () { | |||
page.search({ AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
page.search({ ClassNo: ClassNo, AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet(), LessonNo: $('#LessonNo').lrselectGet(), ClassRoomNo: $('#ClassRoomNo').lrselectGet(), EmpNo: $('#EmpNo').lrselectGet() }); | |||
}); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
@@ -70,6 +79,13 @@ var bootstrap = function ($, learun) { | |||
text: 'text' | |||
}); | |||
//课程 | |||
//$('#LessonNo').lrselect({ | |||
// placeholder: "请选择课程", | |||
// allowSearch: true, | |||
// url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo', | |||
// value: 'value', | |||
// text: 'text' | |||
//}); | |||
$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname', placeholder:'请选择课程' }); | |||
$('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname', placeholder: '请选择教室' }); | |||
$('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname', placeholder: '请选择教师' }); | |||
@@ -80,14 +96,15 @@ var bootstrap = function ($, learun) { | |||
headData: [ | |||
{ label: '学年', name: 'AcademicYearNo', width: 70, align: "left" }, | |||
{ label: '学期', name: 'Semester', width: 60, align: "left" }, | |||
{ label: '考试开始时间', name: 'StartDate', width: 120, align: "left" }, | |||
{ label: '考试结束时间', name: 'EndDate', width: 120, align: "left" }, | |||
{ label: '考试日期', name: 'ExamDate', width: 120, align: "left" }, | |||
{ label: '考试时间', name: 'ExamTime', width: 120, align: "left" }, | |||
{ label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, | |||
{ label: '课程名称', name: 'LessonName', width: 200, align: "left" }, | |||
{ label: '监考教师编号', name: 'EmpNo', width: 150, align: "left" }, | |||
{ label: '监考教师姓名', name: 'EmpName', width: 150, align: "left" }, | |||
{ label: '教室编号', name: 'ClassRoomNo', width: 100, align: "left" }, | |||
{ label: '教室名称', name: 'ClassRoomName', width: 100, align: "left" }, | |||
{ label: '班级名称', name: 'ClassName', width: 100, align: "left" }, | |||
{ label: '学生编号', name: 'StuNo', width: 100, align: "left" }, | |||
{ label: '学生姓名', name: 'StuName', width: 200, align: "left" }, | |||
{ label: '座位编号', name: 'SitNumber', width: 100, align: "left" } | |||
@@ -29,8 +29,8 @@ | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">负责人</div> | |||
<input id="F_Manager" type="text" class="form-control" /> | |||
</div> | |||
<div id="F_Manager"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">分管校长</div> | |||
<div id="F_SchoolMasterId" ></div> | |||
@@ -37,6 +37,13 @@ var bootstrap = function ($, learun) { | |||
} | |||
} | |||
}); | |||
//部门负责人 | |||
$("#F_Manager").lrformselect({ | |||
layerUrl: top.$.rootUrl + '/LR_OrganizationModule/User/SelectOnlyForm', | |||
layerUrlW: 400, | |||
layerUrlH: 300, | |||
dataUrl: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds' | |||
}); | |||
$('#NoticeCategory').lrDataItemSelect({ code: 'NoticeCategory', type: 'multiple', allowSearch:true }); | |||
}, | |||
@@ -112,10 +112,22 @@ var bootstrap = function ($, learun) { | |||
{ label: "部门编号", name: "F_EnCode", width: 100, align: "left" }, | |||
{ label: "部门简称", name: "F_ShortName", width: 100, align: "left" }, | |||
{ label: "部门性质", name: "F_Nature", width: 100, align: "left" }, | |||
{ label: "负责人", name: "F_Manager", width: 100, align: "left" }, | |||
{ | |||
label: "负责人", name: "F_Manager", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: value, | |||
keyId: 'f_userid', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "分管校长", name: "F_SchoolMaster", width: 100, align: "left" }, | |||
{ | |||
label: "公告类别", name: "NoticeCategory", width: 200, align: "left" , | |||
label: "公告类别", name: "NoticeCategory", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getsAsync('dataItem', { | |||
key: value, | |||
@@ -205,16 +205,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
var semester =entity.Semester; | |||
var schoolid = entity.F_SchoolId; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"delete from ArrangeExamTermNew where AcademicYearNo='{academicYearNo}' and Semester='{semester}' and F_SchoolId='{schoolid}'"); | |||
this.BaseRepository("CollegeMIS").ExecuteBySql($"delete from ArrangeExamTermItemNew where AcademicYearNo='{academicYearNo}' and Semester='{semester}' and F_SchoolId='{schoolid}'"); | |||
//排考数据处理 | |||
var insertList = new List<ArrangeExamTermNewEntity>(); | |||
var arrangeExamTermData = (await BaseRepository("CollegeMIS").FindListAsync<ArrangeExamTermNewEntity>()).ToList(); | |||
var classRoomInfoData = this.BaseRepository("CollegeMIS").FindList<ClassroomInfoEntity>().ToList(); | |||
var lessonData = this.BaseRepository("CollegeMIS").FindList<LessonInfoEntity>().ToList(); | |||
var classinfoData = (await BaseRepository("CollegeMIS").FindListAsync<ClassInfoEntity>()).ToList(); | |||
var studentData = (await BaseRepository("CollegeMIS").FindListAsync<StuInfoBasicEntity>()).ToList(); | |||
HttpContent httpContent = new StringContent("{\"school\":\"" + entity.F_SchoolId + "\",\"year\":\"" + entity.AcademicYearNo + "\",\"number\":\"" + entity.Semester + "\"}"); | |||
httpContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json"); | |||
var apiData = await Client.PostAsync(Config.GetValue("ArrangeExamAPINew"), httpContent).Result.Content.ReadAsStringAsync(); | |||
//明细接口 | |||
Client.PostAsync(Config.GetValue("ArrangeExamItemAPINew"), httpContent); | |||
//Client.PostAsync(Config.GetValue("ArrangeExamItemAPINew"), httpContent); | |||
if (!string.IsNullOrEmpty(apiData)) | |||
{ | |||
var data = JsonConvert.DeserializeObject<ArrangeExamRoot>(apiData); | |||
@@ -253,7 +254,51 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
result = await BaseRepository("CollegeMIS").InsertAsync(insertList)>0; | |||
} | |||
} | |||
//明细对接 | |||
string sql = @"SELECT semester.year AS 'AcademicYearNo',semester.number AS 'Semester',currid.number AS 'LessonNo',currid.name AS 'LessonName', | |||
student.name AS 'StuName',student.number AS 'StuNo',classroom.name 'ClassRoomName',classroom.number AS 'ClassRoomNo', | |||
paikao.time AS 'StartDate',paikao.endtime 'EndDate',a.number 'SitNumber', | |||
(SELECT GROUP_CONCAT(teachername) FROM tb_paikao WHERE currid = a.`currid` AND classroomid = a.`classroom`) AS EmpName, | |||
(SELECT GROUP_CONCAT(number) FROM tb_teacher WHERE id IN | |||
(SELECT teacherid FROM tb_paikao WHERE currid = a.`currid` AND classroomid = a.`classroom`) ) AS EmpNo | |||
FROM tb_studentpaikao a | |||
LEFT JOIN tb_student student ON student.id = a.student | |||
LEFT JOIN tb_classroom classroom ON classroom.id = a.classroom | |||
LEFT JOIN tb_curriculum currid ON currid.id = a.currid | |||
LEFT JOIN tb_semester semester ON semester.id = a.semester | |||
LEFT JOIN tb_paikaorule paikao ON paikao.currid = a.currid where semester.year='"+academicYearNo+ "' and semester.number='"+semester+"'"; | |||
var list= BaseRepository("paikeDbString").FindList<ArrangeExamTermItemNewEntity>(sql); | |||
var listsqlserver =new List<ArrangeExamTermItemNewEntity>(); | |||
foreach (var item in list) | |||
{ | |||
ArrangeExamTermItemNewEntity aetitem = new ArrangeExamTermItemNewEntity(); | |||
aetitem.Create(); | |||
aetitem.AcademicYearNo = item.AcademicYearNo; | |||
aetitem.Semester = item.Semester; | |||
aetitem.LessonNo = item.LessonNo; | |||
aetitem.LessonName = item.LessonName; | |||
item.ExamDate = Convert.ToDateTime(item.StartDate); | |||
aetitem.ExamDate = item.ExamDate; | |||
item.ExamTime = Convert.ToDateTime(item.StartDate).ToShortTimeString() + "~" + Convert.ToDateTime(item.EndDate).ToShortTimeString(); | |||
aetitem.ExamTime = item.ExamTime; | |||
aetitem.ClassNo = item.ClassNo; | |||
aetitem.ClassName = item.ClassName; | |||
aetitem.EmpNo = item.EmpNo; | |||
aetitem.EmpName = item.EmpName; | |||
aetitem.ClassRoomNo = item.ClassRoomNo; | |||
aetitem.ClassRoomName = item.ClassRoomName; | |||
aetitem.F_SchoolId = schoolid; | |||
aetitem.SitNumber = item.SitNumber; | |||
aetitem.StuNo = item.StuNo; | |||
aetitem.StuName = item.StuName; | |||
var classitem = studentData.Find(m => m.StuNo == item.StuNo); | |||
item.ClassNo = classitem?.ClassNo; | |||
aetitem.ClassNo = item.ClassNo; | |||
aetitem.ClassName = classinfoData.Find(m=>m.ClassNo==aetitem.ClassNo)?.ClassName; | |||
listsqlserver.Add(aetitem); | |||
} | |||
BaseRepository("CollegeMIS").Insert(listsqlserver); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -23,7 +23,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ArrangeExamTermNewEntity> GetList( string queryJson ) | |||
public IEnumerable<ArrangeExamTermNewEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
@@ -161,6 +161,41 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public List<TreeModel> GetClassTree() | |||
{ | |||
try | |||
{ | |||
var list = arrangeExamTermNewService.GetClassTree(); | |||
List<TreeModel> treeList = new List<TreeModel>(); | |||
foreach (var item in list) | |||
{ | |||
TreeModel node = new TreeModel | |||
{ | |||
id = item.ClassNo, | |||
text = item.ClassName, | |||
value = item.ClassNo, | |||
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); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -52,5 +52,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
void SaveEntity(string keyValue, ArrangeExamTermNewEntity entity); | |||
#endregion | |||
List<TreeModel> GetClassTree(); | |||
} | |||
} |
@@ -132,7 +132,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 获取排考详情 直接读取排课系统mysql | |||
/// 获取排考详情 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
@@ -142,19 +142,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append(@"select * from(SELECT semester.year AS 'AcademicYearNo',semester.number AS 'Semester',currid.number AS 'LessonNo',currid.name AS 'LessonName', | |||
student.name AS 'StuName',student.number AS 'StuNo',classroom.name 'ClassRoomName',classroom.number AS 'ClassRoomNo', | |||
paikao.time AS 'StartDate',paikao.endtime 'EndDate',a.number 'SitNumber', | |||
(SELECT GROUP_CONCAT( teachername) FROM tb_paikao WHERE currid=a.`currid` AND classroomid = a.`classroom`) AS EmpName, | |||
(SELECT GROUP_CONCAT(number) FROM tb_teacher WHERE id IN | |||
(SELECT teacherid FROM tb_paikao WHERE currid=a.`currid` AND classroomid = a.`classroom`) ) AS EmpNo | |||
FROM tb_studentpaikao a | |||
LEFT JOIN tb_student student ON student.id = a.student | |||
LEFT JOIN tb_classroom classroom ON classroom.id = a.classroom | |||
LEFT JOIN tb_curriculum currid ON currid.id = a.currid | |||
LEFT JOIN tb_semester semester ON semester.id = a.semester | |||
LEFT JOIN tb_paikaorule paikao ON paikao.currid= a.currid ) t where 1=1 "); | |||
strSql.Append(@"select * from ArrangeExamTermItemNew t where 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
@@ -186,10 +174,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND ( StartDate >= '" + queryParam["StartTime"].ToString() + "' AND StartDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
strSql.Append(" AND ( ExamDate >= '" + queryParam["StartTime"].ToString() + "' AND ExamDate <= '" + queryParam["EndTime"].ToString() + "' ) "); | |||
} | |||
return this.BaseRepository("paikeDbString").FindList<ArrangeExamTermItemNewEntity>(strSql.ToString(), null, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<ArrangeExamTermItemNewEntity>(strSql.ToString(), null, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -289,5 +277,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
#endregion | |||
public IEnumerable<ClassInfoEntity> GetClassTree() | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>("select ClassNo,ClassName from ArrangeExamTermItemNew group by ClassNo,ClassName order by ClassNo"); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
} | |||
} |