Browse Source

app学生请假接口

新疆体育高职分支
ndbs 1 year ago
parent
commit
a49dba211b
4 changed files with 127 additions and 1 deletions
  1. +35
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs
  2. +41
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs
  3. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs
  4. +48
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs

+ 35
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/StuLeaveManagementApi.cs View File

@@ -25,6 +25,7 @@ namespace Learun.Application.WebApi
{

private StuLeaveManagementIBLL stuLeaveManagementIBLL = new StuLeaveManagementBLL();
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();

/// <summary>
/// 注册接口
@@ -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);
}

/// <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>
/// 学生请假--教师审核列表
/// <summary>
@@ -185,6 +205,21 @@ namespace Learun.Application.WebApi
stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity);
return Success("保存成功!");
}

/// <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 私有类


+ 41
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementBLL.cs View File

@@ -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 提交数据
@@ -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



+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementIBLL.cs View File

@@ -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 提交数据
@@ -44,6 +45,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, StuLeaveManagementEntity entity);
void ModifyStatus(string keyValue, string CheckStatus, string processId);

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

}


+ 48
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuLeaveManagement/StuLeaveManagementService.cs View File

@@ -446,6 +446,54 @@ 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 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);
}
}
}
/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public StuLeaveManagementEntity GetEntityByProcessId(string processId)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<StuLeaveManagementEntity>(t => t.ProcessId == processId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

}


Loading…
Cancel
Save