Sfoglia il codice sorgente

学生请假定制化开发

新疆警官学校中职
ndbs 1 anno fa
parent
commit
8c144dc97a
31 ha cambiato i file con 1919 aggiunte e 366 eliminazioni
  1. +64
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs
  2. +38
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs
  3. +13
    -9
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml
  4. +69
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js
  5. +27
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.cshtml
  6. +115
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js
  7. +7
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml
  8. +100
    -109
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js
  9. +43
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Statistics.cshtml
  10. +158
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Statistics.js
  11. +22
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml
  12. +15
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js
  13. +67
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.cshtml
  14. +127
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js
  15. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml
  16. +101
    -43
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js
  17. +9
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  18. +5
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config
  19. +35
    -3
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs
  20. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/ioc.config
  21. +93
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs
  22. +64
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs
  23. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs
  24. +132
    -11
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs
  25. +79
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs
  26. +31
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs
  27. +6
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs
  28. +411
    -156
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs
  29. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj
  30. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuCancelLeaveManageMethod.cs
  31. +26
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuLeaveManagementMethod.cs

+ 64
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuCancelLeaveManagementController.cs Vedi File

@@ -4,6 +4,7 @@ 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
{
@@ -40,7 +41,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
}

/// <summary>
/// 主页面【学工信息管理】
/// 主页面【学工信息管理】【旧】
/// <summary>
/// <returns></returns>
[HttpGet]
@@ -49,7 +50,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return View();
}
/// <summary>
/// 表单页【学工信息管理】
/// 表单页【学工信息管理】【旧】
/// <summary>
/// <returns></returns>
[HttpGet]
@@ -57,6 +58,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
/// <summary>
/// 表单页-查看
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormView()
{
return View();
}
/// <summary>
/// 表单页-统计
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Statistics()
{
return View();
}
#endregion

#region 获取数据
@@ -97,6 +116,34 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="processId">流程实例主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataByProcessId(string processId)
{
var StuCancelLeaveManagementData = stuCancelLeaveManagementIBLL.GetEntityByProcessId(processId);
var jsonData = new
{
StuCancelLeaveManagement = StuCancelLeaveManagementData,
};
return Success(jsonData);
}
/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetList(string queryJson)
{
var Data = stuCancelLeaveManagementIBLL.GetPageList(queryJson);
return Success(Data);
}
#endregion

#region 提交数据
@@ -129,6 +176,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
entity.CreateUserId = loginInfo.userId;
entity.CreateUserNo = loginInfo.account;
entity.CreateTime = DateTime.Now;
entity.CheckStatus = "0";

stuCancelLeaveManagementIBLL.SaveEntity(keyValue,entity);
return Success("保存成功!");
@@ -152,6 +201,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
stuCancelLeaveManagementIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DoSubmit(string keyValue, string status, string processId)
{
stuCancelLeaveManagementIBLL.DoSubmit(keyValue, status, processId);
return Success("提交成功!");
}
#endregion

}


+ 38
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs Vedi File

@@ -17,7 +17,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
/// </summary>
public class StuLeaveManagementController : MvcControllerBase
{
private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();
private StuCanceLeaveManagementIBLL stuLeaveManagementIBLL = new StuCanceLeaveManagementBLL();

#region 视图功能

@@ -39,7 +39,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}

/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult FormView()
{
return View();
}
/// <summary>
/// 主页面【学工信息管理】
/// <summary>
@@ -116,6 +125,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}

[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataByProcessId(string processId)
{
var StuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(processId);
var jsonData = new
{
StuLeaveManagement = StuLeaveManagementData,
};
return Success(jsonData);
}
#endregion

#region 提交数据
@@ -143,11 +164,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
[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("保存成功!");
}
@@ -170,6 +188,20 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
stuLeaveManagementIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}

/// <summary>
/// 提交--修改状态
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult ModifyStatus(string keyValue,string CheckStatus,string processId)
{
stuLeaveManagementIBLL.ModifyStatus(keyValue, CheckStatus, processId);
return Success("保存成功!");
}
#endregion

}


+ 13
- 9
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.cshtml Vedi File

@@ -3,21 +3,25 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" >
<div class="lr-form-item-title">销假类型<font face="宋体">*</font></div>
<div id="CancelLeaveType" isvalid="yes" checkexpession="NotNull" ></div>
@*<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" >
<div class="lr-form-item-title">销假类型<font face="宋体">*</font></div>
<div id="CancelLeaveType" isvalid="yes" checkexpession="NotNull" ></div>
</div>*@
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" style="display:none;">
<div class="lr-form-item-title">销假请假单<font face="宋体">*</font></div>
<input id="LeaveId" type="text" readonly class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" >
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">到校时间<font face="宋体">*</font></div>
<input id="WorkTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm',onpicked: function () { $('#WorkTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" />
<input id="WorkTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm',onpicked: function () { $('#WorkTime').trigger('change'); } })" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" >
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">销假事由</div>
<textarea id="CancelLeaveReason" class="form-control" style="height:100px;" ></textarea>
<textarea id="CancelLeaveReason" class="form-control" style="height:100px;"></textarea>
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" >
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height:100px;" ></textarea>
<textarea id="Remark" class="form-control" style="height:100px;"></textarea>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js")

+ 69
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Form.js Vedi File

@@ -6,8 +6,40 @@
*/
var acceptClick;
var keyValue = request('keyValue');
var keyValueInLeave = request('keyValueInLeave');
//console.log(keyValue, keyValueInLeave);
// 设置权限
var setAuthorize;
// 设置表单数据
var setFormData;
// 验证数据是否填写完整
var validForm;
// 保存数据
var save;
var bootstrap = function ($, learun) {
"use strict";
if (keyValue == "null") {
keyValue = "";
}
// 设置权限
setAuthorize = function (data) {
if (!!data) {
for (var field in data) {
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除
$('#' + data[field].fieldId).parent().remove();
}
else {
if (data[field].isEdit != 1) {
$('#' + data[field].fieldId).attr('disabled', 'disabled');
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) {
$('#' + data[field].fieldId).css({ 'padding-right': '58px' });
$('#' + data[field].fieldId).find('.btn-success').remove();
}
}
}
}
}
};
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
@@ -15,7 +47,10 @@ var bootstrap = function ($, learun) {
page.initData();
},
bind: function () {
$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' });
if (!!keyValueInLeave) {
$('#LeaveId').val(keyValueInLeave);
}
//$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' });
},
initData: function () {
if (!!keyValue) {
@@ -27,23 +62,52 @@ var bootstrap = function ($, learun) {
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
$("#WorkTime").val(data[id].WorkTime);
}
});
}
}
};
// 保存数据
acceptClick = function (callBack) {
// 设置表单数据
setFormData = function (processId, param, callback) {
if (!!processId) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/GetFormDataByProcessId?processId=' + processId, function (data) {
for (var id in data) {
if (!!data[id] && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
if (id == 'StuCancelLeaveManagement' && data[id]) {
keyValue = data[id].Id;
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
$("#WorkTime").val(data[id].WorkTime);
}
});
}
callback && callback();
}
// 验证数据是否填写完整
validForm = function () {
if (!$('body').lrValidform()) {
return false;
}
return true;
};
// 保存数据
save = function (processId, callBack, i) {
var formData = $('body').lrGetFormData();
if (!!processId) {
formData.ProcessId = processId;
}
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
strEntity: JSON.stringify(formData)
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
callBack(res, i);
}
});
};


+ 27
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.cshtml Vedi File

@@ -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="StuCancelLeaveManagement" >
<div class="lr-form-item-title">销假类型<font face="宋体">*</font></div>
<div id="CancelLeaveType" isvalid="yes" checkexpession="NotNull" ></div>
</div>*@
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement" style="display:none;">
<div class="lr-form-item-title">销假请假单<font face="宋体">*</font></div>
<input id="LeaveId" type="text" readonly class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">到校时间<font face="宋体">*</font></div>
<input id="WorkTime" type="text" readonly class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">销假事由</div>
<textarea id="CancelLeaveReason" readonly class="form-control" style="height:100px;"></textarea>
</div>
<div class="col-xs-12 lr-form-item" data-table="StuCancelLeaveManagement">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" readonly class="form-control" style="height:100px;"></textarea>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js")

+ 115
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/FormView.js Vedi File

