高经理不在,我的需求是把改变主表的状态后把 尚未结束的流程结束掉,如下操作 AQuery.CommandText := 'UPDATE TFLOW SET FSTATE = ''fsFinished'' WHERE ' +
'FGUID IN (SELECT FFLOWGUID FROM TFLOWID WHERE FID = ''' + AFlowID + ''')';
AQuery.Execute;
AQuery.Close;
AQuery.CommandText := 'UPDATE TTASK SET FSTATE = ''tsAborted'', FFINISHTIME = ''' +
lDate + ''' WHERE FFLOWGUID IN (SELECT FFLOWGUID FROM TFLOWID WHERE FID = ''' +
AFlowID + ''') AND FSTATE NOT IN (''tsFinished'', ''tsCanceled'', ''tsTransmited'')';
AQuery.Execute;
AQuery.Close;
AQuery.CommandText := 'UPDATE TTASKMESSAGE SET FSTATE = ''tmsAborted'', ' +
'FFINISHTIME = ''' + lDate + ''' WHERE FTASKGUID IN (SELECT FGUID FROM TTASK ' +
'WHERE FFLOWGUID IN (SELECT FFLOWGUID FROM TFLOWID WHERE FID = ''' + AFlowID +
''')) AND FSTATE NOT IN (''tmsFinished'',''tmsCanceled'',''tmsTransmited'')';
AQuery.Execute;
操作后刷新工作台,1楼的错误忽略,参数都正确也不出错,但没刷新,请alang帮看看吧 |