Przeglądaj źródła

【修改】宿舍管理导入:寝室号为空、床位为空、加判断;床位管理:新增增加床位编号;

临城职教中职
dyy 2 lat temu
rodzic
commit
979ef0b50d
1 zmienionych plików z 6 dodań i 4 usunięć
  1. +6
    -4
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs

+ 6
- 4
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs Wyświetl plik

@@ -1763,6 +1763,7 @@ select parentid from [dbo].[Acc_DormitoryBuild] where BuildType='5' and (student
{
var parentEntity = db.FindEntity<Acc_DormitoryBuildEntity>(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();


Ładowanie…
Anuluj
Zapisz