From 9c35c978fd0203c9fb152287e1c35af7976ccb0d Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 3 Nov 2022 14:34:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=BF=E8=88=8D=E7=AE=A1=E7=90=86=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Accommodation/AccommodationService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 9ecab90b1..960cdd883 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 @@ -1715,6 +1715,7 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student { var parentEntity = db.FindEntity(ParentID); entity.Create(); + entity.DNo = entity.Name.Substring(0,entity.Name.Length-1); entity.ApartmentId = parentEntity.ApartmentId; entity.UnitId = parentEntity.UnitId; entity.FloorId = parentEntity.FloorId; @@ -2115,7 +2116,7 @@ where ID='{ParentID}' var dormitoryCode = dr["寝室编号"].ToString().Trim(); var dormitory = dormitoryBuildList.Where(x => x.Name == dormitoryName && x.DNo == dormitoryCode && x.BuildType == "4" && x.ParentID == floor.ID) .FirstOrDefault(); - if (dormitory == null) + if (dormitory == null && !string.IsNullOrEmpty(dormitoryName) && !string.IsNullOrEmpty(dormitoryCode)) { //添加 dormitory = new Acc_DormitoryBuildEntity(); @@ -2146,9 +2147,9 @@ where ID='{ParentID}' //床位 var bedName = dr["床位"].ToString().Trim(); var bedCode = bedName.Replace("床", "").Replace("号", ""); - var bed = dormitoryBuildList.Where(x => x.Name == bedName && x.DNo == bedCode && x.BuildType == "5" && x.ParentID == dormitory.ID) + var bed = dormitoryBuildList.Where(x => x.Name == bedName && x.DNo == bedCode && x.BuildType == "5" && x.ParentID == dormitory?.ID) .FirstOrDefault(); - if (bed == null) + if (bed == null && !string.IsNullOrEmpty(bedName) && !string.IsNullOrEmpty(bedCode)) { bed = new Acc_DormitoryBuildEntity(); bed.Create();