From 0606b85dcb83d6f8a77c4ffa74fcbaafc09cd463 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 13 Mar 2023 15:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91OA=E5=8A=9E?= =?UTF-8?q?=E5=85=AC=EF=BC=9A=E5=A2=9E=E5=8A=A0=E2=80=9D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BA=8B=E5=8A=A1=E9=85=8D=E7=BD=AE=E2=80=9C=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/WP_OfficeConfigController.cs | 117 +++++++++++++ .../Views/WP_OfficeConfig/Form.cshtml | 19 +++ .../Views/WP_OfficeConfig/Form.js | 54 ++++++ .../Views/WP_OfficeConfig/Index.cshtml | 40 +++++ .../Views/WP_OfficeConfig/Index.js | 98 +++++++++++ .../Learun.Application.Web.csproj | 5 + .../XmlConfig/database.config | 1 + .../Learun.Application.Mapping.csproj | 1 + .../PersonnelManagement/WP_OfficeConfigMap.cs | 29 ++++ .../Learun.Application.TwoDevelopment.csproj | 4 + .../WP_OfficeConfig/WP_OfficeConfigBLL.cs | 125 ++++++++++++++ .../WP_OfficeConfig/WP_OfficeConfigEntity.cs | 84 ++++++++++ .../WP_OfficeConfig/WP_OfficeConfigIBLL.cs | 48 ++++++ .../WP_OfficeConfig/WP_OfficeConfigService.cs | 156 ++++++++++++++++++ 14 files changed, 781 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WP_OfficeConfigController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/WP_OfficeConfigMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WP_OfficeConfigController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WP_OfficeConfigController.cs new file mode 100644 index 000000000..2e4c8e078 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/WP_OfficeConfigController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.PersonnelManagement; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public class WP_OfficeConfigController : MvcControllerBase + { + private WP_OfficeConfigIBLL wP_OfficeConfigIBLL = new WP_OfficeConfigBLL(); + + #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 = wP_OfficeConfigIBLL.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 WP_OfficeConfigData = wP_OfficeConfigIBLL.GetWP_OfficeConfigEntity( keyValue ); + var jsonData = new { + WP_OfficeConfig = WP_OfficeConfigData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + wP_OfficeConfigIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + WP_OfficeConfigEntity entity = strEntity.ToObject(); + wP_OfficeConfigIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.cshtml new file mode 100644 index 000000000..49cff0b6b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.cshtml @@ -0,0 +1,19 @@ +@{ + ViewBag.Title = "个人事务配置"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
名称*
+ +
+
+
内容*
+ +
+
+
是否启用
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.js new file mode 100644 index 000000000..0a041f0ae --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Form.js @@ -0,0 +1,54 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-03-13 15:02 + * 描 述:个人事务配置 + */ +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 () { + $('#IsEnabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/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 + '/PersonnelManagement/WP_OfficeConfig/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.cshtml new file mode 100644 index 000000000..e89fc6a15 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.cshtml @@ -0,0 +1,40 @@ +@{ + ViewBag.Title = "个人事务配置"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
名称
+ +
+
+
内容
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.js new file mode 100644 index 000000000..4a63b517f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/WP_OfficeConfig/Index.js @@ -0,0 +1,98 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-03-13 15:02 + * 描 述:个人事务配置 + */ +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); + $('#IsEnabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/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 + '/PersonnelManagement/WP_OfficeConfig/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)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/PersonnelManagement/WP_OfficeConfig/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 150, align: "left" }, + { label: "内容", name: "Contents", width: 200, align: "left" }, + { + label: "是否启用", name: "IsEnabled", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "" : ""; + } + }, + ], + 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 906453892..32b32fa9c 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 @@ -877,6 +877,7 @@ + @@ -6469,6 +6470,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config index 2e514e22d..72e20af2a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config @@ -12,4 +12,5 @@ + \ No newline at end of file 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 d9d60d1f5..db363edae 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 @@ -610,6 +610,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/WP_OfficeConfigMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/WP_OfficeConfigMap.cs new file mode 100644 index 000000000..7976035ef --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/PersonnelManagement/WP_OfficeConfigMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.PersonnelManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public class WP_OfficeConfigMap : EntityTypeConfiguration + { + public WP_OfficeConfigMap() + { + #region 表、主键 + //表 + this.ToTable("WP_OFFICECONFIG"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #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 b4490741e..fb6ea938a 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 @@ -1872,6 +1872,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigBLL.cs new file mode 100644 index 000000000..9be8781d0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigBLL.cs @@ -0,0 +1,125 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public class WP_OfficeConfigBLL : WP_OfficeConfigIBLL + { + private WP_OfficeConfigService wP_OfficeConfigService = new WP_OfficeConfigService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return wP_OfficeConfigService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取WP_OfficeConfig表实体数据 + /// + /// 主键 + /// + public WP_OfficeConfigEntity GetWP_OfficeConfigEntity(string keyValue) + { + try + { + return wP_OfficeConfigService.GetWP_OfficeConfigEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + wP_OfficeConfigService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, WP_OfficeConfigEntity entity) + { + try + { + wP_OfficeConfigService.SaveEntity(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/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigEntity.cs new file mode 100644 index 000000000..382245122 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigEntity.cs @@ -0,0 +1,84 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public class WP_OfficeConfigEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 名称 + /// + [Column("NAME")] + public string Name { get; set; } + /// + /// 内容 + /// + [Column("CONTENTS")] + public string Contents { get; set; } + /// + /// 是否启用 + /// + [Column("ISENABLED")] + public bool? IsEnabled { get; set; } + /// + /// CreateUserId + /// + [Column("CREATEUSERID")] + public string CreateUserId { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// ModifyUserId + /// + [Column("MODIFYUSERID")] + public string ModifyUserId { get; set; } + /// + /// ModifyTime + /// + [Column("MODIFYTIME")] + public DateTime? ModifyTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.CreateUserId = LoginUserInfo.Get().userId; + this.CreateTime = DateTime.Now; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + this.ModifyUserId = LoginUserInfo.Get().userId; + this.ModifyTime = DateTime.Now; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigIBLL.cs new file mode 100644 index 000000000..0d7e3f9e0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigIBLL.cs @@ -0,0 +1,48 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public interface WP_OfficeConfigIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取WP_OfficeConfig表实体数据 + /// + /// 主键 + /// + WP_OfficeConfigEntity GetWP_OfficeConfigEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, WP_OfficeConfigEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigService.cs new file mode 100644 index 000000000..a4a4e096f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/WP_OfficeConfig/WP_OfficeConfigService.cs @@ -0,0 +1,156 @@ +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.PersonnelManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-03-13 15:02 + /// 描 述:个人事务配置 + /// + public class WP_OfficeConfigService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM WP_OfficeConfig t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Name"].IsEmpty()) + { + dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Name Like @Name "); + } + if (!queryParam["Contents"].IsEmpty()) + { + dp.Add("Contents", "%" + queryParam["Contents"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Contents Like @Contents "); + } + if (!queryParam["IsEnabled"].IsEmpty()) + { + dp.Add("IsEnabled",queryParam["IsEnabled"].ToString(), DbType.String); + strSql.Append(" AND t.IsEnabled = @IsEnabled "); + } + return this.BaseRepository("CollegeMISFor30").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取WP_OfficeConfig表实体数据 + /// + /// 主键 + /// + public WP_OfficeConfigEntity GetWP_OfficeConfigEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMISFor30").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("CollegeMISFor30").Delete(t=>t.Id == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, WP_OfficeConfigEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMISFor30").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMISFor30").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + } +}