Exemple #1
0
        /// <summary>
        /// 获取气象监测组织机构树
        /// </summary>
        /// <param name="DEPT_CODE"></param>
        /// <param name="PARENT_CODE"></param>
        /// <param name="isCheckAll"></param>
        /// <returns></returns>
        public static string GetWeatherDeptTree(string DEPT_CODE, string PARENT_CODE, bool isCheckAll)
        {
            string strJson = string.Empty;
            List <SYS_DEPTANDMEMBER_TEMP> listOrgRy = new List <SYS_DEPTANDMEMBER_TEMP>();
            List <SYS_DEPT> listMenu = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" && m.DEPT_CODE.Length <= 8 && (m.PARENT_CODE.StartsWith(DEPT_CODE) || m.DEPT_CODE == DEPT_CODE))
                                       .OrderBy(m => m.DEPT_ORDER).ThenBy(m => m.DEPT_CODE).ToList();

            if (listMenu.Count > 0)
            {
                foreach (SYS_DEPT org in listMenu)
                {
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = org.DEPT_CODE,
                        PARENT_CODE = org.PARENT_CODE,
                        ORGRY_NAME  = org.DEPT_NAME,
                        ICO         = org.C_ICO,
                        RYMOBILE    = "",
                        STATE       = org.STATUS_FLAG//0关闭
                    });
                }
            }
            List <ZTreeNode> listTreeNodes = SYS_DEPTANDMEMBER_TEMP.ConvertZTreeNodes(listOrgRy, PARENT_CODE, DEPT_CODE, isCheckAll);

            strJson = ObjToJson.GetToJson(listTreeNodes).Replace("Checked", "checked");
            return(strJson);
        }
Exemple #2
0
        /// <summary>
        /// 获取用户对应部门组织树
        /// </summary>
        /// <returns></returns>
        public static string GetMyORGandRYTree(string DEPT_CODE, string PARENT_CODE, bool isCheckAll)
        {
            string strJson = string.Empty;
            List <SYS_DEPTANDMEMBER_TEMP> listOrgRy = new List <SYS_DEPTANDMEMBER_TEMP>();
            //获取人员
            List <SYS_MEMBER> listRyMenu = oc.BllSession.ISYS_MEMBERService.GetListByCondition <string>(m => m.DEL_FLAG == "0" && m.LOCATION_FLAG == "1" && m.DEPT_CODE.StartsWith(DEPT_CODE), m => m.MOBILE).Select(mb => mb.ToPOCO()).ToList();

            if (listRyMenu.Count > 0)
            {
                foreach (SYS_MEMBER ry in listRyMenu)
                {
                    string icon = "icon-Off-line";
                    if (ry.MOBILE_STATE == "1")
                    {
                        icon = "icon-status_busy";
                    }
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = ry.MOBILE,
                        PARENT_CODE = ry.DEPT_CODE,
                        ORGRY_NAME  = ry.NAME,
                        ICO         = icon,
                        RYMOBILE    = ry.MOBILE,
                        STATE       = "0"//关闭
                    });
                }
            }
            //获得组织
            //List<SYS_ORG> listMenu = oc.BllSession.ISYS_ORGService.GetListByCondition<string>(m => m.DEL_FLAG == "0", m => m.DEPT_CODE).Select(mb => mb.ToPOCO()).ToList();
            List <SYS_DEPT> listMenu = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" && (m.PARENT_CODE.StartsWith(DEPT_CODE) || m.DEPT_CODE == DEPT_CODE))
                                       .OrderBy(m => m.DEPT_ORDER).ThenBy(m => m.DEPT_CODE).ToList();

            if (listMenu.Count > 0)
            {
                foreach (SYS_DEPT org in listMenu)
                {
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = org.DEPT_CODE,
                        PARENT_CODE = org.PARENT_CODE,
                        ORGRY_NAME  = org.DEPT_NAME,
                        ICO         = org.C_ICO,
                        RYMOBILE    = "",
                        STATE       = org.STATUS_FLAG//0关闭
                    });
                }
            }
            //List<EasyUITreeNode> listTreeNodes = SYS_DEPTANDMEMBER.ConvertTreeNodes(listOrgRy, PARENT_CODE, DEPT_CODE, isCheckAll);
            List <ZTreeNode> listTreeNodes = SYS_DEPTANDMEMBER_TEMP.ConvertZTreeNodes(listOrgRy, PARENT_CODE, DEPT_CODE, isCheckAll);

            strJson = ObjToJson.GetToJson(listTreeNodes).Replace("Checked", "checked");

            return(strJson);
        }
