예제 #1
0
        /// <summary>
        /// 根据条件获取所有实体对象(包含角色名称)
        /// </summary>
        /// <param name="roleAuthorQuery"></param>
        /// <returns></returns>
        public IList <RoleAuthorEntity> GetRoleAuthorDetailList(RoleAuthorQuery roleAuthorQuery)
        {
            HttpClientHelper         clientHelper   = new HttpClientHelper();
            IList <RoleAuthorEntity> roleAuthorList = clientHelper.PostAuth <IList <RoleAuthorEntity>, RoleAuthorQuery>(GetAPIUrl(APIConstant.GETROLEAUTHORDETAILLIST), roleAuthorQuery);

            return(roleAuthorList);
        }
예제 #2
0
        public Pager <RoleAuthorEntity> GetRoleAuthorPageList(RoleAuthorQuery roleAuthorQuery)
        {
            HttpClientHelper         clientHelper       = new HttpClientHelper();
            Pager <RoleAuthorEntity> RoleAuthorPageList = clientHelper.PostAuth <Pager <RoleAuthorEntity>, RoleAuthorQuery>(GetAPIUrl(APIConstant.GETROLEAUTHORPAGELIST), roleAuthorQuery);

            return(RoleAuthorPageList);
        }
예제 #3
0
        public Pager <RoleAuthorEntity> GetRoleAuthorPageList(RoleAuthorQuery roleAuthorQuery)
        {
            IRoleAuthorService       service = ServiceContainer.Instance.Container.Resolve <IRoleAuthorService>();
            Pager <RoleAuthorEntity> pager   = service.GetRoleAuthorPageList(roleAuthorQuery);

            return(pager);
        }
예제 #4
0
        public ActionResult GetWorkloadList(WorkloadQuery query)
        {
            IRoleAuthorFacadeService roleAuthorService = ServiceContainer.Instance.Container.Resolve <IRoleAuthorFacadeService>();
            RoleAuthorQuery          roleAuthorQuery   = new RoleAuthorQuery();

            roleAuthorQuery.JournalID = JournalID;
            roleAuthorQuery.GroupID   = query.GroupID;
            roleAuthorQuery.OrderStr  = " AI.AuthorID ASC";
            roleAuthorQuery.RealName  = query.RealName;
            if (query.RoleID > 0)
            {
                roleAuthorQuery.RoleID = query.RoleID;
            }
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <RoleAuthorEntity> listRoleAuthor;

            if (query.isStatByGroup == true)
            {
                listRoleAuthor = roleAuthorService.GetRoleAuthorDetailList(roleAuthorQuery);
            }
            else
            {
                listRoleAuthor = roleAuthorService.GetRoleAuthorDetailList(roleAuthorQuery).Distinct(new Compare <RoleAuthorEntity>((x, y) => (null != x && null != y) && (x.AuthorID == y.AuthorID))).ToList();
            }
            //去除固定的不需统计的人员ID
            listRoleAuthor.Where(p => p.AuthorID != 84381 && p.AuthorID != 84386 && p.AuthorID != 84388 && p.AuthorID != 95844);
            return(Json(new { Rows = listRoleAuthor.Skip((pageIndex - 1) * 50).Take(50), Total = listRoleAuthor.Count }));
        }
예제 #5
0
        public string RoleAuthorDetailQueryToSQLWhere(RoleAuthorQuery query)
        {
            StringBuilder sbWhere = new StringBuilder(" RA.JournalID = " + query.JournalID);

            if (query.AuthorID != null)
            {
                sbWhere.Append(" AND RA.AuthorID = ").Append(query.AuthorID.Value).Append("");
            }

            if (query.RealName != null)
            {
                sbWhere.Append(" AND RealName like '%").Append(query.RealName).Append("%'");
            }

            if (query.GroupID != null)
            {
                sbWhere.Append(" AND AI.GroupID = ").Append(query.GroupID.Value).Append("");
            }

            if (query.RoleID != null)
            {
                sbWhere.Append(" AND RI.RoleID = ").Append(query.RoleID.Value).Append("");
            }

            if (query.RoleID != null)
            {
                sbWhere.Append(" AND RA.RoleID = ").Append(query.RoleID.Value).Append("");
            }
            if (query.RoleName != null)
            {
                sbWhere.Append(" AND RI.RoleName = ").Append(query.RoleName).Append("");
            }
            return(sbWhere.ToString());
        }
