@@ -1,5 +1,6 @@ | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | using Learun.Application.TwoDevelopment.EducationalAdministration; | ||||
using Learun.Util; | using Learun.Util; | ||||
using System; | |||||
using System.Data; | using System.Data; | ||||
using System.Web.Mvc; | using System.Web.Mvc; | ||||
@@ -15,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
public class TeacherPlanCheckController : MvcControllerBase | public class TeacherPlanCheckController : MvcControllerBase | ||||
{ | { | ||||
private TeacherPlanCheckIBLL teacherPlanCheckIBLL = new TeacherPlanCheckBLL(); | private TeacherPlanCheckIBLL teacherPlanCheckIBLL = new TeacherPlanCheckBLL(); | ||||
private EADateArrangeIBLL eADateArrangeIBLL = new EADateArrangeBLL(); | |||||
#region 视图功能 | #region 视图功能 | ||||
@@ -25,7 +27,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
[HttpGet] | [HttpGet] | ||||
public ActionResult Index() | public ActionResult Index() | ||||
{ | { | ||||
return View(); | |||||
//获取“教学工作安排”中“教学教案检查打分”的记录 | |||||
var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("教学教案检查打分"); | |||||
if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) | |||||
{ | |||||
ViewBag.CanInputFlag = true;//可以打分标识 | |||||
} | |||||
else | |||||
{ | |||||
ViewBag.CanInputFlag = false; | |||||
} | |||||
return View(); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 表单页 | /// 表单页 | ||||
@@ -36,3 +36,6 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js") | @Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js") | ||||
<script> | |||||
var CanInputFlag = "@ViewBag.CanInputFlag"; | |||||
</script> |
@@ -59,8 +59,12 @@ var bootstrap = function ($, learun) { | |||||
location.reload(); | location.reload(); | ||||
}); | }); | ||||
// 编辑 | |||||
// 打分 | |||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
if (CanInputFlag != "True") { | |||||
top.learun.layerConfirm('当前时间不是打分时间!', function (res) { }); | |||||
return false; | |||||
} | |||||
var keyValue = $('#gridtable').jfGridValue('EmpId'); | var keyValue = $('#gridtable').jfGridValue('EmpId'); | ||||
selectedRow = $('#gridtable').jfGridGet('rowdata'); | selectedRow = $('#gridtable').jfGridGet('rowdata'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
@@ -321,6 +321,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 增加工作安排 | |||||
/// </summary> | |||||
/// <param name="workName">工作名称</param> | |||||
public void AddWork(string workName) | |||||
{ | |||||
try | |||||
{ | |||||
var yearAndSemester = Common.GetSemesterAndYear(); | |||||
if (!string.IsNullOrEmpty(workName)) | |||||
{ | |||||
//判断是否存在 | |||||
var model = this.BaseRepository("CollegeMIS").FindEntity<EADateArrangeEntity>(x => x.WorkName == workName); | |||||
if (model == null) | |||||
{ | |||||
//不存在的话写入一条 | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append($@"insert into EADateArrange(dm, WorkName, MakeDate, AcademicYearNo, Semester, EndDate, CheckMark, WhoArrange) | |||||
values((select Max(CONVERT(int, dm)) + 1 from EADateArrange),'{workName}' , GETDATE(), '{yearAndSemester.AcademicYearShort}', '{yearAndSemester.Semester}', DATEADD(month, 1, GETDATE()), 0, '超级管理员') "); | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString()); | |||||
} | |||||
} | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
/// <summary> | /// <summary> | ||||
@@ -532,6 +569,5 @@ and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity. | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } |
@@ -17,6 +17,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
public class TeacherPlanCheckService : RepositoryFactory | public class TeacherPlanCheckService : RepositoryFactory | ||||
{ | { | ||||
private EADateArrangeService eADateArrangeService = new EADateArrangeService(); | |||||
#region 构造函数和属性 | #region 构造函数和属性 | ||||
private string fieldSql; | private string fieldSql; | ||||
@@ -105,6 +107,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
//“教学工作安排”表增加“教学教案检查打分”项 | |||||
eADateArrangeService.AddWork("教学教案检查打分"); | |||||
//学年、学期 | //学年、学期 | ||||
var yearAndSemester = Common.GetSemesterAndYear(); | var yearAndSemester = Common.GetSemesterAndYear(); | ||||
var year = yearAndSemester.AcademicYearShort; | var year = yearAndSemester.AcademicYearShort; | ||||