Exemple #3
0
        public static string GetCarTree_TWO(string DEPT_CODE, string PARENT_CODE, bool isCheckAll)
        {
            string strJson = string.Empty;
            List <SYS_DEPTANDMEMBER_TEMP> listOrgRy = new List <SYS_DEPTANDMEMBER_TEMP>();
            //获取人员
            List <CAR_BDATA_CAR> listCarMenu = oc.BllSession.ICAR_BDATA_CARService.GetListByCondition <string>(m => m.DEPT_CODE.StartsWith(DEPT_CODE), m => m.CAR_NO).Select(mb => mb.ToPOCO()).ToList();

            if (listCarMenu.Count > 0)
            {
                foreach (CAR_BDATA_CAR ry in listCarMenu)
                {
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = ry.CAR_NO,
                        PARENT_CODE = ry.DEPT_CODE,
                        ORGRY_NAME  = ry.CAR_LICENSENO,
                        ICO         = "car-Off-line",
                        RYMOBILE    = ry.CAR_NO,
                        STATE       = "0"//关闭
                    });
                }
            }
            //获得组织
            //List<SYS_ORG> listMenu = oc.BllSession.ISYS_ORGService.GetListByCondition<string>(m => m.DEL_FLAG == "0", m => m.DEPT_CODE).Select(mb => mb.ToPOCO()).ToList();
            List <SYS_DEPT> listMenu = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" && (m.PARENT_CODE.StartsWith(DEPT_CODE) || m.DEPT_CODE == DEPT_CODE))
                                       .OrderBy(m => m.DEPT_ORDER).ThenBy(m => m.DEPT_CODE).ToList();

            if (listMenu.Count > 0)
            {
                foreach (SYS_DEPT org in listMenu)
                {
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = org.DEPT_CODE,
                        PARENT_CODE = org.PARENT_CODE,
                        ORGRY_NAME  = org.DEPT_NAME,
                        ICO         = org.C_ICO,
                        RYMOBILE    = "",
                        STATE       = org.STATUS_FLAG//0关闭
                    });
                }
            }
            List <ZTreeNode> listTreeNodes = SYS_DEPTANDMEMBER_TEMP.ConvertZTreeNodes(listOrgRy, PARENT_CODE, DEPT_CODE, isCheckAll);

            //return  ObjToJson.GetToJson(listTreeNodes, true);
            strJson = ObjToJson.GetToJson(listTreeNodes).Replace("Checked", "checked");
            return(strJson);
        }
