@@ -472,6 +472,19 @@ namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers | |||
nWFProcessIBLL.DeleteEntity(processId); | |||
return Success("删除成功"); | |||
} | |||
/// <summary> | |||
/// 普通教师请假归档 | |||
/// </summary> | |||
/// <param name="keyValue">请假主键</param> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DoFileStudentLeave(string keyValue) | |||
{ | |||
studentLeaveIBLL.DoFile(keyValue); | |||
return Success("归档成功"); | |||
} | |||
#endregion | |||
#region 流程API | |||
@@ -40,6 +40,7 @@ | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_eye" class="btn btn-default"><i class="fa fa-eye"></i> <span class="lrlg">查看</span></a> | |||
<a id="lr_file" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlg">归档</span></a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -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 "<span class=\"label label-success\">已归档</span>"; | |||
} else { | |||
return "<span class=\"label label-warning\">未归档</span>"; | |||
} | |||
} | |||
}, | |||
], | |||
mainId: 'SLId', | |||
isPage: true, | |||
@@ -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 | |||
@@ -30,7 +30,7 @@ | |||
</ul></div>*@ | |||
<div class="lr-im-bell2" title="消息中心2"> | |||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"> | |||
<span class="point" style="display:none;"></span> | |||
<span class="point" @(ViewBag.UnreadNum <= 0 ? "style=display:none;" : "")></span> | |||
<i style="font-size: 20px" class="fa fa-bell"></i> | |||
</a> | |||
<ul class="dropdown-menu pull-right"> | |||
@@ -39,8 +39,9 @@ | |||
<li><a href="javascript:void(0);" id="btn_tonggao"><i class="fa fa-paper-plane"></i>通告 @ViewBag.UnreadNews 条</a></li> | |||
<li><a href="javascript:void(0);" id="btn_gongwen"><i class="fa fa-tag"></i>公文 @ViewBag.UnreadFile 条</a></li> | |||
@*<li><a href="javascript:void(0);" id="btn_gongwen1"><i class="fa fa-quora"></i>未完成作业 2 条</a></li> | |||
<li><a href="javascript:void(0);" id="btn_gongwen2"><i class="fa fa-anchor"></i>未批改作业 1 条</a></li> | |||
<li><a href="javascript:void(0);" id="btn_gongwen3"><i class="fa fa-balance-scale"></i>备课任务 0 条</a></li>*@ | |||
<li><a href="javascript:void(0);" id="btn_gongwen2"><i class="fa fa-anchor"></i>未批改作业 1 条</a></li> | |||
<li><a href="javascript:void(0);" id="btn_gongwen3"><i class="fa fa-balance-scale"></i>备课任务 0 条</a></li>*@ | |||
<li><a href="javascript:void(0);" id="btn_studentleave"><i class="fa fa-tag"></i>教师请假归档 @ViewBag.UnfileLeave 条</a></li> | |||
<li> 共 @ViewBag.UnreadNum 条</li> | |||
</ul> | |||
</div> | |||
@@ -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% | |||
} |
@@ -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); | |||
@@ -67,6 +67,31 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StudentLeaveEntity> GetListWithProcess(string queryJson) | |||
{ | |||
try | |||
{ | |||
return studentLeaveService.GetListWithProcess(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
@@ -142,6 +167,28 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
} | |||
} | |||
/// <summary> | |||
/// 归档 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DoFile(string keyValue) | |||
{ | |||
try | |||
{ | |||
studentLeaveService.DoFile(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -104,6 +104,12 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
/// <returns></returns> | |||
[Column("LEAVEDAY")] | |||
public string LeaveDay { get; set; } | |||
/// <summary> | |||
/// 归档状态(1已归档) | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("FILESTATUS")] | |||
public string FileStatus { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -28,6 +28,14 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<StudentLeaveEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
IEnumerable<StudentLeaveEntity> GetListWithProcess(string queryJson); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
@@ -49,6 +57,12 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, StudentLeaveEntity entity); | |||
/// <summary> | |||
/// 归档 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DoFile(string keyValue); | |||
#endregion | |||
} | |||
@@ -148,6 +148,74 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表分页数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">条件参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StudentLeaveEntity> 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<StudentLeaveEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
@@ -232,6 +300,29 @@ namespace Learun.Application.TwoDevelopment.LR_LGManager | |||
} | |||
} | |||
/// <summary> | |||
/// 归档 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
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 | |||
} | |||