Ejemplo n.º 1
0
        public ActionResult Index(int pageIndex, int pageSize, string keyWord)
        {
            var pageData = _organizeService.GetList(pageIndex, pageSize, keyWord);
            var result   = new LayPadding <Sys_Organize>()
            {
                result = true,
                msg    = "success",
                list   = pageData.Items,
                count  = pageData.TotalItems
            };

            return(Content(result.ToJson()));
        }
        public object GetOrganizeList()
        {
            var data = _organizeService.GetList();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            foreach (Organize item in data)
            {
                var fiedItem = new
                {
                    encode   = item.F_EnCode,
                    fullname = item.F_FullName
                };
                dictionary.Add(item.F_Id, fiedItem);
            }
            return(dictionary);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <see cref="IDoorControlService.GetEventList(Request.DoorEventQueryRequest)"/>
        /// </summary>
        public async Task <ListBaseResponse <Dto.DoorEventQueryResponse> > GetEventList(
            Request.DoorEventQueryRequest request)
        {
            var data = await _hikHttp.PostAsync <HikVisionResponse <ListBaseResponse <DoorEventQueryResponse> > >("/api/acs/v1/door/events", new
            {
                startTime      = request.StartTime.GetTimeIosFormatter(),
                endTime        = request.EndTime.GetTimeIosFormatter(),
                personIds      = request.PersonIds?.Count > 0 ? request.PersonIds : new List <string>(),
                doorIndexCodes = request.DoorIndexCodes?.Count > 0 ? request.DoorIndexCodes : new List <string>(),
                pageNo         = request.PageNo,
                pageSize       = request.PageSize
            });

            var list = data?.Data;

            if (list?.List?.Count > 0)
            {
                List <string> personIds = list.List.Where(o => !string.IsNullOrWhiteSpace(o.PersonId)).Select(o => o.PersonId).ToList();
                var           userInfos = await _userService.GetDetailV2(personIds);

                foreach (var item in list.List)
                {
                    if (!string.IsNullOrWhiteSpace(item.OrgIndexCode))
                    {
                        var orgInfo = await _organizeService.GetList(new OrganizeRequest()
                        {
                            OrgIndexCodes = new List <string>()
                            {
                                item.OrgIndexCode
                            },
                            PageNo   = 1,
                            PageSize = 10
                        });

                        item.OrgName = orgInfo?.List?.FirstOrDefault()?.OrgName;
                    }

                    if (!string.IsNullOrWhiteSpace(item.PersonId))
                    {
                        var detail = userInfos?.FirstOrDefault(o => o.PersonId.Equals(item.PersonId));
                        item.PersonJobNo = detail?.JobNo;
                        item.PersonPhone = detail?.PhoneNo;
                    }
                }
            }
            return(list);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 机构列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable <OrganizeEntity> GetList()
 {
     return(service.GetList());
 }