Browse Source

【修改】教学业务档案增加学年学期填写一次的限制;

怀来职教中心中职
dyy 1 year ago
parent
commit
87ed6c4557
7 changed files with 95 additions and 29 deletions
  1. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherServiceInfoController.cs
  2. +5
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml
  3. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml
  4. +21
    -15
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js
  5. +27
    -7
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs
  6. +9
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs
  7. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs

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

@@ -102,6 +102,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
public ActionResult SaveForm(string keyValue, string strEntity)
{
TeacherServiceInfoEntity entity = strEntity.ToObject<TeacherServiceInfoEntity>();
var model = teacherServiceInfoIBLL.GetTeacherServiceInfoEntityByYear(entity.AcademicYearNo, entity.Semester);
if (model != null && model.ID != keyValue)
{
return Fail("当前学年学期已有数据!");
}
teacherServiceInfoIBLL.SaveEntity(keyValue,entity);
return Success("保存成功!");
}


+ 5
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml View File

@@ -4,19 +4,19 @@
}
<div class="lr-form-wrap">
<div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo">
<div class="lr-form-item-title">学年</div>
<div class="lr-form-item-title">学年<font face="宋体">*</font></div>
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo">
<div class="lr-form-item-title">学期</div>
<div class="lr-form-item-title">学期<font face="宋体">*</font></div>
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo">
@*<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo">
<div class="lr-form-item-title">教学业务</div>
<div id="ServiceType" isvalid="yes" checkexpession="NotNull"></div>
</div>
</div>*@
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo">
<div class="lr-form-item-title">附件</div>
<div class="lr-form-item-title">附件<font face="宋体">*</font></div>
<div id="Path" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo">


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml View File

@@ -18,10 +18,10 @@
<div class="lr-form-item-title">学期</div>
<div id="Semester"></div>
</div>
<div class="col-xs-12 lr-form-item">
@*<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">教学业务</div>
<div id="ServiceType"></div>
</div>
</div>*@
</div>
</div>
</div>


+ 21
- 15
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js View File

@@ -32,7 +32,7 @@ var bootstrap = function ($, learun) {
value: 'value',
text: 'text'
});
$('#ServiceType').lrDataItemSelect({ code: 'ServiceType' });
//$('#ServiceType').lrDataItemSelect({ code: 'ServiceType' });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
@@ -87,18 +87,18 @@ var bootstrap = function ($, learun) {
headData: [
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left"},
{ label: "学期", name: "Semester", width: 100, align: "left" },
{
label: "教学业务", name: "ServiceType", width: 200, align: "left",
formatterAsync: function (callback, value) {
learun.clientdata.getAsync('dataItem', {
key: value,
code: 'ServiceType',
callback: function (_data) {
callback(_data.text);
}
});
}
},
//{
// label: "教学业务", name: "ServiceType", width: 200, align: "left",
// formatterAsync: function (callback, value) {
// learun.clientdata.getAsync('dataItem', {
// key: value,
// code: 'ServiceType',
// callback: function (_data) {
// callback(_data.text);
// }
// });
// }
//},
{
label: "创建用户", name: "CreateUser", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
@@ -116,11 +116,17 @@ var bootstrap = function ($, learun) {
return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
}
},
//{ label: "文件", name: "Path", width: 100, align: "left" },
{
label: "附件", name: "Path", width: 100, align: "left", formatter: function (cellvalue) {
return !!cellvalue ? "已上传" : "未上传";
}
},
{ label: "备注", name: "Remark", width: 100, align: "left"},
],
mainId:'ID',
isPage: true
isPage: true,
sidx: 'AcademicYearNo desc,Semester desc',
sord:'desc'
});
page.search();
},


+ 27
- 7
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs View File

@@ -14,7 +14,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
public class TeacherServiceInfoBLL : TeacherServiceInfoIBLL
{
private TeacherServiceInfoService teacherServiceInfoEntity = new TeacherServiceInfoService();
private TeacherServiceInfoService teacherServiceInfoService = new TeacherServiceInfoService();

#region 获取数据

@@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
return teacherServiceInfoEntity.GetPageList(pagination, queryJson);
return teacherServiceInfoService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
@@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
return teacherServiceInfoEntity.GetTeacherServiceInfoEntity(keyValue);
return teacherServiceInfoService.GetTeacherServiceInfoEntity(keyValue);
}
catch (Exception ex)
{
@@ -65,11 +65,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 获取ClassInfo表实体数据
/// <param name="classNo">班级编号</param>
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据
/// <param name="academicYearNo">学年</param>
/// <param name="semester">学期</param>
/// <summary>
/// <returns></returns>
public TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester)
{
try
{
return teacherServiceInfoService.GetTeacherServiceInfoEntityByYear(academicYearNo, semester);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

@@ -78,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
teacherServiceInfoEntity.DeleteEntity(keyValue);
teacherServiceInfoService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
@@ -102,7 +122,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
teacherServiceInfoEntity.SaveEntity(keyValue, entity);
teacherServiceInfoService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{


+ 9
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs View File

@@ -26,6 +26,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <summary>
/// <returns></returns>
TeacherServiceInfoEntity GetTeacherServiceInfoEntity(string keyValue);

/// <summary>
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据
/// <param name="academicYearNo">学年</param>
/// <param name="semester">学期</param>
/// <summary>
/// <returns></returns>
TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester);

#endregion

#region 提交数据


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs View File

@@ -91,6 +91,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据
/// <param name="academicYearNo">学年</param>
/// <param name="semester">学期</param>
/// <summary>
/// <returns></returns>
public TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester)
{
try
{
var loginUserInfo = LoginUserInfo.Get();
return this.BaseRepository("CollegeMIS").FindEntity<TeacherServiceInfoEntity>(x => x.AcademicYearNo == academicYearNo && x.Semester == semester && x.CreateUser == loginUserInfo.userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据


Loading…
Cancel
Save