Beispiel #1
0
        public string getArea()
        {
            claim = (JwtClaim)_accessor.HttpContext.Items["user"];
            List <SYS_AREA> model = SystemService.getArea(connstr);
            LayTableModel <List <SYS_AREA> > table = new LayTableModel <List <SYS_AREA> >();

            table.message   = "success";
            table.code      = 200;
            table.total     = model.Count;
            table.rows      = new Rows <List <SYS_AREA> >();
            table.rows.item = new List <SYS_AREA>();
            table.rows.item = model;
            return(JsonConvert.SerializeObject(table));
        }
Beispiel #2
0
        public string getToDo()
        {
            claim = (JwtClaim)_accessor.HttpContext.Items["user"];
            if (claim.area == 0)
            {
                claim.uid = "";
            }
            List <ToDoModel> model = ToDoService.getToDo(claim.uid, connstr);
            LayTableModel <List <ToDoModel> > table = new LayTableModel <List <ToDoModel> >();

            table.message   = "success";
            table.code      = 200;
            table.total     = model.Count;
            table.rows      = new Rows <List <ToDoModel> >();
            table.rows.item = new List <ToDoModel>();
            table.rows.item = model;
            return(JsonConvert.SerializeObject(table));
        }
Beispiel #3
0
        /// <summary>
        /// add by lpl
        /// 2019-1-3
        /// 加载权利事项
        /// </summary>
        /// <param name="limit"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult LoadItem(string limit, string page, string Item, string LX)
        {
            PowerItemEntity powerItemEntity = new PowerItemEntity()
            {
                LX   = LX,
                Item = Item
            };
            var data      = new PowerItemBll().QueryList(powerItemEntity);
            var pagecount = data.Count;

            data = data.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();
            var result = new LayTableModel <PowerItemEntity>
            {
                code  = 0,
                msg   = "成功",
                count = pagecount,
                data  = data
            };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
        public string GetJieShouQk(string Id, string limit, string page)
        {
            var entity = new DocNotfPersonEntity()
            {
                ContentId = Id
            };

            var data      = new DocNotfPersonBall().search(entity);
            var pagecount = data.Count;

            //分页有空重写,linq实现的数据量过大效率会出现瓶颈
            data = data.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();

            var result = new LayTableModel <DocNotfPersonEntity>
            {
                code  = 0,
                msg   = "成功",
                count = pagecount,
                data  = data
            };

            return(JsonConvert.SerializeObject(result));
        }
Beispiel #5
0
        /// <summary>
        /// 公文管理展示
        /// </summary>
        /// <param name="limit"></param>每页显示数量
        /// <param name="page"></param>当前页码
        /// <returns></returns>
        public string GongWenIndex(string limit, string page)
        {
            var user = CurrentUser.CrmUser;
            //公文管理权限
            bool isMangerGongWen = new CrmUserMenuBll().GetAuthorizationByUserId("OA", "MangerAuthorization", user.Id);

            if (isMangerGongWen)
            {
                //用Linq分页,用ORM自身的非常慢,后面研究为什么这么慢
                var data      = new GongGaoMangerBll().QueryList();
                var pagecount = data.Count;
                data = data.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();
                var result = new LayTableModel <GongGaoMangerEntity>
                {
                    code  = 0,
                    msg   = "成功",
                    count = pagecount,
                    data  = data
                };
                return(JsonConvert.SerializeObject(result));
            }
            else
            {
                //非管理权限,查询公文详情表
                var data      = new GongGaoDetialBll().QueryList(user.Id);
                var pagecount = data.Count;
                data = data.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();
                var result = new LayTableModel <GongGaoDetialEntity>
                {
                    code  = 0,
                    msg   = "成功",
                    count = pagecount,
                    data  = data
                };
                return(JsonConvert.SerializeObject(result));
            }
        }
Beispiel #6
0
        /// <summary>
        /// 获取公告通知表数据
        /// add by lpl
        /// 2018-12-14
        /// </summary>
        /// <param name="fileId"></param>
        /// <returns></returns>
        public string GetAllDoc(string limit, string page, string Title, string datafw, string Gglx)
        {
            #region 根据当前用户ID,取出属于当前用户的通告列表
            ////取当前用户
            //var usersId = _crmUserBll.GetUserEntity(CurrentUser.CrmUser.Id);

            ////搜索当前用户接受到的所有通知
            //var personentity = new DocNotfPersonEntity()
            //{
            //    Pid = usersId.Id
            //};
            //var person = new DocNotfPersonBall().search(personentity);

            ////拼接字符串,用来通知公告表筛选
            //string jieshouGuid = "";
            //foreach (DocNotfPersonEntity doc in person)
            //{

            //    jieshouGuid +=  "'" + doc.ContentId + "',";
            //}

            //jieshouGuid = jieshouGuid.TrimEnd(',');
            ////jieshouGuid = jieshouGuid.TrimEnd('\'');
            #endregion


            var usersId = _crmUserBll.GetUserEntity(CurrentUser.CrmUser.Id);
            var entity  = new DocumentNotificationEntity()
            {
                Title    = Title,
                Category = Gglx
            };

            var personentity = new DocNotfPersonEntity()
            {
                Title    = Title,
                Category = Gglx,
                Pid      = usersId.Id
            };

            var data  = new List <DocumentNotificationEntity>();
            var data2 = new List <DocNotfPersonEntity>();
            //领导权限
            var userrole = new CrmUserRoleEntity()
            {
                UserId = usersId.Id,
                RoleId = "96518d03-85c3-4ec3-a42c-ad56b9501099"
            };
            var list = new CrmUserRoleBll().GetSearchResult(userrole);

            //管理员权限
            var adminrole = new CrmUserRoleEntity()
            {
                UserId = usersId.Id,
                RoleId = "09c19ef1-77ef-4483-b7db-c09284d0deff"
            };
            var list2 = new CrmUserRoleBll().GetSearchResult(adminrole);
            //搜索条件

            //是管理员或者领导
            if (list.Count > 0 || list2.Count > 0)
            {
                //不查询接受人,全部可以看到
                data = new DocumentNotificationBll().SearchQuery(entity, datafw);
                var pagecount = data.Count;

                //分页有空重写,linq实现的数据量过大效率会出现瓶颈
                data = data.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();

                var result = new LayTableModel <DocumentNotificationEntity>
                {
                    code  = 0,
                    msg   = "成功",
                    count = pagecount,
                    data  = data
                };

                return(JsonConvert.SerializeObject(result));
            }
            else
            {
                //如果不是领导,而是接收人,则需要重新绑定数据源

                data2 = new DocNotfPersonBall().search(personentity, datafw);
                //分页有空重写,linq实现的数据量过大效率会出现瓶颈
                data2 = data2.Skip((Convert.ToInt32(page) - 1) * Convert.ToInt32(limit)).Take(Convert.ToInt32(limit)).ToList();
                var pagecount = data2.Count;
                var result    = new LayTableModel <DocNotfPersonEntity>
                {
                    code  = 0,
                    msg   = "成功",
                    count = pagecount,
                    data  = data2
                };

                return(JsonConvert.SerializeObject(result));
            }
        }