仿钉钉流程设计- 会签按比例通过bug 修复

This commit is contained in:
jason 2024-06-14 21:53:57 +08:00
parent d7e1b87b1b
commit 8585e05772

View File

@ -54,17 +54,6 @@ public class CompleteByRejectCountExpression {
// 多人会签(按通过比例)
Integer approveRatio = NumberUtils.parseInt(BpmnModelUtils.parseExtensionElement(flowElement, USER_TASK_APPROVE_RATIO));
Assert.notNull(approveRatio, "通过比例不能空");
if (Objects.equals(100, approveRatio)) {
// 所有人都同意
if (agreeCount == nrOfInstances) {
return true;
}
// 一个人拒绝了
if (rejectCount > 0) {
execution.setVariable(String.format("%s_reject", flowElement.getId()), Boolean.TRUE);
return true;
}
} else {
// 判断通过比例
double approvePct = approveRatio / (double) 100;
double realApprovePct = (double) agreeCount / nrOfInstances;
@ -74,11 +63,10 @@ public class CompleteByRejectCountExpression {
double rejectPct = (100 - approveRatio) / (double) 100;
double realRejectPct = (double) rejectCount / nrOfInstances;
// 判断拒绝比例
if (realRejectPct >= rejectPct) {
if (realRejectPct > rejectPct) {
execution.setVariable(String.format("%s_reject", flowElement.getId()), Boolean.TRUE);
return true;
}
}
return false;
}