From 02cdb91b61709a949ce16fb5742b73947c9eecd1 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 5 Dec 2022 18:13:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=8D=B0=E7=AB=A0=E7=AE=A1=E7=90=86=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StampPersonalController.cs | 212 +++++++++++++++++ .../Views/StampPersonal/EqualForm.cshtml | 11 + .../Views/StampPersonal/EqualForm.js | 35 +++ .../Views/StampPersonal/Form.cshtml | 43 ++++ .../Views/StampPersonal/Form.css | 21 ++ .../Views/StampPersonal/Form.js | 86 +++++++ .../Views/StampPersonal/Index.cshtml | 61 +++++ .../Views/StampPersonal/Index.js | 209 +++++++++++++++++ .../StampPersonal/StampDetailIndex.cshtml | 64 ++++++ .../Views/StampPersonal/StampDetailIndex.js | 71 ++++++ .../Learun.Application.Web.csproj | 10 + .../LR_OA/StampPersonalMap.cs | 27 +++ .../Learun.Application.Mapping.csproj | 1 + .../Learun.Application.OA.csproj | 4 + .../StampPersonal/StampPersonalBLL.cs | 217 ++++++++++++++++++ .../StampPersonal/StampPersonalEntity.cs | 94 ++++++++ .../StampPersonal/StampPersonalIBLL.cs | 75 ++++++ .../StampPersonal/StampPersonalService.cs | 214 +++++++++++++++++ 18 files changed, 1455 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampPersonalController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_OA/StampPersonalMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampPersonalController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampPersonalController.cs new file mode 100644 index 000000000..de94a7a10 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/StampPersonalController.cs @@ -0,0 +1,212 @@ +using Learun.Application.Base.SystemModule; +using Learun.Application.OA.StampPersonal; +using Learun.Util; +using System; +using System.IO; +using System.Web; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers +{ + /// + /// 版 本 Learun-ADMS V6.1.6.0 力软敏捷开发框架 + /// Copyright (c) 2013-2017 上海力软信息技术有限公司 + /// 创建人:力软-框架开发组(王飞) + /// 日 期:2022.12.05 + /// 描 述:个人印章管理 + /// + public class StampPersonalController : MvcControllerBase + { + private StampPersonalIBLL stampPersonalIBLL = new StampPersonalBLL(); + private ImgIBLL imgIBLL = new ImgBLL(); + + #region 视图功能 + /// + /// 管理页面 + /// + /// + public ActionResult Index() + { + return View(); + } + /// + /// 表单页面 + /// + /// + public ActionResult Form() + { + return View(); + } + + public ActionResult StampDetailIndex() + { + return View(); + } + + public ActionResult EqualForm() + { + return View(); + } + #endregion + + #region 获取数据 + /// + /// 分页 + /// + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stampPersonalIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 获取所有的印章信息 + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string keyword, string userId) + { + var data = stampPersonalIBLL.GetList(keyword, userId); + return Success(data); + } + + /// + /// 获取图片 + /// + /// + /// + [HttpGet] + public ActionResult GetImg(string keyValue) + { + stampPersonalIBLL.GetImg(keyValue); + return Success("获取成功!"); + } + + #endregion + + #region 提交数据 + /// + /// 保存印章 + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, StampPersonalEntity entity) + { + stampPersonalIBLL.SaveEntity(keyValue, entity); + return Success("保存成功。"); + + } + /// + /// 删除印章 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + stampPersonalIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + #endregion + + #region 扩展方法 + /// + /// 图片上传 + /// + /// 主键 + /// 印章实体 + /// + [HttpPost] + public ActionResult UploadFile(string keyValue, StampPersonalEntity entity) + { + HttpFileCollection files = System.Web.HttpContext.Current.Request.Files; + + if (files[0].ContentLength == 0 || string.IsNullOrEmpty(files[0].FileName)) + { + stampPersonalIBLL.SaveEntity(keyValue, entity); + } + else + { + string FileEextension = Path.GetExtension(files[0].FileName); + ImgEntity imgEntity = null; + if (string.IsNullOrEmpty(entity.F_ImgFile)) + { + imgEntity = new ImgEntity(); + } + else + { + imgEntity = imgIBLL.GetEntity(entity.F_ImgFile); + } + + imgEntity.F_Name = files[0].FileName; + imgEntity.F_ExName = FileEextension; + byte[] bytes = new byte[files[0].InputStream.Length]; + files[0].InputStream.Read(bytes, 0, bytes.Length); + + imgEntity.F_Content = Convert.ToBase64String(bytes); + imgIBLL.SaveEntity(entity.F_ImgFile, imgEntity); + + entity.F_ImgFile = imgEntity.F_Id; + stampPersonalIBLL.SaveEntity(keyValue, entity); + } + return Success("保存成功。"); + } + + /// + /// 启用/停用 + /// + /// 主键 + /// 状态 1启用 0禁用 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpDateSate(string keyValue, int state) + { + stampPersonalIBLL.UpdateState(keyValue, state); + return Success((state == 1 ? "启用" : "禁用") + "成功!"); + } + /// + /// 密码验证 + /// + /// 主键 + /// 密码 + /// + [HttpPost] + [AjaxOnly] + public ActionResult EqualForm(string keyValue, string Password) + { + var result = stampPersonalIBLL.EqualPassword(keyValue, Password); + if (result) + { + return Success("密码验证成功!"); + } + else + { + return Fail("密码不正确!"); + } + + } + #endregion + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.cshtml new file mode 100644 index 000000000..1bc27f66b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.cshtml @@ -0,0 +1,11 @@ +@{ + ViewBag.Title = "印章密码"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
密码*
+ +
+
+@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.js new file mode 100644 index 000000000..b2ef39635 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/EqualForm.js @@ -0,0 +1,35 @@ +/* * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:超级管理员 + * 日 期:2022-12-05 + * 描 述:密码验证 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var selectedRow = learun.frameTab.currentIframe().selectedRow; + var page = { + init: function () { + page.bind(); + }, + bind: function () { + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + var F_Password = $.md5(postData.F_Password); + learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) { + // 正确之后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml new file mode 100644 index 000000000..86d7091e8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.cshtml @@ -0,0 +1,43 @@ + +@{ + ViewBag.Title = "个人印章操作"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@Html.AppendCssFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css") +
+
+
印章名称*
+ +
+
+
印章分类*
+
+
+ +
+
密码*
+ +
+
+
排序*
+ +
+
+
图片文件
+
+ +
+
+ 上传图片尺寸为200x200,大小不超过1M。 +
+
+
+
备注
+ +
+ +
+ +@Html.AppendJsFile("/Views/LR_Content/script/lr-fileupload.js", "/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js") + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css new file mode 100644 index 000000000..9f775b33a --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.css @@ -0,0 +1,21 @@ +.fileEx { + width: 100%; + height: 120px; + position: relative; + overflow: hidden; +} + + .fileEx input { + position: absolute; + font-size: 120px; + right: 0; + top: 0; + opacity: 0; + cursor: pointer !important; + } + + .fileEx img { + width: 120px; + height: 120px; + cursor: pointer; + } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js new file mode 100644 index 000000000..1a990d61d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Form.js @@ -0,0 +1,86 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人:力软-前端开发组 + * 日 期:2022.12.05 + * 描 述:个人印章管理 + */ + +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var selectedRow = learun.frameTab.currentIframe().selectedRow; + + function uploadImg() { + var f = document.getElementById("uploadFile").files[0];//获取文件 + var src = window.URL.createObjectURL(f); + document.getElementById('uploadPreview').src = src; + } + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + // 印章分类 + $('#F_StampType').lrDataItemSelect({ code: 'StampType' }); + //图片显示 + $('#uploadFile').on('change', uploadImg); + $('.fileEx').prepend(''); + }, + initData: function () { + if (!!selectedRow) { + selectedRow.F_Password = '*****'; + $('#form').lrSetFormData(selectedRow); + + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(keyValue); + if (postData.F_Password != '*****' || !keyValue) { + postData.F_Password = $.md5(postData.F_Password); + } + else { + delete postData.F_Password; + } + if (!keyValue && !postData.uploadFile) { + learun.alert.error("请选择图片"); + return false; + } + + var f = document.getElementById('uploadFile').files[0]; + //是否上传图片 + if (!!f) { + learun.loading(true, '正在保存...'); + $.ajaxFileUpload({ + data: postData, + url: top.$.rootUrl + "/LR_NewWorkFlow/StampPersonal/UploadFile?keyValue=" + keyValue, + secureuri: false, + fileElementId: 'uploadFile', + dataType: 'json', + success: function (data) { + if (!!callBack) { + callBack(); + } + learun.loading(false); + learun.layerClose(window.name); + } + }); + } + else { + $.lrSaveForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml new file mode 100644 index 000000000..169252463 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.cshtml @@ -0,0 +1,61 @@ + +@{ + ViewBag.Title = "个人印章管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
印章分类信息
+
+
+
+
+
+
+ 印章管理 - 未选择分类 +
+
+
+
+
+ + +
+
+
+ +
+
+  查询 +
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js new file mode 100644 index 000000000..7691a7388 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/Index.js @@ -0,0 +1,209 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人: + * 日 期:2022.12.05 + * 描 述:个人印章管理 + */ +var selectedRow; +var refreshGirdData; +var F_StampType; +var F_StampName; +var F_EnabledMark; +var acceptClick; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGrid(); + page.bind(); + }, + bind: function () { + // 左侧数据加载 + $('#lr_left_tree').lrtree({ + url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailTree', + param: { itemCode: 'StampType' }, + nodeClick: function (item) { + F_StampType = item.value; + F_StampName = null;//将文本框数据设置为null,如果不设置,那么不能按照左侧分类查询 + F_EnabledMark = null;//将文本框数据设置为null,如果不设置,那么不能按照左侧分类查询 + $('#titleinfo').text(item.text); + page.search(); + } + }); + //查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + F_StampType = null; + page.search({ F_StampName: keyword }); + }); + + $('[name="isEnabled"]').on('click', function () { + var value = $(this).val(); //状态查询 + if (value == 1) { + F_EnabledMark = value; + page.search(); + } + else { + F_EnabledMark = value; + page.search(); + } + }); + //刷新 + $("#lr_refresh").on('click', function () { + location.reload(); + }); + //新增 + $("#lr_add").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'form', + title: '添加印章', + url: top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/Form', + width: 700, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + //编辑 + $("#lr_edit").on("click", function () { + selectedRow = $("#gridtable").jfGridGet("rowdata");//获取选中的当前行数据 + var keyValue = $("#gridtable").jfGridValue("F_StampId");//获取当前选中的主键值 + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'Form', + title: '编辑印章', + url: top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/Form?keyValue=' + keyValue, + width: 750, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + //删除 + $("#lr_delete").on("click", function () { + var keyValue = $('#gridtable').jfGridValue('F_StampId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 启用 + $('#lr_enable').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_StampId'); + var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); + if (learun.checkrow(keyValue)) { + if (enabledMark != 1) { + learun.layerConfirm('是否确认启用该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/UpDateSate', { keyValue: keyValue, state: 1 }, function () { + refreshGirdData(); + }); + } + }); + } + else { + learun.alert.warning('该项已启用!'); + } + } + }); + // 禁用 + $('#lr_disabled').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_StampId'); + var enabledMark = $('#gridtable').jfGridValue('F_EnabledMark'); + + if (learun.checkrow(keyValue)) { + if (enabledMark == 1) { + learun.layerConfirm('是否确认禁用该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/UpDateSate', { keyValue: keyValue, state: 0 }, function () { + refreshGirdData(); + }); + } + }); + } + else { + learun.alert.warning('该项已禁用!'); + } + } + }); + /*分类管理*/ + $('#lr_category').on('click', function () { + learun.layerForm({ + id: 'ClassifyIndex', + title: '分类管理', + url: top.$.rootUrl + '/LR_SystemModule/DataItem/DetailIndex?itemCode=StampType', + width: 800, + height: 500, + maxmin: true, + btn: null, + end: function () { + learun.clientdata.update('dataItem'); + location.reload(); + } + }); + }); + }, + initGrid: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/GetPageList', + headData: [ + { label: '印章名称', name: 'F_StampName', width: 150, align: "center" }, + { + label: '印章分类', name: 'F_StampType', width: 100, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StampType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: '图片', name: 'F_ImgFile', width: 110, align: "center", + formatter: function (value, row, op, $cell) { + return ''; + } + }, + { + label: '状态', name: 'F_EnabledMark', width: 60, align: "center", formatter: function (value, row, op, $cell) { + if (value == 1) { + return '启用'; + } else if (value == 0) { + return '禁用'; + } + } + }, + { label: '备注', name: 'F_Description', width: 200, align: "left" } + ], + mainId: 'F_StampId', + isPage: true, + rowHeight: 110, + sidx: 'F_EnabledMark Desc,F_Sort ASC' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.F_StampType = F_StampType; + param.F_EnabledMark = F_EnabledMark; + param.F_CreateUserId = learun.clientdata.get(['userinfo']).userId; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + } + refreshGirdData = function () { + page.search(); + }; + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml new file mode 100644 index 000000000..33b8a9298 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.cshtml @@ -0,0 +1,64 @@ +@{ + ViewBag.Title = "个人印章管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
+ +
+
+  查询 +
+
+ +
+
+
+
+ +@Html.AppendJsFile("/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js") + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js new file mode 100644 index 000000000..b1ecde79f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/StampPersonal/StampDetailIndex.js @@ -0,0 +1,71 @@ +/* + * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2018 上海力软信息技术有限公司 + * 创建人: + * 日 期:2022.12.05 + * 描 述:个人印章管理 + */ +var keyword; +var acceptClick; +var path = ''; +var bootstrap = function ($, learun) { + "use strict"; + // 保存数据 + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + // 订单产品信息 + $('#datagird').jfGrid({ + headData: [ + { label: '名称', name: 'F_StampName', width: 150, align: "center" }, + { + label: '印章', name: 'F_ImgFile', width: 110, align: "left", + formatter: function (value, row, op, $cell) { + return ''; + } + } + ], + mainId: 'F_StampId', + rowHeight: 110, + }); + //查询 + $('#btn_Search').on('click', function () { + keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + }, + initData: function () { + $.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/GetList?keyword=' + '' + '&userId=' + learun.clientdata.get(['userinfo']).userId, function (data) { + $('.lr-layout-wrap').lrSetFormData(data.data); + $('#datagird').jfGridSet('refreshdata', data); + }); + }, + search: function (param) { + param = param || {}; + $.lrSetForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/GetList?keyword=' + keyword + '&userId=' + learun.clientdata.get(['userinfo']).userId, function (data) { + $('.lr-layout-wrap').lrSetFormData(data.data); + $('#datagird').jfGridSet('refreshdata', data); + + }); + } + }; + acceptClick = function (callBack) { + var keyValue = $("#datagird").jfGridValue("F_StampId"); + if (!$('.lr-item').lrValidform()) { + return false; + } + var postData = $('.lr-item').lrGetFormData(); + var F_Password = $.md5(postData.F_Password); + if (!keyValue) { + learun.alert.error("请选择印章!"); + return false; + } + learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/StampPersonal/EqualForm', { keyValue: keyValue, Password: F_Password }, function (res) { + callBack(keyValue); + }); + }; + page.init(); +} \ No newline at end of file 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 ed64ee2a0..adeac834e 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 @@ -453,6 +453,7 @@ + @@ -1722,6 +1723,11 @@ + + + + + @@ -8003,6 +8009,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_OA/StampPersonalMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_OA/StampPersonalMap.cs new file mode 100644 index 000000000..281142ca3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_OA/StampPersonalMap.cs @@ -0,0 +1,27 @@ +using Learun.Application.OA.StampPersonal; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{/// + /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-12-05 09:57 + /// 描 述:个人印章管理 + /// + public class StampPersonalMap : EntityTypeConfiguration + { + public StampPersonalMap() + { + #region 表、主键 + //表 + this.ToTable("LR_BASE_STAMPPERSONAL"); + //主键 + this.HasKey(s =>s.F_StampId); + #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 6bc5afd74..c9ea30f28 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 @@ -196,6 +196,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Learun.Application.OA.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Learun.Application.OA.csproj index 728c69d8d..23fe4ebd6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Learun.Application.OA.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Learun.Application.OA.csproj @@ -140,6 +140,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalBLL.cs new file mode 100644 index 000000000..4ea176c66 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalBLL.cs @@ -0,0 +1,217 @@ +using Learun.Application.Base.SystemModule; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Linq; + + + +namespace Learun.Application.OA.StampPersonal +{ + /// + /// 版 本 Learun-ADMS V6.1.6.0 力软敏捷开发框架 + /// Copyright (c) 2013-2017 上海力软信息技术有限公司 + /// 创建人:力软-框架开发组(王飞) + /// 日 期:2022.12.05 + /// 描 述:个人印章管理 + /// + public class StampPersonalBLL : StampPersonalIBLL + { + private StampPersonalService stampPersonalService = new StampPersonalService(); + private ImgIBLL imgIBLL = new ImgBLL(); + #region 获取数据 + + /// + /// 获取所有的印章信息/模糊查询(根据名称/状态(启用或者停用)) + /// + /// 查询的关键字 + /// + public IEnumerable GetList(string keyWord, string userId) + { + try + { + return stampPersonalService.GetList(keyWord, userId); + + } + catch (Exception ex) + { + + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + + return stampPersonalService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体 + /// + /// 主键 + /// + public StampPersonalEntity GetEntity(string keyValue) + { + try + { + return stampPersonalService.GetEntity(keyValue); + } + catch (Exception ex) + { + + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + + } + #endregion + + #region 提交数据 + /// + /// 保存印章信息(新增/编辑) + /// + /// + /// + public void SaveEntity(string keyValue, StampPersonalEntity entity) + { + try + { + stampPersonalService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 删除印章信息 + /// + /// + public void DeleteEntity(string keyVlaue) + { + try + { + stampPersonalService.DeleteEntity(keyVlaue); + } + catch (Exception ex) + { + + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 扩展方法 + /// + /// 获取图片 + /// + /// 主键 + public void GetImg(string keyValue) + { + //首先获取实体 + StampPersonalEntity entity = GetEntity(keyValue); + string img = ""; + //实体是否存在 + if (entity != null && !string.IsNullOrEmpty(entity.F_ImgFile)) + { + ImgEntity imgEntity = imgIBLL.GetEntity(entity.F_ImgFile); + + if (imgEntity != null && !string.IsNullOrEmpty(imgEntity.F_Content)) + { + FileDownHelper.DownLoadBase64(imgEntity.F_Content, imgEntity.F_Name); + return; + } + } + else + { + img = "/Content/images/add.jpg"; + } + if (string.IsNullOrEmpty(img)) + { + img = "/Content/images/add.jpg"; + } + FileDownHelper.DownLoad(img); + } + + /// + /// 更新数据状态 + /// + /// 主键 + /// 状态 1启用 0禁用 + public void UpdateState(string keyValue, int state) + { + StampPersonalEntity entity = new StampPersonalEntity(); + entity.F_EnabledMark = state; + SaveEntity(keyValue, entity); + } + + /// + /// 密码验证 + /// + /// 主键 + /// 密码 + /// + public bool EqualPassword(string keyValue, string password) + { + StampPersonalEntity entity = GetEntity(keyValue); + if (entity.F_Password.Equals(password))//加密后进行对比 + { + return true; + } + else + { + return false; + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalEntity.cs new file mode 100644 index 000000000..b3c58a49d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalEntity.cs @@ -0,0 +1,94 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.OA.StampPersonal +{ + public class StampPersonalEntity + { + + /// + /// 印章编号 + /// + [Column("F_STAMPID")] + public string F_StampId { get; set; } + + + /// + /// 印章名称 + /// + [Column("F_STAMPNAME")] + public string F_StampName { get; set; } + + /// + /// 印章备注 + /// + [Column("F_DESCRIPTION")] + public string F_Description { get; set; } + + /// + /// 印章分类 + /// + [Column("F_STAMPTYPE")] + public string F_StampType { get; set; } + + /// + /// 密码 + /// + [Column("F_PASSWORD")] + public string F_Password { get; set; } + + /// + /// 图片文件 + /// + [Column("F_IMGFILE")] + public string F_ImgFile { get; set; } + + /// + /// 排序 + /// + [Column("F_SORT")] + public string F_Sort { get; set; } + + /// + /// 印章状态 + /// + [Column("F_ENABLEDMARK")] + public int? F_EnabledMark { get; set; } + /// + /// 创建人 + /// + [Column("F_CREATEUSERID")] + public string F_CreateUserId { get; set; } + /// + /// 时间 + /// + [Column("F_CREATETIME")] + public DateTime? F_CreateTime { get; set; } + + #region 扩展方法 + + /// + /// 编辑调用 + /// + /// 主键 + public void Modify(string keyValue) + { + this.F_StampId = keyValue; + this.F_CreateUserId = LoginUserInfo.Get().userId; //创建人 + this.F_CreateTime = DateTime.Now; + } + /// + /// 新增调用 + /// + public void Create() + { + this.F_StampId = Guid.NewGuid().ToString(); //产生印章编号 + this.F_EnabledMark = 1;//默认状态为启用 + this.F_CreateUserId = LoginUserInfo.Get().userId; //创建人 + this.F_CreateTime = DateTime.Now; + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalIBLL.cs new file mode 100644 index 000000000..ac1aa31b0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalIBLL.cs @@ -0,0 +1,75 @@ +using Learun.Util; +using System.Collections.Generic; + +namespace Learun.Application.OA.StampPersonal +{ + /// + /// 版 本 Learun-ADMS V6.1.6.0 力软敏捷开发框架 + /// Copyright (c) 2013-2017 上海力软信息技术有限公司 + /// 创建人:力软-框架开发组(王飞) + /// 日 期:2022.12.05 + /// 描 述:个人印章管理 + /// + public interface StampPersonalIBLL + { + #region 获取数据 + /// + /// 模糊查询(根据名称/状态(启用或者停用)) + /// + /// + /// + IEnumerable GetList(string keyWord, string userId); + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + + /// + /// 获取印章树形数据 + /// + /// 父级节点 + /// + StampPersonalEntity GetEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 保存印章信息(新增/编辑) + /// + /// + /// + void SaveEntity(string keyValue, StampPersonalEntity stampEntity); + + /// + /// 删除印章信息 + /// + /// + void DeleteEntity(string keyVlaue); + + /// + /// 更新数据状态 + /// + /// 主键 + /// 状态 1启用 0禁用 + void UpdateState(string keyValue, int state); + #endregion + + #region 扩展方法 + /// + /// 获取图片 + /// + /// 主键 + void GetImg(string keyValue); + /// + /// 密码匹配 + /// + /// 主键 + /// 密码 + /// + bool EqualPassword(string keyValue, string Password); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalService.cs new file mode 100644 index 000000000..93c8d75b7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/StampPersonal/StampPersonalService.cs @@ -0,0 +1,214 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.OA.StampPersonal +{ + /// + /// 版 本 Learun-ADMS V6.1.6.0 力软敏捷开发框架 + /// Copyright (c) 2013-2017 上海力软信息技术有限公司 + /// 创建人:力软-框架开发组(王飞) + /// 日 期:2022.12.05 + /// 描 述:个人印章管理 + /// + public class StampPersonalService : RepositoryFactory + { + #region 构造函数和属性 + private string fieldSql; + public StampPersonalService() + { + //sql字段 + fieldSql = @" + * + "; + } + #endregion + + #region 获取数据 + /// + /// 获取印章信息(根据名称/状态:启用或停用模糊查询) + /// + /// 名称/状态 + /// + public IEnumerable GetList(string keyWord, string userId) + { + try + { + StringBuilder Sql = new StringBuilder(); + Sql.Append("SELECT"); + Sql.Append(this.fieldSql); + Sql.Append("FROM LR_Base_StampPersonal s where 1=1 "); + Sql.Append("and s.F_EnabledMark =1 "); + if (!string.IsNullOrEmpty(keyWord)) + {// cbb 如果没有查询条件则不需要输入 + Sql.AppendFormat(" and s.F_StampName LIKE '%{0}%'", keyWord); + } + if (!string.IsNullOrEmpty(userId)) + { + Sql.AppendFormat(" and s.F_CreateUserId = '{0}'", userId); + } + + Sql.Append(" Order by F_Sort"); + + return this.BaseRepository().FindList(Sql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var dp = new DynamicParameters(new { }); + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM LR_Base_StampPersonal s Where 1=1 "); + if (queryParam.HasValues) + { + if (!queryParam["F_StampName"].IsEmpty()) + { + dp.Add("F_StampName", "%" + queryParam["F_StampName"].ToString() + "%", DbType.String); + strSql.Append(" AND s.F_StampName like @F_StampName "); + } + if (!queryParam["F_EnabledMark"].IsEmpty()) + { + dp.Add("F_EnabledMark", queryParam["F_EnabledMark"].ToString(), DbType.String); + strSql.Append(" AND s.F_EnabledMark=@F_EnabledMark"); + } + if (!queryParam["F_StampType"].IsEmpty()) + { + dp.Add("F_StampType", queryParam["F_StampType"].ToString(), DbType.String); + strSql.Append(" AND s.F_StampType = @F_StampType"); + } + if (!queryParam["F_CreateUserId"].IsEmpty()) + { + dp.Add("F_CreateUserId", queryParam["F_CreateUserId"].ToString(), DbType.String); + strSql.Append(" AND s.F_CreateUserId = @F_CreateUserId"); + } + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取印章实体 + /// + /// 主键 + /// + public StampPersonalEntity GetEntity(string keyValue) + { + + try + { + return this.BaseRepository().FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 保存印章信息(新增/编辑) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, StampPersonalEntity entity) + { + try + { + //如果keyValue值为空或者null,表示,当前的操作是添加,否则是修改 + if (string.IsNullOrEmpty(keyValue)) + { + entity.Create(); + this.BaseRepository().Insert(entity); + } + else + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + + } + } + + /// + /// 删除印章信息 + /// + /// 主键 + public void DeleteEntity(string keyVlaue) + { + try + { + this.BaseRepository().Delete(s => s.F_StampId == keyVlaue);//删除操作 + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + + } + } + #endregion + } + +}