From fde18615b54d365aec127b30bc3fa851a92779b9 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 20 May 2021 18:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=B1=E7=89=A9=E6=8B=9B=E9=A2=86=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=96=B0=E5=BB=BA=E8=A1=A8=EF=BC=8C=E5=8A=A0=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E3=80=81=E8=AE=A4=E9=A2=86=E3=80=81=E6=92=A4=E4=B8=8B?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E3=80=82=E9=A6=96=E9=A1=B5=E5=A4=B1=E7=89=A9?= =?UTF-8?q?=E6=8B=9B=E9=A2=86=E6=96=B0=E5=BB=BA=E6=9F=A5=E7=9C=8B=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/LostArticleInfoController.cs | 178 ++++++++++++++ .../Controllers/NoticeController.cs | 34 --- .../Views/LostArticleInfo/Form.cshtml | 25 ++ .../Form.js} | 18 +- .../Views/LostArticleInfo/FormClaim.cshtml | 22 ++ .../Views/LostArticleInfo/FormClaim.js | 143 +++++++++++ .../Views/LostArticleInfo/FormView.cshtml | 41 ++++ .../Views/LostArticleInfo/FormView.js | 55 +++++ .../Index.cshtml} | 9 +- .../Index.js} | 115 +++++++-- .../Views/Notice/FormLostArticle.cshtml | 50 ---- .../Views/Notice/FormLostArticleView.cshtml | 50 ---- .../Views/Notice/FormLostArticleView.js | 123 ---------- .../Controllers/UtilityController.cs | 9 + .../Learun.Application.Web.csproj | 17 +- .../Views/Home/AdminDesktop/Index.js | 17 +- .../Views/Utility/ListContentIndexLost.cshtml | 49 ++++ .../Views/Utility/ListContentIndexLost.js | 59 +++++ .../LR_Desktop/LostArticleInfoMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 1 + .../Learun.Application.OA.csproj | 4 + .../LostArticleInfo/LostArticleInfoBLL.cs | 193 +++++++++++++++ .../LostArticleInfo/LostArticleInfoEntity.cs | 109 +++++++++ .../LostArticleInfo/LostArticleInfoIBLL.cs | 64 +++++ .../LostArticleInfo/LostArticleInfoService.cs | 229 ++++++++++++++++++ .../Learun.Application.OA/Notice/NoticeBLL.cs | 44 ---- .../Notice/NoticeIBLL.cs | 14 -- .../Notice/NoticeService.cs | 70 +----- 28 files changed, 1348 insertions(+), 423 deletions(-) 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 rename Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/{Notice/FormLostArticle.js => LostArticleInfo/Form.js} (84%) 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 rename Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/{Notice/IndexLostArticle.cshtml => LostArticleInfo/Index.cshtml} (74%) rename Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/{Notice/IndexLostArticle.js => LostArticleInfo/Index.js} (50%) delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.cshtml delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.cshtml delete mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.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/Controllers/NoticeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs index b8ae187c2..08c14f80d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/NoticeController.cs @@ -177,26 +177,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers return JsonResult(jsonData); } - /// - /// 获取失物招领分页数据 - /// - /// 分页参数 - /// 关键词 - /// - public ActionResult GetPageListForLostArticle(string pagination, string keyword) - { - Pagination paginationobj = pagination.ToObject(); - var data = noticeIBLL.GetPageListForLostArticle(paginationobj, keyword); - var jsonData = new - { - rows = data, - total = paginationobj.total, - page = paginationobj.page, - records = paginationobj.records, - }; - return JsonResult(jsonData); - } - /// /// 查看通知公告 /// @@ -470,20 +450,6 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers } } - /// - /// 保存表单数据 - /// - /// 主键 - /// 实体 - /// - [HttpPost, ValidateAntiForgeryToken, AjaxOnly] - public ActionResult SaveFormForLostArticle(string keyValue, NewsEntity entity) - { - entity.F_NewsContent = WebHelper.HtmlEncode(entity.F_NewsContent); - noticeIBLL.SaveFormForLostArticle(keyValue, entity); - return Success("保存成功!"); - } - /// /// 删除表单数据 /// 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..b3c54da1c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.cshtml @@ -0,0 +1,25 @@ +@{ + 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/Notice/FormLostArticle.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js similarity index 84% rename from Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.js rename to Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js index 4ec20106a..c86445036 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Form.js @@ -27,7 +27,7 @@ var bootstrap = function ($, learun) { bind: function () { //var loginInfo = top.learun.clientdata.get(['userinfo']); - $('#F_NewsImage').lrUploader(); + $('#F_Image').lrUploader(); //内容编辑器 ue = UE.getEditor('editor'); @@ -36,10 +36,12 @@ var bootstrap = function ($, learun) { if (!!keyValue) { //$('#form').lrSetFormData(selectedRow); //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); - $.lrSetForm(top.$.rootUrl + '/LR_OAModule/Notice/GetEntity?keyValue=' + keyValue, function (data) { + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + keyValue, function (data) { $('#form').lrSetFormData(data); setTimeout(function () { - ue.setContent(decodeURI(data.F_NewsContent)); + if (data.F_Content) { + ue.setContent(decodeURI(data.F_Content)); + }; }, 100); }); } @@ -77,9 +79,8 @@ var bootstrap = function ($, learun) { return false; } var postData = $('#form').lrGetFormData(keyValue); - postData["F_NewsContent"] = encodeURI(ue.getContent(null, null, true)); - console.log("1111111111111"); - $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormForLostArticle?keyValue=' + keyValue, postData, function (res) { + postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); @@ -117,9 +118,8 @@ var bootstrap = function ($, learun) { return false; } var postData = $('#form').lrGetFormData(keyValue); - postData["F_NewsContent"] = encodeURI(ue.getContent(null, null, true)); - console.log("2222222222"); - $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormForLostArticle?keyValue=' + keyValue, postData, function (res) { + postData["F_Content"] = encodeURI(ue.getContent(null, null, true)); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); 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..41143dabb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/FormView.cshtml @@ -0,0 +1,41 @@ +@{ + 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/Notice/IndexLostArticle.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml similarity index 74% rename from Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexLostArticle.cshtml rename to Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml index fd09b0b36..cb4dd033c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexLostArticle.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.cshtml @@ -20,15 +20,20 @@ +
-@Html.AppendJsFile("/Areas/LR_OAModule/Views/Notice/IndexLostArticle.js") +@Html.AppendJsFile("/Areas/LR_OAModule/Views/LostArticleInfo/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexLostArticle.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js similarity index 50% rename from Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexLostArticle.js rename to Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js index 419c8447a..f9ae6c191 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/IndexLostArticle.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/LostArticleInfo/Index.js @@ -29,7 +29,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'form', title: '添加公告', - url: top.$.rootUrl + '/LR_OAModule/Notice/FormLostArticle', + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form', width: 1000, height: 650, maxmin: true, @@ -49,21 +49,21 @@ var bootstrap = function ($, learun) { }); // 编辑 $('#lr_edit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('F_NewsId'); + var keyValue = $('#gridtable').jfGridValue('F_LId'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(",") != -1) { learun.alert.warning("只能选择一条记录进行编辑!"); return false; } - var SendFlag = $('#gridtable').jfGridValue('F_Status'); - if (SendFlag == "1" || SendFlag == "2") { + 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/Notice/FormLostArticle?keyValue=' + keyValue, + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/Form?keyValue=' + keyValue, width: 1000, height: 650, maxmin: true, @@ -75,7 +75,7 @@ var bootstrap = function ($, learun) { }); // 查看 $('#lr_view').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('F_NewsId'); + var keyValue = $('#gridtable').jfGridValue('F_LId'); if (learun.checkrow(keyValue)) { if (keyValue.indexOf(",") != -1) { learun.alert.warning("只能选择一条记录查看!"); @@ -84,9 +84,9 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'form', title: '查看', - url: top.$.rootUrl + '/LR_OAModule/Notice/FormLostArticleView?keyValue=' + keyValue, + url: top.$.rootUrl + '/LR_OAModule/LostArticleInfo/FormView?keyValue=' + keyValue, width: 800, - height: 650, + height: 750, btn: null }); } @@ -94,11 +94,11 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('F_NewsId'); + var keyValue = $('#gridtable').jfGridValue('F_LId'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/LR_OAModule/Notice/DeleteForm', { keyValue: keyValue }, function () { + learun.deleteForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -106,29 +106,106 @@ var bootstrap = function ($, learun) { } }); - + + //  发布 + $('#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/Notice/GetPageListForLostArticle', + 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) { + 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_CreateDate", index: "F_CreateDate", width: 130, 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 == 3) + return "已撤下"; + } + }, + //{ label: "创建时间", name: "F_CreateTime", index: "F_CreateDate", width: 130, align: 'left' } ], - mainId: 'F_NewsId', + mainId: 'F_LId', reloadSelected: true, isMultiselect: true, isPage: true, - sidx: 'F_CreateDate', + sidx: 'F_CreateTime', sord: 'desc' }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.cshtml deleted file mode 100644 index bef854362..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticle.cshtml +++ /dev/null @@ -1,50 +0,0 @@ -@{ - ViewBag.Title = "发布失物招领"; - Layout = "~/Views/Shared/_Form.cshtml"; -} - -
-
-
公告标题*
- -
- @*
-
公告类别*
-
- -
*@ -
-
发布时间*
- -
- @*
-
信息来源*
- -
-
-
来源地址
- -
-
-
接收部门
-
-
-
-
接收岗位
-
-
-
-
下发飞星
-
-
*@ -
-
标题图片
-
-
-
-
公告内容
-
-
-
- -@Html.AppendJsFile("/Areas/LR_OAModule/Views/Notice/FormLostArticle.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.cshtml deleted file mode 100644 index 078b9233b..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.cshtml +++ /dev/null @@ -1,50 +0,0 @@ -@{ - ViewBag.Title = "发布失物招领"; - Layout = "~/Views/Shared/_Form.cshtml"; -} - -
-
-
公告标题*
- -
- @*
-
公告类别*
-
- -
*@ -
-
发布时间*
- -
- @*
-
信息来源*
- -
-
-
来源地址
- -
-
-
接收部门
-
-
-
-
接收岗位
-
-
-
-
下发飞星
-
-
*@ -
-
标题图片
-
-
-
-
公告内容
-
-
-
- -@Html.AppendJsFile("/Areas/LR_OAModule/Views/Notice/FormLostArticleView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.js deleted file mode 100644 index 8abeb4e10..000000000 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Notice/FormLostArticleView.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 版 本 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_NewsImage').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/Notice/GetEntity?keyValue=' + keyValue, function (data) { - $('#form').lrSetFormData(data); - setTimeout(function () { - ue.setContent(decodeURI(data.F_NewsContent)); - }, 100); - }); - } - } - }; - - //// 验证数据是否填写完整 - //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_NewsContent"] = ue.getContent(null, null, true); - // $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormForLostArticle?keyValue=' + keyValue, postData, function (res) { - // // 保存成功后才回调 - // if (!!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_NewsContent"] = ue.getContent(null, null, true); - // $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Notice/SaveFormForLostArticle?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/Controllers/UtilityController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UtilityController.cs index 6151dc105..c46d958fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UtilityController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/UtilityController.cs @@ -595,6 +595,15 @@ namespace Learun.Application.Web.Controllers { return View(); } + /// + /// 失物招领 + /// + /// + [HttpGet] + public ActionResult ListContentIndexLost() + { + return View(); + } #endregion #region 开发向导 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 ac4aa7161..95bb11f1c 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 @@ -416,6 +416,7 @@ + @@ -1305,11 +1306,12 @@ - - + + + + - @@ -5128,6 +5130,7 @@ + @@ -7175,9 +7178,6 @@ - - - @@ -7185,6 +7185,10 @@ + + + + @@ -7267,6 +7271,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js index b3dd24b04..613a60191 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDesktop/Index.js @@ -114,13 +114,15 @@ $(function () { var n = $(this).parents(".col-xs-6"); var o = n.attr("data-Id"); var p = $(this)[0].item; + if (d[o].F_ItemUrl) { top.learun.frameTab.open({ F_ModuleId: "dtlist" + p.f_id, F_FullName: p.f_title, F_UrlAddress: d[o].F_ItemUrl + p.f_id - }) - } else { + }); + } + else { //判断点击项是否为‘待办’的子项 if (d[o].F_Id == "33d50f1a-a64d-4b86-a6d4-2d937226de95") { if (p.f_tasktype != 2) { @@ -134,11 +136,20 @@ $(function () { } } else { top["dtlist" + p.f_id] = p; + if (p.islost) { + top.learun.frameTab.open({ + F_ModuleId: "dtlist" + p.f_id, + F_FullName: p.f_title, + F_UrlAddress: "/Utility/ListContentIndexLost?id=" + p.f_id + }); + } else { top.learun.frameTab.open({ F_ModuleId: "dtlist" + p.f_id, F_FullName: p.f_title, F_UrlAddress: "/Utility/ListContentIndex?id=" + p.f_id - }) + }) + } + } } return false diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.cshtml new file mode 100644 index 000000000..9ac9a2775 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.cshtml @@ -0,0 +1,49 @@ + +@{ + ViewBag.Title = "ListContentIndex"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + + + + + + +
+ +
+
+
+
+ 发布时间: + 信息来源: + 公告类别: +
+
+ +
+
+
+
+
+
+ +
已读人员
+
    + @*
  • + 一个的 + 2018-09-02 +
  • *@ +
+
+
+ +
+ + + +@Html.AppendJsFile("/Views/Utility/ListContentIndexLost.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.js new file mode 100644 index 000000000..d0646bc32 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Utility/ListContentIndexLost.js @@ -0,0 +1,59 @@ +/* + * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:陈彬彬 + * 日 期:2018.04.28 + * 描 述:桌面消息查看 + */ +var id = request('id'); +var bootstrap = function ($, learun) { + "use strict"; + + var page = { + init: function () { + $('#F_NewsImage').lrUploader({ isUpload: false, isView:false}); + $('.warpper').lrscroll(); + var item = top['dtlist' + id]; + if(false){// (!!item) { + $("#F_FullHead").text(item.f_title); + $("#F_CreateDate").text(item.f_createdate); + $("#F_CreateUserName").text(item.f_createusername); + $("#F_Category").text(item.f_category); + $("#F_NewsContent").html($('
').html(item.f_content).text()); + } else { + $.lrSetForm(top.$.rootUrl + '/LR_OAModule/LostArticleInfo/GetEntity?keyValue=' + id, function (data) { + data.F_NewsContent = decodeURI(data.F_Content); + $('.inSec1T').attr("hidden", "hidden"); + $('#readlist').attr("hidden", "hidden"); + $('#msgSource').attr("hidden", "hidden"); + $('#newType').attr("hidden", "hidden"); + + $("#F_FullHead").text(data.F_FullHead); + $("#F_CreateDate").text(data.F_CreateTime); + $("#F_CreateUserName").text(data.F_CreateUserName == null ? "" : data.F_CreateUserName); + $("#F_Category").text('失物招领'); + $("#F_NewsContent").html($('
').html(data.F_NewsContent)); + $('#F_NewsImage').lrUploaderSet(data.F_Image); + }); + } + //阅读 + learun.httpAsyncPost(top.$.rootUrl + "/LR_Desktop/LR_OA_NewsRead/NewsRead", { newsId: id }, function (res) { + + }); + //阅读者列表 + learun.httpAsyncGet(top.$.rootUrl + "/LR_Desktop/LR_OA_NewsRead/GetNewsReadList?newsId=" + id, function (res) { + if (res.code == 200) { + var html = ''; + for (var i = 0; i < res.data.rows.length; i++) { + var item = res.data.rows[i]; + html += '
  • ' + item.RUserName + '' + item.RTime + '
  • '; + } + $('#readlist').html(html); + } + }); + + + } + }; + page.init(); +} \ No newline at end of file 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 e85fe4839..7cd2ac170 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 @@ -559,6 +559,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..805e0e776 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/LostArticleInfo/LostArticleInfoEntity.cs @@ -0,0 +1,109 @@ +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_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、撤下3 + /// + [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..2d254a8b4 --- /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、撤下3 + 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、撤下3 + UserInfo userInfo = LoginUserInfo.Get(); + string sql = $@"update LostArticleInfo set F_State=3,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、撤下3 + string sql = $"update LostArticleInfo set F_State=3 where F_LId='{keyValue}'"; + this.BaseRepository().ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs index 9fa00e02c..0524d769f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeBLL.cs @@ -60,24 +60,6 @@ namespace Learun.Application.OA } } - public IEnumerable GetPageListForLostArticle(Pagination pagination, string keyword) - { - try - { - return noticeService.GetPageListForLostArticle(pagination, keyword); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } /// /// 公告实体 /// @@ -170,32 +152,6 @@ namespace Learun.Application.OA } } - - /// - /// 保存(新增、修改)失物招领 - /// - /// 主键值 - /// 公告实体 - /// - public void SaveFormForLostArticle(string keyValue, NewsEntity newsEntity) - { - try - { - noticeService.SaveFormForLostArticle(keyValue, newsEntity); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - - } #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs index 6de95c443..01c6de29f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeIBLL.cs @@ -22,13 +22,6 @@ namespace Learun.Application.OA IEnumerable GetPageList(Pagination pagination, string keyword); IEnumerable GetPageListRevert(Pagination pagination, string keyword); /// - /// 获取失物招领分页数据 - /// - /// - /// - /// - IEnumerable GetPageListForLostArticle(Pagination pagination, string keyword); - /// /// 公告实体 /// /// 主键值 @@ -49,13 +42,6 @@ namespace Learun.Application.OA /// 公告实体 /// void SaveEntity(string keyValue, NewsEntity newsEntity); - - /// - /// 保存失物招领信息 - /// - /// - /// - void SaveFormForLostArticle(string keyValue, NewsEntity newsEntity); #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs index c135fbc1e..127c06df0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Notice/NoticeService.cs @@ -71,37 +71,6 @@ namespace Learun.Application.OA } } - /// - /// 失物招领分页列表 - /// - /// 分页参数 - /// 关键词 - /// - public IEnumerable GetPageListForLostArticle(Pagination pagination, string keyword) - { - try - { - var strSql = new StringBuilder(); - strSql.Append("SELECT * FROM LR_OA_News t WHERE t.F_TypeId = 3 and F_CategoryId=99 "); - if (!string.IsNullOrEmpty(keyword)) - { - strSql.Append(" AND F_FullHead like @keyword"); - } - return this.BaseRepository().FindList(strSql.ToString(), new { keyword = "%" + keyword + "%" }, pagination); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - } - /// /// 新闻公告实体 /// @@ -228,44 +197,7 @@ namespace Learun.Application.OA } } - - /// - /// 保存(新增、修改)失物招领 - /// - /// 主键值 - /// 新闻公告实体 - /// - public void SaveFormForLostArticle(string keyValue, NewsEntity newsEntity) - { - try - { - newsEntity.F_TypeId = 3; - newsEntity.F_CategoryId = "99"; - newsEntity.F_Category = "失物招领"; - if (!string.IsNullOrEmpty(keyValue)) - { - newsEntity.Modify(keyValue); - this.BaseRepository().Update(newsEntity); - } - else - { - newsEntity.Create(); - this.BaseRepository().Insert(newsEntity); - } - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowServiceException(ex); - } - } - - } + #endregion #region 扩展数据