Exemple #4
0
        public static string GetPosLevelCheckedTree(string DEPT_CODE, string PARENT_CODE, bool isCheckAll)
        {
            string strJson = string.Empty;
            List <SYS_DEPTANDMEMBER_TEMP> listOrgRy = new List <SYS_DEPTANDMEMBER_TEMP>();
            //获取人员
            List <SYS_MEMBER> listRyMenu = oc.BllSession.ISYS_MEMBERService.GetListByCondition <string>(m => m.DEL_FLAG == "0" &&
                                                                                                        m.LOCATION_FLAG == "1" && m.DEPT_CODE.StartsWith(DEPT_CODE), m => m.MOBILE)
                                           .Select(mb => mb.ToPOCO()).ToList();
            //级别
            List <SYS_POSLEVEL_DIC> PosLevellist = oc.BllSession.ISYS_POSLEVEL_DICService.Entities.OrderBy(u => u.DIC_ORDER).ToList();

            if (listRyMenu.Count > 0)
            {
                foreach (SYS_MEMBER ry in listRyMenu)
                {
                    string icon = "icon-Off-line";
                    if (ry.MOBILE_STATE == "1")
                    {
                        icon = "icon-status_busy";
                    }
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = ry.MOBILE,
                        PARENT_CODE = (ry.DEPT_CODE.Length >= 4 ? ry.DEPT_CODE.Substring(0, 4) : ry.DEPT_CODE) +
                                      (!PosLevellist.Select(u => u.DIC_ID).Contains(ry.POS_LEVEL) ? "1A" : ry.POS_LEVEL), //如果没有归类(空或者在字典表不存在),则默认到其他
                        ORGRY_NAME = ry.NAME,
                        ICO        = icon,
                        RYMOBILE   = ry.MOBILE,
                        STATE      = "0"//关闭
                    });
                }
            }
            //获取资质
            List <SYS_DEPTANDMEMBER_TEMP> listTemp = new List <SYS_DEPTANDMEMBER_TEMP>();
            List <string> parList = listOrgRy.Select(u => u.PARENT_CODE).Distinct().ToList();

            if (PosLevellist.Count > 0)
            {
                foreach (string parcode in parList)
                {
                    string deptcode = parcode.Substring(0, parcode.Length - 2);
                    string diccode  = parcode.Substring(parcode.Length - 2);
                    if (PosLevellist.Where(u => u.DIC_ID.Equals(diccode)).Count() > 0)
                    {
                        SYS_POSLEVEL_DIC dic = PosLevellist.Where(u => u.DIC_ID.Equals(diccode)).FirstOrDefault();
                        listTemp.Add(new SYS_DEPTANDMEMBER_TEMP()
                        {
                            ORGRY_CODE  = parcode,
                            PARENT_CODE = deptcode,
                            ORGRY_NAME  = dic.DIC_NAME,
                            ICO         = dic.DIC_ICON,
                            ORDER       = dic.DIC_ORDER,
                            RYMOBILE    = string.Empty, //parcode,
                            STATE       = "0"           //关闭
                        });
                    }
                }
            }
            listOrgRy.AddRange(listTemp.OrderBy(u => u.ORDER));

            //获得组织
            List <SYS_DEPT> listMenu = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" &&
                                                                                     (m.PARENT_CODE.StartsWith(DEPT_CODE) || m.DEPT_CODE == DEPT_CODE) &&
                                                                                     m.DEPT_CODE.Length <= 4)
                                       .OrderBy(m => m.DEPT_ORDER).ThenBy(m => m.DEPT_CODE).ToList();

            if (listMenu.Count > 0)
            {
                foreach (SYS_DEPT org in listMenu)
                {
                    listOrgRy.Add(new SYS_DEPTANDMEMBER_TEMP()
                    {
                        ORGRY_CODE  = org.DEPT_CODE,
                        PARENT_CODE = org.PARENT_CODE,
                        ORGRY_NAME  = org.DEPT_NAME,
                        ICO         = org.C_ICO,
                        RYMOBILE    = "",
                        STATE       = org.STATUS_FLAG//0关闭
                    });
                }
            }
            List <ZTreeNode> listTreeNodes = SYS_DEPTANDMEMBER_TEMP.ConvertZTreeNodes(listOrgRy, PARENT_CODE, DEPT_CODE, isCheckAll);

            strJson = ObjToJson.GetToJson(listTreeNodes).Replace("Checked", "checked");
            return(strJson);
        }