@@ -0,0 +1,115 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-03-26 11:35
* 描 述:学生销假管理
*/
var acceptClick;
var keyValue = request('keyValue');
var keyValueInLeave = request('keyValueInLeave');
//console.log(keyValue, keyValueInLeave);
// 设置权限
var setAuthorize;
// 设置表单数据
var setFormData;
// 验证数据是否填写完整
var validForm;
// 保存数据
var save;
var bootstrap = function ($, learun) {
"use strict";
if (keyValue == "null") {
keyValue = "";
}
// 设置权限
setAuthorize = function (data) {
if (!!data) {
for (var field in data) {
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除
$('#' + data[field].fieldId).parent().remove();
}
else {
if (data[field].isEdit != 1) {
$('#' + data[field].fieldId).attr('disabled', 'disabled');
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) {
$('#' + data[field].fieldId).css({ 'padding-right': '58px' });
$('#' + data[field].fieldId).find('.btn-success').remove();
}
}
}
}
}
};
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
if (!!keyValueInLeave) {
$('#LeaveId').val(keyValueInLeave);
}
//$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' });
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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]);
}
$("#WorkTime").val(data[id].WorkTime);
}
});
}
}
};
// 设置表单数据
setFormData = function (processId, param, callback) {
if (!!processId) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/GetFormDataByProcessId?processId=' + processId, function (data) {
for (var id in data) {
if (!!data[id] && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
if (id == 'StuCancelLeaveManagement' && data[id]) {
keyValue = data[id].Id;
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
$("#WorkTime").val(data[id].WorkTime);
}
});
}
callback && callback();
}
// 验证数据是否填写完整
validForm = function () {
if (!$('body').lrValidform()) {
return false;
}
return true;
};
// 保存数据
save = function (processId, callBack, i) {
var formData = $('body').lrGetFormData();
if (!!processId) {
formData.ProcessId = processId;
}
var postData = {
strEntity: JSON.stringify(formData)
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack(res, i);
}
});
};
page.init();
}

+ 7
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.cshtml Vedi File

@@ -11,8 +11,8 @@
<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="CancelLeaveType"></div>
<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>
@@ -27,10 +27,13 @@
<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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;销假</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_view" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;查看</a>
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;提交</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>


+ 100
- 109
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Index.js Vedi File

@@ -7,6 +7,7 @@
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var processId = '';
var page = {
init: function () {
page.initGird();
@@ -16,42 +17,39 @@ var bootstrap = function ($, learun) {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
$('#CancelLeaveType').lrDataItemSelect({ code: 'LeaveType' });
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
$('#LeaveType').lrDataItemSelect({ code: 'LeaveTypeOfStu' });
$('#CheckStatus').lrselect({ data: [{ id: '0', text: '草稿' }, { id: '1', text: '审批中' }, { id: '2', text: '审批通过' }, { id: '3', text: '审批不通过' }] });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/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("该项已审核无法编辑!");
var keyValueInLeave = $('#gridtable').jfGridValue('IdInLeave');
if (learun.checkrow(keyValueInLeave)) {
var keyValue = $('#gridtable').jfGridValue('Id');
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (keyValue != null && CheckStatus != "0") {
learun.alert.warning("当前项已提交销假!");
return false;
}
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/Form?keyValue=' + keyValue,
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/Form?keyValue=' + keyValue + '&keyValueInLeave=' + keyValueInLeave,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
res = top[id].save('', function () {
page.search();
});
}
return res;
}
});
}
@@ -61,14 +59,47 @@ var bootstrap = function ($, learun) {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var status = $('#gridtable').jfGridValue('CheckStatus');
if (status == "1") {
learun.alert.warning("该项已审核通过无法删除!");
if (status != "0") {
learun.alert.warning("当前项已提交销假!");
return false;
}
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/DeleteForm', { keyValue: keyValue}, function () {
refreshGirdData();
page.search();
});
}
});
}
});
//  查看
$('#lr_view').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formview',
title: '查看',
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/FormView?keyValue=' + keyValue,
width: 600,
height: 400,
btn: null
});
}
});
//  提交
$('#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/StuCancelLeaveManagement/DoSubmit', { keyValue: keyValue, status: "1", processId: processId }, function (res) {
refreshGirdData(res, {});
});
}
});
@@ -77,131 +108,91 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/GetPageList',
headData: [
{ label: "学号", name: "CreateUserNoInLeave", width: 100, align: "left" },
{
label: "审核状态", name: "CheckStatus", width: 100, align: "left",
label: "姓名", name: "CreateUserIdInLeave", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('dataItem', {
learun.clientdata.getAsync('user', {
key: value,
code: 'LeaveCheck',
callback: function (_data) {
callback(_data.text ? _data.text : "申请中");
callback(_data.name);
}
});
}
},
{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
{ label: "审核时间", name: "CheckTime", width: 130, align: "left" },
{
label: "审核人", name: "CheckUserNo", width: 100, align: "left",
label: "请假类型", name: "LeaveType", 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: "CancelLeaveType", 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: "WorkTime", width: 120, align: "left"},
{ label: "销假事由", name: "CancelLeaveReason", 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',
learun.clientdata.getAsync('dataItem', {
key: value,
keyId: 'classno',
code: 'LeaveType',
callback: function (_data) {
callback(_data['classname']);
callback(_data.text);
}
});
}
},
{
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: "IsCampus", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "外出假" : "校内假";
}
},
{
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: "IsStay", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "是" : "否";
}
},
{ label: "请假时间", name: "StartTime", width: 120, align: "left" },
{ label: "返校时间", name: "EndTime", width: 120, align: "left" },
{ label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
{ label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
{
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: "CheckStatusInLeave", 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: "CreateTime", width: 130, align: "left" },
{ label: "到校时间", name: "WorkTime", width: 120, align: "left"},
{ label: "销假事由", name: "CancelLeaveReason", width: 100, align: "left" },
{
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: "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>" : cellvalue == "0" ? "<span class=\"label label-default\">草稿</span>" : "";
}
},
],
mainId:'Id',
isPage: true,
sord: 'CreateTime desc'
sord: 'CreateTimeInLeave desc'
});
page.search();
},
search: function (param) {
param = param || {};
param.StuNo = learun.clientdata.get(['userinfo']).account;
param.CreateUserIdInLeave = learun.clientdata.get(['userinfo']).userId; //登录用户的已审核通过的请假单
param.users = learun.clientdata.get(['userinfo']).account;
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
refreshGirdData = function (res, postData) {
if (!!res) {
if (res.code == 200) {
// 发起流程
var postData = {
schemeCode: 'StuCancelLeaveManagement',// 填写流程对应模板编号
processId: processId,
level: '1',
};
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
learun.loading(false);
});
}
page.search();
}
};
page.init();
}

+ 43
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Statistics.cshtml Vedi File

@@ -0,0 +1,43 @@
@{
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="DeptNo"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">专业</div>
<div id="MajorNo"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">班级</div>
<div id="ClassNo"></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>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Statistics.js")

+ 158
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuCancelLeaveManagement/Statistics.js Vedi File

@@ -0,0 +1,158 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-03-26 11:35
* 描 述:学生销假管理
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var processId = '';
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
$('#DeptNo').lrselect({
allowSearch: true,
value: "deptno",
text: "deptname",
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdDeptInfo',
select: function (item) {
if (item) {
$('#MajorNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
param: { strWhere: "DeptNo='" + item.deptno + "' AND CheckMark=1" }
});
} else {
$('#MajorNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
param: { strWhere: "1=1 AND CheckMark=1" }
});
}

}
});
$('#MajorNo').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo',
value: "majorno",
text: "majorname",
param: { strWhere: "1=1 AND CheckMark=1" },
select: function (item) {
if (item) {
$('#ClassNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "majorno='" + item.majorno + "' AND CheckMark=1 order by classno desc" }
});
} else {
$('#ClassNo').lrselectRefresh({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" }
});
}
}
});
$('#ClassNo').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj',
param: { strWhere: "1=1 AND CheckMark=1 order by classno desc" },
value: "classno",
text: "classname"
});
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/EducationalAdministration/StuCancelLeaveManagement/GetList',
headData: [
{
label: "校内/外出假", name: "IsCampus", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "外出假" : "校内假";
}
},
{
label: "过夜", name: "IsStay", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "是" : "否";
}
},
{ label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
{
label: "系所", name: "DeptNo", width: 200, 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: 200, 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: "ClassNo", width: 200, 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: "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: "Sum", width: 100, align: "left" },
],
isPage: false,
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
page.init();
}

+ 22
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.cshtml Vedi File

@@ -3,19 +3,35 @@
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 class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">编号<font face="宋体">*</font></div>
<input id="Code" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="StuLeaveManagement">
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">区队<font face="宋体">*</font></div>
<input id="DistrictTeam" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">校内/外出假<font face="宋体">*</font></div>
<div id="IsCampus" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">过夜</div>
<div id="IsStay"></div>
</div>
<div class="col-xs-6 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="col-xs-6 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="col-xs-6 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-6 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>


+ 15
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Form.js Vedi File

@@ -17,13 +17,27 @@ var bootstrap = function ($, learun) {
bind: function () {
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
$('#IsCampus').lrselect({
data: [{ text: "外出假", value: "1" }, { text: "校内假", value: "0" }],
text: "text",
value: "value",
select: function (item) {
if (item.value == "1") {
$('#IsStay').lrDataItemSelect({ code: 'YesOrNoInt' });
$('#IsStay').attr('style', 'display: block');
} else {
$('#IsStay').val(0);
$('#IsStay').attr('style', 'display: none');
}
}
})
},
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]);
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);


+ 67
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.cshtml Vedi File

