@@ -223,6 +223,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
itementity.NewEmpNo = entity.NewEmpNo; | itementity.NewEmpNo = entity.NewEmpNo; | ||||
itementity.NewClassroomNo = entity.NewClassroomNo; | itementity.NewClassroomNo = entity.NewClassroomNo; | ||||
itementity.LessonDate = Convert.ToDateTime(item["LessonDate"].ToString()); | |||||
itementity.LessonTime = item["LessonTime"].ToString(); | |||||
itementity.AcademicYearNo = item["Academicyear"].ToString(); | itementity.AcademicYearNo = item["Academicyear"].ToString(); | ||||
itementity.Semester = item["Semester"].ToString(); | itementity.Semester = item["Semester"].ToString(); | ||||
itementity.DeptNo = item["DeptNo"].ToString(); | itementity.DeptNo = item["DeptNo"].ToString(); | ||||
@@ -231,14 +233,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
itementity.TeachClassNo = item["TeachClassNo"].ToString(); | itementity.TeachClassNo = item["TeachClassNo"].ToString(); | ||||
itementity.EmpNo = item["Empno"].ToString(); | itementity.EmpNo = item["Empno"].ToString(); | ||||
itementity.ClassroomNo = item["ClassRoomNo"].ToString(); | itementity.ClassroomNo = item["ClassRoomNo"].ToString(); | ||||
itementity.NewTime = entity.NewTime; | |||||
itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限 | itementity.AttemperTimeType = entity.AttemperTimeType;//调度时限 | ||||
itementity.AttemperStartTime = entity.AttemperStartTime; | itementity.AttemperStartTime = entity.AttemperStartTime; | ||||
itementity.AttemperEndTime = entity.AttemperEndTime; | itementity.AttemperEndTime = entity.AttemperEndTime; | ||||
itementity.Status = 0; | |||||
itementity.CheckStatus = 0; | |||||
if (itementity.AttemperType=="03") | |||||
{ | |||||
itementity.Status = 1; | |||||
itementity.CheckStatus = 2;//通过 | |||||
} | |||||
else | |||||
{ | |||||
itementity.Status = 0; | |||||
itementity.CheckStatus = 0; | |||||
} | |||||
arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, itementity); | arrangeLessonTermAttemperIBLL.SaveEntity(keyValue, itementity); | ||||
} | } | ||||
@@ -3,6 +3,10 @@ using System.Data; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | using Learun.Application.TwoDevelopment.EducationalAdministration; | ||||
using System.Web.Mvc; | using System.Web.Mvc; | ||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.IO; | |||||
using System; | |||||
using NPOI.HSSF.UserModel; | |||||
using NPOI.SS.UserModel; | |||||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | ||||
{ | { | ||||
@@ -46,6 +50,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
{ | { | ||||
return View(); | return View(); | ||||
} | } | ||||
/// <summary> | |||||
/// 导入表单页 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult ImportForm() | |||||
{ | |||||
return View(); | |||||
} | |||||
#endregion | #endregion | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -159,6 +172,68 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 下载文件 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public ActionResult DownTemplate() | |||||
{ | |||||
FileStreamResult result = null; | |||||
try | |||||
{ | |||||
var fileHead = "成绩比例设置导入模板"; | |||||
var path = Server.MapPath("~/Content/excel/"); | |||||
var pathoffull = path + "OpenLessonPlanImport.xls"; | |||||
string queryJson = "{}"; | |||||
var data = openLessonPlanIBLL.GetList( queryJson); | |||||
IWorkbook book = null; | |||||
ISheet sheet = null; | |||||
FileStream fs = new FileStream(pathoffull, FileMode.Open, FileAccess.Read); | |||||
book = new HSSFWorkbook(fs); | |||||
sheet = book.GetSheetAt(0);//获取第一个工作表 | |||||
//获取数据源 | |||||
int index = 1; | |||||
foreach (var item in data) | |||||
{ | |||||
IRow row = sheet.CreateRow(index); | |||||
row.CreateCell(0).SetCellValue(item.ID); | |||||
row.CreateCell(1).SetCellValue(item.F_School); | |||||
row.CreateCell(2).SetCellValue(item.AcademicYearNo); | |||||
row.CreateCell(3).SetCellValue(item.Semester); | |||||
row.CreateCell(4).SetCellValue(item.Grade); | |||||
row.CreateCell(5).SetCellValue(item.DeptNo); | |||||
row.CreateCell(6).SetCellValue(item.DeptName); | |||||
row.CreateCell(7).SetCellValue(item.MajorNo); | |||||
row.CreateCell(8).SetCellValue(item.MajorName); | |||||
row.CreateCell(9).SetCellValue(item.LessonNo); | |||||
row.CreateCell(10).SetCellValue(item.LessonName); | |||||
index++; | |||||
} | |||||
var fileguid = Guid.NewGuid().ToString(); | |||||
path = Server.MapPath("~/Resource/DormitoryBuildExportFile/" + DateTime.Now.ToString("yyyyMMdd") + "/"); | |||||
pathoffull = path + fileguid + ".xls"; | |||||
if (!Directory.Exists(path)) | |||||
{ | |||||
Directory.CreateDirectory(path); | |||||
} | |||||
FileStream fswrite = new FileStream(pathoffull, FileMode.Create, FileAccess.Write); | |||||
book.Write(fswrite); | |||||
fswrite.Close(); | |||||
FileStream fsread = new FileStream(pathoffull, FileMode.OpenOrCreate, FileAccess.Read); | |||||
result = File(fsread, "application/ms-excel", fileHead + ".xls"); | |||||
return result; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
return null; | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -801,7 +801,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
aaa.Add("TotalScore", item.TotalScore.ToString()); | aaa.Add("TotalScore", item.TotalScore.ToString()); | ||||
foreach (var lessonInfoItem in item.LessonInfo) | foreach (var lessonInfoItem in item.LessonInfo) | ||||
{ | { | ||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); | |||||
try | |||||
{ | |||||
aaa.Add(lessonInfoItem.LessonNo, lessonInfoItem.ScoreFormat); | |||||
} | |||||
catch (Exception) | |||||
{ | |||||
} | |||||
} | } | ||||
result.Add(aaa); | result.Add(aaa); | ||||
@@ -60,37 +60,37 @@ | |||||
<div id="sourcedata" class="col-xs-12 lr-form-item lr-form-item-grid"> | <div id="sourcedata" class="col-xs-12 lr-form-item lr-form-item-grid"> | ||||
<div id="gridtable2"></div> | <div id="gridtable2"></div> | ||||
@*<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | @*<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | ||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||||
<div id="AcademicYearNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||||
<div id="Semester" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">系部<font face="宋体">*</font></div> | |||||
<div id="DeptNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||||
<div id="MajorNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||||
<div id="LessonNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||||
<div id="TeachClassNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">教师<font face="宋体">*</font></div> | |||||
<div id="EmpNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">教室<font face="宋体">*</font></div> | |||||
<div id="ClassroomNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div>*@ | |||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||||
<div id="AcademicYearNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||||
<div id="Semester" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">系部<font face="宋体">*</font></div> | |||||
<div id="DeptNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">专业<font face="宋体">*</font></div> | |||||
<div id="MajorNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||||
<div id="LessonNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">班级<font face="宋体">*</font></div> | |||||
<div id="TeachClassNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">教师<font face="宋体">*</font></div> | |||||
<div id="EmpNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div> | |||||
<div class="col-xs-4 lr-form-item" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">教室<font face="宋体">*</font></div> | |||||
<div id="ClassroomNo" class="olddata" readonly isvalid="yes" checkexpession="NotNull"></div> | |||||
</div>*@ | |||||
</div> | </div> | ||||
<!--表格--> | <!--表格--> | ||||
<div class="col-xs-12 lr-form-item lr-form-item-grid" id="oldgridtable" style="display:none"> | <div class="col-xs-12 lr-form-item lr-form-item-grid" id="oldgridtable" style="display:none"> | ||||
@@ -105,6 +105,12 @@ | |||||
<div class="lr-form-item-title">校区<font face="宋体">*</font></div> | <div class="lr-form-item-title">校区<font face="宋体">*</font></div> | ||||
<div id="NewF_SchoolId" class="contentDiv" readonly></div> | <div id="NewF_SchoolId" class="contentDiv" readonly></div> | ||||
</div>*@ | </div>*@ | ||||
@*<div id="targetdata1"> | |||||
<div class="col-xs-4 lr-form-item AttemperType AttemperTypeDuiDiao" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">日期<font face="宋体">*</font></div> | |||||
<div id="NewTime"></div> | |||||
</div> | |||||
</div>*@ | |||||
<div id="targetdata"> | <div id="targetdata"> | ||||
<div class="col-xs-4 lr-form-item AttemperType AttemperTypeDuiDiao" data-table="ArrangeLessonTermAttemper"> | <div class="col-xs-4 lr-form-item AttemperType AttemperTypeDuiDiao" data-table="ArrangeLessonTermAttemper"> | ||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | <div class="lr-form-item-title">学年<font face="宋体">*</font></div> | ||||
@@ -146,6 +152,11 @@ | |||||
<div class="lr-form-item-title">调度结束时间<font face="宋体">*</font></div> | <div class="lr-form-item-title">调度结束时间<font face="宋体">*</font></div> | ||||
<div id="AttemperEndTime"></div> | <div id="AttemperEndTime"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-4 lr-form-item AttemperType AttemperTypehuanke" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">日期<font face="宋体">*</font></div> | |||||
@*<div id="NewTime"></div>*@ | |||||
<input id="NewTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#NewTime').trigger('change'); } })" /> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item lr-form-item-grid" id="targetgridtable" style="display:none"> | <div class="col-xs-12 lr-form-item lr-form-item-grid" id="targetgridtable" style="display:none"> | ||||
@@ -103,6 +103,12 @@ var bootstrap = function ($, learun) { | |||||
bindSelect: function () { | bindSelect: function () { | ||||
$('#AttemperType').lrDataItemSelect({ | $('#AttemperType').lrDataItemSelect({ | ||||
code: 'AttemperType', select: function (item) { | code: 'AttemperType', select: function (item) { | ||||
if (item.id == '03') { | |||||
if (learun.clientdata.get(['userinfo']).roleIds.indexOf("d080a7c6-17bd-401b-b3df-fe0f741e5838") < 0) { | |||||
learun.alert.warning("无权操作!"); | |||||
return; | |||||
} | |||||
} | |||||
$('.AttemperType').hide(); | $('.AttemperType').hide(); | ||||
$("#AttemperTimeType").removeAttr("isvalid"); | $("#AttemperTimeType").removeAttr("isvalid"); | ||||
@@ -138,12 +144,15 @@ var bootstrap = function ($, learun) { | |||||
} else if (item.id === "02") { //停课 | } else if (item.id === "02") { //停课 | ||||
} else if (item.id === "03") { //对调 | } else if (item.id === "03") { //对调 | ||||
$('.AttemperTypeDuiDiao').show(); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
$('.AttemperTypehuanke').show(); | |||||
$("#NewTime").attr("isvalid", "yes"); | |||||
$("#NewTime").attr("checkexpession", "NotNull"); | |||||
//$('.AttemperTypeDuiDiao').show(); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
//$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
//$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
} else if (item.id === "04") { //调课 | } else if (item.id === "04") { //调课 | ||||
//$('#gridtable').jfGridSet('refreshdata', []); | //$('#gridtable').jfGridSet('refreshdata', []); | ||||
$("#sourcedata").hide(); | $("#sourcedata").hide(); | ||||
@@ -432,6 +441,7 @@ var bootstrap = function ($, learun) { | |||||
], | ], | ||||
mainId: 'Id', | mainId: 'Id', | ||||
isPage: false, | isPage: false, | ||||
height:160 | |||||
//sord: 'desc', | //sord: 'desc', | ||||
//sidx: 'CreateTime' | //sidx: 'CreateTime' | ||||
}); | }); | ||||
@@ -622,6 +632,10 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
//获取要操作的课程列表 | //获取要操作的课程列表 | ||||
formData.query = $('#gridtable2').jfGridGet('rowdatas'); | formData.query = $('#gridtable2').jfGridGet('rowdatas'); | ||||
if (formData.query.length==0) { | |||||
learun.alert.warning("请选择课程!"); | |||||
return false; | |||||
} | |||||
console.log(formData) | console.log(formData) | ||||
if (!!processId) { | if (!!processId) { | ||||
formData.ProcessId = processId; | formData.ProcessId = processId; | ||||
@@ -152,6 +152,11 @@ | |||||
@*<div id="AttemperEndTime"></div>*@ | @*<div id="AttemperEndTime"></div>*@ | ||||
<input id="AttemperEndTime" type="text" class="form-control" readonly /> | <input id="AttemperEndTime" type="text" class="form-control" readonly /> | ||||
</div> | </div> | ||||
<div class="col-xs-4 lr-form-item AttemperType AttemperTypehuanke" data-table="ArrangeLessonTermAttemper"> | |||||
<div class="lr-form-item-title">日期<font face="宋体">*</font></div> | |||||
@*<div id="NewTime"></div>*@ | |||||
<input id="NewTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd',onpicked: function () { $('#NewTime').trigger('change'); } })" /> | |||||
</div> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item lr-form-item-grid" id="targetgridtable" style="display:none"> | <div class="col-xs-12 lr-form-item lr-form-item-grid" id="targetgridtable" style="display:none"> | ||||
@@ -120,12 +120,15 @@ var bootstrap = function ($, learun) { | |||||
} else if (item.id === "02") { //停课 | } else if (item.id === "02") { //停课 | ||||
} else if (item.id === "03") { //对调 | } else if (item.id === "03") { //对调 | ||||
$('.AttemperTypeDuiDiao').show(); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
$('.AttemperTypehuanke').show(); | |||||
$("#NewTime").attr("isvalid", "yes"); | |||||
$("#NewTime").attr("checkexpession", "NotNull"); | |||||
//$('.AttemperTypeDuiDiao').show(); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
//$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
//$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
} | } | ||||
else if (item.id === "04") { //调课 | else if (item.id === "04") { //调课 | ||||
$("#sourcedata").hide(); | $("#sourcedata").hide(); | ||||
@@ -261,12 +264,15 @@ var bootstrap = function ($, learun) { | |||||
$("#AttemperEndTime").attr("checkexpession", "NotNull"); | $("#AttemperEndTime").attr("checkexpession", "NotNull"); | ||||
} else if (data[id].AttemperType == "02") { | } else if (data[id].AttemperType == "02") { | ||||
} else if (data[id].AttemperType == "03") { | } else if (data[id].AttemperType == "03") { | ||||
$('.AttemperTypeDuiDiao').show(); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
$('.AttemperTypehuanke').show(); | |||||
$("#NewTime").attr("isvalid", "yes"); | |||||
$("#NewTime").attr("checkexpession", "NotNull"); | |||||
//$('.AttemperTypeDuiDiao').show(); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
//$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
//$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
} else if (data[id].AttemperType == "04") { | } else if (data[id].AttemperType == "04") { | ||||
$("#sourcedata").hide(); | $("#sourcedata").hide(); | ||||
$("#oldgridtable").show(); | $("#oldgridtable").show(); | ||||
@@ -536,12 +542,15 @@ var bootstrap = function ($, learun) { | |||||
$("#AttemperEndTime").attr("checkexpession", "NotNull"); | $("#AttemperEndTime").attr("checkexpession", "NotNull"); | ||||
} else if (data[id].AttemperType == "02") { | } else if (data[id].AttemperType == "02") { | ||||
} else if (data[id].AttemperType == "03") { | } else if (data[id].AttemperType == "03") { | ||||
$('.AttemperTypeDuiDiao').show(); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
$('.AttemperTypehuanke').show(); | |||||
$("#NewTime").attr("isvalid", "yes"); | |||||
$("#NewTime").attr("checkexpession", "NotNull"); | |||||
//$('.AttemperTypeDuiDiao').show(); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("isvalid", "yes"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr("checkexpession", "NotNull"); | |||||
//$(".AttemperTypeDuiDiao").find('.contentDiv').attr('readonly', 'readonly'); | |||||
//$('#NewEmpNo').siblings('div').html('教师<font face="宋体">*</font>'); | |||||
//$('#NewClassroomNo').siblings('div').html('教室<font face="宋体">*</font>'); | |||||
} else if (data[id].AttemperType == "04") { | } else if (data[id].AttemperType == "04") { | ||||
$("#sourcedata").hide(); | $("#sourcedata").hide(); | ||||
$("#oldgridtable").show(); | $("#oldgridtable").show(); | ||||
@@ -119,6 +119,10 @@ var bootstrap = function ($, learun) { | |||||
// 提交 | // 提交 | ||||
$('#lr_submit').on('click', function () { | $('#lr_submit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('Id'); | var keyValue = $('#gridtable').jfGridValue('Id'); | ||||
if ($('#gridtable').jfGridValue('AttemperType').indexOf('03') >= 0) { | |||||
learun.alert.warning("无需审核!"); | |||||
return; | |||||
} | |||||
//selectedRow = $('#gridtable').jfGridGet('rowdata'); | //selectedRow = $('#gridtable').jfGridGet('rowdata'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var stat = $('#gridtable').jfGridValue('Status'); | var stat = $('#gridtable').jfGridValue('Status'); | ||||
@@ -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/OpenLessonPlan/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/OpenLessonPlan/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,240 @@ | |||||
/* | |||||
* 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) | |||||
* Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
* 创建人:陈彬彬 | |||||
* 日 期:2023.03.01 | |||||
* 描 述:导入固定资产信息 | |||||
*/ | |||||
var id = request('id'); | |||||
var keyVaule = ''; | |||||
var bootstrap = function ($, learun) { | |||||
"use strict"; | |||||
var page1 = { | |||||
init: function () { | |||||
page.bind(); | |||||
page.initData(); | |||||
}, | |||||
bind: function () { | |||||
$('#lr_add_format').on('click', function () { | |||||
currentColRow = null; | |||||
learun.layerForm({ | |||||
id: 'FormatForm', | |||||
title: '添加', | |||||
url: top.$.rootUrl + '/LR_SystemModule/CodeRule/FormatForm', | |||||
width: 450, | |||||
height: 310, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
$('#gridtable').jfGridSet('addRow', { row: data }); | |||||
}); | |||||
} | |||||
}); | |||||
}); | |||||
$('#lr_edit_format').on('click', function () { | |||||
currentColRow = $('#gridtable').jfGridGet('rowdata'); | |||||
var _id = currentColRow ? currentColRow.itemTypeName : ''; | |||||
if (learun.checkrow(_id)) { | |||||
learun.layerForm({ | |||||
id: 'FormatForm', | |||||
title: '修改', | |||||
url: top.$.rootUrl + '/LR_SystemModule/CodeRule/FormatForm', | |||||
width: 450, | |||||
height: 310, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(function (data) { | |||||
$('#gridtable').jfGridSet('updateRow', { row: data }); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
$('#lr_delete_format').on('click', function () { | |||||
currentColRow = null; | |||||
var row = $('#gridtable').jfGridGet('rowdata'); | |||||
var _id = row ? row.itemTypeName : ''; | |||||
if (learun.checkrow(_id)) { | |||||
learun.layerConfirm('是否确认删除该项!', function (res, index) { | |||||
if (res) { | |||||
$('#gridtable').jfGridSet('removeRow'); | |||||
top.layer.close(index); //再执行关闭 | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
$('#gridtable').jfGrid({ | |||||
headData: [ | |||||
{ label: "前缀", name: "itemTypeName", width: 120, align: "left" }, | |||||
{ label: "格式", name: "formatStr", width: 120, align: "left" }, | |||||
{ label: "步长", name: "stepValue", width: 100, align: "left" }, | |||||
{ label: "初始值", name: "initValue", width: 120, align: "left" }, | |||||
{ label: "说明", name: "description", width: 180, align: "left" } | |||||
] | |||||
}); | |||||
/*检测重复项*/ | |||||
$('#F_EnCode').on('blur', function () { | |||||
$.lrExistField(keyValue, 'F_EnCode', top.$.rootUrl + '/LR_SystemModule/CodeRule/ExistEnCode'); | |||||
}); | |||||
$('#F_FullName').on('blur', function () { | |||||
$.lrExistField(keyValue, 'F_FullName', top.$.rootUrl + '/LR_SystemModule/CodeRule/ExistFullName'); | |||||
}); | |||||
}, | |||||
initData: function () { | |||||
if (!!selectedRow) { | |||||
keyValue = selectedRow.F_RuleId; | |||||
$('#form').lrSetFormData(selectedRow); | |||||
var formatdata = JSON.parse(selectedRow.F_RuleFormatJson); | |||||
$('#gridtable').jfGridSet('refreshdata', formatdata); | |||||
} | |||||
} | |||||
}; | |||||
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/OpenLessonPlanImport", 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/OpenLessonPlan/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(); | |||||
} |
@@ -50,9 +50,10 @@ | |||||
<div class=" btn-group btn-group-sm"> | <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_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | ||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||||
<div class=" btn-group btn-group-sm" > | |||||
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a>*@ | @*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 录入</a>*@ | ||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 成绩比例设置</a> | <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 成绩比例设置</a> | ||||
<a id="lr_import" class="btn btn-default"><i class="fa fa-trash-o"></i> 导入</a> | |||||
@*<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a>*@ | @*<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a>*@ | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -68,6 +68,21 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
///上传 | |||||
$('#lr_import').on('click', | |||||
function () { | |||||
learun.layerForm({ | |||||
id: 'form', | |||||
title: '导入', | |||||
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/ImportForm', | |||||
width: 600, | |||||
height: 400, | |||||
btn: null, | |||||
callBack: function (id) { | |||||
return top[id].acceptClick(refreshGirdData); | |||||
} | |||||
}); | |||||
}); | |||||
}, | }, | ||||
bindSelect: function () { | bindSelect: function () { | ||||
//校区 | //校区 | ||||
@@ -25,10 +25,10 @@ var bootstrap = function ($, learun) { | |||||
p.ClassNo = $('#ClassNo').lrselectGet(); | p.ClassNo = $('#ClassNo').lrselectGet(); | ||||
p.StuNo = $('#StuNo').lrselectGet(); | p.StuNo = $('#StuNo').lrselectGet(); | ||||
p.TableName = $('#TableName').lrselectGet(); | p.TableName = $('#TableName').lrselectGet(); | ||||
if (p.ClassNo == null || p.ClassNo == "") { | |||||
learun.alert.warning("请选择班级!"); | |||||
return; | |||||
} | |||||
//if (p.ClassNo == null || p.ClassNo == "") { | |||||
// learun.alert.warning("请选择班级!"); | |||||
// return; | |||||
//} | |||||
if (p.TableName == null || p.TableName == "") { | if (p.TableName == null || p.TableName == "") { | ||||
learun.alert.warning("请选择考试类型!"); | learun.alert.warning("请选择考试类型!"); | ||||
return; | return; | ||||
@@ -66,11 +66,11 @@ var bootstrap = function ($, learun) { | |||||
if (val) { | if (val) { | ||||
deptno = val.deptno; | deptno = val.deptno; | ||||
} | } | ||||
$('#MajorNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetListByDeptNo?DeptNo=' + deptno, | |||||
text: "MajorName", | |||||
value: "MajorNo" | |||||
}) | |||||
//$('#MajorNo').lrselectRefresh({ | |||||
// url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GetListByDeptNo?DeptNo=' + deptno, | |||||
// text: "MajorName", | |||||
// value: "MajorNo" | |||||
//}) | |||||
} | } | ||||
}); | }); | ||||
$('#MajorNo').lrDataSourceSelect({ | $('#MajorNo').lrDataSourceSelect({ | ||||
@@ -80,11 +80,11 @@ var bootstrap = function ($, learun) { | |||||
if (val) { | if (val) { | ||||
majorNo = val.MajorNo; | majorNo = val.MajorNo; | ||||
} | } | ||||
$('#ClassNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetClassByMajorNo?majorNo=' + majorNo, | |||||
text: "ClassName", | |||||
value: "ClassNo" | |||||
}) | |||||
//$('#ClassNo').lrselectRefresh({ | |||||
// url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetClassByMajorNo?majorNo=' + majorNo, | |||||
// text: "ClassName", | |||||
// value: "ClassNo" | |||||
//}) | |||||
} | } | ||||
}); | }); | ||||
$('#ClassNo').lrDataSourceSelect({ | $('#ClassNo').lrDataSourceSelect({ | ||||
@@ -93,11 +93,11 @@ var bootstrap = function ($, learun) { | |||||
if (val) { | if (val) { | ||||
classNo = val.ClassNo; | classNo = val.ClassNo; | ||||
} | } | ||||
$('#StuNo').lrselectRefresh({ | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfoByClassNo?classNo=' + classNo, | |||||
text: "StuName", | |||||
value: "StuNo" | |||||
}) | |||||
//$('#StuNo').lrselectRefresh({ | |||||
// url: top.$.rootUrl + '/EducationalAdministration/StuInfoBasic/GetStuInfoByClassNo?classNo=' + classNo, | |||||
// text: "StuName", | |||||
// value: "StuNo" | |||||
//}) | |||||
} | } | ||||
}); | }); | ||||
@@ -25,6 +25,7 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||||
private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); | ||||
private Ass_FixAssetsIBLL ass_FixAssetsIBLL = new Ass_FixAssetsBLL(); | private Ass_FixAssetsIBLL ass_FixAssetsIBLL = new Ass_FixAssetsBLL(); | ||||
private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | private ArrangeLessonTermIBLL arrangeLessonTermIBLL = new ArrangeLessonTermBLL(); | ||||
private OpenLessonPlanIBLL openLessonPlanIBLL = new OpenLessonPlanBLL(); | |||||
#region 视图功能 | #region 视图功能 | ||||
/// <summary> | /// <summary> | ||||
@@ -355,6 +356,36 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 成绩比例导入 | |||||
/// </summary> | |||||
/// <param name="templateId">模板Id</param> | |||||
/// <param name="fileId">文件主键</param> | |||||
/// <param name="chunks">分片数</param> | |||||
/// <param name="ext">文件扩展名</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
public ActionResult OpenLessonPlanImport(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); | |||||
string res = openLessonPlanIBLL.OpenLessonPlanImport(dt, fileId); | |||||
var data = new | |||||
{ | |||||
Success = res.Split('|')[0], | |||||
Fail = res.Split('|')[1] | |||||
}; | |||||
return JsonResult(data); | |||||
} | |||||
else | |||||
{ | |||||
return Fail("导入数据失败!"); | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// | /// | ||||
/// </summary> | /// </summary> | ||||
/// <param name="fileId"></param> | /// <param name="fileId"></param> | ||||
@@ -103,7 +103,9 @@ | |||||
.lr-select { | .lr-select { | ||||
width: 150px; | width: 150px; | ||||
} | } | ||||
.perWeek .choose { | |||||
cursor: pointer; | |||||
} | |||||
.perFestivalsBox td.active div.box { | .perFestivalsBox td.active div.box { | ||||
cursor: pointer; | cursor: pointer; | ||||
} | } | ||||
@@ -111,7 +113,9 @@ | |||||
.perFestivalsBox td.active div.box.active { | .perFestivalsBox td.active div.box.active { | ||||
color: blue; | color: blue; | ||||
} | } | ||||
.perFestivalsBox td.active div.box1.active { | |||||
color: blue; | |||||
} | |||||
.perFestivalsBox td.active { | .perFestivalsBox td.active { | ||||
cursor: auto; | cursor: auto; | ||||
} | } | ||||
@@ -1,11 +1,17 @@ | |||||
| | ||||
var acceptClick; | var acceptClick; | ||||
var attempertype = request('attempertype'); | |||||
var refreshGirdData; | var refreshGirdData; | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
var startTime; | var startTime; | ||||
var endTime; | var endTime; | ||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
if (attempertype == '03') { | |||||
$('.perWeek li').addClass('choose'); | |||||
} else { | |||||
} | |||||
page.bind(); | page.bind(); | ||||
page.bindSelect(); | page.bindSelect(); | ||||
}, | }, | ||||
@@ -77,18 +83,33 @@ var bootstrap = function ($, learun) { | |||||
if (i > 0) { | if (i > 0) { | ||||
html += '<hr>'; | html += '<hr>'; | ||||
} | } | ||||
html += "<div class='box' data-val='" + JSON.stringify(item) + "'><div>课程:" + | |||||
item.Curriculum + | |||||
"</div>" + | |||||
"<div>教师:" + | |||||
item.Teacher + | |||||
"</div>" + | |||||
"<div>班级:" + | |||||
item.ClassName + | |||||
"</div>" + | |||||
"<div>教室:" + | |||||
item.ClassRoom + | |||||
"</div></div>"; | |||||
if (attempertype == '03') { | |||||
html += "<div class='box1' data-val='" + JSON.stringify(item) + "'><div>课程:" + | |||||
item.Curriculum + | |||||
"</div>" + | |||||
"<div>教师:" + | |||||
item.Teacher + | |||||
"</div>" + | |||||
"<div>班级:" + | |||||
item.ClassName + | |||||
"</div>" + | |||||
"<div>教室:" + | |||||
item.ClassRoom + | |||||
"</div></div>"; | |||||
} else { | |||||
html += "<div class='box' data-val='" + JSON.stringify(item) + "'><div>课程:" + | |||||
item.Curriculum + | |||||
"</div>" + | |||||
"<div>教师:" + | |||||
item.Teacher + | |||||
"</div>" + | |||||
"<div>班级:" + | |||||
item.ClassName + | |||||
"</div>" + | |||||
"<div>教室:" + | |||||
item.ClassRoom + | |||||
"</div></div>"; | |||||
} | |||||
}); | }); | ||||
html += '</td>'; | html += '</td>'; | ||||
@@ -157,11 +178,36 @@ var bootstrap = function ($, learun) { | |||||
p.EmpNo = $('#EmpNo').lrselectGet(); | p.EmpNo = $('#EmpNo').lrselectGet(); | ||||
page.search(p); | page.search(p); | ||||
}); | }); | ||||
//换课点击表头选中对应课程 | |||||
$('.perWeek').on('click', 'li', function () { | |||||
if (attempertype != '03') { | |||||
return; | |||||
} | |||||
$('.perFestivalsBox tr td div.active').removeClass('active'); | |||||
var li = $(this); | |||||
//if ($('#ClassNo').lrselectGet() == '' && $('#EmpNo').lrselectGet() == '') { | |||||
// learun.alert.warning("请选择班级或者教师!"); | |||||
// return; | |||||
//} | |||||
$('.perFestivalsBox tr').each(function (index, row) { | |||||
$($(row).find('td').eq(li.index()).find('.box1')).addClass('active') | |||||
}) | |||||
}) | |||||
//点击课程表内容 | //点击课程表内容 | ||||
$('.perFestivalsBox').on('click', 'td.active div.box', function () { | $('.perFestivalsBox').on('click', 'td.active div.box', function () { | ||||
if (attempertype == '03') { | |||||
return; | |||||
} | |||||
var box = $(this); | var box = $(this); | ||||
var choosedata = JSON.parse(box[0].getAttribute('data-val')); | var choosedata = JSON.parse(box[0].getAttribute('data-val')); | ||||
$('.perFestivalsBox').find('div.box.active').removeClass('active'); | |||||
if (box[0].className.indexOf('active') >= 0) { | |||||
box[0].classList.remove('active'); | |||||
return; | |||||
} | |||||
if (attempertype != '02') { | |||||
$('.perFestivalsBox').find('div.box.active').removeClass('active'); | |||||
} | |||||
if ($('#ClassNo').lrselectGet() == '' && $('#EmpNo').lrselectGet() == '') { | if ($('#ClassNo').lrselectGet() == '' && $('#EmpNo').lrselectGet() == '') { | ||||
learun.alert.warning("请选择班级或者教师!"); | learun.alert.warning("请选择班级或者教师!"); | ||||
} else { | } else { | ||||
@@ -280,18 +326,34 @@ var bootstrap = function ($, learun) { | |||||
}; | }; | ||||
// 保存数据 | // 保存数据 | ||||
acceptClick = function (callBack) { | acceptClick = function (callBack) { | ||||
var box = $('.perFestivalsBox').find('div.box.active'); | |||||
if (box.length <= 0) { | |||||
learun.alert.warning("请选择课程!"); | |||||
return false; | |||||
} | |||||
var postData = new Array(); | |||||
for (var i = 0; i < box.length; i++) { | |||||
postData.push(JSON.parse(box[i].getAttribute('data-val'))) | |||||
} | |||||
if (!!callBack) { | |||||
callBack(postData); | |||||
return true; | |||||
if (attempertype == '03') { | |||||
var box = $('.perFestivalsBox').find('div.box1.active'); | |||||
if (box.length <= 0) { | |||||
learun.alert.warning("请选择课程!"); | |||||
return false; | |||||
} | |||||
var postData = new Array(); | |||||
for (var i = 0; i < box.length; i++) { | |||||
postData.push(JSON.parse(box[i].getAttribute('data-val'))) | |||||
} | |||||
if (!!callBack) { | |||||
callBack(postData); | |||||
return true; | |||||
} | |||||
} else { | |||||
var box = $('.perFestivalsBox').find('div.box.active'); | |||||
if (box.length <= 0) { | |||||
learun.alert.warning("请选择课程!"); | |||||
return false; | |||||
} | |||||
var postData = new Array(); | |||||
for (var i = 0; i < box.length; i++) { | |||||
postData.push(JSON.parse(box[i].getAttribute('data-val'))) | |||||
} | |||||
if (!!callBack) { | |||||
callBack(postData); | |||||
return true; | |||||
} | |||||
} | } | ||||
}; | }; | ||||
page.init(); | page.init(); | ||||
@@ -1036,6 +1036,8 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\FormNum.js" /> | <Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\FormNum.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\SetIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\SetIndex.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\StudentIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\LessonInfoOfElectiveOnline\StudentIndex.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlan\ImportForm.css" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlan\ImportForm.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\PsychologyInfo\FormView.js" /> | <Content Include="Areas\EducationalAdministration\Views\PsychologyInfo\FormView.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\SchoolLevelScholarship\FormOfStudent.js" /> | <Content Include="Areas\EducationalAdministration\Views\SchoolLevelScholarship\FormOfStudent.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\SchoolLevelScholarship\FormView.js" /> | <Content Include="Areas\EducationalAdministration\Views\SchoolLevelScholarship\FormView.js" /> | ||||
@@ -8365,6 +8367,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreStat.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuScore\StuScoreStat.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\StuScoreStat.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPass\StuScoreStat.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\StuScoreStat.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\StuScoreStat.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlan\ImportForm.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -31,6 +31,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[Column("F_SCHOOLID")] | [Column("F_SCHOOLID")] | ||||
public string F_SchoolId { get; set; } | public string F_SchoolId { get; set; } | ||||
/// <summary> | /// <summary> | ||||
/// LessonDate | |||||
/// </summary> | |||||
[Column("LESSONDATE")] | |||||
public DateTime? LessonDate { get; set; } | |||||
/// <summary> | |||||
/// LessonTime | |||||
/// </summary> | |||||
[Column("LESSONTIME")] | |||||
public string LessonTime { get; set; } | |||||
/// <summary> | |||||
/// AcademicYearNo | /// AcademicYearNo | ||||
/// </summary> | /// </summary> | ||||
[Column("ACADEMICYEARNO")] | [Column("ACADEMICYEARNO")] | ||||
@@ -170,11 +180,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
[Column("PROCESSID")] | [Column("PROCESSID")] | ||||
public string ProcessId { get; set; } | public string ProcessId { get; set; } | ||||
///// <summary> | |||||
///// Details | |||||
///// </summary> | |||||
//[Column("DETAILS")] | |||||
//public string Details { get; set; } | |||||
/// <summary> | |||||
/// NewTime | |||||
/// </summary> | |||||
[Column("NEWTIME")] | |||||
public DateTime? NewTime { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -243,6 +243,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
entity.Create(); | entity.Create(); | ||||
this.BaseRepository("CollegeMIS").Insert(entity); | this.BaseRepository("CollegeMIS").Insert(entity); | ||||
if (entity.AttemperType == "03") | |||||
{ | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql($"update ArrangeLessonTerm set LessonDate='{entity.NewTime}' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'"); | |||||
} | |||||
if (entity.AttemperType == "04") | if (entity.AttemperType == "04") | ||||
{ | { | ||||
foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) | foreach (ArrangeLessonTermAttrmperChildEntity item in entity.query) | ||||
@@ -407,11 +412,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
else if (entity.AttemperType == "02") //停课 | else if (entity.AttemperType == "02") //停课 | ||||
{ | { | ||||
//ArrangeLessonTerm | //ArrangeLessonTerm | ||||
//db.ExecuteBySql($"update ArrangeLessonTerm set CheckMark='0' where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' "); | //db.ExecuteBySql($"update ArrangeLessonTerm set CheckMark='0' where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' "); | ||||
db.ExecuteBySql($"update ArrangeLessonTerm set CheckMark='0' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' "); | |||||
//修改课程基础数据 | |||||
db.ExecuteBySql($"update ArrangeLessonTerm set CheckMark='0' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'"); | |||||
//StuSelectLessonList | //StuSelectLessonList | ||||
//db.ExecuteBySql($"update StuSelectLessonList set CheckMark='0' where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo='{entity.TeachClassNo}' and EmpNo='{entity.EmpNo}' "); | //db.ExecuteBySql($"update StuSelectLessonList set CheckMark='0' where F_SchoolId='{entity.F_SchoolId}' and AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo='{entity.TeachClassNo}' and EmpNo='{entity.EmpNo}' "); | ||||
//修改学生课程数据 | |||||
db.ExecuteBySql($"update StuSelectLessonList set CheckMark='0' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo='{entity.TeachClassNo}' and EmpNo='{entity.EmpNo}' "); | db.ExecuteBySql($"update StuSelectLessonList set CheckMark='0' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo='{entity.TeachClassNo}' and EmpNo='{entity.EmpNo}' "); | ||||
//ArrangeLessonTerm | //ArrangeLessonTerm | ||||
@@ -419,77 +427,81 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
else if (entity.AttemperType == "03") //对调 | else if (entity.AttemperType == "03") //对调 | ||||
{ | { | ||||
//ArrangeLessonTerm | |||||
//var ArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.F_SchoolId == entity.F_SchoolId && x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.DeptNo && x.MajorNo == entity.MajorNo && x.LessonNo == entity.LessonNo && x.TeachClassNo.Contains(entity.TeachClassNo) && x.EmpNo == entity.EmpNo && x.ClassroomNo == entity.ClassroomNo); | |||||
var ArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.DeptNo && x.MajorNo == entity.MajorNo && x.LessonNo == entity.LessonNo && x.TeachClassNo.Contains(entity.TeachClassNo) && x.EmpNo == entity.EmpNo && x.ClassroomNo == entity.ClassroomNo); | |||||
//var NewArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.F_SchoolId == entity.F_SchoolId && x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.NewDeptNo && x.MajorNo == entity.NewMajorNo && x.LessonNo == entity.NewLessonNo && x.TeachClassNo.Contains(entity.NewTeachClassNo) && x.EmpNo == entity.NewEmpNo && x.ClassroomNo == entity.NewClassroomNo); | |||||
var NewArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.NewDeptNo && x.MajorNo == entity.NewMajorNo && x.LessonNo == entity.NewLessonNo && x.TeachClassNo.Contains(entity.NewTeachClassNo) && x.EmpNo == entity.NewEmpNo && x.ClassroomNo == entity.NewClassroomNo); | |||||
if (ArrangeLessonTermList.Any() && NewArrangeLessonTermList.Any()) | |||||
{ | |||||
var oldEntity = ArrangeLessonTermList.FirstOrDefault(); | |||||
var newEntity = NewArrangeLessonTermList.FirstOrDefault(); | |||||
var oldEntityTemp = new ArrangeLessonTermEntity() | |||||
{ | |||||
DeptNo = oldEntity.DeptNo, | |||||
MajorNo = oldEntity.MajorNo, | |||||
LessonNo = oldEntity.LessonNo, | |||||
LessonName = oldEntity.LessonName, | |||||
TeachClassNo = oldEntity.TeachClassNo, | |||||
TeachClassSn = oldEntity.TeachClassSn, | |||||
EmpNo = oldEntity.EmpNo, | |||||
EmpName = oldEntity.EmpName, | |||||
LessonSortNo = oldEntity.LessonSortNo, | |||||
StuSortNo = oldEntity.StuSortNo, | |||||
JoinLessonNum = oldEntity.JoinLessonNum, | |||||
RelatedClassNo = oldEntity.RelatedClassNo, | |||||
ClassroomNo = oldEntity.ClassroomNo, | |||||
Remark = oldEntity.Remark, | |||||
CheckMark = oldEntity.CheckMark, | |||||
RecordMark = oldEntity.RecordMark, | |||||
}; | |||||
db.ExecuteBySql($"update ArrangeLessonTerm set LessonDate='{entity.NewTime}' where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' and DeptNo='{entity.DeptNo}' and MajorNo='{entity.MajorNo}' and LessonNo='{entity.LessonNo}' and TeachClassNo like '%{entity.TeachClassNo}%' and EmpNo='{entity.EmpNo}' and ClassroomNo='{entity.ClassroomNo}' and LessonDate='{entity.LessonDate}' and LessonTime='{entity.LessonTime}'"); | |||||
#region MyRegion | |||||
////ArrangeLessonTerm | |||||
////var ArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.F_SchoolId == entity.F_SchoolId && x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.DeptNo && x.MajorNo == entity.MajorNo && x.LessonNo == entity.LessonNo && x.TeachClassNo.Contains(entity.TeachClassNo) && x.EmpNo == entity.EmpNo && x.ClassroomNo == entity.ClassroomNo); | |||||
//var ArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.DeptNo && x.MajorNo == entity.MajorNo && x.LessonNo == entity.LessonNo && x.TeachClassNo.Contains(entity.TeachClassNo) && x.EmpNo == entity.EmpNo && x.ClassroomNo == entity.ClassroomNo); | |||||
////var NewArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.F_SchoolId == entity.F_SchoolId && x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.NewDeptNo && x.MajorNo == entity.NewMajorNo && x.LessonNo == entity.NewLessonNo && x.TeachClassNo.Contains(entity.NewTeachClassNo) && x.EmpNo == entity.NewEmpNo && x.ClassroomNo == entity.NewClassroomNo); | |||||
//var NewArrangeLessonTermList = this.BaseRepository("CollegeMIS").FindList<ArrangeLessonTermEntity>(x => x.AcademicYearNo == entity.AcademicYearNo && x.Semester == entity.Semester && x.DeptNo == entity.NewDeptNo && x.MajorNo == entity.NewMajorNo && x.LessonNo == entity.NewLessonNo && x.TeachClassNo.Contains(entity.NewTeachClassNo) && x.EmpNo == entity.NewEmpNo && x.ClassroomNo == entity.NewClassroomNo); | |||||
//if (ArrangeLessonTermList.Any() && NewArrangeLessonTermList.Any()) | |||||
//{ | |||||
// var oldEntity = ArrangeLessonTermList.FirstOrDefault(); | |||||
// var newEntity = NewArrangeLessonTermList.FirstOrDefault(); | |||||
foreach (var item in ArrangeLessonTermList) | |||||
{ | |||||
item.DeptNo = newEntity.DeptNo; | |||||
item.MajorNo = newEntity.MajorNo; | |||||
item.LessonNo = newEntity.LessonNo; | |||||
item.LessonName = newEntity.LessonName; | |||||
item.TeachClassNo = newEntity.TeachClassNo; | |||||
item.TeachClassSn = newEntity.TeachClassSn; | |||||
item.EmpNo = newEntity.EmpNo; | |||||
item.EmpName = newEntity.EmpName; | |||||
item.LessonSortNo = newEntity.LessonSortNo; | |||||
item.StuSortNo = newEntity.StuSortNo; | |||||
item.JoinLessonNum = newEntity.JoinLessonNum; | |||||
item.RelatedClassNo = newEntity.RelatedClassNo; | |||||
item.ClassroomNo = newEntity.ClassroomNo; | |||||
item.Remark = newEntity.Remark; | |||||
item.CheckMark = newEntity.CheckMark; | |||||
item.RecordMark = newEntity.RecordMark; | |||||
db.Update(item); | |||||
} | |||||
foreach (var newitem in NewArrangeLessonTermList) | |||||
{ | |||||
newitem.DeptNo = oldEntityTemp.DeptNo; | |||||
newitem.MajorNo = oldEntityTemp.MajorNo; | |||||
newitem.LessonNo = oldEntityTemp.LessonNo; | |||||
newitem.LessonName = oldEntityTemp.LessonName; | |||||
newitem.TeachClassNo = oldEntityTemp.TeachClassNo; | |||||
newitem.TeachClassSn = oldEntityTemp.TeachClassSn; | |||||
newitem.EmpNo = oldEntityTemp.EmpNo; | |||||
newitem.EmpName = oldEntityTemp.EmpName; | |||||
newitem.LessonSortNo = oldEntityTemp.LessonSortNo; | |||||
newitem.StuSortNo = oldEntityTemp.StuSortNo; | |||||
newitem.JoinLessonNum = oldEntityTemp.JoinLessonNum; | |||||
newitem.RelatedClassNo = oldEntityTemp.RelatedClassNo; | |||||
newitem.ClassroomNo = oldEntityTemp.ClassroomNo; | |||||
newitem.Remark = oldEntityTemp.Remark; | |||||
newitem.CheckMark = oldEntityTemp.CheckMark; | |||||
newitem.RecordMark = oldEntityTemp.RecordMark; | |||||
db.Update(newitem); | |||||
} | |||||
} | |||||
// var oldEntityTemp = new ArrangeLessonTermEntity() | |||||
// { | |||||
// DeptNo = oldEntity.DeptNo, | |||||
// MajorNo = oldEntity.MajorNo, | |||||
// LessonNo = oldEntity.LessonNo, | |||||
// LessonName = oldEntity.LessonName, | |||||
// TeachClassNo = oldEntity.TeachClassNo, | |||||
// TeachClassSn = oldEntity.TeachClassSn, | |||||
// EmpNo = oldEntity.EmpNo, | |||||
// EmpName = oldEntity.EmpName, | |||||
// LessonSortNo = oldEntity.LessonSortNo, | |||||
// StuSortNo = oldEntity.StuSortNo, | |||||
// JoinLessonNum = oldEntity.JoinLessonNum, | |||||
// RelatedClassNo = oldEntity.RelatedClassNo, | |||||
// ClassroomNo = oldEntity.ClassroomNo, | |||||
// Remark = oldEntity.Remark, | |||||
// CheckMark = oldEntity.CheckMark, | |||||
// RecordMark = oldEntity.RecordMark, | |||||
// }; | |||||
// foreach (var item in ArrangeLessonTermList) | |||||
// { | |||||
// item.DeptNo = newEntity.DeptNo; | |||||
// item.MajorNo = newEntity.MajorNo; | |||||
// item.LessonNo = newEntity.LessonNo; | |||||
// item.LessonName = newEntity.LessonName; | |||||
// item.TeachClassNo = newEntity.TeachClassNo; | |||||
// item.TeachClassSn = newEntity.TeachClassSn; | |||||
// item.EmpNo = newEntity.EmpNo; | |||||
// item.EmpName = newEntity.EmpName; | |||||
// item.LessonSortNo = newEntity.LessonSortNo; | |||||
// item.StuSortNo = newEntity.StuSortNo; | |||||
// item.JoinLessonNum = newEntity.JoinLessonNum; | |||||
// item.RelatedClassNo = newEntity.RelatedClassNo; | |||||
// item.ClassroomNo = newEntity.ClassroomNo; | |||||
// item.Remark = newEntity.Remark; | |||||
// item.CheckMark = newEntity.CheckMark; | |||||
// item.RecordMark = newEntity.RecordMark; | |||||
// db.Update(item); | |||||
// } | |||||
// foreach (var newitem in NewArrangeLessonTermList) | |||||
// { | |||||
// newitem.DeptNo = oldEntityTemp.DeptNo; | |||||
// newitem.MajorNo = oldEntityTemp.MajorNo; | |||||
// newitem.LessonNo = oldEntityTemp.LessonNo; | |||||
// newitem.LessonName = oldEntityTemp.LessonName; | |||||
// newitem.TeachClassNo = oldEntityTemp.TeachClassNo; | |||||
// newitem.TeachClassSn = oldEntityTemp.TeachClassSn; | |||||
// newitem.EmpNo = oldEntityTemp.EmpNo; | |||||
// newitem.EmpName = oldEntityTemp.EmpName; | |||||
// newitem.LessonSortNo = oldEntityTemp.LessonSortNo; | |||||
// newitem.StuSortNo = oldEntityTemp.StuSortNo; | |||||
// newitem.JoinLessonNum = oldEntityTemp.JoinLessonNum; | |||||
// newitem.RelatedClassNo = oldEntityTemp.RelatedClassNo; | |||||
// newitem.ClassroomNo = oldEntityTemp.ClassroomNo; | |||||
// newitem.Remark = oldEntityTemp.Remark; | |||||
// newitem.CheckMark = oldEntityTemp.CheckMark; | |||||
// newitem.RecordMark = oldEntityTemp.RecordMark; | |||||
// db.Update(newitem); | |||||
// } | |||||
//} | |||||
#endregion | |||||
} | } | ||||
else if (entity.AttemperType == "04")//调课 | else if (entity.AttemperType == "04")//调课 | ||||
{ | { | ||||
@@ -41,6 +41,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<OpenLessonPlanEntity> GetList( string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return openLessonPlanService.GetList( queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取OpenLessonPlan表实体数据 | /// 获取OpenLessonPlan表实体数据 | ||||
@@ -195,6 +218,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 导入 | |||||
/// </summary> | |||||
/// <param name="dt"></param> | |||||
/// <param name="fileId"></param> | |||||
/// <returns></returns> | |||||
public string OpenLessonPlanImport(DataTable dt, string fileId) | |||||
{ | |||||
try | |||||
{ | |||||
return openLessonPlanService.OpenLessonPlanImport(dt, fileId); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -22,6 +22,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson); | ||||
/// <summary> | /// <summary> | ||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<OpenLessonPlanEntity> GetList( string queryJson); | |||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | /// 获取OpenLessonPlan表实体数据 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <summary> | /// <summary> | ||||
@@ -68,6 +74,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListEntity entity); | void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListEntity entity); | ||||
/// <summary> | |||||
/// 固定资产导入 | |||||
/// </summary> | |||||
/// <param name="dt"></param> | |||||
/// <param name="fileId"></param> | |||||
/// <returns></returns> | |||||
string OpenLessonPlanImport(DataTable dt, string fileId); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -1,4 +1,6 @@ | |||||
using Dapper; | using Dapper; | ||||
using Learun.Cache.Base; | |||||
using Learun.Cache.Factory; | |||||
using Learun.DataBase.Repository; | using Learun.DataBase.Repository; | ||||
using Learun.Util; | using Learun.Util; | ||||
using System; | using System; | ||||
@@ -115,6 +117,100 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<OpenLessonPlanEntity> GetList( string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var basedbname = BaseRepository().getDbConnection().Database; | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("select t.*,c.F_FullName as F_School,d.DeptName,m.MajorName from OpenLessonPlan t "); | |||||
strSql.Append(" left join " + basedbname + ".dbo.LR_Base_Company c on t.F_SchoolId=c.f_CompanyId "); | |||||
strSql.Append(" left join CdDept d on t.DeptNo=d.DeptNo "); | |||||
strSql.Append(" left join CdMajor m on t.MajorNo=m.MajorNo "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
if (!queryParam["F_SchoolId"].IsEmpty()) | |||||
{ | |||||
dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.F_SchoolId = @F_SchoolId "); | |||||
} | |||||
if (!queryParam["F_School"].IsEmpty()) | |||||
{ | |||||
dp.Add("F_School", "%" + queryParam["F_School"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND c.F_FullName Like @F_School "); | |||||
} | |||||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); | |||||
} | |||||
if (!queryParam["Semester"].IsEmpty()) | |||||
{ | |||||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.Semester = @Semester "); | |||||
} | |||||
if (!queryParam["Grade"].IsEmpty()) | |||||
{ | |||||
dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.Grade = @Grade "); | |||||
} | |||||
if (!queryParam["DeptNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.DeptNo = @DeptNo "); | |||||
} | |||||
if (!queryParam["DeptName"].IsEmpty()) | |||||
{ | |||||
dp.Add("DeptName", "%" + queryParam["DeptName"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND d.DeptName Like @DeptName "); | |||||
} | |||||
if (!queryParam["MajorNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.MajorNo = @MajorNo "); | |||||
} | |||||
if (!queryParam["MajorName"].IsEmpty()) | |||||
{ | |||||
dp.Add("MajorName", "%" + queryParam["MajorName"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND m.MajorName Like @MajorName "); | |||||
} | |||||
if (!queryParam["LessonNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.LessonNo = @LessonNo "); | |||||
} | |||||
if (!queryParam["LessonName"].IsEmpty()) | |||||
{ | |||||
dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.LessonName Like @LessonName "); | |||||
} | |||||
if (!queryParam["GZ"].IsEmpty()) | |||||
{ | |||||
dp.Add("GZ", queryParam["GZ"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.MajorNo Like @GZ "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanEntity>(strSql.ToString(), dp); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取OpenLessonPlan表实体数据 | /// 获取OpenLessonPlan表实体数据 | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -373,6 +469,131 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
private ICache cache = CacheFactory.CaChe(); | |||||
private string cacheKey = "Learun_adms_excelError_"; // +公司主键 | |||||
/// <summary> | |||||
/// 导入 | |||||
/// </summary> | |||||
/// <param name="dt"></param> | |||||
/// <param name="fileId"></param> | |||||
/// <returns></returns> | |||||
public string OpenLessonPlanImport(DataTable dt, string fileId) | |||||
{ | |||||
try | |||||
{ | |||||
int snum = 0; | |||||
int fnum = 0; | |||||
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); | |||||
} | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
#region MyRegion | |||||
//IEnumerable<Ass_FixAssetsEntity> Ass_FixAssetsHistory = db.FindList<Ass_FixAssetsEntity>("select * from Ass_FixAssets"); | |||||
//List<Ass_FixAssetsEntity> Ass_FixAssetsinsert = new List<Ass_FixAssetsEntity>(); | |||||
// 循环遍历导入 | |||||
foreach (DataRow dr in dt.Rows) | |||||
{ | |||||
try | |||||
{ | |||||
#region 必填项空验证 | |||||
if (dr["ID"].ToString().IsEmpty()) | |||||
{ | |||||
throw (new Exception("ID不能为空")); | |||||
} | |||||
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 MyRegion | |||||
//多个编辑 | |||||
var model = db.FindEntity<OpenLessonPlanEntity>(Convert.ToInt32(dr["ID"].ToString())); | |||||
if (model != null) | |||||
{ | |||||
model.OrdinaryScoreScale = Convert.ToDecimal(dr["平时成绩占比"].ToString()); | |||||
model.TermInScoreScale = Convert.ToDecimal(dr["期中成绩占比"].ToString()); | |||||
model.TermEndScoreScale = Convert.ToDecimal(dr["期末成绩占比"].ToString()); | |||||
model.OtherScoreScale = Convert.ToDecimal(dr["其他成绩占比"].ToString()); | |||||
model.IsAllowEdit = dr["是否允许编辑"].ToString() == "是" ? true : false; | |||||
db.Update(model); | |||||
//修改StuSelectLessonList中的比例 | |||||
db.ExecuteBySql("update StuSelectLessonList set OrdinaryScoreScale=" + model.OrdinaryScoreScale + ",TermInScoreScale=" + model.TermInScoreScale + ",TermEndScoreScale=" + model.TermEndScoreScale + ",OtherScoreScale=" + model.OtherScoreScale + " where AcademicYearNo='" + model.AcademicYearNo + "' and Semester='" + model.Semester + "' and OpenLessonDeptNo='" + model.DeptNo + "' and OpenLessonMajorNo='" + model.MajorNo + "' and LessonNo='" + model.LessonNo + "' and LessonSortNo='" + model.LessonSortNo + "' and Grade='" + model.Grade + "' "); | |||||
//修改StuScore中的成绩 | |||||
var beforeList = db.FindList<StuScoreEntity>(x => x.AcademicYearNo == model.AcademicYearNo && x.Semester == model.Semester && x.OpenLessonDeptNo == model.DeptNo && x.OpenLessonMajorNo == model.MajorNo && x.LessonNo == model.LessonNo && x.LessonSortNo == model.LessonSortNo && x.Grade == model.Grade); | |||||
if (beforeList.Any()) | |||||
{ | |||||
foreach (var stuScoreItem in beforeList) | |||||
{ | |||||
if (stuScoreItem.Score != null) | |||||
{ | |||||
stuScoreItem.Score = (stuScoreItem.OrdinaryScore * (model.OrdinaryScoreScale / 100) + stuScoreItem.TermInScore * (model.TermInScoreScale / 100) + stuScoreItem.TermEndScore * (model.TermEndScoreScale / 100) + stuScoreItem.OtherScore * (model.OtherScoreScale / 100)).ToDecimal(0); | |||||
db.Update(stuScoreItem); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
#endregion | |||||
snum++; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
fnum++; | |||||
dr["导入错误"] = ex.Message; | |||||
failDt.Rows.Add(dr.ItemArray); | |||||
} | |||||
} | |||||
#endregion | |||||
////执行导入 | |||||
//db.Insert(Ass_FixAssetsinsert); | |||||
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) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||