diff --git a/CloudBuilder/CloudBuilder.Master.Service/FamilyTreeService.auto.cs b/CloudBuilder/CloudBuilder.Master.Service/FamilyTreeService.auto.cs index 9c772cf..42b2b9a 100644 --- a/CloudBuilder/CloudBuilder.Master.Service/FamilyTreeService.auto.cs +++ b/CloudBuilder/CloudBuilder.Master.Service/FamilyTreeService.auto.cs @@ -396,12 +396,18 @@ namespace CloudBuilder.Master.Service [UnitOfWork] public FamilyTreeData Update(FamilyTreeData data) { - FamilyTreeEntity d = repository.DetachedEntities.Where(x => x.TreeName == data.FamilyTree.TreeName).FirstOrDefault(); - if (d == null) + FamilyTreeEntity d = null; + if (data.FamilyTree.TreeName != data.FamilyTree.OrgTreeName) { - throw new ValidatedException("家族名称不存在."); + d = repository.DetachedEntities.Where(x => x.TreeName == data.FamilyTree.TreeName).FirstOrDefault(); + if (d != null) + { + throw new ValidatedException("家族名称已存在."); + } } + d = repository.DetachedEntities.Where(x => x.TreeId == data.FamilyTree.TreeId).FirstOrDefault(); + Validate(data.FamilyTree); ObjectCopyHelper.Copy(data.FamilyTree, d); diff --git a/CloudBuilder/CloudBuilder.Master/Data/FamilyTreeDisplayData.cs b/CloudBuilder/CloudBuilder.Master/Data/FamilyTreeDisplayData.cs index 67150fa..e66395b 100644 --- a/CloudBuilder/CloudBuilder.Master/Data/FamilyTreeDisplayData.cs +++ b/CloudBuilder/CloudBuilder.Master/Data/FamilyTreeDisplayData.cs @@ -25,6 +25,8 @@ namespace CloudBuilder.Master.Data } public string? AncestorPersonGenealogyName { get; set; } + + public string? OrgTreeName { get; set; } } } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs index 004f70d..852ae0d 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/CloudBuilderMasterRegistEntity.auto.cs @@ -105,7 +105,8 @@ builder.Entity(eb => { eb.HasNoKey(); }); builder.Entity(eb => { eb.HasNoKey(); }); - //***END*** + +//***END*** } } } diff --git a/CloudBuilder/CloudBuilder.Master/Entity/FamilyPersonEntity.auto.cs b/CloudBuilder/CloudBuilder.Master/Entity/FamilyPersonEntity.auto.cs index 06672b3..a777744 100644 --- a/CloudBuilder/CloudBuilder.Master/Entity/FamilyPersonEntity.auto.cs +++ b/CloudBuilder/CloudBuilder.Master/Entity/FamilyPersonEntity.auto.cs @@ -14,140 +14,144 @@ namespace CloudBuilder.Master.Entity { } - [Column("created_datetime")] - public DateTime CreatedDatetime { get; set; } - [Column("created_by")] - public string CreatedBy { get; set; } - [Column("updated_datetime")] - public DateTime UpdatedDatetime { get; set; } - [Column("updated_by")] - public string UpdatedBy { get; set; } - [Key] - [Column("person_id")] - public string PersonId { get; set; } - [Column("avatar_filename")] - public string? AvatarFilename { get; set; } - [Column("surname")] - public string Surname { get; set; } - [Column("genealogy_name")] - public string? GenealogyName { get; set; } - [Column("common_name")] - public string? CommonName { get; set; } [Column("alias")] public string? Alias { get; set; } - [Column("zi")] - public string? Zi { get; set; } - [Column("hao")] - public string? Hao { get; set; } - [Column("father_id")] - public string? FatherId { get; set; } - [Column("mother_name")] - public string? MotherName { get; set; } - [Column("birth_order")] - public string? BirthOrder { get; set; } - [Column("gender")] - public string? Gender { get; set; } - [Column("marital_status")] - public string? MaritalStatus { get; set; } - [Column("school")] - public string? School { get; set; } - [Column("major")] - public string? Major { get; set; } - [Column("education")] - public string? Education { get; set; } - [Column("graduation_status")] - public string? GraduationStatus { get; set; } - [Column("duty")] - public string? Duty { get; set; } - [Column("title")] - public string? Title { get; set; } - [Column("birth_text")] - public string? BirthText { get; set; } + [Column("avatar_filename")] + public string? AvatarFilename { get; set; } + [Column("bind_user_id")] + public string? BindUserId { get; set; } [Column("birth_date")] public Nullable BirthDate { get; set; } - [Column("death_text")] - public string? DeathText { get; set; } + [Column("birth_order")] + public string? BirthOrder { get; set; } + [Column("birth_text")] + public string? BirthText { get; set; } + [Column("common_name")] + public string? CommonName { get; set; } + [Column("created_by")] + public string CreatedBy { get; set; } + [Column("created_datetime")] + public DateTime CreatedDatetime { get; set; } [Column("death_date")] public Nullable DeathDate { get; set; } - [Column("privacy")] - public string? Privacy { get; set; } - [Column("live_status")] - public string LiveStatus { get; set; } + [Column("death_text")] + public string? DeathText { get; set; } + [Column("duty")] + public string? Duty { get; set; } + [Column("education")] + public string? Education { get; set; } + [Column("father_id")] + public string? FatherId { get; set; } + [Column("gender")] + public string? Gender { get; set; } + [Column("genealogy_name")] + public string? GenealogyName { get; set; } + [Column("graduation_status")] + public string? GraduationStatus { get; set; } + [Column("hao")] + public string? Hao { get; set; } [Column("introduction")] public string? Introduction { get; set; } [Column("is_bind_user")] public string? IsBindUser { get; set; } - [Column("bind_user_id")] - public string? BindUserId { get; set; } + [Column("live_status")] + public string LiveStatus { get; set; } + [Column("major")] + public string? Major { get; set; } + [Column("marital_status")] + public string? MaritalStatus { get; set; } + [Column("mother_name")] + public string? MotherName { get; set; } + [Key] + [Column("person_id")] + public string PersonId { get; set; } + [Column("privacy")] + public string? Privacy { get; set; } + [Column("school")] + public string? School { get; set; } + [Column("surname")] + public string Surname { get; set; } + [Column("title")] + public string? Title { get; set; } + [Column("tree_id")] + public string TreeId { get; set; } + [Column("updated_by")] + public string UpdatedBy { get; set; } + [Column("updated_datetime")] + public DateTime UpdatedDatetime { get; set; } + [Column("zi")] + public string? Zi { get; set; } - public const string CREATED_DATETIME = "CreatedDatetime"; - public const string CREATED_BY = "CreatedBy"; - public const string UPDATED_DATETIME = "UpdatedDatetime"; - public const string UPDATED_BY = "UpdatedBy"; - public const string PERSON_ID = "PersonId"; - public const string AVATAR_FILENAME = "AvatarFilename"; - public const string SURNAME = "Surname"; - public const string GENEALOGY_NAME = "GenealogyName"; - public const string COMMON_NAME = "CommonName"; public const string ALIAS = "Alias"; - public const string ZI = "Zi"; - public const string HAO = "Hao"; - public const string FATHER_ID = "FatherId"; - public const string MOTHER_NAME = "MotherName"; - public const string BIRTH_ORDER = "BirthOrder"; - public const string GENDER = "Gender"; - public const string MARITAL_STATUS = "MaritalStatus"; - public const string SCHOOL = "School"; - public const string MAJOR = "Major"; - public const string EDUCATION = "Education"; - public const string GRADUATION_STATUS = "GraduationStatus"; - public const string DUTY = "Duty"; - public const string TITLE = "Title"; - public const string BIRTH_TEXT = "BirthText"; + public const string AVATAR_FILENAME = "AvatarFilename"; + public const string BIND_USER_ID = "BindUserId"; public const string BIRTH_DATE = "BirthDate"; - public const string DEATH_TEXT = "DeathText"; + public const string BIRTH_ORDER = "BirthOrder"; + public const string BIRTH_TEXT = "BirthText"; + public const string COMMON_NAME = "CommonName"; + public const string CREATED_BY = "CreatedBy"; + public const string CREATED_DATETIME = "CreatedDatetime"; public const string DEATH_DATE = "DeathDate"; - public const string PRIVACY = "Privacy"; - public const string LIVE_STATUS = "LiveStatus"; + public const string DEATH_TEXT = "DeathText"; + public const string DUTY = "Duty"; + public const string EDUCATION = "Education"; + public const string FATHER_ID = "FatherId"; + public const string GENDER = "Gender"; + public const string GENEALOGY_NAME = "GenealogyName"; + public const string GRADUATION_STATUS = "GraduationStatus"; + public const string HAO = "Hao"; public const string INTRODUCTION = "Introduction"; public const string IS_BIND_USER = "IsBindUser"; - public const string BIND_USER_ID = "BindUserId"; + public const string LIVE_STATUS = "LiveStatus"; + public const string MAJOR = "Major"; + public const string MARITAL_STATUS = "MaritalStatus"; + public const string MOTHER_NAME = "MotherName"; + public const string PERSON_ID = "PersonId"; + public const string PRIVACY = "Privacy"; + public const string SCHOOL = "School"; + public const string SURNAME = "Surname"; + public const string TITLE = "Title"; + public const string TREE_ID = "TreeId"; + public const string UPDATED_BY = "UpdatedBy"; + public const string UPDATED_DATETIME = "UpdatedDatetime"; + public const string ZI = "Zi"; public const string DB_NAME_FAMILY_PERSON = "family_person"; - public const string DB_NAME_FIELDS="created_datetime,created_by,updated_datetime,updated_by,person_id,avatar_filename,surname,genealogy_name,common_name,alias,zi,hao,father_id,mother_name,birth_order,gender,marital_status,school,major,education,graduation_status,duty,title,birth_text,birth_date,death_text,death_date,privacy,live_status,introduction,is_bind_user,bind_user_id"; + public const string DB_NAME_FIELDS="alias,avatar_filename,bind_user_id,birth_date,birth_order,birth_text,common_name,created_by,created_datetime,death_date,death_text,duty,education,father_id,gender,genealogy_name,graduation_status,hao,introduction,is_bind_user,live_status,major,marital_status,mother_name,person_id,privacy,school,surname,title,tree_id,updated_by,updated_datetime,zi"; - public const string DB_CREATED_DATETIME = "created_datetime"; - public const string DB_CREATED_BY = "created_by"; - public const string DB_UPDATED_DATETIME = "updated_datetime"; - public const string DB_UPDATED_BY = "updated_by"; - public const string DB_PERSON_ID = "person_id"; - public const string DB_AVATAR_FILENAME = "avatar_filename"; - public const string DB_SURNAME = "surname"; - public const string DB_GENEALOGY_NAME = "genealogy_name"; - public const string DB_COMMON_NAME = "common_name"; public const string DB_ALIAS = "alias"; - public const string DB_ZI = "zi"; - public const string DB_HAO = "hao"; - public const string DB_FATHER_ID = "father_id"; - public const string DB_MOTHER_NAME = "mother_name"; - public const string DB_BIRTH_ORDER = "birth_order"; - public const string DB_GENDER = "gender"; - public const string DB_MARITAL_STATUS = "marital_status"; - public const string DB_SCHOOL = "school"; - public const string DB_MAJOR = "major"; - public const string DB_EDUCATION = "education"; - public const string DB_GRADUATION_STATUS = "graduation_status"; - public const string DB_DUTY = "duty"; - public const string DB_TITLE = "title"; - public const string DB_BIRTH_TEXT = "birth_text"; + public const string DB_AVATAR_FILENAME = "avatar_filename"; + public const string DB_BIND_USER_ID = "bind_user_id"; public const string DB_BIRTH_DATE = "birth_date"; - public const string DB_DEATH_TEXT = "death_text"; + public const string DB_BIRTH_ORDER = "birth_order"; + public const string DB_BIRTH_TEXT = "birth_text"; + public const string DB_COMMON_NAME = "common_name"; + public const string DB_CREATED_BY = "created_by"; + public const string DB_CREATED_DATETIME = "created_datetime"; public const string DB_DEATH_DATE = "death_date"; - public const string DB_PRIVACY = "privacy"; - public const string DB_LIVE_STATUS = "live_status"; + public const string DB_DEATH_TEXT = "death_text"; + public const string DB_DUTY = "duty"; + public const string DB_EDUCATION = "education"; + public const string DB_FATHER_ID = "father_id"; + public const string DB_GENDER = "gender"; + public const string DB_GENEALOGY_NAME = "genealogy_name"; + public const string DB_GRADUATION_STATUS = "graduation_status"; + public const string DB_HAO = "hao"; public const string DB_INTRODUCTION = "introduction"; public const string DB_IS_BIND_USER = "is_bind_user"; - public const string DB_BIND_USER_ID = "bind_user_id"; + public const string DB_LIVE_STATUS = "live_status"; + public const string DB_MAJOR = "major"; + public const string DB_MARITAL_STATUS = "marital_status"; + public const string DB_MOTHER_NAME = "mother_name"; + public const string DB_PERSON_ID = "person_id"; + public const string DB_PRIVACY = "privacy"; + public const string DB_SCHOOL = "school"; + public const string DB_SURNAME = "surname"; + public const string DB_TITLE = "title"; + public const string DB_TREE_ID = "tree_id"; + public const string DB_UPDATED_BY = "updated_by"; + public const string DB_UPDATED_DATETIME = "updated_datetime"; + public const string DB_ZI = "zi"; private string ProviderName { get; set; } @@ -168,45 +172,46 @@ namespace CloudBuilder.Master.Entity throw new NullReferenceException("Source entity is null."); } - this.CreatedDatetime = source.CreatedDatetime; - this.CreatedBy = source.CreatedBy; - this.UpdatedDatetime = source.UpdatedDatetime; - this.UpdatedBy = source.UpdatedBy; - this.PersonId = source.PersonId; - this.AvatarFilename = source.AvatarFilename; - this.Surname = source.Surname; - this.GenealogyName = source.GenealogyName; - this.CommonName = source.CommonName; this.Alias = source.Alias; - this.Zi = source.Zi; - this.Hao = source.Hao; - this.FatherId = source.FatherId; - this.MotherName = source.MotherName; - this.BirthOrder = source.BirthOrder; - this.Gender = source.Gender; - this.MaritalStatus = source.MaritalStatus; - this.School = source.School; - this.Major = source.Major; - this.Education = source.Education; - this.GraduationStatus = source.GraduationStatus; - this.Duty = source.Duty; - this.Title = source.Title; - this.BirthText = source.BirthText; + this.AvatarFilename = source.AvatarFilename; + this.BindUserId = source.BindUserId; this.BirthDate = source.BirthDate; - this.DeathText = source.DeathText; + this.BirthOrder = source.BirthOrder; + this.BirthText = source.BirthText; + this.CommonName = source.CommonName; + this.CreatedBy = source.CreatedBy; + this.CreatedDatetime = source.CreatedDatetime; this.DeathDate = source.DeathDate; - this.Privacy = source.Privacy; - this.LiveStatus = source.LiveStatus; + this.DeathText = source.DeathText; + this.Duty = source.Duty; + this.Education = source.Education; + this.FatherId = source.FatherId; + this.Gender = source.Gender; + this.GenealogyName = source.GenealogyName; + this.GraduationStatus = source.GraduationStatus; + this.Hao = source.Hao; this.Introduction = source.Introduction; this.IsBindUser = source.IsBindUser; - this.BindUserId = source.BindUserId; + this.LiveStatus = source.LiveStatus; + this.Major = source.Major; + this.MaritalStatus = source.MaritalStatus; + this.MotherName = source.MotherName; + this.PersonId = source.PersonId; + this.Privacy = source.Privacy; + this.School = source.School; + this.Surname = source.Surname; + this.Title = source.Title; + this.TreeId = source.TreeId; + this.UpdatedBy = source.UpdatedBy; + this.UpdatedDatetime = source.UpdatedDatetime; + this.Zi = source.Zi; if (includeSystemFields) { - this.CreatedDatetime = source.CreatedDatetime; this.CreatedBy = source.CreatedBy; - this.UpdatedDatetime = source.UpdatedDatetime; + this.CreatedDatetime = source.CreatedDatetime; this.UpdatedBy = source.UpdatedBy; + this.UpdatedDatetime = source.UpdatedDatetime; } } diff --git a/WebVue/src/views/master/FamilyPersonEnquiry.vue b/WebVue/src/views/master/FamilyPersonEnquiry.vue index f1aa076..4226a62 100644 --- a/WebVue/src/views/master/FamilyPersonEnquiry.vue +++ b/WebVue/src/views/master/FamilyPersonEnquiry.vue @@ -16,13 +16,13 @@ @on-select-change="onSelectChange" >