已经通过远程协助看了,原因是
lPosition := TContextUtils.GetOperatorPosition(context).PositionID;
lPosition := SystemCore.TSystemCore.Operator.DefaultPosition.PositionID ;
原来是注销掉的被你们给放开了,GetFilter函数原来的代码是这样的
function TNEWSPLACARD_NAVINFO.GetFilter: string;
var
lPerson,lPosition,lDept,lorg: string;
lFilter: string;
lNow: Double;
begin
lNow := Business.Data.SysSrv.SysService.Time;
lPerson := TContextUtils.GetOperator(Context).ID;
{lPosition := TContextUtils.GetOperatorPosition(context).PositionID;
lDept := TContextUtils.GetDept(context).ID;}
lorg := GetOgrn.ID;
lFilter := ' ftype = ''NEWSPLACARDDEAL'' ';
if SysUtils.SameText(sdsTask.Connection.Meta.DataProvider, Business.Data.BizSchemaTypes.cDriver_ORACLE) then
begin
lFilter := lFilter + SysUtils.Format('and TTask.FPLANSTARTTIME <= TO_DATE(''%s'', ''YY-MM-DD HH24:MI:SS'')',
[SysUtils.FormatDateTime('yyyy-mm-dd hh:mm:ss', lNow)]);
lFilter := lFilter + SysUtils.Format('and TTask.FPLANFINISHTIME >= TO_DATE(''%s'', ''YY-MM-DD HH24:MI:SS'')',
[SysUtils.FormatDateTime('yyyy-mm-dd hh:mm:ss', lNow)]);
end
else
begin
lFilter := lFilter + SysUtils.Format('and TTask.FPLANSTARTTIME <= ''%s''',
[SysUtils.FormatDateTime('yyyy-mm-dd hh:mm:ss', lNow)]);
lFilter := lFilter + SysUtils.Format('and TTask.FPLANFINISHTIME >= ''%s''',
[SysUtils.FormatDateTime('yyyy-mm-dd hh:mm:ss', lNow)]);
end;
{lFilter := lFilter + 'and (TTASK.FGUID IN '+
' (SELECT TTASKMESSAGE.FTASKGUID '+
' FROM TTASKMESSAGE '+
' WHERE (TTASKMESSAGE.FSTATE IN '+
// ' (''tmsSend'', ''tmsReceived'', ''tmsProcessing'')) '+
' (''tmsFinished'')) '+
' AND (((TTASKMESSAGE.FRDEPT = '''+lDept+''') AND '+
' (TTASKMESSAGE.FRPOSITION = '''+lPosition+''') AND '+
' (TTASKMESSAGE.FRPERSON = '''+lPerson+''')) or '+
' ((TTASKMESSAGE.FRDEPT = '''+lDept+''') AND '+
' (TTASKMESSAGE.FRPOSITION = '''+lPosition+''') AND '+
' (TTASKMESSAGE.FRPERSON is null)) or '+
' ((TTASKMESSAGE.FRDEPT = '''+lDept+''') AND '+
' (TTASKMESSAGE.FRPOSITION is null) AND '+
' (TTASKMESSAGE.FRPERSON is null)) or '+
' ((TTASKMESSAGE.FRDEPT is null) AND '+
' (TTASKMESSAGE.FRPOSITION is null) AND '+
' (TTASKMESSAGE.FRPERSON is null) AND '+
' (TTASKMESSAGE.FROGN = '''+lorg+''')))) '+
' or (TTASK.FGUID IN '+
' (SELECT T1.FGUID '+
' FROM TTASK T1 '+
' WHERE (T1.FSTATE IN (''tsStarted'', ''tsProcessing'')) '+
' AND ((T1.FSDEPT = '''+lDept+''') AND (T1.FSPOSITION = '''+lPosition+''') AND '+
' (T1.FSPERSON = '''+lPerson+'''))))) ';}
lFilter := lFilter + 'and (TTASK.FGUID IN '+
' (SELECT TTASKMESSAGE.FTASKGUID '+
' FROM TTASKMESSAGE '+
' WHERE (TTASKMESSAGE.FSTATE IN '+
' (''tmsFinished'')) '+
' AND (TTASKMESSAGE.FRORGURL IN ('+DoGetQueryURLStr(PersonMemberAndParentURLs)+') or '+
' (TTASKMESSAGE.FRORGURL in (''\ROOT\_UNEXIST_.OGN\.DPT\.PTM\.PSM'',''\ROOT\_UNEXIST_.OGN\.DPT'') and TTASKMESSAGE.FROGN = '''+lorg+''' )) ) '+
' or (TTASK.FGUID IN '+
' (SELECT T1.FGUID '+
' FROM TTASK T1 '+
' WHERE (T1.FSTATE IN (''tsStarted'', ''tsProcessing'',''tsFinished'')) '+
' and (T1.FSPERSON = '''+lPerson+''')))) ';
Result := lFilter;
end; |