diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs index ec6947c2d..51a28bb96 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs @@ -25,6 +25,7 @@ namespace Learun.Application.WebApi { private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL(); + private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL(); /// /// 注册接口 @@ -44,6 +45,9 @@ namespace Learun.Application.WebApi //审核学生请假 Post["/savecheck"] = SaveCheckForm; + Post["/submit"] = Submit; + Get["/shList"] = GetshList; + } #region 获取数据 @@ -65,6 +69,22 @@ namespace Learun.Application.WebApi }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// + /// + public Response GetshList(dynamic _) + { + StuLeaveManagementEntity parameter = this.GetReqData(); + var stuLeaveManagementData = stuLeaveManagementIBLL.GetEntityByProcessId(parameter.ProcessId); + var jsonData = new + { + stuLeaveManagement = stuLeaveManagementData, + }; + return Success(jsonData); + } /// /// 学生请假--教师审核列表 /// @@ -185,6 +205,21 @@ namespace Learun.Application.WebApi stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity); return Success("保存成功!"); } + + /// + /// 提交 + /// + /// + /// + 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 私有类 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs index ebfab9707..abb6b20a4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs @@ -91,7 +91,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取StuLeaveManagement表实体数据 + /// + /// 主键 + /// + 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 提交数据 @@ -162,6 +184,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + public void ChangeStatusById(string keyValue, int status, string processId) + { + try + { + stuLeaveManagementService.ChangeStatusById(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs index 3f12a110a..e9ff7ea16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs @@ -28,6 +28,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// StuLeaveManagementEntity GetStuLeaveManagementEntity(string keyValue); + StuLeaveManagementEntity GetEntityByProcessId(string processId); #endregion #region 提交数据 @@ -44,6 +45,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, StuLeaveManagementEntity entity); void ModifyStatus(string keyValue, string CheckStatus, string processId); + + void ChangeStatusById(string keyValue, int status, string processId); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs index 4f815c0dd..5cca53734 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs @@ -446,6 +446,54 @@ and a.lessondate between '{startTime}' and '{endTime}'"); } } + + /// + /// + /// + /// + /// + /// + public void ChangeStatusById(string keyValue, int status, string processId) + { + try + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update stuleavemanagement set ProcessId='{processId}',status='{status}' where Id='{keyValue}'"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取主表实体数据 + /// + /// 流程实例ID + /// + public StuLeaveManagementEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }