Parcourir la source

【修改】会议管理:增加会议场地是否被占用的判断;

黑艺新账号
dyy il y a 1 an
Parent
révision
227937263d
5 fichiers modifiés avec 103 ajouts et 0 suppressions
  1. +13
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/MeetingManagementController.cs
  2. +8
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/MeetingManagement/Form.js
  3. +24
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementBLL.cs
  4. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs
  5. +51
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs

+ 13
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/MeetingManagementController.cs Voir le fichier

@@ -170,6 +170,12 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
{
UserInfo userInfo = LoginUserInfo.Get();
MeetingManagementEntity entity = strEntity.ToObject<MeetingManagementEntity>();
//判断会议场地是否被占用
var isOccupy = meetingManagementIBLL.JudgeIsOccupy(entity);
if (isOccupy)
{
return Fail("会议场地当前时间段已被占用!");
}
entity.CreateUser = userInfo.userId;
entity.CreateTime = DateTime.Now;
entity.CheckStatus = "0";
@@ -200,6 +206,13 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
[AjaxOnly]
public ActionResult DoSubmit(string keyValue, string status, string processId)
{
//判断会议场地是否被占用
var entity = meetingManagementIBLL.GetMeetingManagementEntity(keyValue);
var isOccupy = meetingManagementIBLL.JudgeIsOccupy(entity);
if (isOccupy)
{
return Fail("会议场地当前时间段已被占用!");
}
meetingManagementIBLL.DoSubmit(keyValue, status, processId);
return Success("操作成功!");
}


+ 8
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/MeetingManagement/Form.js Voir le fichier

@@ -93,6 +93,14 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) {
return false;
}
//验证结束时间必须大于开始时间
var BeginTime = $("#BeginTime").val();
var EndTime = $("#EndTime").val();
if (new Date(EndTime) <= new Date(BeginTime)) {
learun.alert.warning("会议结束时间必须大于会议开始时间!");
return false;
}

return true;
};
// 保存数据


+ 24
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementBLL.cs Voir le fichier

@@ -215,6 +215,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 判断会议场地是否被占用
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public bool JudgeIsOccupy(MeetingManagementEntity entity)
{
try
{
return meetingManagementService.JudgeIsOccupy(entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 审核实体数据
/// <param name="keyValue">主键</param>


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementIBLL.cs Voir le fichier

@@ -70,6 +70,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <summary>
/// <returns></returns>
void DoSubmit(string keyValue, string status, string processId);

/// <summary>
/// 判断会议场地是否被占用
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
bool JudgeIsOccupy(MeetingManagementEntity entity);
/// <summary>
/// 审核实体数据
/// <param name="keyValue">主键</param>


+ 51
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/MeetingManagement/MeetingManagementService.cs Voir le fichier

@@ -378,6 +378,57 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 判断会议场地是否被占用
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
public bool JudgeIsOccupy(MeetingManagementEntity entity)
{
try
{
var result = false;//默认false,代表未占用

//查找已提交/已审核通过的会议场地
var list = this.BaseRepository("CollegeMIS").FindList<MeetingManagementEntity>(x => x.MeetingPlace == entity.MeetingPlace && (x.CheckStatus == "1" || x.CheckStatus == "3")).OrderBy(x => x.BeginTime);
if (list.Any())
{
//有则判断时间是否冲突
foreach (var item in list)
{
//开始时间:小于区间左,则判断结束时间;区间中间,则占用;大于区间右,则不占用;
if (entity.BeginTime < item.BeginTime)
{
//结束时间:小于区间左,则不占用;
if (entity.EndTime > item.BeginTime)
{
result = true;
return result;
}
}
else if(entity.BeginTime < item.EndTime)
{
result = true;
return result;
}
}
}

return result;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 审核实体数据
/// <param name="keyValue">主键</param>


Chargement…
Annuler
Enregistrer