Ver código fonte

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

西昌缴费二期
dyy 2 anos atrás
pai
commit
b4ee12b2e0
1 arquivos alterados com 6 adições e 4 exclusões
  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 Ver arquivo

@@ -1715,6 +1715,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;
@@ -2004,7 +2005,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++;
@@ -2114,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();
@@ -2145,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();


Carregando…
Cancelar
Salvar