private void SetChildTreeNode(ControllerBase context, PortalTreeNode node)
        {
            //不显示组织模型、数据模型、流程包的子节点
            if (node.Code == FunctionNode.Category_Organization_Code ||
                node.NodeType == FunctionNodeType.BizObject ||
                node.NodeType == FunctionNodeType.BizWorkflowPackage ||
                node.NodeType == FunctionNodeType.BizRule)
            {
                return;
            }

            List <PortalTreeNode> children = CreateHandler(context, node.NodeType).CreatePortalTree(node.ObjectID, node.Code) as List <PortalTreeNode>;

            if (children != null && node.Code == FunctionNode.Category_ServiceMoniter_Code)
            {
                // 根据模块授权过滤部署节点
                List <PortalTreeNode> childrenAuthorized = new List <PortalTreeNode>();
                foreach (PortalTreeNode child in children)
                {
                    if (child.Code == FunctionNode.Category_Apps_Code && !AppsAuthorized ||
                        child.Code == FunctionNode.Category_BizBus_Code && !BizBusAuthorized ||
                        child.Code == FunctionNode.Category_BizRule_Code && !BizRuleAuthorized ||
                        child.Code == FunctionNode.Category_BPA_Code && !BPAAuthorized)
                    {
                        continue;
                    }
                    childrenAuthorized.Add(child);
                }
                children = childrenAuthorized;
            }

            List <PortalTreeNode> childrenFilter = new List <PortalTreeNode>();

            if (children != null)
            {
                // 节点的最新更新时间
                Dictionary <ConfigurationChange, DateTime> modifiedTimeDic = this.Engine.Interactor.GetConfigurationChanges();
                foreach (PortalTreeNode child in children)
                {
                    if (!filterCode.Contains(child.Code))
                    {
                        ConfigurationChange key = new ConfigurationChange(child.NodeType, child.Code);
                        //主数据和流程包只呈现发布后的
                        if (child.NodeType == FunctionNodeType.BizObject || child.NodeType == FunctionNodeType.BizWorkflowPackage)
                        {
                            if (modifiedTimeDic.Keys.Contains(key))
                            {
                                child.NeedDeploy = modifiedTimeDic[key] > lastDeploymentTime;
                                childrenFilter.Add(child);
                            }
                        }
                        else
                        {
                            child.NeedDeploy = true;
                            if (modifiedTimeDic.Keys.Contains(key))
                            {
                                child.NeedDeploy = modifiedTimeDic[key] > lastDeploymentTime;
                            }
                            childrenFilter.Add(child);
                        }
                    }
                }
            }
            node.children = childrenFilter;

            if (children != null)
            {
                foreach (PortalTreeNode child in childrenFilter)
                {
                    SetChildTreeNode(context, child);
                }
            }
        }
Esempio n. 2
0
 // Configuration change event Invoker
 internal void OnConfigurationChanged(ConfigurationChangeEventArgs args) => ConfigurationChange?.Invoke(this, args);