From 473848d8906940a7a97df92120f8d4c028deb381 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Fri, 11 Jun 2021 16:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=97=A5?= =?UTF-8?q?=E7=A8=8B=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0=E6=8F=90=E9=86=92?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LR_OAModule/Views/Schedule/Form.cshtml | 8 ++-- .../Areas/LR_OAModule/Views/Schedule/Form.js | 6 +++ .../Controllers/HomeController.cs | 35 +++++++++++++++ .../Schedule/ScheduleBLL.cs | 24 +++++++++++ .../Schedule/ScheduleIBLL.cs | 6 +++ .../Schedule/ScheduleService.cs | 24 +++++++++++ .../LR_Desktop/MessageRind/MessageRindBLL.cs | 25 +++++++++++ .../LR_Desktop/MessageRind/MessageRindIBLL.cs | 8 ++++ .../MessageRind/MessageRindService.cs | 43 +++++++++++++++++++ 9 files changed, 175 insertions(+), 4 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.cshtml index 6e2d5d0bd..9931cf383 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.cshtml @@ -6,7 +6,7 @@
开始日期*
- +
时间
@@ -65,7 +65,7 @@
结束日期*
- +
时间
@@ -130,7 +130,7 @@
日程内容*
-
+ @*
-
+
*@
@Html.AppendJsFile("/Areas/LR_OAModule/Views/Schedule/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.js index ca3a2f341..50b862941 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/Schedule/Form.js @@ -48,6 +48,12 @@ var bootstrap = function ($, learun) { return false; } var postData = $('#form').lrGetFormData(""); + + var stime = $('#F_StartTime').find('.lr-select-placeholder').html(); + var etime = $('#F_EndTime').find('.lr-select-placeholder').html(); + postData.F_StartDate += (" " + stime); + postData.F_EndDate += (" " + etime); + $.lrSaveForm(top.$.rootUrl + '/LR_OAModule/Schedule/SaveForm?keyValue=' + keyValue, postData, function (res) { learun.frameTab.currentIframe().location.reload(); }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs index 899a6996d..be1c26d1e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/HomeController.cs @@ -17,6 +17,7 @@ using Learun.Application.OA; using Learun.Application.TwoDevelopment.LR_Desktop; using Learun.Application.TwoDevelopment.Permission; using Learun.Application.WorkFlow; +using Learun.Application.OA.Schedule; namespace Learun.Application.Web.Controllers { @@ -58,6 +59,8 @@ namespace Learun.Application.Web.Controllers private Perm_FunctionIBLL perm_FunctionIBLL = new Perm_FunctionBLL(); private ICache redisCache = CacheFactory.CaChe(); private Sys_DefaultPwdConfigIBLL sys_DefaultPwdConfigIBLL = new Sys_DefaultPwdConfigBLL(); + private ScheduleIBLL scheduleIBLL = new ScheduleBLL(); + private MessageRindIBLL messageRindIBLL = new MessageRindBLL(); #region 视图功能 public ActionResult ChangePwd() @@ -506,6 +509,38 @@ namespace Learun.Application.Web.Controllers ViewBag.ACIp = ConfigurationManager.AppSettings["ACIp"] ?? ""; ViewBag.ACIp2 = ConfigurationManager.AppSettings["ACIp2"] ?? ""; + #region 日程提醒 + + //判断今天是否有日程提醒 + var scheduleList = scheduleIBLL.GetListByUserId(userinfo.userId).Where(x => x.F_StartDate <= DateTime.Now && x.F_EndDate >= DateTime.Now); + if (scheduleList.Any()) + { + foreach (var item in scheduleList) + { + //判断该日程今天是否已提醒过 + var st = Convert.ToDateTime(string.Format("{0} {1}", DateTime.Now.ToString("yyyy-MM-dd"), "00:00:00")); + var et = Convert.ToDateTime(string.Format("{0} {1}", DateTime.Now.ToString("yyyy-MM-dd"), "23:59:59")); + var mrlist = messageRindIBLL.GetList("{\"InstanceId\":\"" + item.F_ScheduleId + "\",\"StartTime\":\"" + st + "\",\"EndTime\":\"" + et + "\"}"); + if (!mrlist.Any()) + { + MessageRemindEntity entity = new MessageRemindEntity(); + entity.ReceiptId = item.F_CreateUserId; + entity.ReceiptName = item.F_CreateUserName; + entity.SenderId = item.F_CreateUserId; + entity.SenderName = item.F_CreateUserName; + entity.TheTitle = "日程提醒"; + entity.TheContent = item.F_ScheduleContent; + entity.InstanceId = item.F_ScheduleId; + entity.ConnectionUrl = "/LR_OAModule/Schedule/Index?keyValue="; + entity.SendTime = DateTime.Now; + entity.ReadSigns = false; + messageRindIBLL.SaveEntity("", entity); + } + } + } + #endregion + + switch (learn_UItheme) { case "1": diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleBLL.cs index 4f1bd9db2..98eb6b178 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleBLL.cs @@ -89,6 +89,30 @@ namespace Learun.Application.OA.Schedule } } } + + /// + /// 获取列表 + /// + /// 返回列表 + public IEnumerable GetListByUserId(string userId) + { + try + { + return scheduleService.GetListByUserId(userId); + } + 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/Schedule/ScheduleIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleIBLL.cs index cc62c0b2b..6d353e469 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleIBLL.cs @@ -37,6 +37,12 @@ namespace Learun.Application.OA.Schedule /// 主键值 /// ScheduleEntity GetEntity(string keyValue); + + /// + /// 获取列表 + /// + /// 返回列表 + IEnumerable GetListByUserId(string userId); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleService.cs index f074c3fab..c973c53a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/Schedule/ScheduleService.cs @@ -94,6 +94,30 @@ namespace Learun.Application.OA.Schedule throw ExceptionEx.ThrowServiceException(ex); } } + + /// + /// 获取列表 + /// + /// 返回列表 + public IEnumerable GetListByUserId(string userId) + { + try + { + return this.BaseRepository().FindList(x => x.F_CreateUserId == userId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs index 0b332ac33..9f0365092 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindBLL.cs @@ -43,6 +43,31 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + return messageRindService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 未读消息 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs index ea552d6ee..22a8dff82 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindIBLL.cs @@ -21,6 +21,14 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + IEnumerable GetList(string queryJson); /// /// 获取未读的消息 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs index 715365de6..2922294d7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/MessageRind/MessageRindService.cs @@ -68,6 +68,49 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.* "); + strSql.Append(" FROM MessageRemind t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.SendTime >= @startTime AND t.SendTime <= @endTime ) "); + } + if (!queryParam["InstanceId"].IsEmpty()) + { + dp.Add("InstanceId", queryParam["InstanceId"].ToString(), DbType.String); + strSql.Append(" AND t.InstanceId = @InstanceId "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取MessageRemind表未读的消息 ///