工作流之公文流转篇

出处:http://www.cnblogs.com/flyskyer/archive/2009/03/11/1408578.html

最近因为接手离职同事的公文审批(没有使用工作流)维护,感觉很麻烦,于是在我开发的工作流平台上重新写了相关的功能,扩展同事的功能,同时可以支持固定流和任意流功能。希望大哥们给予指点。

固定流就是由发起人定义审批的步骤,流程按照既定步骤执行。

任意流就是由发起人发起,选择下一步审批人审批,然后审批再选择下一步审批人。

当然公文审批支持的电子签名的功能也有,但是不作为本篇讨论内容,还有界面美观。

1.服务代码。

Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Workflow.Runtime;
usingSystem.Workflow.Activities;
usingSystem.Workflow.ComponentModel;

namespaceStateMachineService
{
[Serializable]
publicclassDocFlowEventArgs:ExternalDataEventArgs
{
publicDocFlowEventArgs(stringuserID,Guiduninstand):base(uninstand)
{

this.uninstand=uninstand;
this.userID=userID;
}


privateGuiduninstand=Guid.Empty;
publicGuidUninstand
{
get{returnthis.uninstand;}
set{this.uninstand=value;}
}

privatestringuserID=string.Empty;
publicstringUserID
{
get{returnthis.userID;}
set{this.userID=value;}
}

}

[ExternalDataExchange]
publicinterfaceIDocFlowService
{
eventEventHandler<DocFlowEventArgs>Next;
eventEventHandler<DocFlowEventArgs>Jump;
eventEventHandler<DocFlowEventArgs>Stop;

voidSetFixNextApprover(intNextStpeID,stringuninstand);
voidSetFixEnableApprover(intCurrentStpeID,stringuninstand);
voidSetAutoNextApprover();
voidSetAutoEnableApprover(stringuninstand);
voidChangeStatus();
}

[Serializable]
publicclassDocFlowService:IDocFlowService
{
IDAL.IWFreeNodeiwfreenode;
GuidT;
stringUserID;
Dictionary
<string,EventHandler<DocFlowEventArgs>>list=newDictionary<string,EventHandler<DocFlowEventArgs>>();
publicvoidRaiseEventer(stringeventName,Guiduninstand,stringuserID)
{
if(list[eventName]!=null)
{
try
{
EventHandler
<DocFlowEventArgs>eventHandler=list[eventName];
DocFlowEventArgsargs
=newDocFlowEventArgs(userID,uninstand);
args.WaitForIdle
=true;
eventHandler.Invoke(
null,args);
this.T=uninstand;
this.UserID=userID;
}

catch
{
}

}

}

IDocFlowService成员#regionIDocFlowService成员

publiceventEventHandler<DocFlowEventArgs>Next
{
add
{
this.list.Add("Next",value);
}

remove
{
this.list.Remove("Next");
}

}


publiceventEventHandler<DocFlowEventArgs>Jump
{add
{
this.list.Add("Jump",value);
}

remove
{
this.list.Remove("Jump");
}

}


publiceventEventHandler<DocFlowEventArgs>Stop
{
add
{
this.list.Add("Stop",value);
}

remove
{
this.list.Remove("Stop");
}

}


publicvoidChangeStatus()
{
thrownewNotImplementedException();
}


#endregion



IDocFlowService成员#regionIDocFlowService成员


publicvoidSetFixNextApprover(intNextStpeID,stringuninstand)
{
iwfreenode
=DALFactory.WFreeNode.CreateInstance();
stringscript="updateWFreeNodeset[ExceteState]=1whereUninstand='"+uninstand+"'andStepID="+NextStpeID;
iwfreenode.Update(script);

//thrownewNotImplementedException();
}


#endregion




IDocFlowService成员#regionIDocFlowService成员


publicvoidSetFixEnableApprover(intCurrentStpeID,stringuninstand)
{
iwfreenode
=DALFactory.WFreeNode.CreateInstance();
stringscript="updateWFreeNodeset[ExceteState]=2whereUninstand='"+uninstand+"'anduserID='"+this.UserID+"'andStepID="+CurrentStpeID;
iwfreenode.Update(script);
//thrownewNotImplementedException();
}


#endregion




IDocFlowService成员#regionIDocFlowService成员


publicvoidSetAutoNextApprover()
{

//thrownewNotImplementedException();
}


publicvoidSetAutoEnableApprover(stringuninstand)
{
iwfreenode
=DALFactory.WFreeNode.CreateInstance();
stringscript="updateWFreeNodeset[ExceteState]=2whereUninstand='"+uninstand+"'anduserID='"+this.UserID+"'";
iwfreenode.Update(script);
}


#endregion

}

}

现在支持前进,抄送(平台功能)和终止,还不支持会退和跳批。

2.数据库结构

Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->CREATETABLE[dbo].[DocFlow](
[Uninstand][uniqueidentifier]NOTNULL,
[UserID][varchar](
50)NOTNULL,
[Date][datetime]NULL,
[Title][varchar](
400)NULL,
[Remark][varchar](
500)NULL,
[DocLevel][varchar](
50)NULL,
[FlowType][varchar](
10)NULL,
[Depart][varchar](
50)NULL
)

3.流程图

a.

b.

2.

3.

4.

流程代码

Code
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->usingSystem;
usingSystem.ComponentModel;
usingSystem.ComponentModel.Design;
usingSystem.Collections;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Workflow.ComponentModel.Compiler;
usingSystem.Workflow.ComponentModel.Serialization;
usingSystem.Workflow.ComponentModel;
usingSystem.Workflow.ComponentModel.Design;
usingSystem.Workflow.Runtime;
usingSystem.Workflow.Activities;
usingSystem.Workflow.Activities.Rules;

namespaceStateMachineLibrary
{
publicpartialclassDocFlow:StateMachineWorkflowActivity
{
publicstaticDependencyPropertyDocFlowTypeProperty=DependencyProperty.Register("DocFlowType",typeof(string),typeof(DocFlow));
publicstringDocFlowType
{
get{return(string)base.GetValue(DocFlow.DocFlowTypeProperty);}
set{base.SetValue(DocFlow.DocFlowTypeProperty,value);}
}

publicstaticDependencyPropertyStepIDListProperty=DependencyProperty.Register("StepIDList",typeof(System.Collections.Generic.List<int>),typeof(DocFlow));
publicSystem.Collections.Generic.List<int>StepIDList
数飞公文流转系统,用于收发文流转审批,可实现公文单自定义、行文单自定义、印章验证、痕迹保留、红头文件、流程自定义、流程审批、会签、催督办等功能。可按照30、60、100、200用户购买。 数飞公文流转系统功能特点 产品特点 公文自定义 支持用户自定义收文和发文单据样式和模板。并支持系统自定义其他审批单据。 公文基本功能 可拟稿、审批、签章、会签、退回、办结、否决;可归档、传阅、变更、催办、跳签等。 流程自定义 可字定义各种审批流程流程设置操作简单,可实现各种复杂流程。 电子印章 支持用户公文审批过程的模板嵌套、电子印章、印章验证、手写签名、文件内容修改、痕迹保留等功能。手写签名可采用手写板。 公文催督办 管理人员可对公文办理过程超时、延迟、有误的文件进行催办、退签等操作,并统计出各部门、各人员办理文件的办理情况报表,对未达指标的人员和部门提供考核依据。 打印自定义 轻松实现红头文件,同一个公文单可根据不同类别自动套红!各种公文单的打印格式都可以在系统自定义,打印模板跟WORD关联,操作简便,用户打印出的公文审批单据可完全同WORD原格式相同。 支持各种移动终端 支持各种iphone、ipad、android手机或平板移动终端 不受浏览器版本和类型的限制 采用远程接入方式,比直接浏览器连接更快 点击即可进入OA登陆地址,不需要重复输入地址 完全支持word、excle、html编辑器、附件上传等功能 按照移动终端在线用户数收费,只需要购买少量在线用户数给管理层使用 安全性高 可选择集成CA认证、UKEY认证、动态密钥等安全认证,可选择绑定IP、网卡等安全措施;可设置日志删除期限;调用印章需要 验证;可验证印章的合法性。 数飞公文系统主要功能 1 公文管理 发文申请、发文待办、发文已办、发文管理、发文待阅、公文类型设置、发文催办记录、发文跳转记录、发文督办、收文登记、收文待办、收文已办、收文管理、收文接收、请示报告、归档文件 2 事务管理 我的申请、我的待办、我的已办、我的待阅、我的管理 3 信息心 公告管理、规章制度、文档心、组织结构、内部论坛、文本聊天室 4 个人心 即时消息、个人日程、通讯录、个人设置、外出留言、个人文档、工作代理、工作日志 5 邮件管理 收件箱、写邮件、发件箱、草稿箱、垃圾箱、外部邮件配置、外部邮件、服务配置、邮件监控、邮件统计 6 用户自定义 自定义公文、自定义流程、新建模块 7 系统设置 组织结构设置、系统模块、权限管理、流程设置、系统日志、备份还原、模板设置、人事档案 数飞公文流转系统截图
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值