Пример #1
0
        public void Extend(EntPartedGroup grp)
        {
            cluster.AddRange(grp.cluster);
            names.UnionWith(grp.names);

            foreach (var p in grp.pnameDict)
            {
                if (pnameDict.ContainsKey(p.Key))
                {
                    pnameDict[p.Key].@int += p.Value.@int;
                }
                else
                {
                    pnameDict[p.Key] = p.Value;
                }
            }

            if (grp.isSelf)
            {
                isSelf = true;
            }
        }
Пример #2
0
        /// <summary>
        /// 为指定公司聚合相关的一组公司
        /// </summary>
        /// <param name="ents"></param>
        /// <param name="self">指定的公司</param>
        /// <returns></returns>
        public static List <EntPartedGroup> ClusterForCom(List <EntPartedFull> ents, EntPartedFull self)
        {
            var group   = new EntPartedGroup(self);
            var reminds = new List <EntPartedFull>();

            bool fanbingbing_flag = false;

            if (Fanbingbing_Codes.Contains(group.cluster[0].code))
            {
                fanbingbing_flag = true;
            }

            for (int i = 0; i < ents.Count; i++)
            {
                if (ents[i].isSelf)
                {
                    continue;
                }
                //var curRelation = group.GetRelation(ents[i]);   // 当前企业与当前分组的相关度
                //if(curRelation > 1)
                //{
                //    group.Add(ents[i]);
                //}
                //else
                //{
                //    reminds.Add(ents[i]);
                //}

                // *****************  手动处理范冰冰 **************************
                if (fanbingbing_flag && Fanbingbing_Codes.Contains(ents[i].code))
                {
                    group.Add(ents[i]);
                    continue;
                }
                // **********************************************************

                if (group.IsRelated(ents[i]))
                {
                    group.Add(ents[i]);
                }
                else
                {
                    reminds.Add(ents[i]);
                }
            }
            for (int i = 0; i < reminds.Count; i++)
            {
                //if (group.GetRelation(reminds[i]) > 1)
                //    group.Add(reminds[i]);

                // *****************  手动处理范冰冰 **************************
                if (fanbingbing_flag && Fanbingbing_Codes.Contains(reminds[i].code))
                {
                    group.Add(reminds[i]);
                    continue;
                }
                // *****************  手动处理范冰冰 **************************

                if (group.IsRelated(reminds[i]))
                {
                    group.Add(reminds[i]);
                }
            }
            return(new List <EntPartedGroup>()
            {
                group
            });
        }