ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控

简介:

系列目录

先补充一个平面化登陆页面代码,自己更换喜欢的颜色背景

 View Code

后台还是之前页面构建ASP.NET MVC4+EF5+EasyUI+Unity2.x注入的后台管理系统(3)-漂亮系统登陆界面 的代码

--------------------------------------

进入主题:流程监控能看到所有申请的状态。主要用于管理员查询数据使用

流程监控=我的申请

我的申请指定了当前的用户,所有监控则查询所有用户的申请。很简单,复制一份Apply控制器的代码

直接上代码: FlowTrackController 需要手动新建FlowTrackController控制器

复制代码
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Apps.Common;
using Apps.IBLL;
using Apps.Models.Sys;
using Microsoft.Practices.Unity;
using Apps.Flow.IBLL;
using Apps.Models.Flow;
using System.Text;
using Apps.Flow.BLL;
using System;
using Apps.Web.Core;
using Apps.Models.Enum;
namespace Apps.Web.Areas.Flow.Controllers
{
    public class FlowTrackController : BaseController
    {
        [Dependency]
        public ISysUserBLL userBLL { get; set; }
        [Dependency]
        public IFlow_TypeBLL m_BLL { get; set; }
        [Dependency]
        public IFlow_FormBLL formBLL { get; set; }
        [Dependency]
        public IFlow_FormAttrBLL formAttrBLL { get; set; }
        [Dependency]
        public IFlow_FormContentBLL formContentBLL { get; set; }
        [Dependency]
        public IFlow_StepBLL stepBLL { get; set; }
        [Dependency]
        public IFlow_StepRuleBLL stepRuleBLL { get; set; }
        [Dependency]
        public IFlow_FormContentStepCheckBLL stepCheckBLL { get; set; }
        [Dependency]
        public IFlow_FormContentStepCheckStateBLL stepCheckStateBLL { get; set; }

        ValidationErrors errors = new ValidationErrors();

        [SupportFilter]
        public ActionResult Index()
        {
            return View();
        }


        [SupportFilter]
        public ActionResult Index()
        {
            ViewBag.Perm = GetPermission();

            List<Flow_FormContentModel> list = formContentBLL.GeExaminetList(ref setNoPagerAscById, "");
            foreach (var model in list)
            {
                List<Flow_FormContentStepCheckModel> stepCheckModelList = stepCheckBLL.GetListByFormId(model.FormId, model.Id);
                model.CurrentState = formContentBLL.GetCurrentFormState(model);
            }
            FlowStateCountModel stateModel = new FlowStateCountModel();
            stateModel.requestCount = list.Count();
            stateModel.passCount = list.Where(a => a.CurrentState == (int)FlowStateEnum.Pass).Count();
            stateModel.rejectCount = list.Where(a => a.CurrentState == (int)FlowStateEnum.Reject).Count();
            stateModel.processCount = list.Where(a => a.CurrentState == (int)FlowStateEnum.Progress).Count();
            stateModel.closedCount = list.Where(a => a.TimeOut < DateTime.Now).Count();
            return View(stateModel);
        }
        [HttpPost]
        public JsonResult GetList(GridPager pager, string queryStr)
        {
            List<Flow_FormContentModel> list = formContentBLL.GetList(ref pager, queryStr);
            var json = new
            {
                total = pager.totalRows,
                rows = (from r in list
                        select new Flow_FormContentModel()
                        {

                            Id = r.Id,
                            Title = r.Title,
                            UserId = r.UserId,
                            FormId = r.FormId,
                            FormLevel = r.FormLevel,
                            CreateTime = r.CreateTime,
                            TimeOut = r.TimeOut,
                            CurrentStep = formContentBLL.GetCurrentFormStep(r),
                            CurrentState = formContentBLL.GetCurrentFormState(r),
                            
                        }).ToArray()

            };
            return Json(json);
        }
    }
}
复制代码

 

DAL层方法(获取统计信息),对比申请的只去掉where 中的userid=

复制代码
 public IQueryable<Flow_FormContent> GeExamineList(DBContainer db)
        {
            IQueryable<Flow_FormContent> list = (from a in db.Flow_FormContent
                                                 join b in db.Flow_Step
                                                 on a.FormId equals b.FormId
                                                 join c in db.Flow_FormContentStepCheck
                                                 on b.Id equals c.StepId
                                                 join d in db.Flow_FormContentStepCheckState
                                                 on c.Id equals d.StepCheckId
                                                 select a).Distinct();
            return list;
        }
复制代码

直接取得运行结果

本文转自ymnets博客园博客,原文链接:http://www.cnblogs.com/ymnets/p/5172064.html,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章