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,如需转载请自行联系原作者
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值