예제 #6
0
        public List <RoleAuthorEntity> GetRoleAuthorDetailList(RoleAuthorQuery query)
        {
            List <RoleAuthorEntity> list           = new List <RoleAuthorEntity>();
            StringBuilder           sqlCommandText = new StringBuilder();

            sqlCommandText.Append(@"SELECT MapID,RA.JournalID,RA.AuthorID,AI.LoginName,AI.RealName,RA.RoleID,RI.RoleName,RA.AddDate FROM dbo.RoleAuthor RA WITH(NOLOCK) 
                                    LEFT JOIN dbo.AuthorInfo AI WITH(NOLOCK) ON RA.AuthorID=AI.AuthorID AND AI.Status=1
                                    LEFT JOIN dbo.RoleInfo RI WITH(NOLOCK) ON RA.JournalID=RI.JournalID AND RA.RoleID=RI.RoleID ");
            string whereSQL = RoleAuthorDetailQueryToSQLWhere(query);
            string orderBy  = RoleAuthorQueryToSQLOrder(query);

            if (!string.IsNullOrEmpty(whereSQL))
            {
                sqlCommandText.Append(" WHERE " + whereSQL);
            }
            if (!string.IsNullOrEmpty(orderBy))
            {
                sqlCommandText.Append(" ORDER BY " + orderBy);
            }
            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                list = MakeRoleAuthorDetailList(dr);
            }
            return(list);
        }
예제 #7
0
        public List <RoleAuthorEntity> GetRoleAuthorList(RoleAuthorQuery query)
        {
            List <RoleAuthorEntity> list           = new List <RoleAuthorEntity>();
            StringBuilder           sqlCommandText = new StringBuilder();

            sqlCommandText.Append("SELECT MapID,JournalID,RoleID,AuthorID,AddDate FROM dbo.RoleAuthor WITH(NOLOCK)");
            string whereSQL = RoleAuthorQueryToSQLWhere(query);
            string orderBy  = RoleAuthorQueryToSQLOrder(query);

            if (!string.IsNullOrEmpty(whereSQL))
            {
                sqlCommandText.Append(" WHERE " + whereSQL);
            }
            if (!string.IsNullOrEmpty(orderBy))
            {
                sqlCommandText.Append(" ORDER BY " + orderBy);
            }
            DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                list = MakeRoleAuthorList(dr);
            }
            return(list);
        }
예제 #8
0
        public IList <RoleAuthorEntity> GetRoleAuthorDetailList(RoleAuthorQuery roleAuthorQuery)
        {
            IRoleAuthorService       service = ServiceContainer.Instance.Container.Resolve <IRoleAuthorService>();
            IList <RoleAuthorEntity> list    = service.GetRoleAuthorDetailList(roleAuthorQuery);

            return(list);
        }
예제 #9
0
        /// <summary>
        /// 获取一个实体对象
        /// </summary>
        /// <param name="mapID"></param>
        /// <returns></returns>
        public RoleAuthorEntity GetRoleAuthor(long mapID)
        {
            HttpClientHelper clientHelper    = new HttpClientHelper();
            RoleAuthorQuery  roleAuthorQuery = new RoleAuthorQuery();

            roleAuthorQuery.MapID = mapID;
            RoleAuthorEntity roleAuthorEntity = clientHelper.PostAuth <RoleAuthorEntity, RoleAuthorQuery>(GetAPIUrl(APIConstant.GETROLEAUTHORLIST), roleAuthorQuery);

            return(roleAuthorEntity);
        }
예제 #10
0
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string RoleAuthorQueryToSQLOrder(RoleAuthorQuery query)
 {
     if (query.OrderStr != null)
     {
         return(query.OrderStr);
     }
     else
     {
         return(" MapID ASC");
     }
 }
예제 #11
0
        /// <summary>
        /// 将查询实体转换为Where语句
        /// <param name="query">查询实体</param>
        /// <returns>获取Where语句,不包含Where</returns>
        /// </summary>
        public string RoleAuthorQueryToSQLWhere(RoleAuthorQuery query)
        {
            StringBuilder sbWhere = new StringBuilder(" JournalID = " + query.JournalID);

            if (query.AuthorID != null)
            {
                sbWhere.Append(" AND AuthorID = ").Append(query.AuthorID.Value).Append("");
            }
            if (query.RoleID != null)
            {
                sbWhere.Append(" AND RoleID = ").Append(query.RoleID.Value).Append("");
            }
            return(sbWhere.ToString());
        }
예제 #12
0
        public Pager <RoleAuthorEntity> GetRoleAuthorPageList(RoleAuthorQuery query)
        {
            int     recordCount            = 0;
            string  whereSQL               = RoleAuthorQueryToSQLWhere(query);
            string  orderBy                = RoleAuthorQueryToSQLOrder(query);
            DataSet ds                     = db.GetPagingData("RoleAuthor", "MapID,JournalID,RoleID,AuthorID,AddDate", orderBy, whereSQL, query.CurrentPage, query.PageSize, out recordCount);
            Pager <RoleAuthorEntity> pager = new Pager <RoleAuthorEntity>();

            if (ds != null && ds.Tables.Count > 0)
            {
                pager.ItemList = MakeRoleAuthorList(ds.Tables[0]);
            }
            pager.CurrentPage  = query.CurrentPage;
            pager.PageSize     = query.PageSize;
            pager.TotalRecords = recordCount;
            return(pager);
        }
예제 #13
0
        public ActionResult WorkloadListToExcel(WorkloadQuery query)
        {
            IRoleAuthorFacadeService roleAuthorService = ServiceContainer.Instance.Container.Resolve <IRoleAuthorFacadeService>();
            RoleAuthorQuery          roleAuthorQuery   = new RoleAuthorQuery();

            roleAuthorQuery.JournalID = JournalID;
            roleAuthorQuery.GroupID   = 1;
            roleAuthorQuery.OrderStr  = " AI.AuthorID ASC";
            roleAuthorQuery.RealName  = query.RealName;
            if (query.RoleID > 0)
            {
                roleAuthorQuery.RoleID = query.RoleID;
            }
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <RoleAuthorEntity> listRoleAuthor = roleAuthorService.GetRoleAuthorDetailList(roleAuthorQuery);
            List <WorkloadEntity>    list           = new List <WorkloadEntity> ();

            for (int i = 0; i < listRoleAuthor.Count; i++)
            {
                WorkloadEntity  workloadEntity = new WorkloadEntity();
                FlowStatusQuery fquery         = new FlowStatusQuery();
                JsonExecResult <FlowStatusEntity> jsonResult0 = new JsonExecResult <FlowStatusEntity>();
                JsonExecResult <FlowStatusEntity> jsonResult1 = new JsonExecResult <FlowStatusEntity>();
                IFlowFacadeService fservice = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                fquery.JournalID   = JournalID;
                fquery.CurAuthorID = listRoleAuthor[i].AuthorID;
                fquery.RoleID      = listRoleAuthor[i].RoleID;
                fquery.StartDate   = query.StartDate;
                fquery.EndDate     = query.EndDate;
                #region 待处理
                try
                {
                    fquery.IsHandled     = 0;//0=待处理
                    jsonResult0.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                    if (jsonResult0.ItemList != null && jsonResult0.ItemList.Count > 0)
                    {
                        jsonResult0.ItemList = jsonResult0.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                        for (int m = 0; m < jsonResult0.ItemList.Count; m++)
                        {
                            workloadEntity.WaitCount += jsonResult0.ItemList[m].ContributionCount;
                        }
                    }
                }
                catch (Exception ex)
                {
                    jsonResult0.result = EnumJsonResult.error.ToString();
                    jsonResult0.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
                }
                #endregion

                #region 已处理
                try
                {
                    fquery.IsHandled     = 1;//1=已处理
                    jsonResult1.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                    if (jsonResult1.ItemList != null && jsonResult1.ItemList.Count > 0)
                    {
                        jsonResult1.ItemList = jsonResult1.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                        for (int n = 0; n < jsonResult1.ItemList.Count; n++)
                        {
                            workloadEntity.WorkCount += jsonResult1.ItemList[n].ContributionCount;
                        }
                    }
                }
                catch (Exception ex)
                {
                    jsonResult1.result = EnumJsonResult.error.ToString();
                    jsonResult1.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
                }
                #endregion

                workloadEntity.AuthorID = listRoleAuthor[i].AuthorID;
                workloadEntity.RealName = listRoleAuthor[i].RealName;
                if (workloadEntity.WorkCount > 0)
                {
                    list.Add(workloadEntity);
                }
            }
            //去除固定的不需统计的人员ID
            list.Where(p => p.AuthorID != 84381 && p.AuthorID != 84386 && p.AuthorID != 84388 && p.AuthorID != 95844);
            //去除List中的重复项
            List <WorkloadEntity> WorkloadList = list.Distinct(new Compare <WorkloadEntity>((x, y) => (null != x && null != y) && (x.AuthorID == y.AuthorID))).ToList();

            string[] titleFiles  = new string[] { "编辑姓名", "已处理", "待处理" };
            int[]    titleWidth  = new int[] { 80, 80, 80 };
            string[] dataFiles   = new string[] { "RealName", "WorkCount", "WaitCount" };
            string[] fomateFiles = new string[] { "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "WorkloadListAll.xls";
            ExcelHelperEx.CreateExcel <WorkloadEntity>("编辑部工作量统计", titleFiles, titleWidth, dataFiles, fomateFiles, WorkloadList, strTempPath);
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
예제 #14
0
 /// <summary>
 /// 获取所有符合查询条件的数据(包含角色名称)
 /// </summary>
 /// <param name="roleAuthorQuery"></param>
 /// <returns></returns>
 public List <RoleAuthorEntity> GetRoleAuthorDetailList(RoleAuthorQuery roleAuthorQuery)
 {
     return(RoleAuthorBusProvider.GetRoleAuthorDetailList(roleAuthorQuery));
 }
예제 #15
0
 /// <summary>
 /// 获取所有符合查询条件的数据(包含角色名称)
 /// </summary>
 /// <param name="roleAuthorQuery"></param>
 /// <returns></returns>
 public List <RoleAuthorEntity> GetRoleAuthorDetailList(RoleAuthorQuery roleAuthorQuery)
 {
     return(RoleAuthorDataAccess.Instance.GetRoleAuthorDetailList(roleAuthorQuery));
 }
예제 #16
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="roleAuthorQuery">RoleAuthorQuery查询实体对象</param>
 /// <returns>Pager<RoleAuthorEntity></returns>
 public Pager <RoleAuthorEntity> GetRoleAuthorPageList(RoleAuthorQuery roleAuthorQuery)
 {
     return(RoleAuthorDataAccess.Instance.GetRoleAuthorPageList(roleAuthorQuery));
 }
예제 #17
0
 /// <summary>
 /// 分页获取符合查询条件的数据
 /// </summary>
 /// <param name="roleAuthorQuery">RoleAuthorQuery查询实体对象</param>
 /// <returns>Pager<RoleAuthorEntity></returns>
 public Pager <RoleAuthorEntity> GetRoleAuthorPageList(RoleAuthorQuery roleAuthorQuery)
 {
     return(RoleAuthorBusProvider.GetRoleAuthorPageList(roleAuthorQuery));
 }