@@ -56,23 +56,23 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
[HttpGet] | [HttpGet] | ||||
public ActionResult CheckIndex() | 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; | |||||
} | |||||
} | |||||
////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(); | return View(); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -197,20 +197,33 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
entity.CheckUserId = loginInfo.userId; | entity.CheckUserId = loginInfo.userId; | ||||
entity.CheckUserNo = loginInfo.account; | entity.CheckUserNo = loginInfo.account; | ||||
entity.CheckTime = DateTime.Now; | entity.CheckTime = DateTime.Now; | ||||
if (entity.CheckStatus == "1") | |||||
{ | |||||
entity.CheckStatus = "2"; | |||||
} | |||||
else | |||||
{ | |||||
entity.CheckStatus = "3"; | |||||
} | |||||
stuLeaveManagementIBLL.SaveEntity(keyValue, entity); | stuLeaveManagementIBLL.SaveEntity(keyValue, entity); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 提交实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult DoSubmit(string keyValue, string status, string processId) | |||||
///// <summary> | |||||
///// 提交实体数据 | |||||
///// </summary> | |||||
///// <param name="keyValue">主键</param> | |||||
///// <returns></returns> | |||||
//[HttpPost] | |||||
//[AjaxOnly] | |||||
//public ActionResult DoSubmit(string keyValue, string status, string processId) | |||||
//{ | |||||
// stuLeaveManagementIBLL.DoSubmit(keyValue, status, processId); | |||||
// return Success("提交成功!"); | |||||
//} | |||||
public ActionResult DoSubmit(string keyValue) | |||||
{ | { | ||||
stuLeaveManagementIBLL.DoSubmit(keyValue, status, processId); | |||||
stuLeaveManagementIBLL.DoSubmit(keyValue); | |||||
return Success("提交成功!"); | return Success("提交成功!"); | ||||
} | } | ||||
#endregion | #endregion | ||||
@@ -41,6 +41,7 @@ var bootstrap = function ($, learun) { | |||||
var postData = { | var postData = { | ||||
strEntity: JSON.stringify($('body').lrGetFormData()) | strEntity: JSON.stringify($('body').lrGetFormData()) | ||||
}; | }; | ||||
console.log(postData,"postData") | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveCheckForm?keyValue=' + keyValue, postData, function (res) { | $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveCheckForm?keyValue=' + keyValue, postData, function (res) { | ||||
// 保存成功后才回调 | // 保存成功后才回调 | ||||
if (!!callBack) { | if (!!callBack) { | ||||
@@ -36,6 +36,6 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js") | @Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js") | ||||
<script> | |||||
@*<script> | |||||
var IsDeptDirector = "@ViewBag.IsDeptDirector"; | var IsDeptDirector = "@ViewBag.IsDeptDirector"; | ||||
</script> | |||||
</script>*@ |
@@ -27,11 +27,11 @@ var bootstrap = function ($, learun) { | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | var keyValue = $('#gridtable').jfGridValue('Id'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
//判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核; | //判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核; | ||||
var day = $('#gridtable').jfGridValue('LeaveDay'); | |||||
if (day > 2 && IsDeptDirector.toLowerCase() == "false") { | |||||
learun.alert.warning("该请假申请大于2天,需要由系主任审核!"); | |||||
return false; | |||||
} | |||||
//var day = $('#gridtable').jfGridValue('LeaveDay'); | |||||
//if (day > 2 && IsDeptDirector.toLowerCase() == "false") { | |||||
// learun.alert.warning("该请假申请大于2天,需要由系主任审核!"); | |||||
// return false; | |||||
//} | |||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'checkform', | id: 'checkform', | ||||
title: '审核', | title: '审核', | ||||
@@ -51,15 +51,8 @@ var bootstrap = function ($, learun) { | |||||
url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList', | url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetPageList', | ||||
headData: [ | 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: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { | |||||
return cellvalue == "1" ? "<span class=\"label label-warning\">待审核</span>" : cellvalue == "2" ? "<span class=\"label label-success\">审核通过</span>" : cellvalue == "3" ? "<span class=\"label label-danger\">审核未通过</span>" : "<span class=\"label label-default\">草稿</span>"; | |||||
} | } | ||||
}, | }, | ||||
{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, | { label: "审核备注", name: "CheckRemark", width: 100, align: "left" }, | ||||
@@ -134,33 +127,33 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, | |||||
{ | |||||
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']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
} | |||||
//{ | |||||
// 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', | mainId: 'Id', | ||||
@@ -15,14 +15,14 @@ | |||||
<div class="lr-form-item-title">返校时间<font face="宋体">*</font></div> | <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 HH:mm:ss',onpicked: function () { $('#EndTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | <input id="EndTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'StartTime\')}',dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#EndTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | <div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | ||||
<input id="LeaveDay" type="number" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | <input id="LeaveDay" type="number" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
@*<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="lr-form-item-title">未销假次数</div> | <div class="lr-form-item-title">未销假次数</div> | ||||
<input id="num" readonly type="text" class="form-control" /> | <input id="num" readonly type="text" class="form-control" /> | ||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | <div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | ||||
<div class="lr-form-item-title">附件上传</div> | <div class="lr-form-item-title">附件上传</div> | ||||
<div id="Files"></div> | <div id="Files"></div> | ||||
@@ -15,14 +15,14 @@ | |||||
<div class="lr-form-item-title">返校时间<font face="宋体">*</font></div> | <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" /> | <input id="EndTime" readonly type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | <div class="lr-form-item-title">请假天数<font face="宋体">*</font></div> | ||||
<input id="LeaveDay" readonly type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | <input id="LeaveDay" readonly type="text" class="form-control" isvalid="yes" checkexpession="PositiveFloatint" /> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
@*<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement"> | |||||
<div class="lr-form-item-title">未销假次数</div> | <div class="lr-form-item-title">未销假次数</div> | ||||
<input id="num" readonly type="text" class="form-control" /> | <input id="num" readonly type="text" class="form-control" /> | ||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | <div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement"> | ||||
<div class="lr-form-item-title">附件上传</div> | <div class="lr-form-item-title">附件上传</div> | ||||
<div id="Files" readonly></div> | <div id="Files" readonly></div> | ||||
@@ -33,7 +33,7 @@ var bootstrap = function ($, learun) { | |||||
height: 400, | height: 400, | ||||
callBack: function (id) { | callBack: function (id) { | ||||
var res = false; | var res = false; | ||||
// 验证数据 | |||||
// 验证数据审核 | |||||
res = top[id].validForm(); | res = top[id].validForm(); | ||||
// 保存数据 | // 保存数据 | ||||
if (res) { | if (res) { | ||||
@@ -107,6 +107,25 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//// 流程提交 | |||||
//$('#lr_submit').on('click', function () { | |||||
// var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
// if (learun.checkrow(keyValue)) { | |||||
// var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); | |||||
// if (CheckStatus != "0") { | |||||
// learun.alert.warning("当前项已提交!"); | |||||
// return false; | |||||
// } | |||||
// learun.layerConfirm('是否确认提交该项!', function (res) { | |||||
// if (res) { | |||||
// processId = learun.newGuid(); | |||||
// learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) { | |||||
// refreshGirdData(res, {}); | |||||
// }); | |||||
// } | |||||
// }); | |||||
// } | |||||
//}); | |||||
// 提交 | // 提交 | ||||
$('#lr_submit').on('click', function () { | $('#lr_submit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('Id'); | var keyValue = $('#gridtable').jfGridValue('Id'); | ||||
@@ -118,14 +137,42 @@ var bootstrap = function ($, learun) { | |||||
} | } | ||||
learun.layerConfirm('是否确认提交该项!', function (res) { | learun.layerConfirm('是否确认提交该项!', function (res) { | ||||
if (res) { | if (res) { | ||||
processId = learun.newGuid(); | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) { | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/DoSubmit', { keyValue: keyValue }, function (res) { | |||||
refreshGirdData(res, {}); | refreshGirdData(res, {}); | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//审核 | |||||
$('#lr_check').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); | |||||
if (CheckStatus != "1") { | |||||
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) { | |||||
// var res = false; | |||||
// // 验证数据 | |||||
// res = top[id].validForm(); | |||||
// // 保存数据 | |||||
// if (res) { | |||||
// res = top[id].save('', function () { | |||||
// page.search(); | |||||
// }); | |||||
// } | |||||
// return res; | |||||
//} | |||||
}); | |||||
} | |||||
}); | |||||
}, | }, | ||||
// 初始化列表 | // 初始化列表 | ||||
initGird: function () { | initGird: function () { | ||||
@@ -272,21 +319,24 @@ var bootstrap = function ($, learun) { | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
refreshGirdData = function (res, postData) { | |||||
if (!!res) { | |||||
if (res.code == 200) { | |||||
// 发起流程 | |||||
var postData = { | |||||
schemeCode: 'StuLeaveManagement',// 填写流程对应模板编号 | |||||
processId: processId, | |||||
level: '1', | |||||
}; | |||||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||||
learun.loading(false); | |||||
}); | |||||
} | |||||
page.search(); | |||||
} | |||||
//refreshGirdData = function (res, postData) { | |||||
// if (!!res) { | |||||
// if (res.code == 200) { | |||||
// // 发起流程 | |||||
// var postData = { | |||||
// schemeCode: 'StuLeaveManagement',// 填写流程对应模板编号 | |||||
// processId: processId, | |||||
// level: '1', | |||||
// }; | |||||
// learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||||
// learun.loading(false); | |||||
// }); | |||||
// } | |||||
// page.search(); | |||||
// } | |||||
//}; | |||||
refreshGirdData = function () { | |||||
$('#gridtable').jfGridSet('reload'); | |||||
}; | }; | ||||
page.init(); | page.init(); | ||||
} | } |
@@ -1111,6 +1111,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\IndexDC.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\IndexDC.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckForm.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckForm.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\FormView.js" /> | |||||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndexInTeacher.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndexInTeacher.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndex.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndex.js" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\Monitor.js" /> | <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\Monitor.js" /> | ||||
@@ -7686,6 +7687,7 @@ | |||||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceiveData.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceiveData.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\Index.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\Index.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\IndexRecive.cshtml" /> | <Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\IndexRecive.cshtml" /> | ||||
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\FormView.cshtml" /> | |||||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | <None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | ||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||
<Content Include="Views\Login\Default-beifen.cshtml" /> | <Content Include="Views\Login\Default-beifen.cshtml" /> | ||||
@@ -200,6 +200,7 @@ | |||||
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermApi.cs" /> | <Compile Include="Modules\EducationalAdministration\ArrangeExamTermApi.cs" /> | ||||
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermNewApi.cs" /> | <Compile Include="Modules\EducationalAdministration\ArrangeExamTermNewApi.cs" /> | ||||
<Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" /> | <Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" /> | ||||
<Compile Include="Modules\StuLeaveManagementApi.cs" /> | |||||
<Compile Include="Modules\PersonnelManagement\MeetingManagementApi.cs" /> | <Compile Include="Modules\PersonnelManagement\MeetingManagementApi.cs" /> | ||||
<Compile Include="Modules\PersonnelManagement\MeetingMinutesApi.cs" /> | <Compile Include="Modules\PersonnelManagement\MeetingMinutesApi.cs" /> | ||||
<Compile Include="Modules\PersonnelManagement\MeetingSignInRecordApi.cs" /> | <Compile Include="Modules\PersonnelManagement\MeetingSignInRecordApi.cs" /> | ||||
@@ -0,0 +1,156 @@ | |||||
using Learun.Application.Organization; | |||||
using Learun.Application.TwoDevelopment.EducationalAdministration; | |||||
using Learun.Application.TwoDevelopment.EvaluationTeach; | |||||
using Learun.Util; | |||||
using Nancy; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
namespace Learun.Application.WebApi.Modules | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:数字化智慧校园-框架开发组 | |||||
/// 日 期:2018.01.04 | |||||
/// 描 述:部门管理 | |||||
/// </summary> | |||||
public class StuLeaveManagementApi : BaseApi | |||||
{ | |||||
private StuLeaveManagementIBLL stuLeaveManagementBLL = new StuLeaveManagementBLL(); | |||||
public StuLeaveManagementApi() | |||||
: base("/learun/adms/stuleavemanagement") | |||||
{ | |||||
Get["/pagelist"] = GetPageList; | |||||
Get["/list"] = GetList; | |||||
Get["/form"] = GetForm; | |||||
Post["/delete"] = DeleteForm; | |||||
Post["/save"] = SaveForm; | |||||
Post["/submit"] = Submit; | |||||
Post["/savecheck"] = SaveCheckForm; | |||||
} | |||||
/// <summary> | |||||
/// 获取页面显示列表分页数据 | |||||
/// <summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetPageList(dynamic _) | |||||
{ | |||||
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); | |||||
var data = stuLeaveManagementBLL.GetPageList(parameter.pagination, parameter.queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = parameter.pagination.total, | |||||
page = parameter.pagination.page, | |||||
records = parameter.pagination.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// <summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetList(dynamic _) | |||||
{ | |||||
string queryJson = this.GetReqData(); | |||||
var data = stuLeaveManagementBLL.GetList(queryJson); | |||||
return Success(data); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | |||||
/// <summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetForm(dynamic _) | |||||
{ | |||||
string keyValue = this.GetReqData(); | |||||
var StuMailData = stuLeaveManagementBLL.GetStuLeaveManagementEntity(keyValue); | |||||
var jsonData = new | |||||
{ | |||||
StuMail = StuMailData, | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
#region 提交数据 | |||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// <param name="_"></param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public Response DeleteForm(dynamic _) | |||||
{ | |||||
string keyValue = this.GetReqData(); | |||||
stuLeaveManagementBLL.DeleteEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="_"></param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public Response SaveForm(dynamic _) | |||||
{ | |||||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||||
StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>(); | |||||
entity.CreateTime = DateTime.Now; | |||||
entity.CreateUserId = this.userInfo.userId; | |||||
entity.CreateUserName = this.userInfo.realName; | |||||
stuLeaveManagementBLL.SaveEntity(parameter.keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="_"></param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public Response SaveCheckForm(dynamic _) | |||||
{ | |||||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||||
StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>(); | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
entity.CheckUserId = loginInfo.userId; | |||||
entity.CheckUserNo = loginInfo.account; | |||||
entity.CheckTime = DateTime.Now; | |||||
if (entity.CheckStatus == "1") | |||||
{ | |||||
entity.CheckStatus = "2"; | |||||
} | |||||
else | |||||
{ | |||||
entity.CheckStatus = "3"; | |||||
} | |||||
stuLeaveManagementBLL.SaveEntity(parameter.keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
/// <summary> | |||||
/// 保存实体数据(新增、修改) | |||||
/// <param name="_"></param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public Response Submit(dynamic _) | |||||
{ | |||||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||||
stuLeaveManagementBLL.DoSubmit(parameter.keyValue); | |||||
return Success("提交成功!"); | |||||
} | |||||
#endregion | |||||
#region 私有类 | |||||
/// <summary> | |||||
/// 表单实体类 | |||||
/// <summary> | |||||
private class ReqFormEntity | |||||
{ | |||||
public string keyValue { get; set; } | |||||
public string strEntity { get; set; } | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -42,6 +42,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public IEnumerable<StuLeaveManagementEntity> GetList(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return stuLeaveManagementService.GetList(queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
@@ -165,6 +183,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 提交实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DoSubmit(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
stuLeaveManagementService.DoSubmit(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 审核实体数据 | /// 审核实体数据 | ||||
@@ -22,6 +22,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson); | ||||
/// <summary> | /// <summary> | ||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
IEnumerable<StuLeaveManagementEntity> GetList(string queryJson); | |||||
/// <summary> | |||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
@@ -55,6 +61,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
void DoSubmit(string keyValue, string status, string processId); | void DoSubmit(string keyValue, string status, string processId); | ||||
void DoSubmit(string keyValue); | |||||
/// <summary> | /// <summary> | ||||
/// 审核实体数据 | /// 审核实体数据 | ||||
@@ -108,6 +108,93 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取页面显示列表数据 | |||||
/// </summary> | |||||
/// <param name="pagination">查询参数</param> | |||||
/// <param name="queryJson">查询参数</param> | |||||
/// <returns></returns> | |||||
public IEnumerable<StuLeaveManagementEntity> GetList(string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT t.*,s.StuName as CreateUserName "); | |||||
//strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); | |||||
strSql.Append(" FROM StuLeaveManagement t "); | |||||
strSql.Append(" left join StuInfoBasic s on t.CreateUserNo=s.StuNo "); | |||||
//strSql.Append(" 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); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -239,6 +326,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 提交实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void DoSubmit(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
this.BaseRepository("CollegeMIS").ExecuteBySql("update StuLeaveManagement set CheckStatus='1' where Id='" + keyValue + "' "); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 审核实体数据 | /// 审核实体数据 | ||||
/// </summary> | /// </summary> | ||||