diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingCompetitionController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingCompetitionController.cs new file mode 100644 index 000000000..b682e9ed3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingCompetitionController.cs @@ -0,0 +1,136 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public class TeachingCompetitionController : MvcControllerBase + { + private TeachingCompetitionIBLL teachingCompetitionIBLL = new TeachingCompetitionBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + + [HttpGet] + public ActionResult CheckForm() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = teachingCompetitionIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var TeachingCompetitionData = teachingCompetitionIBLL.GetTeachingCompetitionEntity(keyValue); + var jsonData = new + { + TeachingCompetition = TeachingCompetitionData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + teachingCompetitionIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + TeachingCompetitionEntity entity = strEntity.ToObject(); + teachingCompetitionIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult CheckForm(string keyValue, string strEntity) + { + TeachingCompetitionEntity entity = strEntity.ToObject(); + teachingCompetitionIBLL.CheckEntity(keyValue, entity); + return Success("评价成功!"); + } + + #endregion + + + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.cshtml new file mode 100644 index 000000000..0ba4b5e81 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.cshtml @@ -0,0 +1,20 @@ +@{ + ViewBag.Title = "TeachingCompetition"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
级别*
+
+
+
+
评价教师*
+ + @*
*@ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.js new file mode 100644 index 000000000..7b9f21ab8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/CheckForm.js @@ -0,0 +1,53 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-12 11:42 + * 描 述:TeachingCompetition + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + //page.initData(); + }, + bind: function () { + $('#EvaluateTeacher')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#EvaluateTeacher').val(learun.clientdata.get(['userinfo']).realName); + $('#Rating').lrDataItemSelect({ code: 'EncouragementDegree' }); + }, + //initData: function () { + //if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + //} + //} + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/CheckForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.cshtml new file mode 100644 index 000000000..83a4f4536 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.cshtml @@ -0,0 +1,43 @@ +@{ + ViewBag.Title = "TeachingCompetition"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
部门*
+
+
+
+
获奖教师*
+
+
+
+
获奖内容*
+ +
+
+
时间*
+ +
+
+
发奖单位*
+ +
+
+
级别*
+
+
+
+
类别*
+
+
+
+
奖励金额
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingCompetition/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.js new file mode 100644 index 000000000..13d816f75 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Form.js @@ -0,0 +1,54 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-12 11:42 + * 描 述:TeachingCompetition + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#DepartmentId').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); + $('#TeachNo').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_account', text: 'f_realname' }); + $('#Grade').lrDataItemSelect({ code: 'Level' }); + $('#Classes').lrDataItemSelect({ code: 'Classes' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.cshtml new file mode 100644 index 000000000..8f174500d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.cshtml @@ -0,0 +1,54 @@ +@{ + ViewBag.Title = "TeachingCompetition"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
部门
+
+
+
+
获奖教师
+
+
+
+
发奖单位
+ +
+
+
级别
+
+
+
+
类别
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingCompetition/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.js new file mode 100644 index 000000000..1f752a79c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingCompetition/Index.js @@ -0,0 +1,206 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-12 11:42 + * 描 述:TeachingCompetition + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 260, 400); + $('#DepartmentId').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); + $('#TeachNo').lrDataSourceSelect({ code: 'TeacherInfo', value: 'f_account', text: 'f_realname' }); + $('#Grade').lrDataItemSelect({ code: 'Level' }); + $('#Classes').lrDataItemSelect({ code: 'Classes' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/Form', + width: 600, + height: 450, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/Form?keyValue=' + keyValue, + width: 600, + height: 450, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 评价 + $('#lr_check').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '评价', + url: top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/CheckForm?keyValue=' + keyValue, + width: 600, + height: 300, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TeachingCompetition/GetPageList', + headData: [ + { + label: "部门", name: "DepartmentId", width: 120, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "获奖教师", name: "TeachNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: "获奖内容", name: "AwardContent", width: 240, align: "left", }, + { + label: "时间", name: "AwardTime", width: 100, align: "left" + , formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd '); + } + }, + { label: "发奖单位", name: "AwardingUnit", width: 200, align: "left" }, + { + label: "级别", name: "Grade", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'Level', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "类别", name: "Classes", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'Classes', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "奖励金额", name: "Money", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + { + label: "评价教师", name: "EvaluateTeacher", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_userid', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { + label: "等次", name: "Rating", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'EncouragementDegree', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "评价时间", name: "EvaluateTime", width: 100, align: "left" + , formatter: function (cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd '); + } + }, + { label: "评价备注", name: "EvaluateRemark", width: 100, align: "left" }, + + ], + mainId: 'ID', + isPage: true, + isMultiselect: true, + sidx: "CreateTime desc" + + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 956451990..3ffbd47a6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -906,6 +906,7 @@ + @@ -1435,6 +1436,7 @@ + @@ -7119,6 +7121,10 @@ + + + + @@ -8116,6 +8122,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TeachingCompetitionMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TeachingCompetitionMap.cs new file mode 100644 index 000000000..e8c78e670 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TeachingCompetitionMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public class TeachingCompetitionMap : EntityTypeConfiguration + { + public TeachingCompetitionMap() + { + #region 表、主键 + //表 + this.ToTable("TEACHINGCOMPETITION"); + //主键 + this.HasKey(t => t.ID); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index fb9b2076b..76eaf4ed8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -664,6 +664,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionBLL.cs new file mode 100644 index 000000000..e9f648479 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionBLL.cs @@ -0,0 +1,143 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public class TeachingCompetitionBLL : TeachingCompetitionIBLL + { + private TeachingCompetitionService teachingCompetitionService = new TeachingCompetitionService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return teachingCompetitionService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取TeachingCompetition表实体数据 + /// + /// 主键 + /// + public TeachingCompetitionEntity GetTeachingCompetitionEntity(string keyValue) + { + try + { + return teachingCompetitionService.GetTeachingCompetitionEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + teachingCompetitionService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, TeachingCompetitionEntity entity) + { + try + { + teachingCompetitionService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public void CheckEntity(string keyValue, TeachingCompetitionEntity entity) + { + try + { + teachingCompetitionService.CheckEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionEntity.cs new file mode 100644 index 000000000..39cacc3b0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionEntity.cs @@ -0,0 +1,121 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public class TeachingCompetitionEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// 部门 + /// + [Column("DEPARTMENTID")] + public string DepartmentId { get; set; } + /// + /// 编号 + /// + [Column("TEACHNO")] + public string TeachNo { get; set; } + /// + /// 获奖内容 + /// + [Column("AWARDCONTENT")] + public string AwardContent { get; set; } + /// + /// 获奖时间 + /// + [Column("AWARDTIME")] + public DateTime? AwardTime { get; set; } + /// + /// 发奖单位 + /// + [Column("AWARDINGUNIT")] + public string AwardingUnit { get; set; } + /// + /// 级别 + /// + [Column("GRADE")] + public string Grade { get; set; } + /// 类别 + ///
+ [Column("CLASSES")] + public string Classes { get; set; } + /// + /// Money + /// + [Column("MONEY")] + public decimal? Money { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUser + /// + [Column("CREATEUSER")] + public string CreateUser { get; set; } + /// + /// 评价教师 + /// + [Column("EVALUATETEACHER")] + public string EvaluateTeacher { get; set; } + /// + /// 评价等级 + /// + [Column("RATING")] + public string Rating { get; set; } + /// + /// EvaluateTime + /// + [Column("EVALUATETIME")] + public DateTime? EvaluateTime { get; set; } + /// + /// EvaluateRemark + /// + [Column("EVALUATEREMARK")] + public string EvaluateRemark { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + this.CreateTime = DateTime.Now; + this.CreateUser = LoginUserInfo.Get().userId; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionIBLL.cs new file mode 100644 index 000000000..0541c1e05 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionIBLL.cs @@ -0,0 +1,49 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public interface TeachingCompetitionIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取TeachingCompetition表实体数据 + /// + /// 主键 + /// + TeachingCompetitionEntity GetTeachingCompetitionEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, TeachingCompetitionEntity entity); + void CheckEntity(string keyValue, TeachingCompetitionEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionService.cs new file mode 100644 index 000000000..884fe96bf --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachingCompetition/TeachingCompetitionService.cs @@ -0,0 +1,211 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-12 11:42 + /// 描 述:TeachingCompetition + /// + public class TeachingCompetitionService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@"t.* "); + strSql.Append(" FROM TeachingCompetition t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["DepartmentId"].IsEmpty()) + { + dp.Add("DepartmentId", queryParam["DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.DepartmentId = @DepartmentId "); + } + if (!queryParam["TeachNo"].IsEmpty()) + { + dp.Add("TeachNo", queryParam["TeachNo"].ToString(), DbType.String); + strSql.Append(" AND t.TeachNo = @TeachNo "); + } + if (!queryParam["AwardingUnit"].IsEmpty()) + { + dp.Add("AwardingUnit", "%" + queryParam["AwardingUnit"].ToString() + "%", DbType.String); + strSql.Append(" AND t.AwardingUnit Like @AwardingUnit "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String); + strSql.Append(" AND t.Grade = @Grade "); + } + if (!queryParam["Classes"].IsEmpty()) + { + dp.Add("Classes", queryParam["Classes"].ToString(), DbType.String); + strSql.Append(" AND t.Classes = @Classes "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取TeachingCompetition表实体数据 + /// + /// 主键 + /// + public TeachingCompetitionEntity GetTeachingCompetitionEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var id = keyValue.Split(','); + foreach (var item in id) + { + db.Delete(t => t.ID == item); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, TeachingCompetitionEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void CheckEntity(string keyValue, TeachingCompetitionEntity entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var Id = keyValue.Split(','); + foreach (var item in Id) + { + TeachingCompetitionEntity model = db.FindEntity(x => x.ID == item); + model.Rating = entity.Rating; + model.EvaluateTeacher = entity.EvaluateTeacher; + model.EvaluateTime = DateTime.Now; + model.EvaluateRemark = entity.EvaluateRemark; + db.Update(model); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 6d0743a3d..c1ef3472c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -2079,6 +2079,10 @@ + + + +