@@ -0,0 +1,176 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System; | |||
using System.Linq; | |||
namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public class StuLeaveManagementController : MvcControllerBase | |||
{ | |||
private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 主页面【学工信息管理】 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult CheckIndex() | |||
{ | |||
ViewBag.IsDeptDirector = false; //登录用户是否是系主任标识 | |||
var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); | |||
var loginInfoRoleIds = LoginUserInfo.Get().roleIds; | |||
if (loginInfoRoleIds.IndexOf(',') == -1) | |||
{ | |||
if (loginInfoRoleIds == deptDirectorRoleId) | |||
{ | |||
ViewBag.IsDeptDirector = true; | |||
} | |||
} | |||
else | |||
{ | |||
if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) | |||
{ | |||
ViewBag.IsDeptDirector = true; | |||
} | |||
} | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页【学工信息管理】 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult CheckForm() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = stuLeaveManagementIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var StuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
StuLeaveManagement = StuLeaveManagementData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
stuLeaveManagementIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
var loginInfo = LoginUserInfo.Get(); | |||
StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>(); | |||
entity.CreateUserId = loginInfo.userId; | |||
entity.CreateUserNo = loginInfo.account; | |||
entity.CreateTime = DateTime.Now; | |||
stuLeaveManagementIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveCheckForm(string keyValue, string strEntity) | |||
{ | |||
var loginInfo = LoginUserInfo.Get(); | |||
StuLeaveManagementEntity entity = strEntity.ToObject<StuLeaveManagementEntity>(); | |||
entity.CheckUserId = loginInfo.userId; | |||
entity.CheckUserNo = loginInfo.account; | |||
entity.CheckTime = DateTime.Now; | |||
stuLeaveManagementIBLL.SaveEntity(keyValue, entity); | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,35 @@ | |||
@{ | |||
ViewBag.Title = "学生请假管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假类型<font face="宋体">*</font></div> | |||
<div id="LeaveType" readonly isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">开始时间<font face="宋体">*</font></div> | |||
<input id="StartTime" readonly type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">结束时间<font face="宋体">*</font></div> | |||
<input id="EndTime" readonly type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | |||
<input id="LeaveDay" readonly type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假事由</div> | |||
<textarea id="LeaveReason" readonly class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">审核状态<font face="宋体">*</font></div> | |||
<div id="CheckStatus" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">审核备注</div> | |||
<textarea id="CheckRemark" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckForm.js") |
@@ -0,0 +1,52 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-27 10:05 | |||
* 描 述:学生请假管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); | |||
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveCheckForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,41 @@ | |||
@{ | |||
ViewBag.Title = "学生请假管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">请假类型</div> | |||
<div id="LeaveType"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">审核状态</div> | |||
<div id="CheckStatus"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 审核</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js") | |||
<script> | |||
var IsDeptDirector = "@ViewBag.IsDeptDirector"; | |||
</script> |
@@ -0,0 +1,182 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-27 10:05 | |||
* 描 述:学生请假管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); | |||
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 审核 | |||
$('#lr_check').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
//判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核; | |||
var day = $('#gridtable').jfGridValue('LeaveDay'); | |||
if (day > 2 && IsDeptDirector.toLowerCase() == "false") { | |||
learun.alert.warning("该请假申请大于2天,需要由系主任审核!"); | |||
return false; | |||
} | |||
learun.layerForm({ | |||
id: 'checkform', | |||
title: '审核', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/CheckForm?keyValue=' + keyValue, | |||
width: 800, | |||
height: 600, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList', | |||
headData: [ | |||
{ | |||
label: "审核状态", name: "CheckStatus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'LeaveCheck', | |||
callback: function (_data) { | |||
callback(_data.text ? _data.text : "申请中"); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, | |||
{ label: "审核时间", name: "CheckTime", width: 130, align: "left" }, | |||
{ | |||
label: "审核人", name: "CheckUserNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "请假类型", name: "LeaveType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'LeaveType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "开始时间", name: "StartTime", width: 100, align: "left" }, | |||
{ label: "结束时间", name: "EndTime", width: 100, align: "left" }, | |||
{ label: "请假天数", name: "LeaveDay", width: 100, align: "left" }, | |||
{ label: "请假事由", name: "LeaveReason", width: 100, align: "left" }, | |||
{ label: "学号", name: "CreateUserNo", width: 100, align: "left" }, | |||
{ label: "姓名", name: "CreateUserName", width: 100, align: "left" }, | |||
{ label: "申请时间", name: "CreateTime", width: 130, align: "left" }, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "系部", name: "DeptNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sord: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.ClassManagerNo = learun.clientdata.get(['userinfo']).account; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "学生请假管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假类型<font face="宋体">*</font></div> | |||
<div id="LeaveType" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">开始时间<font face="宋体">*</font></div> | |||
<input id="StartTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'EndTime\')}', dateFmt:'yyyy-MM-dd',onpicked: function () { $('#StartTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">结束时间<font face="宋体">*</font></div> | |||
<input id="EndTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'StartTime\')}',dateFmt:'yyyy-MM-dd',onpicked: function () { $('#EndTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | |||
<input id="LeaveDay" type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||
<div class="lr-form-item-title">请假事由</div> | |||
<textarea id="LeaveReason" class="form-control" style="height:100px;"></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js") |
@@ -0,0 +1,52 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-27 10:05 | |||
* 描 述:学生请假管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); | |||
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,40 @@ | |||
@{ | |||
ViewBag.Title = "学生请假管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">请假类型</div> | |||
<div id="LeaveType"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">审核状态</div> | |||
<div id="CheckStatus"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js") |
@@ -0,0 +1,212 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2020-11-27 10:05 | |||
* 描 述:学生请假管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' }); | |||
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var status = $('#gridtable').jfGridValue('CheckStatus'); | |||
if (status == "1" || status == "2") { | |||
learun.alert.warning("该项已审核无法编辑!"); | |||
return false; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
var status = $('#gridtable').jfGridValue('CheckStatus'); | |||
if (status == "1") { | |||
learun.alert.warning("该项已审核通过无法删除!"); | |||
return false; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList', | |||
headData: [ | |||
{ | |||
label: "审核状态", name: "CheckStatus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'LeaveCheck', | |||
callback: function (_data) { | |||
callback(_data.text ? _data.text : "申请中"); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, | |||
{ label: "审核时间", name: "CheckTime", width: 130, align: "left" }, | |||
{ | |||
label: "审核人", name: "CheckUserNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "请假类型", name: "LeaveType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'LeaveType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "开始时间", name: "StartTime", width: 100, align: "left" }, | |||
{ label: "结束时间", name: "EndTime", width: 100, align: "left" }, | |||
{ label: "请假天数", name: "LeaveDay", width: 100, align: "left" }, | |||
{ label: "请假事由", name: "LeaveReason", width: 100, align: "left" }, | |||
{ label: "学号", name: "CreateUserNo", width: 100, align: "left" }, | |||
{ label: "姓名", name: "CreateUserName", width: 100, align: "left" }, | |||
{ label: "申请时间", name: "CreateTime", width: 130, align: "left" }, | |||
{ | |||
label: "班级", name: "ClassNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: value, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "系部", name: "DeptNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', | |||
key: value, | |||
keyId: 'empno', | |||
callback: function (_data) { | |||
callback(_data['empname']); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sord: 'CreateTime desc' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StuNo = learun.clientdata.get(['userinfo']).account; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -790,6 +790,7 @@ | |||
<Compile Include="Areas\AssetManagementSystem\Controllers\Ass_AcceptanceController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\LoginUserBindController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\Sys_InformationPushController.cs" /> | |||
<Compile Include="Areas\EducationalAdministration\Controllers\StuLeaveManagementController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -971,6 +972,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\FormDC.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\SchoolUniform.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\IndexDC.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckForm.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndexInTeacher.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\Monitor.js" /> | |||
@@ -6111,6 +6114,10 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_InformationPush\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Index.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Form.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -6874,6 +6881,8 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Acceptance\ViewForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\BindAccountIndex.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuAttendanceLeave\IndexInStudent.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -161,4 +161,6 @@ | |||
<!--第三方登录跳转地址(最后不加/)--> | |||
<add key="redirect_url" value="http://localhost:20472"/> | |||
<add key="QJUrl" value="www.qj.com"/> | |||
<!--系主任角色Id--> | |||
<add key="DeptDirectorRoleId" value="cccde0ce-ebfe-41f2-9a78-e49aaa21cd5a" /> | |||
</appSettings> |
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public class StuLeaveManagementMap : EntityTypeConfiguration<StuLeaveManagementEntity> | |||
{ | |||
public StuLeaveManagementMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("STULEAVEMANAGEMENT"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -542,6 +542,7 @@ | |||
<Compile Include="AssetManagementSystem\Ass_AcceptanceMap.cs" /> | |||
<Compile Include="EducationalAdministration\LoginUserBindMap.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_InformationPushMap.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagementMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -0,0 +1,125 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public class StuLeaveManagementBLL : StuLeaveManagementIBLL | |||
{ | |||
private StuLeaveManagementService stuLeaveManagementService = new StuLeaveManagementService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return stuLeaveManagementService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuLeaveManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return stuLeaveManagementService.GetStuLeaveManagementEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
stuLeaveManagementService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, StuLeaveManagementEntity entity) | |||
{ | |||
try | |||
{ | |||
stuLeaveManagementService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,122 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public class StuLeaveManagementEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 请假类型 | |||
/// </summary> | |||
[Column("LEAVETYPE")] | |||
public string LeaveType { get; set; } | |||
/// <summary> | |||
/// 开始时间 | |||
/// </summary> | |||
[Column("STARTTIME")] | |||
public DateTime? StartTime { get; set; } | |||
/// <summary> | |||
/// 结束时间 | |||
/// </summary> | |||
[Column("ENDTIME")] | |||
public DateTime? EndTime { get; set; } | |||
/// <summary> | |||
/// 请假天数 | |||
/// </summary> | |||
[Column("LEAVEDAY")] | |||
public decimal? LeaveDay { get; set; } | |||
/// <summary> | |||
/// 请假事由 | |||
/// </summary> | |||
[Column("LEAVEREASON")] | |||
public string LeaveReason { get; set; } | |||
/// <summary> | |||
/// 申请人ID | |||
/// </summary> | |||
[Column("CREATEUSERID")] | |||
public string CreateUserId { get; set; } | |||
/// <summary> | |||
/// 申请人编号 | |||
/// </summary> | |||
[Column("CREATEUSERNO")] | |||
public string CreateUserNo { get; set; } | |||
/// <summary> | |||
/// 申请时间 | |||
/// </summary> | |||
[Column("CREATETIME")] | |||
public DateTime? CreateTime { get; set; } | |||
/// <summary> | |||
/// 审核状态 | |||
/// </summary> | |||
[Column("CHECKSTATUS")] | |||
public string CheckStatus { get; set; } | |||
/// <summary> | |||
/// 审核备注 | |||
/// </summary> | |||
[Column("CHECKREMARK")] | |||
public string CheckRemark { get; set; } | |||
/// <summary> | |||
/// 审核人ID | |||
/// </summary> | |||
[Column("CHECKUSERID")] | |||
public string CheckUserId { get; set; } | |||
/// <summary> | |||
/// 审核人编号 | |||
/// </summary> | |||
[Column("CHECKUSERNO")] | |||
public string CheckUserNo { get; set; } | |||
/// <summary> | |||
/// 审核时间 | |||
/// </summary> | |||
[Column("CHECKTIME")] | |||
public DateTime? CheckTime { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public string CreateUserName { get; set; } | |||
[NotMapped] | |||
public string ClassNo { get; set; } | |||
[NotMapped] | |||
public string DeptNo { get; set; } | |||
[NotMapped] | |||
public string MajorNo { get; set; } | |||
[NotMapped] | |||
public string ClassDiredctorNo { get; set; } | |||
[NotMapped] | |||
public string ClassTutorNo { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,48 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public interface StuLeaveManagementIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取StuLeaveManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, StuLeaveManagementEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,195 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2020-11-27 10:05 | |||
/// 描 述:学生请假管理 | |||
/// </summary> | |||
public class StuLeaveManagementService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); | |||
strSql.Append(" FROM StuLeaveManagement t left join StuInfoBasic s on t.CreateUserNo=s.StuNo left join ClassInfo c on s.ClassNo=c.ClassNo "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["LeaveType"].IsEmpty()) | |||
{ | |||
dp.Add("LeaveType",queryParam["LeaveType"].ToString(), DbType.String); | |||
strSql.Append(" AND t.LeaveType = @LeaveType "); | |||
} | |||
if (!queryParam["CheckStatus"].IsEmpty()) | |||
{ | |||
dp.Add("CheckStatus",queryParam["CheckStatus"].ToString(), DbType.String); | |||
strSql.Append(" AND t.CheckStatus = @CheckStatus "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.CreateUserNo = @StuNo "); | |||
} | |||
//班级班主任/辅导员/系主任 | |||
if (!queryParam["ClassManagerNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String); | |||
strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo "); | |||
//登录用户是否是系主任:若是,展示大于2天的请假记录; | |||
var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); | |||
if (deptDirectorRoleId != null) | |||
{ | |||
var loginInfoRoleIds = LoginUserInfo.Get().roleIds; | |||
if (loginInfoRoleIds.IndexOf(',') == -1) | |||
{ | |||
if (loginInfoRoleIds == deptDirectorRoleId) | |||
{ | |||
strSql.Append(" or t.LeaveDay>2 )"); | |||
} | |||
else | |||
{ | |||
strSql.Append(" ) "); | |||
} | |||
} | |||
else | |||
{ | |||
if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) | |||
{ | |||
strSql.Append(" or t.LeaveDay>2 )"); | |||
} | |||
else | |||
{ | |||
strSql.Append(" ) "); | |||
} | |||
} | |||
} | |||
else | |||
{ | |||
strSql.Append(" ) "); | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取StuLeaveManagement表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<StuLeaveManagementEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<StuLeaveManagementEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, StuLeaveManagementEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -1589,6 +1589,10 @@ | |||
<Compile Include="EducationalAdministration\Sys_InformationPush\Sys_InformationPushService.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_InformationPush\Sys_InformationPushBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Sys_InformationPush\Sys_InformationPushIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementEntity.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementService.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementBLL.cs" /> | |||
<Compile Include="EducationalAdministration\StuLeaveManagement\StuLeaveManagementIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||