Пример #1
0
        public ActionResult GetSelectJson(string enCode)
        {
            var           data = itemsDetailApp.GetItemList(enCode);
            List <object> list = new List <object>();

            foreach (ItemsDetailEntity item in data)
            {
                list.Add(new { id = item.F_ItemCode, text = item.F_ItemName });
            }
            return(Content(list.ToJson()));
        }
        public ActionResult GetNationality()
        {
            ResponseBase <List <GetNationalityResponse> > response = new ResponseBase <List <GetNationalityResponse> >();

            response.IsSuccess = false;
            response.Reason    = "系统出错,请联系管理员";
            try
            {
                var itemsDetailList = itemsDetailApp.GetItemList("Language");

                List <GetNationalityResponse> list = new List <GetNationalityResponse>();
                if (itemsDetailList != null && itemsDetailList.Any())
                {
                    foreach (var info in itemsDetailList)
                    {
                        GetNationalityResponse getNationalityResponse = new GetNationalityResponse();
                        getNationalityResponse.Id    = info.F_Id;
                        getNationalityResponse.Value = info.F_ItemName;
                        list.Add(getNationalityResponse);
                    }
                }
                response.Result    = list;
                response.IsSuccess = true;
            }
            catch (Exception ex)
            {
            }
            return(Content(response.ToJson()));
        }
Пример #3
0
        /// <summary>
        /// 数据字典
        /// </summary>
        /// <param name="enCode">字典父节点英文简写</param>
        /// <returns></returns>
        public ApiResult <dynamic> PostItemDetail()
        {
            ApiResult <dynamic> api = new ApiResult <dynamic>();

            try
            {
                string         enCode         = Common.GetString("enCode");
                ItemsDetailApp itemsDetailApp = new ItemsDetailApp();
                var            data           = itemsDetailApp.GetItemList(enCode);
                List <object>  list           = new List <object>();
                foreach (ItemsDetailEntity item in data)
                {
                    list.Add(new { id = item.F_ItemCode, text = item.F_ItemName });
                }
                api.Message = "获取成功";
                api.Result  = list;
                api.Status  = true;
                return(api);
            }
            catch (Exception e)
            {
                api.Message = e.Message;
                return(api);
            }
        }
Пример #4
0
        //
        // GET: /StatisticsManage/Department/
        public override ActionResult Index()
        {
            string  organizeId = Common.GetString("organizeid");
            string  startDT    = Common.GetString("startdt"); // Request["StartDT"];
            string  endDT      = Common.GetString("enddt");   // Request["EndDT"];
            UserApp userApp    = new UserApp();

            organizeId = string.IsNullOrEmpty(organizeId) ? NFine.Code.OperatorProvider.Provider.GetCurrent().CompanyId : organizeId;//获取到当前的组织结构id
            //todo 找出该组织的下级
            OrganizeApp   organizeApp    = new OrganizeApp();
            var           organizeData   = organizeApp.GetList(organizeId);
            List <string> listOrganizeId = organizeData.Select(x => x.F_Id).ToList();// new List<string>() { organizeId };

            //var userData = userApp.GetList(listOrganizeId);
            ViewBag.OrganizeList = organizeData.Select(x => x.F_FullName).ToJson();
            //todo 找出每个员工的完成情况 放入内存中 执行逻辑操作
            TaskApp taskApp = new TaskApp();
            //var taskData = taskApp.GetList(userData.Select(x => x.F_Id).ToList());
            List <Report>  listReports    = new List <Report>();
            ItemsDetailApp itemsDetailApp = new ItemsDetailApp();
            var            itemsData      = itemsDetailApp.GetItemList(schedule);

            foreach (var item in itemsData)
            {
                Report report = new Report();
                report.name = item.F_ItemName;
                List <int> listCount = new List <int>();
                foreach (var organizeItem in organizeData)
                {
                    //todo 获取组织下的所有员工
                    //获取组织下的组织
                    var           data             = organizeApp.GetAllList(organizeItem.F_Id);
                    List <string> listOrganizeNext = new List <string>();
                    foreach (var organizeItemNext in data)
                    {
                        listOrganizeNext.Add(organizeItemNext);
                    }
                    //获取下级下的所有员工
                    var userData = userApp.GetList(listOrganizeNext);
                    //获取下级下的所有员工的任务
                    var taskData = taskApp.GetList(userData.Select(x => x.F_Id).ToList());
                    if (!string.IsNullOrEmpty(startDT))
                    {
                        var time = Utils.ObjectToDateTime(startDT);
                        taskData = taskData.Where(d => d.F_CreatorTime > time).ToList();
                    }
                    if (!string.IsNullOrEmpty(endDT))
                    {
                        var time = Utils.ObjectToDateTime(endDT);
                        taskData = taskData.Where(d => d.F_CreatorTime <= time).ToList();
                    }
                    listCount.Add(taskData.Count(d => d.F_Status == item.F_Id));
                }
                report.data = listCount;
                listReports.Add(report);
            }
            ViewBag.Series = listReports.ToJson();
            return(View());
        }