@@ -0,0 +1,67 @@
@{
ViewBag.Title = "学生请假管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">编号<font face="宋体">*</font></div>
<input id="Code" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">区队<font face="宋体">*</font></div>
<input id="DistrictTeam" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">校内/外出假<font face="宋体">*</font></div>
<div id="IsCampus" isvalid="yes" checkexpession="NotNull" readonly></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">过夜</div>
<div id="IsStay" readonly></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">开始时间<font face="宋体">*</font></div>
<input id="StartTime" type="text" readonly class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">结束时间<font face="宋体">*</font></div>
<input id="EndTime" type="text" readonly class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">请假类型<font face="宋体">*</font></div>
<div id="LeaveType" isvalid="yes" checkexpession="NotNull" readonly></div>
</div>
<div class="col-xs-6 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" readonly />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">学生学号</div>
<input id="CreateUserNo" readonly type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">学生姓名</div>
<input id="CreateUserName" readonly type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">系部</div>
<div id="DeptNo" readonly></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">专业</div>
<div id="MajorNo" readonly></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">班级</div>
<div id="ClassNo" readonly></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="StuLeaveManagement">
<div class="lr-form-item-title">班主任</div>
<div id="ClassDiredctorNo" readonly></div>
</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>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js")

+ 127
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/FormView.js Vedi File

@@ -0,0 +1,127 @@
/* * 版 本 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 setAuthorize;
// 设置表单数据
var setFormData;
// 验证数据是否填写完整
var validForm;
// 保存数据
var save;
var bootstrap = function ($, learun) {
"use strict";
// 设置权限
setAuthorize = function (data) {
if (!!data) {
for (var field in data) {
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除
$('#' + data[field].fieldId).parent().remove();
}
else {
if (data[field].isEdit != 1) {
$('#' + data[field].fieldId).attr('disabled', 'disabled');
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) {
$('#' + data[field].fieldId).css({ 'padding-right': '58px' });
$('#' + data[field].fieldId).find('.btn-success').remove();
}
}
}
}
}
};
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
$('#IsCampus').lrselect({
data: [{ text: "外出假", value: "1" }, { text: "校内假", value: "0" }],
text: "text",
value: "value",
})
$('#IsStay').lrDataItemSelect({ code: 'YesOrNoInt' });
//$('#CreateUserName').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuno', text: 'stuname' });
$('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' });
$('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' });
$('#ClassDiredctorNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
$('#ClassTutorNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' });
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
//$('#Files').lrUploader();
},
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]);
}

$("#StartTime").val(data[id].StartTime);
$("#EndTime").val(data[id].EndTime);
}
});
}
}
};
// 设置表单数据
setFormData = function (processId, param, callback) {
if (!!processId) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/GetFormDataByProcessId?processId=' + processId, function (data) {
for (var id in data) {
if (!!data[id] && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
}
else {
if (id == 'StuLeaveManagement' && data[id]) {
keyValue = data[id].Id;

$('#CreateUserName').lrselectSet(data[id].CreateUserNo);
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}

//$("#StartTime").val(data[id].StartTime);
//$("#EndTime").val(data[id].EndTime);
}
});
}
callback && callback();
}
// 验证数据是否填写完整
validForm = function () {
if (!$('body').lrValidform()) {
return false;
}
return true;
};
// 保存数据
save = function (processId, callBack, i) {
var formData = $('body').lrGetFormData();
if (!!processId) {
formData.ProcessId = processId;
}
var postData = {
strEntity: JSON.stringify(formData)
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack(res, i);
}
});
};
page.init();
}

+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.cshtml Vedi File

@@ -27,9 +27,10 @@
<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>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;提交</a>
</div>
</div>
</div>


+ 101
- 43
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/Index.js Vedi File

@@ -7,6 +7,7 @@
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var processId = '';
var page = {
init: function () {
page.initGird();
@@ -17,13 +18,22 @@ var bootstrap = function ($, learun) {
page.search(queryJson);
}, 220, 400);
$('#LeaveType').lrDataItemSelect({ code: 'LeaveType' });
$('#CheckStatus').lrDataItemSelect({ code: 'LeaveCheck' });
$('#CheckStatus').lrselect({
data: [{ text: "草稿", value: "0" }, { text: "审核中", value: "1" }, { text: "审核通过", value: "2" }, { text: "审核未通过", value: "3" }],
text: "text",
value: "value"
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
var roles = learun.clientdata.get(['userinfo']).Description;
if (roles!="学生") {
learun.alert.warning("当前用户不可新增!");
return false;
}
learun.layerForm({
id: 'form',
title: '新增',
@@ -37,10 +47,19 @@ var bootstrap = function ($, learun) {
});
// 编辑
$('#lr_edit').on('click', function () {
var roles = learun.clientdata.get(['userinfo']).Description;
if (roles != "学生") {
learun.alert.warning("当前用户不可编辑!");
return false;
}
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var status = $('#gridtable').jfGridValue('CheckStatus');
if (status == "1" || status == "2") {
if (status == "1") {
learun.alert.warning("该项已提交无法编辑!");
return false;
}
if (status == "2") {
learun.alert.warning("该项已审核无法编辑!");
return false;
}
@@ -62,7 +81,11 @@ var bootstrap = function ($, learun) {
if (learun.checkrow(keyValue)) {
var status = $('#gridtable').jfGridValue('CheckStatus');
if (status == "1") {
learun.alert.warning("该项已审核通过无法删除!");
learun.alert.warning("该项已提交无法删除!");
return false;
}
if (status == "2") {
learun.alert.warning("该项已审核无法删除!");
return false;
}
learun.layerConfirm('是否确认删除该项!', function (res) {
@@ -74,37 +97,63 @@ var bootstrap = function ($, learun) {
});
}
});
//提交
$('#lr_submit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var status = $('#gridtable').jfGridValue('CheckStatus');
if (status == "1") {
learun.alert.warning("当前项目已提交,请耐心等待审批!");
return;
}
if (status == "2") {
learun.alert.warning("当前项目已审核!");
return;
}
learun.layerConfirm('是否确认提交该项!', function (res) {
if (res) {
processId = learun.newGuid();
learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/ModifyStatus', { keyValue: keyValue, CheckStatus: "1", processId: processId }, function (res) {
refreshGirdData(res, {});
});
}
});
}
});

},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
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 : "申请中");
}
});
formatter: function (cellvalue) {
if (cellvalue == 2) {
return "<span class=\"label label-success\">审核通过</span>";
} else if (cellvalue == 3) {
return "<span class=\"label label-danger\">审核未通过</span>";
} else if (cellvalue == 1) {
return "<span class=\"label label-warning\">审核中</span>";
} else if (cellvalue == 0) {
return "<span class=\"label label-default\">草稿</span>";
}
}

},
{ label: "审核备注", name: "CheckRemark", width: 100, align: "left" },
{ label: "审核时间", name: "CheckTime", width: 130, align: "left" },
{ label: "编号", name: "Code", width: 100, align: "left" },
{ label: "区队", name: "DistrictTeam", width: 100, 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: "IsCampus", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "外出假" : "校内假";
}
},
{
label: "过夜", name: "IsStay", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == 1 ? "是" : "否";
}
},
{
@@ -119,8 +168,18 @@ var bootstrap = function ($, learun) {
});
}
},
{ label: "开始时间", name: "StartTime", width: 100, align: "left" },
{ label: "结束时间", name: "EndTime", width: 100, align: "left" },
{
label: "开始时间", name: "StartTime", width: 100, align: "left",
formatter: function (value, row) {
return learun.formatDate(value, 'yyyy-MM-dd');
}
},
{
label: "结束时间", name: "EndTime", width: 100, align: "left",
formatter: function (value, row) {
return learun.formatDate(value, 'yyyy-MM-dd');
}
},
{ label: "请假天数", name: "LeaveDay", width: 100, align: "left" },
{ label: "请假事由", name: "LeaveReason", width: 100, align: "left" },
{ label: "学号", name: "CreateUserNo", width: 100, align: "left" },
@@ -178,24 +237,10 @@ var bootstrap = function ($, learun) {
});
}
},
{
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'
sidx: 'CreateTime desc'
});
page.search();
},
@@ -205,8 +250,21 @@ var bootstrap = function ($, learun) {
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
refreshGirdData = function (res, postData) {
if (!!res && 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();
};

page.init();
}

+ 9
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Vedi File

@@ -1194,6 +1194,8 @@
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\CheckForm.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\CheckIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\Form.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\FormView.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\Statistics.js" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\StuConsumption\IndexForStudent.js" />
<Content Include="Areas\EducationalAdministration\Views\StuConsumption\IndexForTeacher.js" />
@@ -1336,6 +1338,8 @@
<Content Include="Areas\EducationalAdministration\Views\BookPutIn\Index.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\ImportForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuInfoBasic\SynPhotoForm.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\FormView.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuCancelLeaveManagement\Statistics.cshtml" />
<None Include="Areas\EducationalAdministration\Views\StuInfoBasic\Printxjk.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\AllocationClassDC.js" />
<Content Include="Areas\EducationalAdministration\Views\StuInfoFresh\StatisticClassIndex.js" />
@@ -1349,6 +1353,7 @@
<Content Include="Areas\EducationalAdministration\Views\StuInfoSemster\Index.js" />
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckForm.js" />
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\CheckIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\FormView.js" />
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\ClassIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\DeptIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\MajorIndex.js" />
@@ -7111,7 +7116,9 @@
<Content Include="XmlConfig\database.config">
<SubType>Designer</SubType>
</Content>
<Content Include="XmlConfig\ioc.config" />
<Content Include="XmlConfig\ioc.config">
<SubType>Designer</SubType>
</Content>
<Content Include="XmlConfig\log4net.config" />
<Content Include="XmlConfig\system.config">
<SubType>Designer</SubType>
@@ -8093,6 +8100,7 @@
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryMSRMilitaryIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryAPStuHealthIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuTransferInfo\QueryStuEncourgementIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuLeaveManagement\FormView.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


+ 5
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config Vedi File

@@ -38,6 +38,8 @@
<typeAlias alias="FundsApplyMethod" type="Learun.Application.WorkFlow.FundsApplyMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StudentCompetitionMethod" type="Learun.Application.WorkFlow.StudentCompetitionMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StudentArticlePublicMethod" type="Learun.Application.WorkFlow.StudentArticlePublicMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StuLeaveManagementMethod" type="Learun.Application.WorkFlow.StuLeaveManagementMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StuCancelLeaveManageMethod" type="Learun.Application.WorkFlow.StuCancelLeaveManageMethod,Learun.Application.WorkFlow" />
<!--任务调度器-->
<typeAlias alias="ITSMethod" type="Learun.Application.Extention.TaskScheduling.ITsMethod,Learun.Application.Extention" />
@@ -86,7 +88,9 @@
<type type="IWorkFlowMethod" mapTo="FundsApplyMethod" name="FundsApplyMethod"></type>
<type type="IWorkFlowMethod" mapTo="StudentCompetitionMethod" name="StudentCompetitionMethod"></type>
<type type="IWorkFlowMethod" mapTo="StudentArticlePublicMethod" name="StudentArticlePublicMethod"></type>
<type type="IWorkFlowMethod" mapTo="StuLeaveManagementMethod" name="StuLeaveManagementMethod"></type>
<type type="IWorkFlowMethod" mapTo="StuCancelLeaveManageMethod" name="StuCancelLeaveManageMethod"></type>

</container>

<container name="TsIOCcontainer">


+ 35
- 3
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs Vedi File

@@ -24,8 +24,9 @@ namespace Learun.Application.WebApi
public class StuLeaveManagementApi : BaseApi
{

private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();

private StuCanceLeaveManagementIBLL stuLeaveManagementIBLL = new StuCanceLeaveManagementBLL();
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();
/// <summary>
/// 注册接口
/// <summary>
@@ -43,7 +44,9 @@ namespace Learun.Application.WebApi
Get["/checkpagelist"] = GetCheckPageList;
//审核学生请假
Post["/savecheck"] = SaveCheckForm;

//流程
Post["/submit"] = Submit;
Get["/shList"] = GetshList;
}
#region 获取数据

@@ -99,7 +102,36 @@ namespace Learun.Application.WebApi
return Success(jsonData);
}

/// <summary>
/// 获取页面显示列表数据
/// <summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetshList(dynamic _)
{
StuLeaveManagementEntity parameter = this.GetReqData<StuLeaveManagementEntity>();
var stuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(parameter.ProcessId);
var jsonData = new
{
stuLeaveManagement = stuLeaveManagementData,
};
return Success(jsonData);
}

/// <summary>
/// 提交
/// <param name="_"></param>
/// <summary>
/// <returns></returns>
public Response Submit(dynamic _)
{
string keyValue = this.GetReqData();
var processId = Guid.NewGuid().ToString();
stuLeaveManagementIBLL.ChangeStatusById(keyValue, 1, processId);
UserInfo userInfo = LoginUserInfo.Get();
nWFProcessIBLL.CreateFlow("StuLeaveManagement", processId, "", 1, "", userInfo);
return Success("提交成功!");
}
#endregion

#region 提交数据


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/ioc.config Vedi File

@@ -36,6 +36,8 @@
<typeAlias alias="StuDisciplineManagementMethod" type="Learun.Application.WorkFlow.StuDisciplineManagementMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StudentCertificateMethod" type="Learun.Application.WorkFlow.StudentCertificateMethod,Learun.Application.WorkFlow" />
<typeAlias alias="FundsApplyMethod" type="Learun.Application.WorkFlow.FundsApplyMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StuLeaveManagementMethod" type="Learun.Application.WorkFlow.StuLeaveManagementMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StuCancelLeaveManageMethod" type="Learun.Application.WorkFlow.StuCancelLeaveManageMethod,Learun.Application.WorkFlow" />

<!--任务调度器-->
<typeAlias alias="ITSMethod" type="Learun.Application.Extention.TaskScheduling.ITsMethod,Learun.Application.Extention" />
@@ -79,6 +81,9 @@
<type type="IWorkFlowMethod" mapTo="StuDisciplineManagementMethod" name="StuDisciplineManagementMethod"></type>
<type type="IWorkFlowMethod" mapTo="StudentCertificateMethod" name="StudentCertificateMethod"></type>
<type type="IWorkFlowMethod" mapTo="FundsApplyMethod" name="FundsApplyMethod"></type>
<type type="IWorkFlowMethod" mapTo="StuLeaveManagementMethod" name="StuLeaveManagementMethod"></type>
<type type="IWorkFlowMethod" mapTo="StuCancelLeaveManageMethod" name="StuCancelLeaveManageMethod"></type>

</container>
<container name="TsIOCcontainer">
<!--<type type="ITSMethod" mapTo="TestTask" name="taskioc"></type>-->


+ 93
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementBLL.cs Vedi File

@@ -42,7 +42,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 统计
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<StuCancelLeaveManagementEntity> GetPageList( string queryJson)
{
try
{
return stuCancelLeaveManagementService.GetPageList(queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 获取StuCancelLeaveManagement表实体数据
/// </summary>
@@ -67,6 +89,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public StuCancelLeaveManagementEntity GetEntityByProcessId(string processId)
{
try
{
return stuCancelLeaveManagementService.GetEntityByProcessId(processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 提交数据
@@ -119,6 +165,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DoSubmit(string keyValue, string status, string processId)
{
try
{
stuCancelLeaveManagementService.DoSubmit(keyValue, status, processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 审核实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void ChangeStatusByProcessId(string status, string processId, string userId)
{
try
{
stuCancelLeaveManagementService.ChangeStatusByProcessId(status, processId, userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}


+ 64
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementEntity.cs Vedi File

@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 日 期:2021-03-26 11:35
/// 描 述:学生销假管理
/// </summary>
public class StuCancelLeaveManagementEntity
public class StuCancelLeaveManagementEntity
{
#region 实体成员
/// <summary>
@@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 审核状态
/// 审核状态(0草稿,1审核中,2审核通过,3,审核不通过)
/// </summary>
[Column("CHECKSTATUS")]
public string CheckStatus { get; set; }
@@ -79,6 +79,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("CHECKUSERNO")]
public string CheckUserNo { get; set; }
/// <summary>
/// 流程Id
/// </summary>
[Column("PROCESSID")]
public string ProcessId { get; set; }
/// <summary>
/// 销假请假单Id
/// </summary>
[Column("LEAVEID")]
public string LeaveId { get; set; }
#endregion

#region 扩展操作
@@ -111,6 +121,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public string ClassDiredctorNo { get; set; }
[NotMapped]
public string ClassTutorNo { get; set; }
/// <summary>
/// Id
/// </summary>
[NotMapped]
public string IdInLeave { get; set; }
/// <summary>
/// 请假类型
/// </summary>
[NotMapped]
public string LeaveType { get; set; }
/// <summary>
/// 开始时间
/// </summary>
[NotMapped]
public DateTime? StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[NotMapped]
public DateTime? EndTime { get; set; }
/// <summary>
/// 请假天数
/// </summary>
[NotMapped]
public decimal? LeaveDay { get; set; }
/// <summary>
/// 请假事由
/// </summary>
[NotMapped]
public string LeaveReason { get; set; }
/// <summary>
/// 申请人ID
/// </summary>
[NotMapped]
public string CreateUserIdInLeave { get; set; }
/// <summary>
/// 申请人编号
/// </summary>
[NotMapped]
public string CreateUserNoInLeave { get; set; }
/// <summary>
/// 申请时间
/// </summary>
[NotMapped]
public DateTime? CreateTimeInLeave { get; set; }
/// <summary>
/// 审核状态(0草稿,1审核中,2审核通过,3审核不通过,)
/// </summary>
[NotMapped]
public string CheckStatusInLeave { get; set; }
[NotMapped]
public int Sum { get; set; }
#endregion
}
}


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementIBLL.cs Vedi File

@@ -22,11 +22,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <returns></returns>
IEnumerable<StuCancelLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 统计
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<StuCancelLeaveManagementEntity> GetPageList(string queryJson);
/// <summary>
/// 获取StuCancelLeaveManagement表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
StuCancelLeaveManagementEntity GetStuCancelLeaveManagementEntity(string keyValue);

/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
StuCancelLeaveManagementEntity GetEntityByProcessId(string processId);
#endregion

#region 提交数据
@@ -42,6 +55,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, StuCancelLeaveManagementEntity entity);

/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
void DoSubmit(string keyValue, string status, string processId);

/// <summary>
/// 审核实体数据
/// </summary>
/// <param name="keyValue">主键</param>
void ChangeStatusByProcessId(string status, string processId, string userId);

#endregion

}


+ 132
- 11
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuCancelLeaveManagement/StuCancelLeaveManagementService.cs Vedi File

@@ -30,16 +30,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
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 StuCancelLeaveManagement t left join StuInfoBasic s on t.CreateUserNo=s.StuNo left join ClassInfo c on s.ClassNo=c.ClassNo ");
strSql.Append(" WHERE 1=1 ");
strSql.Append("SELECT t.Id as IdInLeave,t.LeaveType,t.StartTime,t.EndTime,t.LeaveDay,t.LeaveReason,t.CreateUserNo as CreateUserNoInLeave,t.CreateUserId as CreateUserIdInLeave,t.CreateTime as CreateTimeInLeave,t.CheckStatus as CheckStatusInLeave,t2.* ");
strSql.Append(" FROM StuLeaveManagement t ");
strSql.Append(" left join StuCancelLeaveManagement t2 on t.Id=t2.LeaveId ");
strSql.Append(" WHERE 1=1 and t.CheckStatus='2' ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["CancelLeaveType"].IsEmpty())
if (!queryParam["LeaveType"].IsEmpty())
{
dp.Add("CancelLeaveType",queryParam["CancelLeaveType"].ToString(), DbType.String);
strSql.Append(" AND t.CancelLeaveType = @CancelLeaveType ");
dp.Add("LeaveType",queryParam["LeaveType"].ToString(), DbType.String);
strSql.Append(" AND t.LeaveType = @LeaveType ");
}
if (!queryParam["CheckStatus"].IsEmpty())
{
@@ -49,13 +50,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
if (!queryParam["StuNo"].IsEmpty())
{
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String);
strSql.Append(" AND t.CreateUserNo = @StuNo ");
strSql.Append(" AND t2.CreateUserNo = @StuNo ");
}
//班级班主任/辅导员
if (!queryParam["ClassManagerNo"].IsEmpty())
if (!queryParam["users"].IsEmpty())
{
dp.Add("ClassManagerNo", queryParam["ClassManagerNo"].ToString(), DbType.String);
strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo ) ");
dp.Add("users", queryParam["users"].ToString(), DbType.String);
strSql.Append(" AND t.CreateUserNo = @users ");
}
return this.BaseRepository("CollegeMIS").FindList<StuCancelLeaveManagementEntity>(strSql.ToString(),dp, pagination);
}
@@ -71,7 +71,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <summary>
/// 统计
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<StuCancelLeaveManagementEntity> GetPageList( string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append(@"select t.iscampus,t.IsStay,t.leavetype,t.leaveday,s.classno,s.majorno,s.deptno from StuLeaveManagement t
left join stuinfobasic s on s.stuno = t.createuserno ");
strSql.Append(" WHERE 1=1 and t.CheckStatus='2' ");

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["ClassNo"].IsEmpty())
{
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String);
strSql.Append(" AND s.ClassNo = @ClassNo ");
}
if (!queryParam["MajorNo"].IsEmpty())
{
dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String);
strSql.Append(" AND s.MajorNo = @MajorNo ");
}
if (!queryParam["DeptNo"].IsEmpty())
{
dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String);
strSql.Append(" AND s.DeptNo = @DeptNo ");
}
strSql.Append("Group by t.iscampus,t.IsStay,t.leavetype,t.leaveday,s.classno,s.majorno,s.deptno ");
return this.BaseRepository("CollegeMIS").FindList<StuCancelLeaveManagementEntity>(strSql.ToString(), dp);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取StuCancelLeaveManagement表实体数据
/// </summary>
@@ -96,6 +147,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public StuCancelLeaveManagementEntity GetEntityByProcessId(string processId)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<StuCancelLeaveManagementEntity>(t => t.ProcessId == processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

#region 提交数据
@@ -156,6 +231,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DoSubmit(string keyValue, string status, string processId)
{
try
{
this.BaseRepository("CollegeMIS").ExecuteBySql("update StuCancelLeaveManagement set CheckStatus='" + status + "',ProcessId='" + processId + "' where Id='" + keyValue + "' ");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 审核实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void ChangeStatusByProcessId(string status, string processId, string userId)
{
try
{
this.BaseRepository("CollegeMIS").ExecuteBySql("update StuCancelLeaveManagement set CheckStatus='" + status + "',CheckUserId='" + userId + "',CheckTime='" + DateTime.Now + "' where ProcessId='" + processId + "' ");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}


+ 79
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs Vedi File

@@ -12,7 +12,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 日 期:2020-11-27 10:05
/// 描 述:学生请假管理
/// </summary>
public class StuLeaveManagementBLL : StuLeaveManagementIBLL
public class StuCanceLeaveManagementBLL : StuCanceLeaveManagementIBLL
{
private StuLeaveManagementService stuLeaveManagementService = new StuLeaveManagementService();

@@ -91,7 +91,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 获取StuLeaveManagement表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public StuLeaveManagementEntity GetEntityByProcessId(string processId)
{
try
{
return stuLeaveManagementService.GetEntityByProcessId(processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 提交数据
@@ -144,6 +166,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}

public void ModifyStatus(string keyValue, string CheckStatus, string processId)
{
try
{
stuLeaveManagementService.ModifyStatus(keyValue, CheckStatus, processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
public void ChangeStatusById(string keyValue, int CheckStatus, string processId)
{
try
{
stuLeaveManagementService.ChangeStatusById(keyValue, CheckStatus, processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public void ChangeStatusByProcessId(string status, string processId, string userId)
{
try
{
stuLeaveManagementService.ChangeStatusByProcessId(status, processId, userId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

}


+ 31
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementEntity.cs Vedi File

@@ -20,6 +20,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// 编号
/// </summary>
[Column("CODE")]
public string Code { get; set; }
/// <summary>
/// 区队
/// </summary>
[Column("DistrictTeam")]
public string DistrictTeam { get; set; }
/// <summary>
/// 请假类型
/// </summary>
[Column("LEAVETYPE")]
@@ -60,11 +70,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// 审核状态
/// 审核状态 0草稿,1已提交,2审核通过
/// </summary>
[Column("CHECKSTATUS")]
public string CheckStatus { get; set; }
/// <summary>
/// 流程Id
/// </summary>
[Column("PROCESSID")]
public string ProcessId { get; set; }
/// <summary>
/// 审核备注
/// </summary>
[Column("CHECKREMARK")]
@@ -84,6 +99,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[Column("CHECKTIME")]
public DateTime? CheckTime { get; set; }
/// <summary>
/// 是否校内
/// </summary>
[Column("ISCAMPUS")]
public int? IsCampus { get; set; }
/// <summary>
/// 是否过夜
/// </summary>
[Column("ISSTAY")]
public int IsStay { get; set; }
#endregion

#region 扩展操作
@@ -93,6 +118,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
public void Create()
{
this.Id = Guid.NewGuid().ToString();
var loginInfo = LoginUserInfo.Get();
this.CreateUserId = loginInfo.userId;
this.CreateUserNo = loginInfo.account;
this.CreateTime = DateTime.Now;
this.CheckStatus = "0";
}
/// <summary>
/// 编辑调用


+ 6
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs Vedi File

@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 日 期:2020-11-27 10:05
/// 描 述:学生请假管理
/// </summary>
public interface StuLeaveManagementIBLL
public interface StuCanceLeaveManagementIBLL
{
#region 获取数据

@@ -28,6 +28,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
/// <returns></returns>
StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue);
StuLeaveManagementEntity GetEntityByProcessId(string processId);
#endregion

#region 提交数据
@@ -43,6 +44,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, StuLeaveManagementEntity entity);
void ModifyStatus(string keyValue, string CheckStatus, string processId);
void ChangeStatusByProcessId(string status, string processId, string userId);

void ChangeStatusById(string keyValue, int CheckStatus, string processId);
#endregion

}


+ 411
- 156
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs Vedi File

@@ -52,44 +52,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String);
strSql.Append(" AND t.CreateUserNo = @StuNo ");
}
//班级班主任/辅导员/系主任
if (!queryParam["ClassManagerNo"].IsEmpty())
if (!queryParam["StuName"].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(" ) ");
}
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String);
strSql.Append(" AND s.StuName like @StuName ");
}
//班级班主任/辅导员/系主任
//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)
@@ -132,6 +137,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String);
strSql.Append(" AND t.CreateUserNo = @StuNo ");
}
if (!queryParam["StuName"].IsEmpty())
{
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String);
strSql.Append(" AND s.StuName like @StuName ");
}
//班级班主任/辅导员/系主任
var ClassManagerNo = LoginUserInfo.Get().account;
if (!string.IsNullOrEmpty(ClassManagerNo))
@@ -206,8 +216,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
data.ClassNo = studentlist.ClassNo;
data.CreateUserName = studentlist.StuName;
}
var classlist = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(x =>x.ClassNo == data.ClassNo).FirstOrDefault();
if (classlist!=null)
var classlist = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(x => x.ClassNo == data.ClassNo).FirstOrDefault();
if (classlist != null)
{
data.ClassDiredctorNo = classlist.ClassDiredctorNo;
data.ClassTutorNo = classlist.ClassTutorNo;
@@ -227,7 +237,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

#endregion

#region 提交数据
@@ -270,133 +279,313 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
entity.Modify(keyValue);
db.Update(entity);
if (entity.CheckStatus.Trim() == "1" && entity.StartTime != null)
{
//请假审核通过后,该学生的对应日期的课表改为请假
var model = this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(
$"select * from StuLeaveManagement where Id='{keyValue}'").FirstOrDefault();
//请假开始时间和结束时间
var startTime = Convert.ToDateTime(model.StartTime?.ToString("yyyy-MM-dd") + " 00:00:00");
var endTime = Convert.ToDateTime(model.EndTime?.ToString("yyyy-MM-dd") + " 23:59:59");

//排课数据
var arrangeLessonTermList = db.FindList<ArrangeLessonTermEntity>($@"select a.*,b.StuName,b.Grade,b.GenderNo from [dbo].[ArrangeLessonTerm] a
// if (entity.CheckStatus.Trim() == "2" && entity.StartTime != null)
// {
// //请假审核通过后,该学生的对应日期的课表改为请假
// var model = this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(
// $"select * from StuLeaveManagement where Id='{keyValue}'").FirstOrDefault();
// //请假开始时间和结束时间
// var startTime = Convert.ToDateTime(model.StartTime?.ToString("yyyy-MM-dd") + " 00:00:00");
// var endTime = Convert.ToDateTime(model.EndTime?.ToString("yyyy-MM-dd") + " 23:59:59");

// //排课数据
// var arrangeLessonTermList = db.FindList<ArrangeLessonTermEntity>($@"select a.*,b.StuName,b.Grade,b.GenderNo from [dbo].[ArrangeLessonTerm] a
//join stuinfobasic b on a.teachclassno=b.classno
//where b.stuno='{model.CreateUserNo}'
//and a.lessondate between '{startTime}' and '{endTime}'");

// var deptList = this.BaseRepository("CollegeMIS").FindList<CdDeptEntity>();
// var majorList = this.BaseRepository("CollegeMIS").FindList<CdMajorEntity>();
// var classInfoList = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>();
// var classRoomList = this.BaseRepository("CollegeMIS").FindList<ClassroomInfoEntity>().ToList();
// var lessonSortList = this.BaseRepository("CollegeMIS").FindList<CdLessonSortEntity>().ToList();
// foreach (var arrangeLessonTerm in arrangeLessonTermList)
// {
// StuAttendanceLeaveEntity stuAttendanceLeave = new StuAttendanceLeaveEntity();
// stuAttendanceLeave.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
// stuAttendanceLeave.Semester = arrangeLessonTerm.Semester;
// stuAttendanceLeave.StuNo = model.CreateUserNo;
// stuAttendanceLeave.StuName = arrangeLessonTerm.StuName;
// stuAttendanceLeave.Grade = arrangeLessonTerm.Grade;
// stuAttendanceLeave.DeptNo = arrangeLessonTerm.DeptNo;
// stuAttendanceLeave.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
// .FirstOrDefault()?.DeptName;
// stuAttendanceLeave.MajorNo = arrangeLessonTerm.MajorNo;
// stuAttendanceLeave.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo)
// .FirstOrDefault()?.MajorName;
// stuAttendanceLeave.ClassNo = arrangeLessonTerm.TeachClassNo;
// stuAttendanceLeave.ClassName = classInfoList
// .Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
// stuAttendanceLeave.LessonNo = arrangeLessonTerm.LessonNo;
// stuAttendanceLeave.LessonName = arrangeLessonTerm.LessonName;
// stuAttendanceLeave.TeachClassNo = arrangeLessonTerm.TeachClassNo;
// stuAttendanceLeave.LessonSortNo = arrangeLessonTerm.LessonSortNo;
// stuAttendanceLeave.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
// stuAttendanceLeave.LessonDate = arrangeLessonTerm.LessonDate;
// stuAttendanceLeave.LessonTime = arrangeLessonTerm.LessonTime;
// stuAttendanceLeave.LeaveType = entity.LeaveType;
// stuAttendanceLeave.EmpNo = arrangeLessonTerm.EmpNo;
// stuAttendanceLeave.TecRemark = "按天请假";
// stuAttendanceLeave.UpdateDate = DateTime.Now;
// stuAttendanceLeave.IsCheck = "1";
// stuAttendanceLeave.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
// stuAttendanceLeave.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
// //去重
// var isExistModel = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceLeaveEntity>(x =>
// x.AcademicYearNo == stuAttendanceLeave.AcademicYearNo && x.Semester == stuAttendanceLeave.Semester &&
// x.StuNo == stuAttendanceLeave.StuNo && x.LessonNo == stuAttendanceLeave.LessonNo && x.TeachClassNo == stuAttendanceLeave.TeachClassNo &&
// x.LessonSortNo == stuAttendanceLeave.LessonSortNo && x.LessonDate == stuAttendanceLeave.LessonDate && x.LessonTime == stuAttendanceLeave.LessonTime &&
// x.EmpNo == stuAttendanceLeave.EmpNo && x.ClassRoomNo == stuAttendanceLeave.ClassRoomNo
// );
// if (isExistModel != null)
// {
// stuAttendanceLeave.Modify(isExistModel.ID);
// db.Update(stuAttendanceLeave);
// }
// else
// {
// stuAttendanceLeave.Create();
// db.Insert(stuAttendanceLeave);
// }

// //学生考勤
// StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity();
// stuAttendanceEntity.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
// stuAttendanceEntity.Semester = arrangeLessonTerm.Semester;
// stuAttendanceEntity.StuNo = model.CreateUserNo;
// stuAttendanceEntity.StuName = arrangeLessonTerm.StuName;
// stuAttendanceEntity.Gender = arrangeLessonTerm.GenderNo.ToLower() == "true" ? "男" : "女";
// stuAttendanceEntity.Grade = arrangeLessonTerm.Grade;
// stuAttendanceEntity.DeptNo = arrangeLessonTerm.DeptNo;
// stuAttendanceEntity.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
// .FirstOrDefault()?.DeptName;
// stuAttendanceEntity.MajorNo = arrangeLessonTerm.MajorNo;
// stuAttendanceEntity.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo).FirstOrDefault()?.MajorName;
// stuAttendanceEntity.ClassNo = arrangeLessonTerm.TeachClassNo;
// stuAttendanceEntity.ClassName = classInfoList
// .Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
// stuAttendanceEntity.LessonNo = arrangeLessonTerm.LessonNo;
// stuAttendanceEntity.LessonName = arrangeLessonTerm.LessonName;
// stuAttendanceEntity.TeachClassNo = arrangeLessonTerm.TeachClassNo;
// stuAttendanceEntity.LessonSortNo = arrangeLessonTerm.LessonSortNo;
// stuAttendanceEntity.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
// stuAttendanceEntity.LessonDate = arrangeLessonTerm.LessonDate;
// stuAttendanceEntity.PlanWeek = null;
// stuAttendanceEntity.LessonTime = arrangeLessonTerm.LessonTime;
// stuAttendanceEntity.AttendOrNo = "否";
// stuAttendanceEntity.Sort = Convert.ToInt32(entity.LeaveType) == 2 ? "病假" : "事假";
// stuAttendanceEntity.EmpNo = arrangeLessonTerm.EmpNo;
// stuAttendanceEntity.Remark = "按天请假";
// stuAttendanceEntity.CheckMarkDept = "";
// stuAttendanceEntity.CheckMark = "";
// stuAttendanceEntity.InertDate = DateTime.Now;
// stuAttendanceEntity.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
// stuAttendanceEntity.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
// //去重
// var isExistModel2 = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceEntity>(x =>
// x.AcademicYearNo == stuAttendanceEntity.AcademicYearNo && x.Semester == stuAttendanceEntity.Semester && x.StuNo == stuAttendanceEntity.StuNo &&
// x.LessonNo == stuAttendanceEntity.LessonNo && x.TeachClassNo == stuAttendanceEntity.TeachClassNo && x.LessonSortNo == stuAttendanceEntity.LessonSortNo &&
// x.LessonDate == stuAttendanceEntity.LessonDate && x.LessonTime == stuAttendanceEntity.LessonTime && x.EmpNo == stuAttendanceEntity.EmpNo && x.ClassRoomNo == stuAttendanceEntity.ClassRoomNo);
// if (isExistModel2 != null)
// {
// stuAttendanceEntity.Modify(isExistModel2.ID);
// db.Update(stuAttendanceEntity);
// }
// else
// {
// stuAttendanceEntity.Create();
// db.Insert(stuAttendanceEntity);
// }

// }
// }
}
else
{
entity.Create();
db.Insert(entity);
}

db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 提交
/// </summary>
/// <param name="keyValue"></param>
/// <param name="CheckStatus"></param>
/// <param name="processId"></param>
public void ModifyStatus(string keyValue, string CheckStatus, string processId)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
var entity = db.FindEntity<StuLeaveManagementEntity>(keyValue);
entity.CheckStatus = CheckStatus;
entity.ProcessId = processId;
db.Update(entity);
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 审核实体数据
/// </summary>
/// <param name="keyValue">主键</param>
public void ChangeStatusByProcessId(string status, string processId, string userId)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
db.ExecuteBySql("update StuLeaveManagement set CheckStatus='" + status + "',CheckUserId='" + userId + "',CheckTime='" + DateTime.Now + "' where ProcessId='" + processId + "' ");
if (status.Trim() == "2")
{
//请假审核通过后,该学生的对应日期的课表改为请假
var model = db.FindList<StuLeaveManagementEntity>(
$"select * from StuLeaveManagement where ProcessId='{processId}'").FirstOrDefault();
//请假开始时间和结束时间
var startTime = Convert.ToDateTime(model.StartTime?.ToString("yyyy-MM-dd") + " 00:00:00");
var endTime = Convert.ToDateTime(model.EndTime?.ToString("yyyy-MM-dd") + " 23:59:59");

//排课数据
var arrangeLessonTermList = db.FindList<ArrangeLessonTermEntity>($@"select a.*,b.StuName,b.Grade,b.GenderNo from [dbo].[ArrangeLessonTerm] a
join stuinfobasic b on a.teachclassno=b.classno
where b.stuno='{model.CreateUserNo}'
and a.lessondate between '{startTime}' and '{endTime}'");

var deptList = this.BaseRepository("CollegeMIS").FindList<CdDeptEntity>();
var majorList = this.BaseRepository("CollegeMIS").FindList<CdMajorEntity>();
var classInfoList = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>();
var classRoomList = this.BaseRepository("CollegeMIS").FindList<ClassroomInfoEntity>().ToList();
var lessonSortList = this.BaseRepository("CollegeMIS").FindList<CdLessonSortEntity>().ToList();
foreach (var arrangeLessonTerm in arrangeLessonTermList)
var deptList = this.BaseRepository("CollegeMIS").FindList<CdDeptEntity>();
var majorList = this.BaseRepository("CollegeMIS").FindList<CdMajorEntity>();
var classInfoList = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>();
var classRoomList = this.BaseRepository("CollegeMIS").FindList<ClassroomInfoEntity>().ToList();
var lessonSortList = this.BaseRepository("CollegeMIS").FindList<CdLessonSortEntity>().ToList();
foreach (var arrangeLessonTerm in arrangeLessonTermList)
{
StuAttendanceLeaveEntity stuAttendanceLeave = new StuAttendanceLeaveEntity();
stuAttendanceLeave.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
stuAttendanceLeave.Semester = arrangeLessonTerm.Semester;
stuAttendanceLeave.StuNo = model.CreateUserNo;
stuAttendanceLeave.StuName = arrangeLessonTerm.StuName;
stuAttendanceLeave.Grade = arrangeLessonTerm.Grade;
stuAttendanceLeave.DeptNo = arrangeLessonTerm.DeptNo;
stuAttendanceLeave.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
.FirstOrDefault()?.DeptName;
stuAttendanceLeave.MajorNo = arrangeLessonTerm.MajorNo;
stuAttendanceLeave.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo)
.FirstOrDefault()?.MajorName;
stuAttendanceLeave.ClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.ClassName = classInfoList
.Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
stuAttendanceLeave.LessonNo = arrangeLessonTerm.LessonNo;
stuAttendanceLeave.LessonName = arrangeLessonTerm.LessonName;
stuAttendanceLeave.TeachClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.LessonSortNo = arrangeLessonTerm.LessonSortNo;
stuAttendanceLeave.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
stuAttendanceLeave.LessonDate = arrangeLessonTerm.LessonDate;
stuAttendanceLeave.LessonTime = arrangeLessonTerm.LessonTime;
stuAttendanceLeave.LeaveType = model.LeaveType;
stuAttendanceLeave.EmpNo = arrangeLessonTerm.EmpNo;
stuAttendanceLeave.TecRemark = "按天请假";
stuAttendanceLeave.UpdateDate = DateTime.Now;
stuAttendanceLeave.IsCheck = "1";
stuAttendanceLeave.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
stuAttendanceLeave.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
//去重
var isExistModel = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceLeaveEntity>(x =>
x.AcademicYearNo == stuAttendanceLeave.AcademicYearNo && x.Semester == stuAttendanceLeave.Semester &&
x.StuNo == stuAttendanceLeave.StuNo && x.LessonNo == stuAttendanceLeave.LessonNo && x.TeachClassNo == stuAttendanceLeave.TeachClassNo &&
x.LessonSortNo == stuAttendanceLeave.LessonSortNo && x.LessonDate == stuAttendanceLeave.LessonDate && x.LessonTime == stuAttendanceLeave.LessonTime &&
x.EmpNo == stuAttendanceLeave.EmpNo && x.ClassRoomNo == stuAttendanceLeave.ClassRoomNo
);
if (isExistModel != null)
{
StuAttendanceLeaveEntity stuAttendanceLeave = new StuAttendanceLeaveEntity();
stuAttendanceLeave.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
stuAttendanceLeave.Semester = arrangeLessonTerm.Semester;
stuAttendanceLeave.StuNo = model.CreateUserNo;
stuAttendanceLeave.StuName = arrangeLessonTerm.StuName;
stuAttendanceLeave.Grade = arrangeLessonTerm.Grade;
stuAttendanceLeave.DeptNo = arrangeLessonTerm.DeptNo;
stuAttendanceLeave.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
.FirstOrDefault()?.DeptName;
stuAttendanceLeave.MajorNo = arrangeLessonTerm.MajorNo;
stuAttendanceLeave.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo)
.FirstOrDefault()?.MajorName;
stuAttendanceLeave.ClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.ClassName = classInfoList
.Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
stuAttendanceLeave.LessonNo = arrangeLessonTerm.LessonNo;
stuAttendanceLeave.LessonName = arrangeLessonTerm.LessonName;
stuAttendanceLeave.TeachClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceLeave.LessonSortNo = arrangeLessonTerm.LessonSortNo;
stuAttendanceLeave.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
stuAttendanceLeave.LessonDate = arrangeLessonTerm.LessonDate;
stuAttendanceLeave.LessonTime = arrangeLessonTerm.LessonTime;
stuAttendanceLeave.LeaveType = entity.LeaveType;
stuAttendanceLeave.EmpNo = arrangeLessonTerm.EmpNo;
stuAttendanceLeave.TecRemark = "按天请假";
stuAttendanceLeave.UpdateDate = DateTime.Now;
stuAttendanceLeave.IsCheck = "1";
stuAttendanceLeave.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
stuAttendanceLeave.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
//去重
var isExistModel = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceLeaveEntity>(x =>
x.AcademicYearNo == stuAttendanceLeave.AcademicYearNo && x.Semester == stuAttendanceLeave.Semester &&
x.StuNo == stuAttendanceLeave.StuNo &&x.LessonNo == stuAttendanceLeave.LessonNo && x.TeachClassNo == stuAttendanceLeave.TeachClassNo &&
x.LessonSortNo == stuAttendanceLeave.LessonSortNo &&x.LessonDate == stuAttendanceLeave.LessonDate && x.LessonTime == stuAttendanceLeave.LessonTime &&
x.EmpNo == stuAttendanceLeave.EmpNo &&x.ClassRoomNo == stuAttendanceLeave.ClassRoomNo
);
if (isExistModel!=null)
{
stuAttendanceLeave.Modify(isExistModel.ID);
db.Update(stuAttendanceLeave);
}
else
{
stuAttendanceLeave.Create();
db.Insert(stuAttendanceLeave);
}
//学生考勤
StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity();
stuAttendanceEntity.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
stuAttendanceEntity.Semester = arrangeLessonTerm.Semester;
stuAttendanceEntity.StuNo = model.CreateUserNo;
stuAttendanceEntity.StuName = arrangeLessonTerm.StuName;
stuAttendanceEntity.Gender = arrangeLessonTerm.GenderNo.ToLower()=="true"?"男":"女";
stuAttendanceEntity.Grade = arrangeLessonTerm.Grade;
stuAttendanceEntity.DeptNo = arrangeLessonTerm.DeptNo;
stuAttendanceEntity.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
.FirstOrDefault()?.DeptName;
stuAttendanceEntity.MajorNo = arrangeLessonTerm.MajorNo;
stuAttendanceEntity.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo).FirstOrDefault()?.MajorName;
stuAttendanceEntity.ClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceEntity.ClassName = classInfoList
.Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
stuAttendanceEntity.LessonNo = arrangeLessonTerm.LessonNo;
stuAttendanceEntity.LessonName = arrangeLessonTerm.LessonName;
stuAttendanceEntity.TeachClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceEntity.LessonSortNo = arrangeLessonTerm.LessonSortNo;
stuAttendanceEntity.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
stuAttendanceEntity.LessonDate = arrangeLessonTerm.LessonDate;
stuAttendanceEntity.PlanWeek = null;
stuAttendanceEntity.LessonTime = arrangeLessonTerm.LessonTime;
stuAttendanceEntity.AttendOrNo = "否";
stuAttendanceEntity.Sort = Convert.ToInt32(entity.LeaveType) == 2 ? "病假" : "事假";
stuAttendanceEntity.EmpNo = arrangeLessonTerm.EmpNo;
stuAttendanceEntity.Remark = "按天请假";
stuAttendanceEntity.CheckMarkDept = "";
stuAttendanceEntity.CheckMark = "";
stuAttendanceEntity.InertDate = DateTime.Now;
stuAttendanceEntity.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
stuAttendanceEntity.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
//去重
var isExistModel2 = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceEntity>(x =>
x.AcademicYearNo == stuAttendanceEntity.AcademicYearNo && x.Semester == stuAttendanceEntity.Semester && x.StuNo == stuAttendanceEntity.StuNo &&
x.LessonNo == stuAttendanceEntity.LessonNo && x.TeachClassNo == stuAttendanceEntity.TeachClassNo && x.LessonSortNo == stuAttendanceEntity.LessonSortNo &&
x.LessonDate == stuAttendanceEntity.LessonDate && x.LessonTime == stuAttendanceEntity.LessonTime && x.EmpNo == stuAttendanceEntity.EmpNo && x.ClassRoomNo == stuAttendanceEntity.ClassRoomNo);
if (isExistModel2 != null)
{
stuAttendanceEntity.Modify(isExistModel2.ID);
db.Update(stuAttendanceEntity);
}
else
{
stuAttendanceEntity.Create();
db.Insert(stuAttendanceEntity);
}
stuAttendanceLeave.Modify(isExistModel.ID);
db.Update(stuAttendanceLeave);
}
else
{
stuAttendanceLeave.Create();
db.Insert(stuAttendanceLeave);
}

//学生考勤
StuAttendanceEntity stuAttendanceEntity = new StuAttendanceEntity();
stuAttendanceEntity.AcademicYearNo = arrangeLessonTerm.AcademicYearNo;
stuAttendanceEntity.Semester = arrangeLessonTerm.Semester;
stuAttendanceEntity.StuNo = model.CreateUserNo;
stuAttendanceEntity.StuName = arrangeLessonTerm.StuName;
stuAttendanceEntity.Gender = arrangeLessonTerm.GenderNo.ToLower() == "true" ? "男" : "女";
stuAttendanceEntity.Grade = arrangeLessonTerm.Grade;
stuAttendanceEntity.DeptNo = arrangeLessonTerm.DeptNo;
stuAttendanceEntity.DeptName = deptList.Where(x => x.DeptNo == arrangeLessonTerm.DeptNo)
.FirstOrDefault()?.DeptName;
stuAttendanceEntity.MajorNo = arrangeLessonTerm.MajorNo;
stuAttendanceEntity.MajorName = majorList.Where(x => x.MajorNo == arrangeLessonTerm.MajorNo).FirstOrDefault()?.MajorName;
stuAttendanceEntity.ClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceEntity.ClassName = classInfoList
.Where(x => x.ClassNo == arrangeLessonTerm.TeachClassNo).FirstOrDefault()?.ClassName;
stuAttendanceEntity.LessonNo = arrangeLessonTerm.LessonNo;
stuAttendanceEntity.LessonName = arrangeLessonTerm.LessonName;
stuAttendanceEntity.TeachClassNo = arrangeLessonTerm.TeachClassNo;
stuAttendanceEntity.LessonSortNo = arrangeLessonTerm.LessonSortNo;
stuAttendanceEntity.LessonSortName = lessonSortList.Find(m => m.LessonSortNo == arrangeLessonTerm.LessonSortNo)?.LessonSortName;
stuAttendanceEntity.LessonDate = arrangeLessonTerm.LessonDate;
stuAttendanceEntity.PlanWeek = null;
stuAttendanceEntity.LessonTime = arrangeLessonTerm.LessonTime;
stuAttendanceEntity.AttendOrNo = "否";
stuAttendanceEntity.Sort = Convert.ToInt32(model.LeaveType) == 2 ? "病假" : "事假";
stuAttendanceEntity.EmpNo = arrangeLessonTerm.EmpNo;
stuAttendanceEntity.Remark = "按天请假";
stuAttendanceEntity.CheckMarkDept = "";
stuAttendanceEntity.CheckMark = "";
stuAttendanceEntity.InertDate = DateTime.Now;
stuAttendanceEntity.ClassRoomNo = arrangeLessonTerm.ClassroomNo;
stuAttendanceEntity.ClassRoomName = classRoomList.FirstOrDefault(x => x.ClassroomNo == arrangeLessonTerm.ClassroomNo)?.ClassroomName;
//去重
var isExistModel2 = this.BaseRepository("CollegeMIS").FindEntity<StuAttendanceEntity>(x =>
x.AcademicYearNo == stuAttendanceEntity.AcademicYearNo && x.Semester == stuAttendanceEntity.Semester && x.StuNo == stuAttendanceEntity.StuNo &&
x.LessonNo == stuAttendanceEntity.LessonNo && x.TeachClassNo == stuAttendanceEntity.TeachClassNo && x.LessonSortNo == stuAttendanceEntity.LessonSortNo &&
x.LessonDate == stuAttendanceEntity.LessonDate && x.LessonTime == stuAttendanceEntity.LessonTime && x.EmpNo == stuAttendanceEntity.EmpNo && x.ClassRoomNo == stuAttendanceEntity.ClassRoomNo);
if (isExistModel2 != null)
{
stuAttendanceEntity.Modify(isExistModel2.ID);
db.Update(stuAttendanceEntity);
}
else
{
stuAttendanceEntity.Create();
db.Insert(stuAttendanceEntity);
}

}
}
else
{
entity.Create();
db.Insert(entity);
}

db.Commit();
}
@@ -414,6 +603,72 @@ and a.lessondate between '{startTime}' and '{endTime}'");
}
}


/// <summary>
///
/// </summary>
/// <param name="keyValue"></param>
/// <param name="status"></param>
/// <param name="processId"></param>
public void ChangeStatusById(string keyValue, int CheckStatus, string processId)
{
try
{
this.BaseRepository("CollegeMIS").ExecuteBySql($"update stuleavemanagement set ProcessId='{processId}',CheckStatus='{CheckStatus}' where Id='{keyValue}'");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public StuLeaveManagementEntity GetEntityByProcessId(string processId)
{
try
{
var data = this.BaseRepository("CollegeMIS").FindEntity<StuLeaveManagementEntity>(t => t.ProcessId == processId);
if (data != null)
{
var studentlist = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(x => x.StuNo == data.CreateUserNo).FirstOrDefault();
if (studentlist != null)
{
data.DeptNo = studentlist.DeptNo;
data.MajorNo = studentlist.MajorNo;
data.ClassNo = studentlist.ClassNo;
data.CreateUserName = studentlist.StuName;
}
var classlist = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(x => x.ClassNo == data.ClassNo).FirstOrDefault();
if (classlist != null)
{
data.ClassDiredctorNo = classlist.ClassDiredctorNo;
data.ClassTutorNo = classlist.ClassTutorNo;
}
}
return data;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj Vedi File

@@ -106,6 +106,8 @@
<Compile Include="NodeMethod\Ass_ReceiveMethod.cs" />
<Compile Include="NodeMethod\MeetingManagementApplyMethod.cs" />
<Compile Include="NodeMethod\StuDisciplineManagementMethod.cs" />
<Compile Include="NodeMethod\StuCancelLeaveManageMethod.cs" />
<Compile Include="NodeMethod\StuLeaveManagementMethod.cs" />
<Compile Include="NodeMethod\SW_Ask_StudentMainMethod.cs" />
<Compile Include="NodeMethod\SW_Ask_TypeMethod.cs" />
<Compile Include="NodeMethod\LC_hetongMethod.cs" />


+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuCancelLeaveManageMethod.cs Vedi File

@@ -0,0 +1,26 @@
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learun.Application.WorkFlow
{
public class StuCancelLeaveManageMethod : IWorkFlowMethod
{
StuCancelLeaveManagementIBLL stuCancelLeaveManagementIBLL = new StuCancelLeaveManagementBLL();

public void Execute(WfMethodParameter parameter)
{
if (parameter.code == "agree")
{
stuCancelLeaveManagementIBLL.ChangeStatusByProcessId("2", parameter.processId, parameter.userId);
}
else
{
stuCancelLeaveManagementIBLL.ChangeStatusByProcessId("3", parameter.processId, parameter.userId);
}
}
}
}

+ 26
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/StuLeaveManagementMethod.cs Vedi File

@@ -0,0 +1,26 @@
using Learun.Application.TwoDevelopment.EducationalAdministration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Learun.Application.WorkFlow
{
public class StuLeaveManagementMethod : IWorkFlowMethod
{
StuCanceLeaveManagementIBLL stuLeaveManagementIBLL = new StuCanceLeaveManagementBLL();

public void Execute(WfMethodParameter parameter)
{
if (parameter.code == "agree")
{
stuLeaveManagementIBLL.ChangeStatusByProcessId("2", parameter.processId, parameter.userId);
}
else
{
stuLeaveManagementIBLL.ChangeStatusByProcessId("3", parameter.processId, parameter.userId);
}
}
}
}

Caricamento…
Annulla
Salva