判断当前用户与审批人是否属于同一个部门

  /// <summary>
        /// 得到一个实例的任务
        /// </summary>
        /// <param name="flowID"></param>
        /// <param name="groupID"></param>
        /// <returns></returns>
        public List<Data.Model.WorkFlowTask> GetTaskList(Guid flowID, Guid groupID)
        {
            //获取当前用户所在部门
            //当前用户id
            Meiqi.OA.Business.Users user = new Users();
            string currentDept = user.GetCurrentUserDept(Business.Users.CurrentUserID);
            //部门列表
            List<Data.Model.WorkFlowTask> task = new List<Data.Model.WorkFlowTask>();
            
            List<Data.Model.WorkFlowTask> wft = dataWorkFlowTask.GetTaskListDept(flowID, groupID);

            List<Data.Model.WorkFlowTask> taskLis = dataWorkFlowTask.GetTaskList(flowID, groupID);

            List<Data.Model.WorkFlowTask> taskList = new List<Data.Model.WorkFlowTask>();

            //获取符合条件的列表
            for (int i = 0; i < wft.Count; i++)
            {
                //如果为当前用户和审批人属于同一部门
                if (currentDept == wft[i].Note)
                {
                    task.Add(wft[i]);

                }
                else
                {
                    if (wft[i].IsPublic != "1")
                    {
                        task.Add(wft[i]);
                    }
                }
            }
            //重新赋值列表
            for (int m = 0; m < taskLis.Count; m++)
            {
                for (int n = 0; n < task.Count; n++)
                {
                    if (taskLis[m].ID == task[n].ID)
                    {
                        taskList.Add(taskLis[m]);
                    }
                }
            }
            return taskList;
        }

 

posted @ 2018-06-05 16:25  韩梦芫  阅读(317)  评论(0编辑  收藏  举报