ow
This commit is contained in:
1 parent
b26bcfcd3b
commit
8285fb4090
9 files changed
+1372
-20
No files matched your search
@@ -25,6 +25,39 @@ namespace CloudBuilder.Master.Service
|
||||
this.service = service;
|
||||
repository = service.GetRepository<IRepository<FamilyTreeEntity>>();
|
||||
}
|
||||
|
||||
[PermissionOperate(name: MasterPermissionPolicy.FamilyTree, operate: Operate.Find)]
|
||||
public FamilyTreeData FindAllByTreeId(string treeId)
|
||||
{
|
||||
FamilyTreeData data = new FamilyTreeData();
|
||||
if (string.IsNullOrEmpty(treeId)) return data;
|
||||
|
||||
FamilyTreeEntity d = repository.DetachedEntities.Where(x => x.TreeId == treeId).FirstOrDefault();
|
||||
|
||||
if (d == null) return data;
|
||||
|
||||
data.FamilyTree = new FamilyTreeDisplayData(d);
|
||||
data.CurrentPerson = new FamilyPersonData();
|
||||
|
||||
IRepository<FamilyPersonEntity> repositoryFamilyPerson = repository.GetRepository<IRepository<FamilyPersonEntity>>();
|
||||
|
||||
var currentPerson = d.AncestorPersonId;
|
||||
|
||||
data.CurrentPerson.FamilyPerson = new FamilyPersonDisplayData(repositoryFamilyPerson.DetachedEntities.Where(x => x.PersonId == currentPerson).FirstOrDefault()!);
|
||||
|
||||
data.FamilyTree.AncestorPersonGenealogyName = data.CurrentPerson.FamilyPerson.GenealogyName;
|
||||
|
||||
IRepository<FamilyTreeChildrenMapViewEntity> repositoryChildrenMap = repository.GetRepository<IRepository<FamilyTreeChildrenMapViewEntity>>();
|
||||
|
||||
IRepository<FamilyTreeSpouseMapViewEntity> repositorySpouseMap = repository.GetRepository<IRepository<FamilyTreeSpouseMapViewEntity>>();
|
||||
|
||||
data.CurrentPerson.FamilyTreeSpouseMaps = repositorySpouseMap.GetRepository<IRepository<FamilyTreeSpouseMapViewEntity>>().DetachedEntities.Where(x => x.TreeId == treeId).OrderBy(x => x.Orderby).ToArray();
|
||||
|
||||
data.CurrentPerson.FamilyTreeChildrenMaps = repositoryChildrenMap.GetRepository<IRepository<FamilyTreeChildrenMapViewEntity>>().DetachedEntities.Where(x => x.TreeId == treeId).OrderBy(x => x.Orderby).ToArray();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: MasterPermissionPolicy.FamilyTree, operate: Operate.Find)]
|
||||
public FamilyTreeData FindByKey(string key)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user