@@ -204,6 +204,7 @@ | |||||
<Compile Include="Modules\LogisticsManagement\Acc_PublicAreaHealthApi.cs" /> | <Compile Include="Modules\LogisticsManagement\Acc_PublicAreaHealthApi.cs" /> | ||||
<Compile Include="Modules\LogisticsManagement\Acc_DailyAssessApi.cs" /> | <Compile Include="Modules\LogisticsManagement\Acc_DailyAssessApi.cs" /> | ||||
<Compile Include="Modules\PersonnelManagement\CustmerLeaveApi.cs" /> | <Compile Include="Modules\PersonnelManagement\CustmerLeaveApi.cs" /> | ||||
<Compile Include="Modules\StuLeaveManagementApi.cs" /> | |||||
<Compile Include="Modules\WelfarePositionApi.cs" /> | <Compile Include="Modules\WelfarePositionApi.cs" /> | ||||
<Compile Include="Modules\OuoutsourcingApi.cs" /> | <Compile Include="Modules\OuoutsourcingApi.cs" /> | ||||
<Compile Include="Modules\WageScheduleApi.cs" /> | <Compile Include="Modules\WageScheduleApi.cs" /> | ||||
@@ -36,6 +36,11 @@ namespace Learun.Application.WebApi | |||||
Get["/form"] = GetForm; | Get["/form"] = GetForm; | ||||
Post["/delete"] = DeleteForm; | Post["/delete"] = DeleteForm; | ||||
Post["/save"] = SaveForm; | Post["/save"] = SaveForm; | ||||
//审核学生请假 | |||||
Post["/savecheck"] = SaveCheckForm; | |||||
//学生请假--教师审核列表 | |||||
Get["/checkpagelist"] = GetCheckPageList; | |||||
} | } | ||||
#region 获取数据 | #region 获取数据 | ||||
@@ -58,6 +63,24 @@ namespace Learun.Application.WebApi | |||||
return Success(jsonData); | return Success(jsonData); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 学生请假--教师审核列表 | |||||
/// <summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response GetCheckPageList(dynamic _) | |||||
{ | |||||
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); | |||||
var data = stuLeaveManagementIBLL.GetCheckPageList(parameter.pagination, parameter.queryJson); | |||||
var jsonData = new | |||||
{ | |||||
rows = data, | |||||
total = parameter.pagination.total, | |||||
page = parameter.pagination.page, | |||||
records = parameter.pagination.records | |||||
}; | |||||
return Success(jsonData); | |||||
} | |||||
/// <summary> | |||||
/// 获取表单数据 | /// 获取表单数据 | ||||
/// <summary> | /// <summary> | ||||
/// <param name="_"></param> | /// <param name="_"></param> | ||||
@@ -74,7 +97,6 @@ namespace Learun.Application.WebApi | |||||
} | } | ||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -102,6 +124,57 @@ namespace Learun.Application.WebApi | |||||
stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity); | stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 判断是否可以审核 | |||||
/// <summary> | |||||
/// <param name="_"></param> | |||||
/// <returns></returns> | |||||
public Response IsCheck(dynamic _) | |||||
{ | |||||
string keyValue = this.GetReqData(); | |||||
var stuLeaveManagementData = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(keyValue); | |||||
bool isDeptDirector = false; //登录用户是否是系主任标识 | |||||
var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); | |||||
var loginInfoRoleIds = LoginUserInfo.Get().roleIds; | |||||
if (loginInfoRoleIds.IndexOf(',') == -1) | |||||
{ | |||||
if (loginInfoRoleIds == deptDirectorRoleId) | |||||
{ | |||||
isDeptDirector = true; | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) | |||||
{ | |||||
isDeptDirector = true; | |||||
} | |||||
} | |||||
if (stuLeaveManagementData.LeaveDay > 2 && !isDeptDirector) | |||||
{ | |||||
return Fail("该请假申请大于2天,需要由系主任审核!"); | |||||
} | |||||
return Success(""); | |||||
} | |||||
/// <summary> | |||||
/// 审核学生请假 | |||||
/// <param name="_"></param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public Response SaveCheckForm(dynamic _) | |||||
{ | |||||
var loginInfo = LoginUserInfo.Get(); | |||||
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); | |||||
StuLeaveManagementEntity entity = parameter.strEntity.ToObject<StuLeaveManagementEntity>(); | |||||
entity.CheckUserId = loginInfo.userId; | |||||
entity.CheckUserNo = loginInfo.account; | |||||
entity.CheckTime = DateTime.Now; | |||||
stuLeaveManagementIBLL.SaveEntity(parameter.keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
#region 私有类 | #region 私有类 | ||||
@@ -43,6 +43,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 学生请假教师审核列表 | |||||
/// </summary> | |||||
/// <param name="pagination"></param> | |||||
/// <param name="queryJson"></param> | |||||
/// <returns></returns> | |||||
public IEnumerable<StuLeaveManagementEntity> GetCheckPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
return stuLeaveManagementService.GetCheckPageList(pagination, queryJson); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="queryJson">查询参数</param> | /// <param name="queryJson">查询参数</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson); | IEnumerable<StuLeaveManagementEntity> GetPageList(Pagination pagination, string queryJson); | ||||
IEnumerable<StuLeaveManagementEntity> GetCheckPageList(Pagination pagination, string queryJson); | |||||
/// <summary> | /// <summary> | ||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -105,6 +105,87 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public IEnumerable<StuLeaveManagementEntity> GetCheckPageList(Pagination pagination, string queryJson) | |||||
{ | |||||
try | |||||
{ | |||||
var strSql = new StringBuilder(); | |||||
strSql.Append("SELECT t.*,s.StuName as CreateUserName,s.ClassNo,s.DeptNo,s.MajorNo,c.ClassDiredctorNo,c.ClassTutorNo "); | |||||
strSql.Append(" FROM StuLeaveManagement t left join StuInfoBasic s on t.CreateUserNo=s.StuNo left join ClassInfo c on s.ClassNo=c.ClassNo "); | |||||
strSql.Append(" WHERE 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | |||||
// 虚拟参数 | |||||
var dp = new DynamicParameters(new { }); | |||||
if (!queryParam["LeaveType"].IsEmpty()) | |||||
{ | |||||
dp.Add("LeaveType", queryParam["LeaveType"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.LeaveType = @LeaveType "); | |||||
} | |||||
if (!queryParam["CheckStatus"].IsEmpty()) | |||||
{ | |||||
dp.Add("CheckStatus", queryParam["CheckStatus"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.CheckStatus = @CheckStatus "); | |||||
} | |||||
if (!queryParam["StuNo"].IsEmpty()) | |||||
{ | |||||
dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); | |||||
strSql.Append(" AND t.CreateUserNo = @StuNo "); | |||||
} | |||||
//班级班主任/辅导员/系主任 | |||||
var ClassManagerNo = LoginUserInfo.Get().account; | |||||
if (!string.IsNullOrEmpty(ClassManagerNo)) | |||||
{ | |||||
dp.Add("ClassManagerNo", ClassManagerNo, DbType.String); | |||||
strSql.Append(" AND (c.ClassDiredctorNo = @ClassManagerNo or c.ClassTutorNo = @ClassManagerNo "); | |||||
//登录用户是否是系主任:若是,展示大于2天的请假记录; | |||||
var deptDirectorRoleId = Config.GetValue("DeptDirectorRoleId"); | |||||
if (deptDirectorRoleId != null) | |||||
{ | |||||
var loginInfoRoleIds = LoginUserInfo.Get().roleIds; | |||||
if (loginInfoRoleIds.IndexOf(',') == -1) | |||||
{ | |||||
if (loginInfoRoleIds == deptDirectorRoleId) | |||||
{ | |||||
strSql.Append(" or t.LeaveDay>2 )"); | |||||
} | |||||
else | |||||
{ | |||||
strSql.Append(" ) "); | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
if (loginInfoRoleIds.Split(',').Contains(deptDirectorRoleId)) | |||||
{ | |||||
strSql.Append(" or t.LeaveDay>2 )"); | |||||
} | |||||
else | |||||
{ | |||||
strSql.Append(" ) "); | |||||
} | |||||
} | |||||
} | |||||
else | |||||
{ | |||||
strSql.Append(" ) "); | |||||
} | |||||
} | |||||
return this.BaseRepository("CollegeMIS").FindList<StuLeaveManagementEntity>(strSql.ToString(), dp, pagination); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 获取StuLeaveManagement表实体数据 | /// 获取StuLeaveManagement表实体数据 | ||||
/// </summary> | /// </summary> | ||||