Defect: Attestation无法选择alternative approver

项目场景:

正常情况下,基本上每一个attestation policy都有两种approver,一个是正常的approver,如果根据数据找不到approver,会有一个alternative approver来进行审批。


问题描述:

问题就出在当前没有approver,但是也不分配给alternative approver进行审批。
下图就是这个流程,实际上,左边蓝色方框里是没有找到approver的,但是在红色菱形判断的结果却是走到了条件满足的蓝色区域。按照原始需求,应该是走到右边紫色的方框步骤中。

在这里插入图片描述


原因分析:

Attestation是可以配置chief approval team成员的。这个team成员可以审批任何case。在实际中,这个team的成员并不会干涉正常的审核,只有在极为特殊的情况下才越俎代庖。
在之前的使用中,是没有对其进行配置。当这个team配置了成员以后,菱形的判断SQL将其判断成正常的审核人员,认为蓝色区域是有审核人的。
下面是菱形内配置的判断SQL。

EXISTS (
     SELECT 1
     FROM AttestationCase ac
     JOIN AttestationHelper ah ON ac.UID_AttestationCase = ah.UID_AttestationCase
     JOIN (
            SELECT ac.UID_AttestationCase
                   ,s.UID_QERWorkingMethod
                   ,ah.LevelNumber
                   ,ac.DecisionLevel + s.PositiveSteps AS 'TargetLevel'
            FROM AttestationCase ac
            JOIN AttestationHelper ah ON ac.UID_AttestationCase = ah.UID_AttestationCase
                   AND ac.DecisionLevel = ah.LevelNumber
            JOIN QERWorkingStep s ON ah.UID_QERWorkingStep = s.UID_QERWorkingStep
            WHERE ac.UID_AttestationCase = '@UID_AttestationCase'
            ) AS x ON ac.UID_AttestationCase = x.UID_AttestationCase
            AND ah.LevelNumber = x.LevelNumber
     JOIN AttestationHelper ah2 ON ac.UID_AttestationCase = ah2.UID_AttestationCase
            AND ah2.LevelNumber = x.TargetLevel
     JOIN QERWorkingStep s2 ON x.UID_QERWorkingMethod = s2.UID_QERWorkingMethod
            AND s2.LevelNumber = x.TargetLevel
     GROUP BY ah.UID_AttestationCase
            ,s2.CountApprover
     HAVING COUNT(*) >= s2.CountApprover
)

解决方案:

解决方案就是修改菱形中的SQL,将chief approval team里的成员都过滤掉。
在倒数第四行添加了一行内容 where ah2.rulerlevel = 0

EXISTS (
     SELECT 1
     FROM AttestationCase ac
     JOIN AttestationHelper ah ON ac.UID_AttestationCase = ah.UID_AttestationCase
     JOIN (
            SELECT ac.UID_AttestationCase
                   ,s.UID_QERWorkingMethod
                   ,ah.LevelNumber
                   --当前的节点level + 正向节点数 = 下一个节点的level
                   ,ac.DecisionLevel + s.PositiveSteps AS 'TargetLevel'
            FROM AttestationCase ac
            JOIN AttestationHelper ah ON ac.UID_AttestationCase = ah.UID_AttestationCase
                   AND ac.DecisionLevel = ah.LevelNumber
            JOIN QERWorkingStep s ON ah.UID_QERWorkingStep = s.UID_QERWorkingStep
            WHERE ac.UID_AttestationCase = '@UID_AttestationCase'
            ) AS x ON ac.UID_AttestationCase = x.UID_AttestationCase
            AND ah.LevelNumber = x.LevelNumber
     JOIN AttestationHelper ah2 ON ac.UID_AttestationCase = ah2.UID_AttestationCase
            AND ah2.LevelNumber = x.TargetLevel
     JOIN QERWorkingStep s2 ON x.UID_QERWorkingMethod = s2.UID_QERWorkingMethod
            AND s2.LevelNumber = x.TargetLevel
	 where ah2.rulerlevel = 0
     GROUP BY ah.UID_AttestationCase
            ,s2.CountApprover
     HAVING COUNT(*) >= s2.CountApprover
)

知识点回顾

  • AttestationCase 表记录了验证case的信息。
  • AttestationHelper 表记录了系统算出来的全部可能的审核人员。每个一条记录。
  • 以下两句SQL用来找出chief approval team的成员有哪些。顺便提一下,oneIM里有两个chief approval team,一个是在attestation里,一个在IT shop里。
select a.Ident_AERole, a.FullPath, a.* from AERole a where a.Ident_AERole='Chief approval team';
select * from PersonInAERole a where a.UID_AERole='ATT-AEROLE-ATTESTATION-INTERVENTION';
  • 相关表
select * from PWODecisionMethod;  --approval policy
select * from PWODecisionSubMethod a where a.UsageArea='A' order by 2; --approval workflow 
select * from PWODecisionStep;  --approval workflow step
select * from PWODecisionRule;  --approval procedure
select * from PWODecisionRuleRulerDetect;  --definition of approval procedure

--下面两张表,记录着类似的信息,并且有外键关联,但是区别在哪里,还没搞清楚
select * from QERWorkingMethod a order by a.Ident_PWODecisionSubMethod;
select * from PWODecisionSubMethod a order by a.Ident_PWODecisionSubMethod;

--下面两张表,记录着类似的信息,并且有外键关联,但是区别在哪里,还没搞清楚
select * from QERWorkingStep a order by a.Ident_PWODecisionStep;
select * from PWODecisionStep a order by a.Ident_PWODecisionStep;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Severstal: Steel Defect Detection 是一种钢铁缺陷检测软件,可以帮助钢铁生产企业快速准确地发现并修复钢铁产品中的缺陷问题。这个软件结合了先进的机器视觉技术和人工智能算法,能够对钢铁产品进行高精度的缺陷检测,并提供相应的解决方案。 该软件的下载过程简便快捷。用户只需登录 Severstal 官方网站或相关应用商店,并按照指示下载安装程序即可。安装完成后,用户可以按照软件提供的操作指南进行设置和使用。 此外,Severstal: Steel Defect Detection 具有以下主要功能:首先,它能够通过图像识别和分析技术对钢铁产品进行自动化的缺陷检测,包括漏气、气泡、裂缝、异物等常见缺陷。其次,软件配备了先进的算法,能够快速准确地识别和定位缺陷位置,为钢铁企业提供可靠的数据支持。此外,软件还具备强大的数据分析功能,可以生成详细的缺陷报告,帮助企业进行质量管理和改进。 Severstal: Steel Defect Detection 不仅适用于现有钢铁生产企业,也可应用于新建厂房的建设过程中。通过对钢铁产品的实时检测和及时处理,可以有效减少缺陷产品数量,提高生产效率和质量。 总之,Severstal: Steel Defect Detection 软件是一个能够帮助钢铁生产企业实现快速准确的缺陷检测和改进的重要工具。通过下载并使用该软件,企业可以提高钢铁产品的质量,降低损失,增强竞争力。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值