Exemple #5
0
        /// <summary>
        /// 获取气象监测线名树
        /// </summary>
        /// <param name="DEPT_CODE"></param>
        /// <param name="PARENT_CODE"></param>
        /// <returns></returns>
        public static string GetWeatherLineTree(string DEPT_CODE, string PARENT_CODE)
        {
            Dictionary <string, string> deptDict = new Dictionary <string, string>();

            if (DEPT_CODE.Length == 2)
            {
                IQueryable <SYS_DEPT> dic = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" && m.DEPT_CODE.Length <= 4);
                foreach (var item in dic)
                {
                    deptDict.Add(item.DEPT_CODE, item.DEPT_NAME);
                }
            }
            string strJson = string.Empty;
            List <SYS_DEPTANDMEMBER_TEMP> listorgHost = new List <SYS_DEPTANDMEMBER_TEMP>();
            //获取主机
            List <BROKENRAIL_BDATA_SECTION> listHost = oc.BllSession.IBROKENRAIL_BDATA_SECTIONService
                                                       .GetListByCondition <string>(g => g.DEPT_CODE.StartsWith(DEPT_CODE), g => g.SECTION_ID).ToList();

            listHost = listHost.OrderBy(o => o.START_MILE).ToList();
            //cwb
            List <BROKENRAIL_BDATA_DEVICE> listDevice = oc.BllSession.IBROKENRAIL_BDATA_DEVICEService.Entities.Where(o => o.TYPE == "主机").ToList();

            if (listHost.Count > 0)
            {
                foreach (BROKENRAIL_BDATA_SECTION host in listHost)
                {
                    string head = string.Empty;
                    if (DEPT_CODE.Length == 2)
                    {
                        head = deptDict[host.DEPT_CODE];
                    }
                    listorgHost.Add(new SYS_DEPTANDMEMBER_TEMP
                    {
                        ORGRY_CODE  = host.SECTION_ID,
                        PARENT_CODE = host.LINE_NAME,
                        ORGRY_NAME  = host.SECTION_NAME,
                        ICO         = "icon-drive",
                        RYMOBILE    = head + "(" + GetToKDESC(host.START_MILE) + "~" + GetToKDESC(host.END_MILE) + ")",
                        STATE       = "0",
                        //cwb
                        // PHONE = host.SECTION_ID//oc.BllSession.IBROKENRAIL_BDATA_DEVICEService.Entities.Where(o => o.SECTION_ID == host.SECTION_ID && o.TYPE == "主机").FirstOrDefault().POINT_NO
                        PHONE = listDevice.Where(o => o.SECTION_ID == host.SECTION_ID).FirstOrDefault().POINT_NO
                    });
                }
            }
            List <string>           line         = oc.BllSession.IBROKENRAIL_BDATA_SECTIONService.Entities.Select(o => o.LINE_NAME).Distinct().ToList();
            IQueryable <T_JOB_LINE> listLineMenu = oc.BllSession.IT_JOB_LINEService.Entities.Where(o => o.LINE_DEPTCODE.Contains(DEPT_CODE));

            foreach (var item in listLineMenu)
            {
                if (!line.Contains(item.LINE_NAME))
                {
                    line.Insert(line.Count, item.LINE_NAME);
                }
            }
            SYS_DEPT dept = oc.BllSession.ISYS_DEPTService.Entities.Where(m => m.DEL_FLAG == "0" && m.DEPT_CODE == DEPT_CODE).FirstOrDefault();

            //List<SYS_DEPT> listMenu = oc.BllSession.ISYS_DEPTService.Entities
            //    .Where(m => m.DEL_FLAG == "0" && (m.PARENT_CODE.StartsWith(DEPT_CODE) || m.DEPT_CODE == DEPT_CODE))
            //    .OrderBy(m => m.DEPT_ORDER).ThenBy(m => m.DEPT_CODE).ToList();
            if (dept != null)
            {
                listorgHost.Add(new SYS_DEPTANDMEMBER_TEMP()
                {
                    ORGRY_CODE  = dept.DEPT_CODE,
                    PARENT_CODE = dept.PARENT_CODE,
                    ORGRY_NAME  = dept.DEPT_NAME,
                    ICO         = "icon-DepartMent",
                    RYMOBILE    = "",
                    STATE       = "0"//0关闭
                });
                if (listLineMenu.Count() > 0)
                {
                    foreach (var org in line)
                    {
                        listorgHost.Add(new SYS_DEPTANDMEMBER_TEMP()
                        {
                            ORGRY_CODE  = org,
                            PARENT_CODE = DEPT_CODE,
                            ORGRY_NAME  = org,
                            ICO         = "icon-DepartMent",
                            RYMOBILE    = "",
                            STATE       = "0"//0关闭
                        });
                    }
                }
            }
            List <ZTreeNode> listTreeNodes = SYS_DEPTANDMEMBER_TEMP.ConvertZTreeNodes(listorgHost, PARENT_CODE, DEPT_CODE, true);

            strJson = ObjToJson.GetToJson(listTreeNodes).Replace("Checked", "checked");
            return(strJson);
        }