From 979ef0b50d505b83c4c9e4d1940533386ebb3c51 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 3 Nov 2022 14:24:21 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=AE=BF?= =?UTF-8?q?=E8=88=8D=E7=AE=A1=E7=90=86=E5=AF=BC=E5=85=A5=EF=BC=9A=E5=AF=9D?= =?UTF-8?q?=E5=AE=A4=E5=8F=B7=E4=B8=BA=E7=A9=BA=E3=80=81=E5=BA=8A=E4=BD=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E3=80=81=E5=8A=A0=E5=88=A4=E6=96=AD=EF=BC=9B?= =?UTF-8?q?=E5=BA=8A=E4=BD=8D=E7=AE=A1=E7=90=86=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=8A=E4=BD=8D=E7=BC=96=E5=8F=B7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Accommodation/AccommodationService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 7700554a1..fdc2f61d6 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 @@ -1763,6 +1763,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; @@ -2001,7 +2002,8 @@ where ID='{ParentID}' var leaderno = ""; if (!string.IsNullOrEmpty(dr["舍长学号"].ToString())) { - leaderno = stuinfobasic.Where(x => x.StuNo == dr["舍长学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; + //leaderno = stuinfobasic.Where(x => x.StuNo == dr["舍长学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; + leaderno = stuinfobasic.Where(x => x.StuNo == dr["舍长学号"].ToString()).FirstOrDefault()?.StuNo; if (string.IsNullOrEmpty(leaderno)) { fnum++; @@ -2111,7 +2113,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(); @@ -2142,9 +2144,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();