From 69ef9d7cd5900c384018c3b6e0196260968ed6c3 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 22 Feb 2022 16:57:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=9D=E5=AE=A4=E5=88=86=E7=B1=BB=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccommodationController.cs | 107 ++---------- .../Accommodation/AccommodationBLL.cs | 159 +----------------- 2 files changed, 19 insertions(+), 247 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs index 0d69a3669..984afa1b0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/AccommodationController.cs @@ -7,7 +7,6 @@ using System.Web.Helpers; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; -using System.Linq; namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { @@ -33,31 +32,26 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { return View(); } - /// - /// 分配宿舍 - /// - /// - [HttpGet] - public ActionResult IndexDistribution() - { - return View(); - } + ///// + ///// 表单页 + ///// + ///// + //[HttpGet] + //public ActionResult Form() + //{ + // return View(); + //} /// /// 带参数的表单页 /// /// [HttpGet] - public ActionResult Form(string ParentID = null, string ParentName = null, string keyValue = null) + public ActionResult Form(string ParentID = null, string ParentName = null) { ViewBag.ParentID = ParentID; ViewBag.ParentName = ParentName; ViewBag.BuildType = accommodationIBLL.GetBuildType(ParentID); - if (!string.IsNullOrEmpty(keyValue)) - { - ViewBag.BuildType = accommodationIBLL.GetParentBuildType(keyValue); - } - return View(); } @@ -143,15 +137,6 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers return View(); } - /// - /// 分配系 - /// - /// - [HttpGet] - public ActionResult FormDept() - { - return View(); - } /// @@ -210,6 +195,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers } + #endregion #region 获取数据 @@ -399,18 +385,6 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers return Success("删除成功!"); } /// - /// 删除 - /// 主键 - /// - /// - [HttpPost] - [AjaxOnly] - public ActionResult DeleteBed(string keyValue,string ParentID) - { - accommodationIBLL.DeleteBed(keyValue, ParentID); - return Success("删除成功!"); - } - /// /// 保存实体数据(新增、修改) /// 主键 /// @@ -424,50 +398,8 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers accommodationIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } - /// - /// 保存实体数据(新增、修改) - /// 主键 - /// - /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveBedForm(string keyValue,string ParentID, string strEntity) - { - Acc_DormitoryBuildEntity entity = strEntity.ToObject(); - accommodationIBLL.SaveBedEntity(keyValue, ParentID, entity); - return Success("保存成功!"); - } - - /// - /// 寝室分配系 - /// 主键 - /// - /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveDeptClass(string keyValue, string strEntity,int type) - { - Acc_DormitoryBuildEntity entity = strEntity.ToObject(); - accommodationIBLL.SaveDeptClass(keyValue, entity, type); - return Success("保存成功!"); - } - /// - /// 寝室分配床位 - /// - /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveRoom(string RoomId, List list) - { - //List list = strEntity.ToObject>(); - accommodationIBLL.SaveRoom(RoomId, list); - return Success("保存成功!"); - } - + /// /// 学生宿舍的单元、楼层、房间、床位添加 /// @@ -479,6 +411,11 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers [AjaxOnly] public ActionResult DormitoryAdd(string keyValue, string strEntity) { + //dynamic entity = JsonConvert.DeserializeObject(strEntity); + //var ElementNum = entity.ElementNum; + //var FloorNum = entity.FloorNum; + //var RoomNum = entity.RoomNUm; + //var BedNum = entity.BedNum; JObject jsonEntity = JObject.Parse(strEntity); var elementNum = int.Parse(jsonEntity["ElementNum"].ToString()); @@ -507,17 +444,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers } - /// - /// 同步宿舍信息数据 - /// - /// - public ActionResult SyncData() - { - accommodationIBLL.SyncData(); - return Success("同步成功"); - - } //public ActionResult DormitoryAdd(string a,string ) #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs index 69d3119ce..0fd4e3ddd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationBLL.cs @@ -42,26 +42,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } } - - public IEnumerable GetBedListByRoomId(string RoomId) - { - try - { - return accommodationService.GetBedListByRoomId(RoomId); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - public IEnumerable GetAllList() { try @@ -218,27 +198,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } - public string GetParentBuildType(string keyValue) - { - try - { - return accommodationService.GetParentBuildType(keyValue); - - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - - } - /// /// 获取Acc_DormitoryBuild表实体数据 /// 主键 @@ -330,9 +289,8 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement value = item.ID.ToString(), showcheck = false, checkstate = 0, - isexpand = true, - parentId = item.ParentID == null ? "" : item.ParentID, - title = item.BuildType + isexpand = false, + parentId = item.ParentID == null ? "" : item.ParentID }; @@ -584,31 +542,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - - /// - /// 删除实体数据 - /// 主键 - /// - /// - public void DeleteBed(string keyValue, string ParentID) - { - try - { - accommodationService.DeleteBed(keyValue, ParentID); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - /// /// 保存实体数据(新增、修改) /// 主键 @@ -633,74 +566,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - /// - /// 保存实体数据(新增、修改) - /// 主键 - /// - /// - public void SaveBedEntity(string keyValue,string ParentID, Acc_DormitoryBuildEntity entity) - { - try - { - accommodationService.SaveBedEntity(keyValue, ParentID, entity); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - - - - /// - /// 分配系 - /// - /// - /// - public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type) - { - try - { - accommodationService.SaveDeptClass(keyValue, entity, type); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } - - public void SaveRoom(string RoomId, List list) - { - try - { - accommodationService.SaveRoom(RoomId, list); - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - } - } /// /// 批量添加单元、楼层、宿舍、床位 @@ -757,26 +622,6 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - public void SyncData() - { - try - { - accommodationService.SyncData(); - - } - catch (Exception ex) - { - if (ex is ExceptionEx) - { - throw; - } - else - { - throw ExceptionEx.ThrowBusinessException(ex); - } - - } - } #endregion