From 17e1d85abf842d42308ba8d549d503bf28bcc341 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 12 Aug 2021 11:40:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E7=89=A9=E6=8B=9B=E9=A2=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LostArticleInfoController.cs | 178 +++++++++++++ .../Views/LostArticleInfo/Form.cshtml | 30 +++ .../LR_OAModule/Views/LostArticleInfo/Form.js | 143 +++++++++++ .../Views/LostArticleInfo/FormClaim.cshtml | 22 ++ .../Views/LostArticleInfo/FormClaim.js | 143 +++++++++++ .../Views/LostArticleInfo/FormView.cshtml | 45 ++++ .../Views/LostArticleInfo/FormView.js | 55 ++++ .../Views/LostArticleInfo/Index.cshtml | 39 +++ .../Views/LostArticleInfo/Index.js | 237 ++++++++++++++++++ .../Learun.Application.Web.csproj | 9 + .../LR_Desktop/LostArticleInfoMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 1 + .../Learun.Application.OA.csproj | 4 + .../LostArticleInfo/LostArticleInfoBLL.cs | 193 ++++++++++++++ .../LostArticleInfo/LostArticleInfoEntity.cs | 114 +++++++++ .../LostArticleInfo/LostArticleInfoIBLL.cs | 64 +++++ .../LostArticleInfo/LostArticleInfoService.cs | 229 +++++++++++++++++ 17 files changed, 1535 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/LostArticleInfoController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/LostArticleInfoMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/LostArticleInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/LostArticleInfoController.cs new file mode 100644 index 000000000..c96dbfd8b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/LostArticleInfoController.cs @@ -0,0 +1,178 @@ +using Learun.Application.OA; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Threading.Tasks; +using System.Web; +using System.Web.Mvc; +using Learun.Application.Base.AuthorizeModule; +using Learun.Application.Base.SystemModule; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.LR_Desktop; +using Learun.Util.Operat; +using Microsoft.AspNet.SignalR.Client; +using Microsoft.Owin.Logging; +using Newtonsoft.Json; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.Permission; + +namespace Learun.Application.Web.Areas.LR_OAModule.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创建人:zl + /// 日 期:2021.05.20 + /// 描 述:失物招领管理 + /// + public class LostArticleInfoController : MvcControllerBase + { + private LostArticleInfoIBLL lostArticleInfoIBLL = new LostArticleInfoBLL(); + + #region 视图功能 + /// + /// 页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页面 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 失物招领表单 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + + /// + /// 认领 + /// + /// + [HttpGet] + public ActionResult FormClaim() + { + return View(); + } + + #endregion + + #region 获取数据 + /// + /// 获取分页数据 + /// + /// 分页参数 + /// 关键词 + /// + public ActionResult GetPageList(string pagination, string keyword) + { + Pagination paginationobj = pagination.ToObject(); + var data = lostArticleInfoIBLL.GetPageList(paginationobj, keyword); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records, + }; + return JsonResult(jsonData); + } + /// + /// 获取实体数据 + /// + /// 主键 + /// + public ActionResult GetEntity(string keyValue) + { + var data = lostArticleInfoIBLL.GetLostArticleInfoEntity(keyValue); + data.F_Content = WebHelper.HtmlDecode(data.F_Content); + return JsonResult(data); + } + + #endregion + + #region 提交数据 + + /// + /// 保存表单数据 + /// + /// 主键 + /// 实体 + /// + [HttpPost, ValidateAntiForgeryToken, AjaxOnly] + public ActionResult SaveForm(string keyValue, LostArticleInfoEntity entity) + { + entity.F_Content = WebHelper.HtmlEncode(entity.F_Content); + entity.F_State = 0; + lostArticleInfoIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + /// + /// 删除表单数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + lostArticleInfoIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + /// + /// 发布 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult PublishForm(string keyValue) + { + lostArticleInfoIBLL.PublishForm(keyValue); + return Success("发布成功!"); + } + /// + /// 认领 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult ClaimForm(string keyValue, LostArticleInfoEntity entity) + { + lostArticleInfoIBLL.ClaimForm(keyValue, entity); + return Success("认领成功!"); + } + /// + /// 撤下 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult CancleForm(string keyValue) + { + lostArticleInfoIBLL.CancleForm(keyValue); + return Success("已撤下!"); + } + #endregion + + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.cshtml new file mode 100644 index 000000000..9d477b496 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.cshtml @@ -0,0 +1,30 @@ +@{ + ViewBag.Title = "发布失物招领"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
标题*
+ +
+
+
发布时间*
+ +
+
+
捡拾人*
+ +
+ +
+
标题图片
+
+
+
+
内容
+
+
+
+ +@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js new file mode 100644 index 000000000..c86445036 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js @@ -0,0 +1,143 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2017.11.11 + * 描 述:公告通知 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +var isUpdate; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //var loginInfo = top.learun.clientdata.get(['userinfo']); + + $('#F_Image').lrUploader(); + + //内容编辑器 + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + if (data.F_Content) { + ue.setContent(decodeURI(data.F_Content)); + }; + }, 100); + }); + } + } + }; + // 设置表单数据 + //setFormData = function (processId) { + // if (!!processId) { + // $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { + // for (var id in data) { + // if (!!data[id] && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // if (id == 'Sys_ReceiveFile') { + // keyValue = data[id].F_DeptRelationId; + // } + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + // } + //} + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(keyValue); + postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + //callBack(res, formData, i); + } + }); + + //var formData = $('body').lrGetFormData(); + //if (!!processId) { + // formData.RProcessId = processId; + //} + + //learun.clientdata.getAsync('dataItem', { + + // key: $("#F_CategoryId").lrselectGet(), + // code: 'NoticeCategory', + // callback: function (_data) { + // $("#F_Category").val(_data.text); + + + // } + //}); + + + //$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(res, formData, i); + // } + //}); + }; + + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(keyValue); + postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + //learun.clientdata.getAsync('dataItem', { + // key: $("#F_CategoryId").lrselectGet(), + // code: 'NoticeCategory', + // callback: function (_data) { + // $("#F_Category").val(_data.text); + + + // } + //}); + + + } + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.cshtml new file mode 100644 index 000000000..583323793 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.cshtml @@ -0,0 +1,22 @@ +@{ + ViewBag.Title = "失物招领认领"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
认领人*
+ +
+
+
认领时间*
+ +
+ +
+
认领照片
+
+
+
+ +@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js new file mode 100644 index 000000000..9ef26e73d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormClaim.js @@ -0,0 +1,143 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2017.11.11 + * 描 述:公告通知 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +var isUpdate; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //var loginInfo = top.learun.clientdata.get(['userinfo']); + + $('#F_ClaimImage').lrUploader(); + + //内容编辑器 + //ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + if (data.F_Content) { + ue.setContent(decodeURI(data.F_Content)); + }; + }, 100); + }); + } + } + }; + // 设置表单数据 + //setFormData = function (processId) { + // if (!!processId) { + // $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetFormDataByProcessId?processId=' + processId, function (data) { + // for (var id in data) { + // if (!!data[id] && data[id].length > 0) { + // $('#' + id).jfGridSet('refreshdata', data[id]); + // } + // else { + // if (id == 'Sys_ReceiveFile') { + // keyValue = data[id].F_DeptRelationId; + // } + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + // } + //} + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(keyValue); + //postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/ClaimForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + //callBack(res, formData, i); + } + }); + + //var formData = $('body').lrGetFormData(); + //if (!!processId) { + // formData.RProcessId = processId; + //} + + //learun.clientdata.getAsync('dataItem', { + + // key: $("#F_CategoryId").lrselectGet(), + // code: 'NoticeCategory', + // callback: function (_data) { + // $("#F_Category").val(_data.text); + + + // } + //}); + + + //$.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveForm?keyValue=' + keyValue, formData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(res, formData, i); + // } + //}); + }; + + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(keyValue); + //postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/ClaimForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + //learun.clientdata.getAsync('dataItem', { + // key: $("#F_CategoryId").lrselectGet(), + // code: 'NoticeCategory', + // callback: function (_data) { + // $("#F_Category").val(_data.text); + + + // } + //}); + + + } + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.cshtml new file mode 100644 index 000000000..6fcf0fad0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.cshtml @@ -0,0 +1,45 @@ +@{ + ViewBag.Title = "发布失物招领"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+
+
公告标题*
+ +
+
+
发布时间*
+ +
+
+
捡拾人*
+ +
+
+
标题图片
+
+
+
+
公告内容
+
+
+
+
认领人
+ +
+
+
认领时间
+ +
+
+
认领照片
+
+
+
+
经手人
+ +
+
+ +@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js new file mode 100644 index 000000000..6f0860bf8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.js @@ -0,0 +1,55 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2017.11.11 + * 描 述:公告通知 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +var isUpdate; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //var loginInfo = top.learun.clientdata.get(['userinfo']); + + $('#F_Image').lrUploader(); + $('#F_ClaimImage').lrUploader(); + + //内容编辑器 + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + if (data.F_Content) { + ue.setContent(decodeURI(data.F_Content)); + } + }, 100); + }); + } + } + }; + + page.init(); +} + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml new file mode 100644 index 000000000..cb4dd033c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "失物招领管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+ +
+
+  查询 +
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/Index.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js new file mode 100644 index 000000000..a9277eb47 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js @@ -0,0 +1,237 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2017.07.11 + * 描 述:公告通知 + */ +var refreshGirdData; // 更新数据 +var bootstrap = function ($, learun) { + "use strict"; + var processId = ''; + var page = { + init: function () { + page.initGrid(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '添加', + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form', + width: 1000, + height: 650, + maxmin: true, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save('', function () { + page.search(); + }); + } + return res; + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return false; + } + var F_State = $('#gridtable').jfGridValue('F_State'); + if (F_State != "0") { + learun.alert.warning("当前项目已提交不能编辑!"); + return; + } + learun.layerForm({ + id: 'formedit', + title: '编辑', + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form?keyValue=' + keyValue, + width: 1000, + height: 650, + maxmin: true, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录查看!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '查看', + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/FormView?keyValue=' + keyValue, + width: 800, + height: 750, + btn: null + }); + } + }); + + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + + //  发布 + $('#lr-publish').on('click', function () { + var F_State = $('#gridtable').jfGridValue('F_State'); + if (F_State != "0") { + learun.alert.warning("当前项目已提交不能发布!"); + return; + } + + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认发布!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/PublishForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  认领 + $('#lr-claim').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录进行认领!"); + return false; + } + var F_State = $('#gridtable').jfGridValue('F_State'); + if (F_State != "1") { + learun.alert.warning("只有已发布才可以认领!"); + return; + } + learun.layerForm({ + id: 'formedit', + title: '认领', + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/FormClaim?keyValue=' + keyValue, + width: 600, + height: 350, + maxmin: true, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + //  撤下 + $('#lr-cancle').on('click', function () { + //var F_State = $('#gridtable').jfGridValue('F_State'); + //if (F_State != "2") { + // learun.alert.warning("当前项目已认领不能撤下!"); + // return; + //} + var keyValue = $('#gridtable').jfGridValue('F_LId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认撤下!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/CancleForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + + }, + initGrid: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetPageList', + headData: [ + { label: '标题', name: 'F_FullHead', index: 'F_FullHead', width: 600, align: 'left' }, + { label: '发布人员', name: 'F_CreateUserName', index: 'F_CreateUserName', width: 100, align: 'left' }, + { + label: "发布时间", + name: "F_ReleaseTime", + index: "F_ReleaseTime", + width: 140, + align: "left", + formatter: function(cellvalue) { + return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm'); + } + }, + { label: '拾捡人', name: 'F_Picker', index: 'F_Picker', width: 100, align: 'left' }, + { + label: "状态", name: "F_State", index: "F_State", width: 140, align: "left", + formatter: function(cellvalue) { + if (cellvalue == 0) + return "草稿"; + else if (cellvalue == 1) + return "待认领"; + else if (cellvalue == 2) + return "已认领"; + //else if (cellvalue == 3) + // return "已撤下"; + } + }, + //{ label: "创建时间", name: "F_CreateTime", index: "F_CreateDate", width: 130, align: 'left' } + ], + mainId: 'F_LId', + reloadSelected: true, + isMultiselect: true, + isPage: true, + sidx: 'F_CreateTime', + sord: 'desc' + }); + page.search(); + }, + search: function (param) { + $('#gridtable').jfGridSet('reload', param); + } + }; + // 保存数据后回调刷新 + refreshGirdData = function (res, postData) { + //if (res && res.code && res.code == 200) { + // var postData = { + // schemeCode: 'OA_News',// 填写流程对应模板编号 + // processId: processId, + // level: '1', + // }; + // learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + // learun.loading(false); + // }); + //} + page.search(); + } + 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 017efbcf4..3b9125b08 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 @@ -418,6 +418,7 @@ + @@ -1312,6 +1313,10 @@ + + + + @@ -7199,6 +7204,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/LostArticleInfoMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/LostArticleInfoMap.cs new file mode 100644 index 000000000..e6879e5d3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LR_Desktop/LostArticleInfoMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.OA; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-05-20 15:14 + /// 描 述:失物招领 + /// + public class LostArticleInfoMap : EntityTypeConfiguration + { + public LostArticleInfoMap() + { + #region 表、主键 + //表 + this.ToTable("LOSTARTICLEINFO"); + //主键 + this.HasKey(t => t.F_LId); + #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 9da9b62ff..8c750d294 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 @@ -112,6 +112,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 c06232bcd..164545276 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 @@ -132,6 +132,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoBLL.cs new file mode 100644 index 000000000..416b87493 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoBLL.cs @@ -0,0 +1,193 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.OA +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-05-20 15:14 + /// 描 述:失物招领 + /// + public class LostArticleInfoBLL : LostArticleInfoIBLL + { + private LostArticleInfoService lostArticleInfoService = new LostArticleInfoService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return lostArticleInfoService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取LostArticleInfo表实体数据 + /// + /// 主键 + /// + public LostArticleInfoEntity GetLostArticleInfoEntity(string keyValue) + { + try + { + return lostArticleInfoService.GetLostArticleInfoEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + lostArticleInfoService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 发布 + /// + /// 主键 + public void PublishForm(string keyValue) + { + try + { + lostArticleInfoService.PublishForm(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void ClaimForm(string keyValue, LostArticleInfoEntity entity) + { + try + { + lostArticleInfoService.ClaimForm(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 撤下 + /// + /// 主键 + public void CancleForm(string keyValue) + { + try + { + lostArticleInfoService.CancleForm(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, LostArticleInfoEntity entity) + { + try + { + lostArticleInfoService.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.OA/LostArticleInfo/LostArticleInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoEntity.cs new file mode 100644 index 000000000..3df9d54d2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoEntity.cs @@ -0,0 +1,114 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.OA +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-05-20 15:14 + /// 描 述:失物招领 + /// + public class LostArticleInfoEntity + { + #region 实体成员 + /// + /// 主键 + /// + [Column("F_LID")] + public string F_LId { get; set; } + /// + /// 标题 + /// + [Column("F_FULLHEAD")] + public string F_FullHead { get; set; } + /// + /// 图片 + /// + [Column("F_IMAGE")] + public string F_Image { get; set; } + /// + /// 内容 + /// + [Column("F_CONTENT")] + public string F_Content { get; set; } + /// + /// 拾捡人 + /// + [Column("F_PICKER")] + public string F_Picker { get; set; } + /// + /// 发布人员 + /// + [Column("F_CREATEUSERNAME")] + public string F_CreateUserName { get; set; } + /// + /// 发布时间 + /// + [Column("F_RELEASETIME")] + public DateTime? F_ReleaseTime { get; set; } + /// + /// 创建时间 + /// + [Column("F_CREATETIME")] + public DateTime? F_CreateTime { get; set; } + /// + /// 状态 草稿0、待认领1、已认领2 + /// + [Column("F_STATE")] + public int? F_State { get; set; } + /// + /// 认领人 + /// + [Column("F_USER")] + public string F_User { get; set; } + /// + /// 认领时间 + /// + [Column("F_USERTIME")] + public DateTime? F_UserTime { get; set; } + /// + /// 认领照片 + /// + [Column("F_CLAIMIMAGE")] + public string F_ClaimImage { get; set; } + + /// + /// 经手人 + /// + [Column("F_MANAGEUSERNAME")] + public string F_ManageUserName { get; set; } + /// + /// 经手人 + /// + [Column("F_MANAGEUSERID")] + public string F_ManageUserId { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.F_LId = Guid.NewGuid().ToString(); + UserInfo userInfo = LoginUserInfo.Get(); + this.F_CreateUserName = userInfo.realName; + this.F_CreateTime = DateTime.Now; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.F_LId = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoIBLL.cs new file mode 100644 index 000000000..996f60788 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoIBLL.cs @@ -0,0 +1,64 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.OA +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-05-20 15:14 + /// 描 述:失物招领 + /// + public interface LostArticleInfoIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取LostArticleInfo表实体数据 + /// + /// 主键 + /// + LostArticleInfoEntity GetLostArticleInfoEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 发布 + /// + /// + void PublishForm(string keyValue); + /// + /// 认领 + /// + /// + /// + void ClaimForm(string keyValue, LostArticleInfoEntity entity); + /// + /// 撤下 + /// + /// + void CancleForm(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, LostArticleInfoEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoService.cs new file mode 100644 index 000000000..8c0047cfb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoService.cs @@ -0,0 +1,229 @@ +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 +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-05-20 15:14 + /// 描 述:失物招领 + /// + public class LostArticleInfoService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@"t.* + "); + strSql.Append(" FROM LostArticleInfo t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (queryParam.HasValues) + { + if (!queryParam["F_FullHead"].IsEmpty()) + { + dp.Add("F_FullHead", "%" + queryParam["F_FullHead"].ToString() + "%", DbType.String); + strSql.Append(" AND t.F_FullHead like @F_FullHead "); + } + } + + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取LostArticleInfo表实体数据 + /// + /// 主键 + /// + public LostArticleInfoEntity GetLostArticleInfoEntity(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 DeleteEntity(string keyValue) + { + try + { + this.BaseRepository().Delete(t => t.F_LId == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, LostArticleInfoEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository().Update(entity); + } + else + { + entity.Create(); + this.BaseRepository().Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 发布 + /// + /// 主键 + public void PublishForm(string keyValue) + { + try + { + //草稿0、待认领1、已认领2 + string sql = $"update LostArticleInfo set F_State=1 where F_LId='{keyValue}'"; + this.BaseRepository().ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 认领 + /// + /// 主键 + public void ClaimForm(string keyValue, LostArticleInfoEntity entity) + { + try + { + //草稿0、待认领1、已认领2 + UserInfo userInfo = LoginUserInfo.Get(); + string sql = $@"update LostArticleInfo set F_State=2,F_User='{entity.F_User}',F_UserTime='{entity.F_UserTime}',F_ClaimImage='{entity.F_ClaimImage}', + F_ManageUserId='{userInfo.userId}',F_ManageUserName='{userInfo.realName}' where F_LId='{keyValue}'"; + this.BaseRepository().ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 撤下 + /// + /// 主键 + public void CancleForm(string keyValue) + { + try + { + //草稿0、待认领1、已认领2 + string sql = $"update LostArticleInfo set F_State=0 where F_LId='{keyValue}'"; + this.BaseRepository().ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +}