|

楼主 |
发表于 2007-11-7 15:25:14
|
显示全部楼层
用到的相关代码如下 不知道那个地方出错..)
//流程第n个功能流转之后
//******************************************************
//*参数说明
//lFlowTask:TFlowTask;
//lFlowTask:=Command.FlowTasks[0];
//ANextPersonID:=lFlowTask.Executors.Items[0].PersonID;
//ANextFuncURL:=lFlowTask.FuncURL.URL;
//上面是在实际的AfterFlowOut()中先获得值
//*ANextPersonID:流程流转后,下一个处理人ID
//*ANextFuncURL:下一个能能的URL
//*APassDay:经过天数。=用当前时间-数据库中的开始时间
//*****************************************************
procedure TGZJD.AfterFlowUpdata(ANextPersonID,ANextFuncURL,APassDay:string);
var
updatesql,strLcid,strXzhj,strClrid,strGwid,strClrbmid,strFuncurl,det,name:string;
lContextCurrent: Business.Model.TContextCurrent;
upset:TSQLDataSet;
//常量定义
const strNext='未处理';
const strClzt='已完成';
begin
//环境上下文
lContextCurrent := Business.Model.TContextCurrent.Create(Self.Context);
strLcid:=lContextCurrent.FlowControl.Flow.GUID;
upset:=TSQLDataSet.Create(self);
upset.Database.URL:='Biz:\OABGZDHXT\BGZDHSJK.DATABASE';
//现在环节取值
name:=lContextCurrent.Operator.DisplayName;
det:=lContextCurrent.Dept.DisplayName;
strXzhj:=det+'('+name+')';
//处理人id,岗位id,部门id取值
strClrbmid:=lContextCurrent.Dept.ID;
strGwid:=lContextCurrent.PositionMember.ID;
strClrid:=lContextCurrent.Operator.ID;
//功能URL
strFuncurl:= lContextCurrent.GetDefaultFunc.BizClassURL.BizURL.URL;
updatesql:='UPDATE GZJKB SET XZHJ ='''+strXzhj+''',CLZT='''+strClzt+''',CLRBMID='''+strClrbmid+''',CLRGWID='''+strGwid+''',CLRID='''+strClrid+''',GNURL='''+strFuncurl+''',JGTS='''+APassDay+''',XYCLRID='''+ANextPersonID+''',XYGRZT='''+strNext+''',XYGNURL='''+ANextFuncURL+''' where Lcid='''+strLcid+'''';
//dialogs.ShowMessage(updatesql);
with upset do
begin
close;
sql.Clear;
sql.Text:=updatesql;
upset.Execute;
upset.Close;
end;
end;
procedure TLWXX.FlowBrokerAfterFlowOut(Sender: TObject; Command: TFlowOutCommand);
var
strNextpID,strNextFuncURL,strPassday:string;
lFlowTask:TFlowTask;
strTemp:string;
j:integer;
begin
lFlowTask:=Command.FlowTasks[0];
strNextpID:=lFlowTask.Executors.Items[0].PersonID;
strNextFuncURL:=lFlowTask.FuncURL.URL;
//计算经过天数
strTemp:=DataSetBroker.DataSet.FieldByName('SWRQ').AsString;
strTemp:=Business.System.StrUtils.LeftStr(strTemp,10);
j:=Integer(now()-StrToDate(strTemp));
strPassday:=IntToStr(j);
lForm.AfterFlowUpdata(strNextpID,strNextFuncURL,strPassday);
end; |
|