@@ -201,6 +201,38 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
}; | }; | ||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetOpenLessonPlanEntityByJson(string queryJson) | |||||
{ | |||||
var OpenLessonPlanData = openLessonPlanOfElectiveIBLL.GetOpenLessonPlanEntityByJson(queryJson); | |||||
var jsonData = new | |||||
{ | |||||
OpenLessonPlanOfElective = OpenLessonPlanData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
[AjaxOnly] | |||||
public ActionResult GetStuSelectLessonListEntityByJson(string queryJson) | |||||
{ | |||||
var StuSelectLessonListData = openLessonPlanOfElectiveIBLL.GetStuSelectLessonListEntityByJson(queryJson); | |||||
var jsonData = new | |||||
{ | |||||
StuSelectLessonListOfElective = StuSelectLessonListData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -357,6 +389,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 设置成绩比例 | |||||
/// </summary> | |||||
/// <param name="queryJson"></param> | |||||
/// <param name="strEntity"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveFormOfElective(string keyValue, string strEntity) | |||||
{ | |||||
OpenLessonPlanOfElectiveEntity entity = strEntity.ToObject<OpenLessonPlanOfElectiveEntity>(); | |||||
openLessonPlanOfElectiveIBLL.SaveFormOfElective(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
#region 扩展数据 | #region 扩展数据 | ||||
@@ -816,5 +864,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
} | } | ||||
#endregion | #endregion | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[ValidateAntiForgeryToken] | |||||
[AjaxOnly] | |||||
public ActionResult SaveFormOfClass(string queryJson, string strEntity) | |||||
{ | |||||
StuSelectLessonListOfElectiveEntity entity = strEntity.ToObject<StuSelectLessonListOfElectiveEntity>(); | |||||
openLessonPlanOfElectiveIBLL.SaveStuSelectLessonListScaleByJson(queryJson, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
} | } | ||||
} | } |
@@ -10,6 +10,8 @@ var AcademicYearNo = request('AcademicYearNo'); | |||||
var Semester = request('Semester'); | var Semester = request('Semester'); | ||||
var LessonNo = request('LessonNo'); | var LessonNo = request('LessonNo'); | ||||
var ClassNo = request('ClassNo'); | var ClassNo = request('ClassNo'); | ||||
var ClassRoomNo = request('ClassRoomNo'); | |||||
var LessonSection = request('LessonSection'); | |||||
var param = {}; | var param = {}; | ||||
if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) { | if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) { | ||||
param.F_SchoolId = F_SchoolId; | param.F_SchoolId = F_SchoolId; | ||||
@@ -17,6 +19,16 @@ if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) { | |||||
param.Semester = Semester; | param.Semester = Semester; | ||||
param.LessonNo = LessonNo; | param.LessonNo = LessonNo; | ||||
param.ClassNo = ClassNo; | param.ClassNo = ClassNo; | ||||
} | |||||
if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassRoomNo && !!LessonSection) { | |||||
param.F_SchoolId = F_SchoolId; | |||||
param.AcademicYearNo = AcademicYearNo; | |||||
param.Semester = Semester; | |||||
param.LessonNo = LessonNo; | |||||
param.ClassRoomNo = ClassRoomNo; | |||||
param.LessonSection = LessonSection; | |||||
} | } | ||||
var bootstrap = function ($, learun) { | var bootstrap = function ($, learun) { | ||||
"use strict"; | "use strict"; | ||||
@@ -31,20 +43,37 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
initData: function () { | initData: function () { | ||||
if (!!param) { | if (!!param) { | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
for (var id in data) { | |||||
if (data[id] == null) { | |||||
learun.alert.warning("学生选课数据不存在!"); | |||||
return false; | |||||
} | |||||
if (!!data[id].length && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
if (!!ClassNo) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
for (var id in data) { | |||||
if (data[id] == null) { | |||||
learun.alert.warning("学生选课数据不存在!"); | |||||
return false; | |||||
} | |||||
if (!!data[id].length && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | } | ||||
else { | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
}); | |||||
} else { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
for (var id in data) { | |||||
if (data[id] == null) { | |||||
learun.alert.warning("学生选课数据不存在!"); | |||||
return false; | |||||
} | |||||
if (!!data[id].length && data[id].length > 0) { | |||||
$('#' + id).jfGridSet('refreshdata', data[id]); | |||||
} | |||||
else { | |||||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||||
} | |||||
} | } | ||||
} | |||||
}); | |||||
}); | |||||
} | |||||
} | } | ||||
} | } | ||||
}; | }; | ||||
@@ -67,12 +96,22 @@ var bootstrap = function ($, learun) { | |||||
var postData = { | var postData = { | ||||
strEntity: JSON.stringify($('body').lrGetFormData()) | strEntity: JSON.stringify($('body').lrGetFormData()) | ||||
}; | }; | ||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
if (!!ClassNo) { | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
} else { | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
} | |||||
}; | }; | ||||
page.init(); | page.init(); | ||||
} | } |
@@ -44,4 +44,4 @@ | |||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/Form.js") | |||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js") |
@@ -51,7 +51,7 @@ var bootstrap = function ($, learun) { | |||||
var postData = { | var postData = { | ||||
strEntity: JSON.stringify($('body').lrGetFormData()) | strEntity: JSON.stringify($('body').lrGetFormData()) | ||||
}; | }; | ||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveFormOfElective?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | // 保存成功后才回调 | ||||
if (!!callBack) { | if (!!callBack) { | ||||
callBack(); | callBack(); | ||||
@@ -22,6 +22,14 @@ | |||||
<div class="lr-form-item-title">课程</div> | <div class="lr-form-item-title">课程</div> | ||||
<div id="LessonNo" type="lrselect" class="lr-select"></div> | <div id="LessonNo" type="lrselect" class="lr-select"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">教师</div> | |||||
<div id="EmpNo" type="lrselect" class="lr-select"></div> | |||||
</div> | |||||
<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">教室</div> | |||||
<div id="ClassRoomNo" type="lrselect" class="lr-select"></div> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -92,7 +92,20 @@ var bootstrap = function ($, learun) { | |||||
value: 'value', | value: 'value', | ||||
text: 'text' | text: 'text' | ||||
}); | }); | ||||
$('#EmpNo').lrselect({ | |||||
placeholder: "请选择老师", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetEmpNoData', | |||||
value: 'value', | |||||
text: 'text' | |||||
}); | |||||
$('#ClassRoomNo').lrselect({ | |||||
placeholder: "请选择教室", | |||||
allowSearch: true, | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData', | |||||
value: 'value', | |||||
text: 'text' | |||||
}); | |||||
}, | }, | ||||
// 初始化列表 | // 初始化列表 | ||||
initGird: function () { | initGird: function () { | ||||
@@ -104,6 +117,11 @@ var bootstrap = function ($, learun) { | |||||
{ label: "学期", name: "Semester", width: 80, align: "left" }, | { label: "学期", name: "Semester", width: 80, align: "left" }, | ||||
{ label: "课程编号", name: "LessonNo", width: 100, align: "left" }, | { label: "课程编号", name: "LessonNo", width: 100, align: "left" }, | ||||
{ label: "课程名称", name: "LessonName", width: 150, align: "left" }, | { label: "课程名称", name: "LessonName", width: 150, align: "left" }, | ||||
{ label: "节次", name: "LessonSection", width: 100, align: "left" }, | |||||
{ label: "教室编号", name: "ClassRoomNo", width: 100, align: "left" }, | |||||
{ label: "教室", name: "ClassRoomName", width: 100, align: "left" }, | |||||
{ label: "教师编号", name: "EmpNo", width: 100, align: "left" }, | |||||
{ label: "教师名称", name: "EmpName", width: 150, align: "left" }, | |||||
{ label: "平时成绩占比", name: "OrdinaryScoreScale", width: 100, align: "left" }, | { label: "平时成绩占比", name: "OrdinaryScoreScale", width: 100, align: "left" }, | ||||
{ label: "期中成绩占比", name: "TermInScoreScale", width: 100, align: "left" }, | { label: "期中成绩占比", name: "TermInScoreScale", width: 100, align: "left" }, | ||||
{ label: "期末成绩占比", name: "TermEndScoreScale", width: 100, align: "left" }, | { label: "期末成绩占比", name: "TermEndScoreScale", width: 100, align: "left" }, | ||||
@@ -198,11 +198,11 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_setScale').on('click', function () { | $('#lr_setScale').on('click', function () { | ||||
var query = judgeSelect(); | var query = judgeSelect(); | ||||
if (query) { | if (query) { | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["OpenLessonPlan"] != null) { | |||||
if (data["OpenLessonPlan"].IsAllowEdit) { //教务允许成绩录入时编辑比例 | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["StuSelectLessonList"] != null) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["OpenLessonPlanOfElective"] != null) { | |||||
if (data["OpenLessonPlanOfElective"].IsAllowEdit) { //教务允许成绩录入时编辑比例 | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["StuSelectLessonListOfElective"] != null) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | ||||
if (data != null) { | if (data != null) { | ||||
if (data.CheckMark == 1) { //学生成绩已审核 | if (data.CheckMark == 1) { //学生成绩已审核 | ||||
@@ -212,7 +212,7 @@ var bootstrap = function ($, learun) { | |||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'FormOfClass', | id: 'FormOfClass', | ||||
title: '班级成绩比例设置', | title: '班级成绩比例设置', | ||||
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo, | |||||
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&LessonSection=' + query.LessonSection + '&ClassRoomNo=' + query.ClassRoomNo, | |||||
width: 600, | width: 600, | ||||
height: 400, | height: 400, | ||||
callBack: function (id) { | callBack: function (id) { | ||||
@@ -235,7 +235,7 @@ var bootstrap = function ($, learun) { | |||||
return false; | return false; | ||||
} | } | ||||
} else { | } else { | ||||
learun.alert.warning("开课计划不存在!"); | |||||
learun.alert.warning("选修开课计划不存在!"); | |||||
return false; | return false; | ||||
} | } | ||||
}); | }); | ||||
@@ -533,9 +533,9 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
searchScale: function (param) { | searchScale: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
if (data["StuSelectLessonList"] != null) { | |||||
var ssll = data["StuSelectLessonList"]; | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
if (data["StuSelectLessonListOfElective"] != null) { | |||||
var ssll = data["StuSelectLessonListOfElective"]; | |||||
$('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); | $('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); | ||||
$('#TermInScoreScale').html(ssll.TermInScoreScale > 0 ? ssll.TermInScoreScale : 0); | $('#TermInScoreScale').html(ssll.TermInScoreScale > 0 ? ssll.TermInScoreScale : 0); | ||||
$('#TermEndScoreScale').html(ssll.TermEndScoreScale > 0 ? ssll.TermEndScoreScale : 0); | $('#TermEndScoreScale').html(ssll.TermEndScoreScale > 0 ? ssll.TermEndScoreScale : 0); | ||||
@@ -590,7 +590,7 @@ var bootstrap = function ($, learun) { | |||||
page.initGird(); | page.initGird(); | ||||
page.search(query); | page.search(query); | ||||
//page.searchScale(query); | |||||
page.searchScale(query); | |||||
} | } | ||||
}; | }; | ||||
judgeSelect = function () { | judgeSelect = function () { | ||||
@@ -198,11 +198,11 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_setScale').on('click', function () { | $('#lr_setScale').on('click', function () { | ||||
var query = judgeSelect(); | var query = judgeSelect(); | ||||
if (query) { | if (query) { | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["OpenLessonPlan"] != null) { | |||||
if (data["OpenLessonPlan"].IsAllowEdit) { //教务允许成绩录入时编辑比例 | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["StuSelectLessonList"] != null) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["OpenLessonPlanOfElective"] != null) { | |||||
if (data["OpenLessonPlanOfElective"].IsAllowEdit) { //教务允许成绩录入时编辑比例 | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | |||||
if (data["StuSelectLessonListOfElective"] != null) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { | ||||
if (data != null) { | if (data != null) { | ||||
if (data.CheckMark == 1) { //学生成绩已审核 | if (data.CheckMark == 1) { //学生成绩已审核 | ||||
@@ -212,7 +212,7 @@ var bootstrap = function ($, learun) { | |||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'FormOfClass', | id: 'FormOfClass', | ||||
title: '班级成绩比例设置', | title: '班级成绩比例设置', | ||||
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo, | |||||
url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&LessonSection=' + query.LessonSection + '&ClassRoomNo=' + query.ClassRoomNo, | |||||
width: 600, | width: 600, | ||||
height: 400, | height: 400, | ||||
callBack: function (id) { | callBack: function (id) { | ||||
@@ -533,7 +533,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
searchScale: function (param) { | searchScale: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { | |||||
if (data["StuSelectLessonList"] != null) { | if (data["StuSelectLessonList"] != null) { | ||||
var ssll = data["StuSelectLessonList"]; | var ssll = data["StuSelectLessonList"]; | ||||
$('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); | $('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); | ||||
@@ -112,6 +112,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return openLessonPlanOfElectiveService.GetOpenLessonPlanEntityByJson(queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取StuSelectLessonListEntity表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return openLessonPlanOfElectiveService.GetStuSelectLessonListEntityByJson(queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -183,6 +229,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveFormOfElective(string keyValue, OpenLessonPlanOfElectiveEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
openLessonPlanOfElectiveService.SaveFormOfElective(keyValue, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 扩展数据 | #region 扩展数据 | ||||
@@ -271,6 +341,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity) | |||||
{ | |||||
try | |||||
{ | |||||
openLessonPlanOfElectiveService.SaveStuSelectLessonListScaleByJson(queryJson, entity); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -166,23 +166,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// OrdinaryScoreScale | /// OrdinaryScoreScale | ||||
/// </summary> | /// </summary> | ||||
[Column("ORDINARYSCORESCALE")] | [Column("ORDINARYSCORESCALE")] | ||||
public decimal OrdinaryScoreScale { get; set; } | |||||
public decimal? OrdinaryScoreScale { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// TermInScoreScale | /// TermInScoreScale | ||||
/// </summary> | /// </summary> | ||||
[Column("TERMINSCORESCALE")] | [Column("TERMINSCORESCALE")] | ||||
public decimal TermInScoreScale { get; set; } | |||||
public decimal? TermInScoreScale { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// TermEndScoreScale | /// TermEndScoreScale | ||||
/// </summary> | /// </summary> | ||||
[Column("TERMENDSCORESCALE")] | [Column("TERMENDSCORESCALE")] | ||||
public decimal TermEndScoreScale { get; set; } | |||||
public decimal? TermEndScoreScale { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// OtherScoreScale | /// OtherScoreScale | ||||
/// </summary> | /// </summary> | ||||
[Column("OTHERSCORESCALE")] | [Column("OTHERSCORESCALE")] | ||||
public decimal OtherScoreScale { get; set; } | |||||
public decimal? OtherScoreScale { get; set; } | |||||
public bool? IsAllowEdit { get; set; } | public bool? IsAllowEdit { get; set; } | ||||
@@ -40,6 +40,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
OpenLessonPlanOfElectiveEntity GetOpenLessonPlanOfElectiveEntity(string keyValue); | OpenLessonPlanOfElectiveEntity GetOpenLessonPlanOfElectiveEntity(string keyValue); | ||||
/// <summary> | |||||
/// 获取OpenLessonPlanOfElectiveEntity表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson); | |||||
/// <summary> | |||||
/// 获取StuSelectLessonListEntity表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson); | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -57,6 +70,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity); | void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity); | ||||
void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity); | void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity); | ||||
void SaveFormOfElective(string keyValue, OpenLessonPlanOfElectiveEntity entity); | |||||
#endregion | #endregion | ||||
#region 扩展数据 | #region 扩展数据 | ||||
@@ -80,5 +96,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#endregion | #endregion | ||||
/// <summary> | |||||
/// 保存StuSelectLessonList中的成绩比例 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity); | |||||
} | } | ||||
} | } |
@@ -151,6 +151,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); | ||||
strSql.Append(" AND t.LessonName Like @LessonName "); | strSql.Append(" AND t.LessonName Like @LessonName "); | ||||
} | } | ||||
if (!queryParam["EmpNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.EmpNo Like @EmpNo "); | |||||
} | |||||
if (!queryParam["ClassRoomNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("ClassRoomNo", "%" + queryParam["ClassRoomNo"].ToString() + "%", DbType.String); | |||||
strSql.Append(" AND t.ClassRoomNo Like @ClassRoomNo "); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanOfElectiveEntity>(strSql.ToString(), dp, pagination); | return this.BaseRepository("CollegeMIS").FindList<OpenLessonPlanOfElectiveEntity>(strSql.ToString(), dp, pagination); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -288,6 +298,81 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取OpenLessonPlan表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var queryParam = queryJson.ToJObject(); | |||||
var F_SchoolId = queryParam["F_SchoolId"].ToString(); | |||||
var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); | |||||
var Semester = queryParam["Semester"].ToString(); | |||||
var LessonNo = queryParam["LessonNo"].ToString(); | |||||
var LessonSection =queryParam["LessonSection"].ToString(); | |||||
var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); | |||||
var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity<ClassroomInfoEntity>(x => x.ClassroomNo == ClassRoomNo); | |||||
if (classInfoEntity == null) | |||||
{ | |||||
return new OpenLessonPlanOfElectiveEntity(); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindEntity<OpenLessonPlanOfElectiveEntity>(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonSection == LessonSection && x.LessonNo == LessonNo && x.LessonSortNo == "2"); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | |||||
/// 获取StuSelectLessonListEntity表实体数据 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var queryParam = queryJson.ToJObject(); | |||||
var F_SchoolId = queryParam["F_SchoolId"].ToString(); | |||||
var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); | |||||
var Semester = queryParam["Semester"].ToString(); | |||||
var LessonNo = queryParam["LessonNo"].ToString(); | |||||
var LessonSection = queryParam["LessonSection"].ToString(); | |||||
var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); | |||||
var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity<ClassroomInfoEntity>(x => x.ClassroomNo == ClassRoomNo); | |||||
if (classInfoEntity == null) | |||||
{ | |||||
return new StuSelectLessonListOfElectiveEntity(); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindEntity<StuSelectLessonListOfElectiveEntity>(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.ClassRoomNo == ClassRoomNo && x.LessonSection == LessonSection); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -390,7 +475,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
emItemEntity.ClassRoomName = entity.ClassRoomName; | emItemEntity.ClassRoomName = entity.ClassRoomName; | ||||
db.Insert(emItemEntity); | db.Insert(emItemEntity); | ||||
} | } | ||||
db.Commit(); | db.Commit(); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -407,6 +492,76 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveFormOfElective(string keyValue, OpenLessonPlanOfElectiveEntity entity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
//单个编辑 | |||||
//entity.Modify(keyValue); | |||||
//this.BaseRepository("CollegeMIS").Update(entity); | |||||
//多个编辑 | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
var model = db.FindEntity<OpenLessonPlanOfElectiveEntity>(item); | |||||
if (model != null) | |||||
{ | |||||
model.OrdinaryScoreScale = entity.OrdinaryScoreScale; | |||||
model.TermInScoreScale = entity.TermInScoreScale; | |||||
model.TermEndScoreScale = entity.TermEndScoreScale; | |||||
model.OtherScoreScale = entity.OtherScoreScale; | |||||
model.IsAllowEdit = entity.IsAllowEdit; | |||||
db.Update(model); | |||||
//修改StuSelectLessonList中的比例 | |||||
db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where AcademicYearNo='" + model.AcademicYearNo + "' and Semester='" + model.Semester + "' and LessonNo='" + model.LessonNo + "' and LessonSortNo='" + model.LessonSortNo + "' "); | |||||
//修改StuScore中的成绩 | |||||
var beforeList = db.FindList<StuScoreEntity>(x => x.AcademicYearNo == model.AcademicYearNo && x.Semester == model.Semester && x.LessonNo == model.LessonNo && x.LessonSortNo == model.LessonSortNo); | |||||
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); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
entity.Create(); | |||||
db.Insert(entity); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 扩展数据 | #region 扩展数据 | ||||
@@ -621,5 +776,59 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
#endregion | #endregion | ||||
/// <summary> | |||||
/// 保存StuSelectLessonList中的成绩比例 | |||||
/// <param name="keyValue">主键</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var queryParam = queryJson.ToJObject(); | |||||
var F_SchoolId = queryParam["F_SchoolId"].ToString(); | |||||
var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); | |||||
var Semester = queryParam["Semester"].ToString(); | |||||
var LessonNo = queryParam["LessonNo"].ToString(); | |||||
var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); | |||||
var LessonSection = queryParam["LessonSection"].ToString(); | |||||
var classInfoEntity = db.FindEntity<ClassroomInfoEntity>(x => x.ClassroomNo == ClassRoomNo); | |||||
if (classInfoEntity != null) | |||||
{ | |||||
db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); | |||||
//修改StuScore中的成绩 | |||||
var beforeList = db.FindList<StuScoreEntity>(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.LessonSection == LessonSection); | |||||
if (beforeList.Any()) | |||||
{ | |||||
foreach (var stuScoreItem in beforeList) | |||||
{ | |||||
if (stuScoreItem.Score != null) | |||||
{ | |||||
stuScoreItem.Score = (stuScoreItem.OrdinaryScore * (entity.OrdinaryScoreScale / 100) + stuScoreItem.TermInScore * (entity.TermInScoreScale / 100) + stuScoreItem.TermEndScore * (entity.TermEndScoreScale / 100) + stuScoreItem.OtherScore * (entity.OtherScoreScale / 100)).ToDecimal(0); | |||||
db.Update(stuScoreItem); | |||||
} | |||||
} | |||||
} | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -374,7 +374,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
strSql.Append(" and t.ClassNo=@ClassNo "); | strSql.Append(" and t.ClassNo=@ClassNo "); | ||||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | ||||
} | } | ||||
if (!queryParam["LessonSection"].IsEmpty()) | |||||
{ | |||||
strSql.Append(" and t.LessonSection=@LessonSection "); | |||||
dp.Add("LessonSection", queryParam["LessonSection"].ToString(), DbType.String); | |||||
} | |||||
if (!queryParam["ClassRoomNo"].IsEmpty()) | |||||
{ | |||||
strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); | |||||
dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindEntity<StuScoreEntity>(strSql.ToString(), dp); | return this.BaseRepository("CollegeMIS").FindEntity<StuScoreEntity>(strSql.ToString(), dp); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
@@ -170,6 +170,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
[Column("STATUS")] | [Column("STATUS")] | ||||
public int? Status { get; set; } | public int? Status { get; set; } | ||||
/// <summary> | |||||
/// F_SchoolId | |||||
/// </summary> | |||||
[Column("F_SCHOOLID")] | |||||
public string F_SchoolId { get; set; } | |||||
/// <summary> | /// <summary> | ||||
/// OrdinaryScoreScale | /// OrdinaryScoreScale | ||||
/// </summary> | /// </summary> | ||||
@@ -210,8 +215,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 扩展字段 | #region 扩展字段 | ||||
[NotMapped] public string F_SchoolId { get; set; } | |||||
[NotMapped] public string LessonTypeId { get; set; } | [NotMapped] public string LessonTypeId { get; set; } | ||||
#endregion | #endregion | ||||