在删除部门时,由于系统没有做是否可以删除的校验,一旦删除被引用的部门会导致系统错误,无法启动工作流服务,下面的SQL可以帮助你检查和部门相关的权限配置:
--ParticipantType 2 部门 --ParticipantType 7 某部分的领导 --ParticipantType 22 某部门某岗位 -- 流程权限设置为和部门相关 SELECT c.ProcessName,c.ProcessCode,c.ProcessVersion,b.GroupName FROM BPMD_PARTICIPANT a INNER JOIN BPMU_GROUP b on b.GroupId = a.Param0 INNER JOIN BPMD_PROCESS c on c.ProcessId = a.ProcessId WHERE a.ParticipantType IN (2,7,22) AND a.FunctionType='ProcPerm' AND a.IsEnable = 1 and c.IsEnable = 1 -- 流程处理人设置为和部门相关 SELECT c.ProcessName,c.ProcessCode,c.ProcessVersion,b.GroupName,d.ElementName FROM BPMD_PARTICIPANT a INNER JOIN BPMU_GROUP b on b.GroupId = a.Param0 INNER JOIN BPMD_PROCESS c on c.ProcessId = a.ProcessId INNER JOIN BPMD_NODE d on d.ElementId = a.ElementId WHERE a.ParticipantType IN (2,7,22) AND a.FunctionType='ActivityRecp' AND a.IsEnable = 1 and c.IsEnable = 1 and d.IsEnable = 1 -- 流程线上设置为何部门相关 SELECT c.ProcessName,c.ProcessCode,c.ProcessVersion,b.GroupName,d.DspString,e.ElementName as FromNode,f.ElementName as ToNode FROM BPMD_PARTICIPANT a INNER JOIN BPMU_GROUP b on b.GroupId = a.Param0 INNER JOIN BPMD_PROCESS c on c.ProcessId = a.ProcessId INNER JOIN BPMD_TRANSITION d on d.ElementId = a.ElementId INNER JOIN BPMD_NODE e on e.ElementId = d.FromActivityId INNER JOIN BPMD_NODE f on f.ElementId = d.ToActivityId WHERE a.ParticipantType IN (2,7,22) AND a.FunctionType='TranRecp' AND a.IsEnable = 1 and c.IsEnable = 1 and d.IsEnable = 1