From 01bfa866bd34523fa5f56c6733acd638aca3ad4d Mon Sep 17 00:00:00 2001
From: dyy <18335927079@163.com>
Date: Wed, 26 May 2021 18:05:43 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E6=99=AE?=
=?UTF-8?q?=E9=80=9A=E6=95=99=E5=B8=88=E8=AF=B7=E5=81=87=E5=BD=92=E6=A1=A3?=
=?UTF-8?q?=E6=8F=90=E9=86=92=EF=BC=9B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/NWFProcessController.cs | 13 +++
.../Views/NWFProcess/LeaveFiling.cshtml | 1 +
.../Views/NWFProcess/LeaveFiling.js | 27 ++++++
.../Controllers/HomeController.cs | 7 +-
.../Views/Home/AdminDefault.cshtml | 7 +-
.../Views/Home/AdminDefault/index.css | 10 ++
.../Views/Home/AdminDefault/index.js | 11 +++
.../StudentLeave/StudentLeaveBLL.cs | 47 ++++++++++
.../StudentLeave/StudentLeaveEntity.cs | 6 ++
.../StudentLeave/StudentLeaveIBLL.cs | 14 +++
.../StudentLeave/StudentLeaveService.cs | 91 +++++++++++++++++++
11 files changed, 230 insertions(+), 4 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs
index 4c9bf0269..cbab26515 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Controllers/NWFProcessController.cs
@@ -472,6 +472,19 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers
nWFProcessIBLL.DeleteEntity(processId);
return Success("删除成功");
}
+
+ ///
+ /// 普通教师请假归档
+ ///
+ /// 请假主键
+ [HttpPost]
+ [AjaxOnly]
+ public ActionResult DoFileStudentLeave(string keyValue)
+ {
+ studentLeaveIBLL.DoFile(keyValue);
+ return Success("归档成功");
+ }
+
#endregion
#region 流程API
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.cshtml
index 9a597d6e7..55247f96c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.cshtml
@@ -40,6 +40,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.js
index 05ce66076..299facf84 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_NewWorkFlow/Views/NWFProcess/LeaveFiling.js
@@ -65,6 +65,24 @@ var bootstrap = function ($, learun) {
$('#lr_eye').on('click', function () {
page.eye();
});
+ // 归档
+ $('#lr_file').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('SLId');
+ if (learun.checkrow(keyValue)) {
+ var FileStatus = $('#gridtable').jfGridValue('FileStatus');
+ if (FileStatus == 1) {
+ learun.alert.warning("当前项已归档!");
+ return false;
+ }
+ learun.layerConfirm('是否确认归档该项!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/DoFileStudentLeave', { keyValue: keyValue }, function () {
+ page.search();
+ });
+ }
+ });
+ }
+ });
},
initleft: function () {
$('#lr_left_list li').on('click', function () {
@@ -158,6 +176,15 @@ var bootstrap = function ($, learun) {
}
},
{ label: '请假事由', name: 'F_Description', width: 80, align: "left" },
+ {
+ label: '归档状态', name: 'FileStatus', width: 80, align: "left", formatter: function (cellvalue) {
+ if (cellvalue == 1) {
+ return "已归档";
+ } else {
+ return "未归档";
+ }
+ }
+ },
],
mainId: 'SLId',
isPage: true,
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 f63d75211..9d6a082a7 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.TwoDevelopment.LR_LGManager;
namespace Learun.Application.Web.Controllers
{
@@ -58,6 +59,7 @@ 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 StudentLeaveIBLL studentLeaveIBLL = new StudentLeaveBLL();
#region 视图功能
public ActionResult ChangePwd()
@@ -489,8 +491,11 @@ namespace Learun.Application.Web.Controllers
ViewBag.UnreadNews = outnewslist.Count(m => !readnewslist.Contains(m.F_NewsId));
paginationobj.sidx = "SendTime";
ViewBag.UnreadFile = sys_ReceiveFileIBLL.GetPageListBySenderId(userinfo.userId).Count();
+ //普通教师请假-未归档数
+ ViewBag.UnfileLeave = studentLeaveIBLL.GetListWithProcess("{\"F_IsFinished\":\"1\",\"F_CreateUserName\":\"" + userinfo.userId + "\"}").Where(x => x.FileStatus != "1").Count();
- ViewBag.UnreadNum = ViewBag.UnreadFile + ViewBag.UnreadNews + ViewBag.UnreadTask + ViewBag.UnreadMail;
+
+ ViewBag.UnreadNum = ViewBag.UnreadFile + ViewBag.UnreadNews + ViewBag.UnreadTask + ViewBag.UnreadMail + ViewBag.UnfileLeave;
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml
index d1ad3225c..b60bf188e 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault.cshtml
@@ -30,7 +30,7 @@
*@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.css b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.css
index dcdd273ec..83848ac2f 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.css
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.css
@@ -845,3 +845,13 @@
cursor: pointer;
z-index: 51;
}
+
+.lr-im-bell2 .point {
+ background: #D71012;
+ position: absolute;
+ right: 9px;
+ top: 6px;
+ width: 8px;
+ height: 8px;
+ border-radius: 50%
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js
index 715b439e8..94f094101 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Home/AdminDefault/index.js
@@ -636,6 +636,17 @@ var bootstrap = function ($, learun) {
});
});
+ //教师请假归档
+ $("#btn_studentleave").on('click',
+ function () {
+ learun.frameTab.open({
+ F_ModuleId: '105',
+ F_Icon: 'fa fa-user',
+ F_FullName: '普通教师请假归档',
+ F_UrlAddress: '/LR_NewWorkFlow/NWFProcess/LeaveFiling'
+ });
+ });
+
// 打开关闭聊天窗
$('.lr-im-bell').off('click').on('click', function () {
var $this = $(this);
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs
index 9866ed17d..90e88b3af 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveBLL.cs
@@ -67,6 +67,31 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
}
}
+ ///
+ /// 获取列表分页数据
+ ///
+ /// 分页参数
+ /// 条件参数
+ ///
+ public IEnumerable GetListWithProcess(string queryJson)
+ {
+ try
+ {
+ return studentLeaveService.GetListWithProcess(queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
///
/// 获取实体数据
///
@@ -142,6 +167,28 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
}
}
+ ///
+ /// 归档
+ ///
+ /// 主键
+ public void DoFile(string keyValue)
+ {
+ try
+ {
+ studentLeaveService.DoFile(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveEntity.cs
index bfb815e5e..b3d8a2b69 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveEntity.cs
@@ -104,6 +104,12 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
///
[Column("LEAVEDAY")]
public string LeaveDay { get; set; }
+ ///
+ /// 归档状态(1已归档)
+ ///
+ ///
+ [Column("FILESTATUS")]
+ public string FileStatus { get; set; }
#endregion
#region 扩展操作
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs
index 9d2e75337..ef7a729b5 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveIBLL.cs
@@ -28,6 +28,14 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
/// 查询参数
///
IEnumerable GetPageList(Pagination pagination, string queryJson);
+
+ ///
+ /// 获取列表分页数据
+ ///
+ /// 分页参数
+ /// 条件参数
+ ///
+ IEnumerable GetListWithProcess(string queryJson);
///
/// 获取实体数据
///
@@ -49,6 +57,12 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
/// 主键
/// 实体
void SaveEntity(string keyValue, StudentLeaveEntity entity);
+
+ ///
+ /// 归档
+ ///
+ /// 主键
+ void DoFile(string keyValue);
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs
index a2af86a29..4dcc3425d 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_LGManager/StudentLeave/StudentLeaveService.cs
@@ -148,6 +148,74 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
}
}
+ ///
+ /// 获取列表分页数据
+ ///
+ /// 分页参数
+ /// 条件参数
+ ///
+ public IEnumerable GetListWithProcess(string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT t.* ");
+ strSql.Append(" FROM StudentLeave t left join LR_NWF_Process p on t.SLId=p.F_Id where p.F_EnabledMark!=2 and p.F_IsChild=0 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["F_IsFinished"].IsEmpty())
+ {
+ dp.Add("F_IsFinished", queryParam["F_IsFinished"].ToString(), DbType.String);
+ strSql.Append(" and p.F_IsFinished=@F_IsFinished ");
+ }
+ 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.F_CreateDate >= @startTime AND t.F_CreateDate <= @endTime ) ");
+ }
+ if (!queryParam["F_CreateUserName"].IsEmpty())
+ {
+ var arr = queryParam["F_CreateUserName"].ToString().Split(',');
+ var arrtemp = "";
+ foreach (var item in arr)
+ {
+ arrtemp += $"'{item}',";
+ }
+ arrtemp = arrtemp.TrimEnd(',');
+ strSql.Append($" and t.F_CreateUserName in ({arrtemp}) ");
+ }
+ if (!queryParam["F_BuMen"].IsEmpty())
+ {
+ dp.Add("F_BuMen", queryParam["F_BuMen"].ToString(), DbType.String);
+ strSql.Append(" and t.F_BuMen=@F_BuMen ");
+ }
+ if (!queryParam["F_QJType"].IsEmpty())
+ {
+ dp.Add("F_QJType", queryParam["F_QJType"].ToString(), DbType.String);
+ strSql.Append(" and t.F_QJType=@F_QJType ");
+ }
+ if (!queryParam["F_Description"].IsEmpty())
+ {
+ dp.Add("F_Description", "%" + queryParam["F_Description"].ToString() + "%", DbType.String);
+ strSql.Append(" and t.F_Description like @F_Description ");
+ }
+ return this.BaseRepository().FindList(strSql.ToString(), dp);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
///
/// 获取实体数据
///
@@ -232,6 +300,29 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager
}
}
+ ///
+ /// 归档
+ ///
+ /// 主键
+ public void DoFile(string keyValue)
+ {
+ try
+ {
+ this.BaseRepository().ExecuteBySql("update StudentLeave set FileStatus='1' where SLId='" + keyValue + "' ");
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
#endregion
}