From 0fa11099e9ebb12cbca388645a1021d0310a7ccf Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 17 Jun 2022 10:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=89=93=E5=8D=A1=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HealthPunchTimeController.cs | 126 ++++++++++++ .../Views/HealthPunchTime/Form.cshtml | 35 ++++ .../Views/HealthPunchTime/Form.js | 56 ++++++ .../Views/HealthPunchTime/Index.cshtml | 42 ++++ .../Views/HealthPunchTime/Index.js | 154 ++++++++++++++ .../Learun.Application.Web.csproj | 5 + .../HealthPunchTimeMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 1 + .../HealthPunchTime/HealthPunchTimeBLL.cs | 148 ++++++++++++++ .../HealthPunchTime/HealthPunchTimeEntity.cs | 80 ++++++++ .../HealthPunchTime/HealthPunchTimeIBLL.cs | 51 +++++ .../HealthPunchTime/HealthPunchTimeService.cs | 188 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 13 files changed, 919 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs new file mode 100644 index 000000000..4b93c7489 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs @@ -0,0 +1,126 @@ +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 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeController : MvcControllerBase + { + private HealthPunchTimeIBLL healthPunchTimeIBLL = new HealthPunchTimeBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = healthPunchTimeIBLL.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 HealthPunchTimeData = healthPunchTimeIBLL.GetHealthPunchTimeEntity(keyValue); + var jsonData = new + { + HealthPunchTime = HealthPunchTimeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + healthPunchTimeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + HealthPunchTimeEntity entity = strEntity.ToObject(); + healthPunchTimeIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + [HttpPost] + [AjaxOnly] + public ActionResult EnableForm(string keyValue) + { + healthPunchTimeIBLL.EnableEntity(keyValue); + return Success("修改成功!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml new file mode 100644 index 000000000..e2d6315e3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
开始时间*
+ +
+
+
结束时间*
+ +
+
+
描述*
+
+
+
+
是否启用*
+
+
+ + +
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js new file mode 100644 index 000000000..8050ebec4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js @@ -0,0 +1,56 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-17 09:17 + * 描 述:健康打卡时段 + */ +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 () { + $('#Description').lrDataItemSelect({ code: 'HealthPunchType' }); + $('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' }); + $('#CheckMark').lrselectSet("1"); + $('#CreateUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#CreateUser').val(learun.clientdata.get(['userinfo']).realName); + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/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/HealthPunchTime/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml new file mode 100644 index 000000000..5c19a70aa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
描述
+
+
+ @*
+
是否启用
+
+
*@ +
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js new file mode 100644 index 000000000..7aa3016e6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js @@ -0,0 +1,154 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-17 09:17 + * 描 述:健康打卡时段 + */ +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); + }, 220, 400); + $('#Description').lrDataItemSelect({ code: 'HealthPunchType' }); + $('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var keyValue = $('#gridtable').jfGridValue('ID'); + var CheckMark = $('#gridtable').jfGridValue('CheckMark'); + if (CheckMark == 1) { + return + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  启用 + $('#lr_lock').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + console.log(keyValue) + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/EnableForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  禁用 + $('#lr_unlock').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/EnableForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/GetPageList', + headData: [ + { label: "开始时间", name: "StarTime", width: 100, align: "left" }, + { label: "结束时间", name: "EndTime", width: 100, align: "left" }, + { + label: "描述", name: "Description", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'HealthPunchType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "录入用户", name: "CreateUser", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "录入时间", name: "CreateTime", width: 200, align: "left" }, + { + label: "是否启用", name: "CheckMark", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == "0" ? "启用" : + "禁用"; + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true + }); + 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 41845996d..7a88a1e0e 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 @@ -833,6 +833,7 @@ + @@ -6551,6 +6552,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs new file mode 100644 index 000000000..3a49861b1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.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 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeMap : EntityTypeConfiguration + { + public HealthPunchTimeMap() + { + #region 表、主键 + //表 + this.ToTable("HEALTHPUNCHTIME"); + //主键 + 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 719cf7c99..7cbcc4ae0 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 @@ -588,6 +588,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs new file mode 100644 index 000000000..48b16879f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs @@ -0,0 +1,148 @@ +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 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeBLL : HealthPunchTimeIBLL + { + private HealthPunchTimeService healthPunchTimeService = new HealthPunchTimeService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return healthPunchTimeService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + public HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue) + { + try + { + return healthPunchTimeService.GetHealthPunchTimeEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + healthPunchTimeService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, HealthPunchTimeEntity entity) + { + try + { + healthPunchTimeService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void EnableEntity(string keyValue) + { + try + { + healthPunchTimeService.EnableEntity(keyValue); + } + 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/HealthPunchTime/HealthPunchTimeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs new file mode 100644 index 000000000..1cb778797 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs @@ -0,0 +1,80 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// StarTime + /// + [Column("STARTIME")] + public string StarTime { get; set; } + /// + /// EndTime + /// + [Column("ENDTIME")] + public string EndTime { get; set; } + /// + /// 描述 + /// + [Column("DESCRIPTION")] + public string Description { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUser + /// + [Column("CREATEUSER")] + public string CreateUser { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CheckMark + /// + [Column("CHECKMARK")] + public int? CheckMark { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + 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/HealthPunchTime/HealthPunchTimeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs new file mode 100644 index 000000000..c62c4186b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs @@ -0,0 +1,51 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public interface HealthPunchTimeIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, HealthPunchTimeEntity entity); + + void EnableEntity(string keyValue); + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs new file mode 100644 index 000000000..fad36cb22 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs @@ -0,0 +1,188 @@ +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 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.ID, + t.StarTime, + t.EndTime, + t.Description, + t.CheckMark, + t.CreateUser, + t.CreateTime, + t.Remark + "); + strSql.Append(" FROM HealthPunchTime t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Description"].IsEmpty()) + { + dp.Add("Description", queryParam["Description"].ToString(), DbType.String); + strSql.Append(" AND t.Description = @Description "); + } + if (!queryParam["CheckMark"].IsEmpty()) + { + dp.Add("CheckMark", queryParam["CheckMark"].ToString(), DbType.String); + strSql.Append(" AND t.CheckMark = @CheckMark "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + public HealthPunchTimeEntity GetHealthPunchTimeEntity(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) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, HealthPunchTimeEntity 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 EnableEntity(string keyValue) + { + try + { + var entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + if (entity.CheckMark == 0) + { + entity.CheckMark = 1; + } + else if (entity.CheckMark == 1) + { + entity.CheckMark = 0; + } + this.BaseRepository("CollegeMIS").Update(entity); + } + catch (Exception ex) + { + 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 d907d81ba..944b75ed2 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 @@ -1782,6 +1782,10 @@ + + + +