且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-09-14 17:48:04

系列目录

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

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

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

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

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

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

流程监控=我的申请

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

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

ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控
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);
        }
    }
}
ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控

 

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

ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控
 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;
        }
ASP.NET MVC5+EF6+EasyUI 后台管理系统(54)-工作流设计-所有流程监控

直接取得运行结果

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

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