From 09c9458f65ad91a548828a3b2a0942101a8eb3ca Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 17 Mar 2022 09:33:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=91=E6=8B=A3=E5=AE=BF=E8=88=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=BC=BA=E5=A4=B1=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.TwoDevelopment.csproj | 44 ++++++++++ .../Accommodation/AccommodationBLL.cs | 54 ++++++++++-- .../Accommodation/AccommodationIBLL.cs | 4 +- .../Accommodation/AccommodationService.cs | 84 +++++++++++++++++++ 4 files changed, 177 insertions(+), 9 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index ccfe45928..53b3a23f2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -144,6 +144,14 @@ + + + + + + + + @@ -184,6 +192,10 @@ + + + + @@ -362,6 +374,22 @@ + + + + + + + + + + + + + + + + @@ -382,10 +410,22 @@ + + + + + + + + + + + + @@ -1687,6 +1727,10 @@ + + + + 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 8e6a8560a..a88770004 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 @@ -85,7 +85,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement { try { - return accommodationService.GetClassifyList(paginationobj,queryJson); + return accommodationService.GetClassifyList(paginationobj, queryJson); } catch (Exception ex) { @@ -239,6 +239,27 @@ 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); + } + } + + } + /// /// 获取Acc_DormitoryBuild表实体数据 /// 主键 @@ -401,7 +422,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - + public List GetClassifyTree() { try @@ -419,7 +440,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement checkstate = 0, isexpand = false, parentId = item.ParentID == null ? "" : item.ParentID, - title =string.IsNullOrEmpty(item.BuildType)?"":(Convert.ToInt32(item.BuildType)+1).ToString() , + title = string.IsNullOrEmpty(item.BuildType) ? "" : (Convert.ToInt32(item.BuildType) + 1).ToString(), }; @@ -489,7 +510,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - /// + /// /// 根据父id 获取树形数据 /// /// @@ -534,11 +555,11 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement } } - public bool MatchDormitoryInfo(string stuNo,string dormitory,string unit,string floor,string room,string bed ,List data) + public bool MatchDormitoryInfo(string stuNo, string dormitory, string unit, string floor, string room, string bed, List data) { try { - return accommodationService.MatchDormitoryInfo(stuNo,dormitory,unit,floor,room,bed,data); + return accommodationService.MatchDormitoryInfo(stuNo, dormitory, unit, floor, room, bed, data); } catch (Exception ex) @@ -613,7 +634,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement /// /// /// - public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type) + public void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity, int type) { try { @@ -651,6 +672,25 @@ 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); + } + } + } + /// /// 批量添加单元、楼层、宿舍、床位 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs index 67f08170d..c64460bd5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationIBLL.cs @@ -73,7 +73,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement void DeleteEntity(string keyValue); string GetBuildType(string parentID); string GetParentBuildType(string keyValue); - + void DeleteBed(string keyValue, string ParentID); /// /// 保存实体数据(新增、修改) /// 主键 @@ -82,7 +82,7 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement void SaveEntity(string keyValue, Acc_DormitoryBuildEntity entity); void SaveDeptClass(string keyValue, Acc_DormitoryBuildEntity entity,int type); string SaveRoom(string RoomId, List list); - + void SaveBedEntity(string keyValue, string ParentID, Acc_DormitoryBuildEntity entity); /// /// 批量添加单元、楼层、房间、床位 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs index acb177053..f83a803e9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs @@ -1082,6 +1082,90 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student } } + public void DeleteBed(string keyValue, string ParentID) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + UpdateCheckInNum(ParentID); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveBedEntity(string keyValue, string ParentID, Acc_DormitoryBuildEntity entity) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + db.Update(entity); + } + else + { + var parentEntity = db.FindEntity(ParentID); + entity.Create(); + entity.ApartmentId = parentEntity.ApartmentId; + entity.UnitId = parentEntity.UnitId; + entity.FloorId = parentEntity.FloorId; + entity.ParentID = ParentID; + entity.BuildType = "5"; + db.Insert(entity); + } + db.Commit(); + UpdateCheckInNum(ParentID); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + private void UpdateCheckInNum(string ParentID) + { + try + { + string sql = $@"update [dbo].[Acc_DormitoryBuild] set RoomType=( +select count(1) from [dbo].[Acc_DormitoryBuild] where ParentId='{ParentID}' and BuildType='5' +) +where ID='{ParentID}' +"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } ///