示例#1
0
        private IList <FlowStatusEntity> GetFlowStatusList(AuthorInfoQuery author)
        {
            JsonExecResult <FlowStatusEntity> jsonResult = new JsonExecResult <FlowStatusEntity>();
            IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            FlowStatusQuery    query   = new FlowStatusQuery();

            query.JournalID   = JournalID;
            query.CurAuthorID = (long)author.AuthorID;
            query.RoleID      = (long)CurAuthor.RoleID;
            query.IsHandled   = 2;
            try
            {
                jsonResult.ItemList = service.GetHaveRightFlowStatus(query);
                if (jsonResult.ItemList != null)
                {
                    jsonResult.ItemList = jsonResult.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                }
                jsonResult.result = EnumJsonResult.success.ToString();
            }
            catch (Exception ex)
            {
                jsonResult.result = EnumJsonResult.error.ToString();
                jsonResult.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
            }
            return(jsonResult.ItemList);
        }
示例#2
0
        public ActionResult GetWorkloadListForAuthorID(FlowStatusQuery fquery)
        {
            JsonExecResult <FlowStatusEntity> jsonResult0 = new JsonExecResult <FlowStatusEntity>();
            JsonExecResult <FlowStatusEntity> jsonResult1 = new JsonExecResult <FlowStatusEntity>();
            IFlowFacadeService fservice = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

            fquery.JournalID = JournalID;

            #region 待处理
            try
            {
                fquery.IsHandled     = 0;//0=待处理
                jsonResult0.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                if (jsonResult0.ItemList != null)
                {
                    jsonResult0.ItemList = jsonResult0.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                }
                jsonResult0.result = EnumJsonResult.success.ToString();
            }
            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 = jsonResult1.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                }
                jsonResult1.result = EnumJsonResult.success.ToString();
            }
            catch (Exception ex)
            {
                jsonResult1.result = EnumJsonResult.error.ToString();
                jsonResult1.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
            }
            #endregion

            return(Json(new { Rows0 = jsonResult0.ItemList, Rows1 = jsonResult1.ItemList }));
        }
示例#3
0
        public ActionResult WorkloadListForEditorToExcel(FlowStatusQuery fquery)
        {
            JsonExecResult <FlowStatusEntity> jsonResult0 = new JsonExecResult <FlowStatusEntity>();
            JsonExecResult <FlowStatusEntity> jsonResult1 = new JsonExecResult <FlowStatusEntity>();
            IFlowFacadeService fservice = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

            fquery.JournalID = JournalID;


            List <WorkloadEntity> list = new List <WorkloadEntity>();

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

            #region 待处理
            try
            {
                fquery.IsHandled     = 0;//0=待处理
                jsonResult0.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                if (jsonResult0.ItemList != null)
                {
                    int WaitCount = 0;
                    jsonResult0.ItemList = jsonResult0.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                    for (int m = 0; m < jsonResult0.ItemList.Count; m++)
                    {
                        WorkloadEntity workloadEntity = new WorkloadEntity();
                        workloadEntity.StatusName   = jsonResult0.ItemList[m].StatusName;
                        workloadEntity.AlreadyCount = jsonResult0.ItemList[m].ContributionCount;
                        WaitCount += jsonResult0.ItemList[m].ContributionCount;
                        workloadEntity.RealName = Request.Params["RealName"];
                        list.Add(workloadEntity);
                    }
                    WorkloadEntity workloadEntityCount = new WorkloadEntity();
                    workloadEntityCount.StatusName   = "待处理总计:";
                    workloadEntityCount.AlreadyCount = WaitCount;
                    list.Add(workloadEntityCount);
                }
            }
            catch (Exception ex)
            {
                jsonResult0.result = EnumJsonResult.error.ToString();
                jsonResult0.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
            }
            #endregion

            string[] titleFiles  = new string[] { "编辑姓名", "稿件状态", "数量" };
            int[]    titleWidth  = new int[] { 80, 80, 80 };
            string[] dataFiles   = new string[] { "RealName", "StatusName", "AlreadyCount" };
            string[] fomateFiles = new string[] { "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "WorkloadListForEditor.xls";
            ExcelHelperEx.CreateExcel <WorkloadEntity>("编辑(" + Request.Params["RealName"] + ")工作量统计", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);

            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
示例#4
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 }));
        }
示例#5
0
 public ActionResult GetFlowStatusListDataAjax(FlowStatusQuery query)
 {
     JsonExecResult<List<FlowStatusEntity>> execResult = new JsonExecResult<List<FlowStatusEntity>>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         query.JournalID = JournalID;
         execResult.result = EnumJsonResult.success.ToString();
         execResult.msg = "";
         execResult.ReturnObject = service.GetFlowStatusList(query);
     }
     catch (Exception ex)
     {
         execResult.result = EnumJsonResult.error.ToString();
         execResult.msg = "获取审稿状态(数据)出现异常:" + ex.Message;
         execResult.ReturnObject = new List<FlowStatusEntity>(0);
         LogProvider.Instance.Error("获取审稿状态(数据)出现异常:" + ex.Message);
     }
     return Content(JsonConvert.SerializeObject(execResult));
 }
示例#6
0
 public ActionResult GetFlowStatusNum()
 {
     JsonExecResult<int> execResult = new JsonExecResult<int>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         FlowStatusQuery query = new FlowStatusQuery();
         query.JournalID = JournalID;
         execResult.result = EnumJsonResult.success.ToString();
         execResult.msg = "";
         execResult.ReturnObject = service.GetFlowStatusSortID(query);
     }
     catch (Exception ex)
     {
         execResult.result = EnumJsonResult.error.ToString();
         execResult.msg = "获取审稿状态序号出现异常:" + ex.Message;
         execResult.ReturnObject = 0;
         LogProvider.Instance.Error("获取审稿状态序号出现异常:" + ex.Message);
     }
     return Content(JsonConvert.SerializeObject(execResult));
 }
示例#7
0
 public ActionResult GetFlowActionListByIDAjax(FlowActionQuery query)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         query.JournalID = JournalID;
         jsonResult.ItemList = service.GetFlowActionList(query);
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "根据步骤ID获取流程操作列表出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
示例#8
0
 public ActionResult GetFlowActionEntityAjax(long ActionID)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         FlowActionQuery query = new FlowActionQuery();
         query.ActionID = ActionID;
         query.JournalID = JournalID;
         jsonResult.ItemList = new List<FlowActionEntity>();
         jsonResult.ItemList.Add(service.GetFlowActionEntity(query));
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取流程操作出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
 public ActionResult GetHaveRightFlowStatus(byte? WorkStatus)
 {
     JsonExecResult<FlowStatusEntity> jsonResult = new JsonExecResult<FlowStatusEntity>();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     FlowStatusQuery query = new FlowStatusQuery();
     query.JournalID = JournalID;
     query.CurAuthorID = CurAuthor.AuthorID;
     query.RoleID = CurAuthor.RoleID == null ? 0 : CurAuthor.RoleID.Value;
     query.IsHandled = WorkStatus == null ? (byte)2 : WorkStatus.Value;
     try
     {
         jsonResult.ItemList = service.GetHaveRightFlowStatus(query);
         if (jsonResult.ItemList != null)
         {
             jsonResult.ItemList = jsonResult.ItemList.Where(p => p.ContributionCount > 0).ToList<FlowStatusEntity>();
         }
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
 public ActionResult GetFlowStatusStat()
 {
     JsonExecResult<FlowStatusEntity> jsonResult = new JsonExecResult<FlowStatusEntity>();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     FlowStatusQuery query = new FlowStatusQuery();
     query.JournalID = JournalID;
     query.IsHandled = 2;
     query.CurAuthorID = 0;
     query.RoleID = 0;
     try
     {
         jsonResult.ItemList = service.GetHaveRightFlowStatus(query);
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取稿件状态统计出现异常:" + ex.Message;
     }
     return Json(new { Rows = jsonResult.ItemList, Total = 200 });
 }
 public ActionResult GetFlowActionByStatus(FlowActionQuery query)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     query.JournalID = JournalID;
     query.AuthorID = CurAuthor.AuthorID;
     query.RoleID = CurAuthor.RoleID == null ? 0 : CurAuthor.RoleID.Value;
     try
     {
         List<FlowActionEntity> listResult = service.GetFlowActionByStatus(query);
         jsonResult.ItemList = listResult;
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取当前状态下的可做操作出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }