Commit be39a26380f6d14ca250477bbadb08da133b7315
Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into develop
Showing
15 changed files
with
41 additions
and
33 deletions
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmParallelMultiInstanceBehavior.java
| @@ -7,35 +7,44 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | @@ -7,35 +7,44 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | ||
| 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; | 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; | 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; |
| 9 | import lombok.Setter; | 9 | import lombok.Setter; |
| 10 | -import org.flowable.bpmn.model.*; | 10 | +import org.flowable.bpmn.model.Activity; |
| 11 | +import org.flowable.bpmn.model.CallActivity; | ||
| 12 | +import org.flowable.bpmn.model.FlowElement; | ||
| 13 | +import org.flowable.bpmn.model.UserTask; | ||
| 11 | import org.flowable.engine.delegate.DelegateExecution; | 14 | import org.flowable.engine.delegate.DelegateExecution; |
| 12 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; | 15 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; |
| 13 | -import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior; | ||
| 14 | -import org.flowable.engine.impl.persistence.entity.ExecutionEntity; | 16 | +import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior; |
| 15 | 17 | ||
| 16 | import java.util.List; | 18 | import java.util.List; |
| 17 | import java.util.Set; | 19 | import java.util.Set; |
| 18 | 20 | ||
| 19 | /** | 21 | /** |
| 20 | - * 自定义的【串行】的【多个】流程任务的 assignee 负责人的分配 | 22 | + * 自定义的【并行】的【多个】流程任务的 assignee 负责人的分配 |
| 23 | + * 第一步,基于分配规则,计算出分配任务的【多个】候选人们。 | ||
| 24 | + * 第二步,将【多个】任务候选人们,设置到 DelegateExecution 的 collectionVariable 变量中,以便 BpmUserTaskActivityBehavior 使用它 | ||
| 21 | * | 25 | * |
| 22 | - * 本质上,实现和 {@link BpmParallelMultiInstanceBehavior} 一样,只是继承的类不一样 | ||
| 23 | - * | ||
| 24 | - * @author 芋道源码 | 26 | + * @author kemengkai |
| 27 | + * @since 2022-04-21 16:57 | ||
| 25 | */ | 28 | */ |
| 26 | @Setter | 29 | @Setter |
| 27 | -public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceBehavior { | 30 | +public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehavior { |
| 28 | 31 | ||
| 29 | private BpmTaskCandidateInvoker taskCandidateInvoker; | 32 | private BpmTaskCandidateInvoker taskCandidateInvoker; |
| 30 | 33 | ||
| 31 | - public BpmSequentialMultiInstanceBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior) { | 34 | + public BpmParallelMultiInstanceBehavior(Activity activity, |
| 35 | + AbstractBpmnActivityBehavior innerActivityBehavior) { | ||
| 32 | super(activity, innerActivityBehavior); | 36 | super(activity, innerActivityBehavior); |
| 33 | } | 37 | } |
| 34 | 38 | ||
| 35 | /** | 39 | /** |
| 36 | - * 逻辑和 {@link BpmParallelMultiInstanceBehavior#resolveNrOfInstances(DelegateExecution)} 类似 | 40 | + * 重写该方法,主要实现两个功能: |
| 41 | + * 1. 忽略原有的 collectionVariable、collectionElementVariable 表达式,而是采用自己定义的 | ||
| 42 | + * 2. 获得任务的处理人,并设置到 collectionVariable 中,用于 BpmUserTaskActivityBehavior 从中可以获取任务的处理人 | ||
| 43 | + * | ||
| 44 | + * 注意,多个任务实例,每个任务实例对应一个处理人,所以返回的数量就是任务处理人的数量 | ||
| 37 | * | 45 | * |
| 38 | - * 差异的点:是在【第二步】的时候,需要返回 LinkedHashSet 集合!因为它需要有序! | 46 | + * @param execution 执行任务 |
| 47 | + * @return 数量 | ||
| 39 | */ | 48 | */ |
| 40 | @Override | 49 | @Override |
| 41 | protected int resolveNrOfInstances(DelegateExecution execution) { | 50 | protected int resolveNrOfInstances(DelegateExecution execution) { |
| @@ -49,9 +58,8 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | @@ -49,9 +58,8 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | ||
| 49 | super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); | 58 | super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); |
| 50 | 59 | ||
| 51 | // 第二步,获取任务的所有处理人 | 60 | // 第二步,获取任务的所有处理人 |
| 52 | - // 不使用 execution.getVariable 原因:目前依次审批任务回退后 collectionVariable 变量没有清理, 如果重新进入该任务不会重新分配审批人 | ||
| 53 | @SuppressWarnings("unchecked") | 61 | @SuppressWarnings("unchecked") |
| 54 | - Set<Long> assigneeUserIds = (Set<Long>) execution.getVariableLocal(super.collectionVariable, Set.class); | 62 | + Set<Long> assigneeUserIds = (Set<Long>) execution.getVariable(super.collectionVariable, Set.class); |
| 55 | if (assigneeUserIds == null) { | 63 | if (assigneeUserIds == null) { |
| 56 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); | 64 | assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution); |
| 57 | if (CollUtil.isEmpty(assigneeUserIds)) { | 65 | if (CollUtil.isEmpty(assigneeUserIds)) { |
| @@ -80,19 +88,4 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | @@ -80,19 +88,4 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | ||
| 80 | return super.resolveNrOfInstances(execution); | 88 | return super.resolveNrOfInstances(execution); |
| 81 | } | 89 | } |
| 82 | 90 | ||
| 83 | - @Override | ||
| 84 | - protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) { | ||
| 85 | - // 参见 https://t.zsxq.com/53Meo 情况 | ||
| 86 | - if (execution.getCurrentFlowElement() instanceof CallActivity | ||
| 87 | - || execution.getCurrentFlowElement() instanceof SubProcess) { | ||
| 88 | - super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); | ||
| 89 | - return; | ||
| 90 | - } | ||
| 91 | - // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F | ||
| 92 | - super.collectionExpression = null; | ||
| 93 | - super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId()); | ||
| 94 | - super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId()); | ||
| 95 | - super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | } | 91 | } |
yudao-module-bpm/src/main/java/cn/iocoder/yudao/module/bpm/framework/flowable/core/behavior/BpmSequentialMultiInstanceBehavior.java
| @@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | @@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand | ||
| 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; | 7 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils; |
| 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; | 8 | import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils; |
| 9 | import lombok.Setter; | 9 | import lombok.Setter; |
| 10 | -import org.flowable.bpmn.model.Activity; | ||
| 11 | -import org.flowable.bpmn.model.CallActivity; | ||
| 12 | -import org.flowable.bpmn.model.FlowElement; | ||
| 13 | -import org.flowable.bpmn.model.UserTask; | 10 | +import org.flowable.bpmn.model.*; |
| 14 | import org.flowable.engine.delegate.DelegateExecution; | 11 | import org.flowable.engine.delegate.DelegateExecution; |
| 15 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; | 12 | import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior; |
| 16 | import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior; | 13 | import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior; |
| @@ -85,6 +82,12 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | @@ -85,6 +82,12 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB | ||
| 85 | 82 | ||
| 86 | @Override | 83 | @Override |
| 87 | protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) { | 84 | protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) { |
| 85 | + // 参见 https://t.zsxq.com/53Meo 情况 | ||
| 86 | + if (execution.getCurrentFlowElement() instanceof CallActivity | ||
| 87 | + || execution.getCurrentFlowElement() instanceof SubProcess) { | ||
| 88 | + super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter); | ||
| 89 | + return; | ||
| 90 | + } | ||
| 88 | // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F | 91 | // 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F |
| 89 | super.collectionExpression = null; | 92 | super.collectionExpression = null; |
| 90 | super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId()); | 93 | super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId()); |
yudao-module-infra/src/main/resources/codegen/vue/views/components/list_sub_erp.vue.vm
| @@ -170,6 +170,7 @@ | @@ -170,6 +170,7 @@ | ||
| 170 | await this.#[[$modal]]#.confirm('是否确认删除?') | 170 | await this.#[[$modal]]#.confirm('是否确认删除?') |
| 171 | try { | 171 | try { |
| 172 | await ${simpleClassName}Api.delete${subSimpleClassName}List(this.checkedIds); | 172 | await ${simpleClassName}Api.delete${subSimpleClassName}List(this.checkedIds); |
| 173 | + this.checkedIds = []; | ||
| 173 | await this.getList(); | 174 | await this.getList(); |
| 174 | this.#[[$modal]]#.msgSuccess("删除成功"); | 175 | this.#[[$modal]]#.msgSuccess("删除成功"); |
| 175 | } catch {} | 176 | } catch {} |
yudao-module-infra/src/main/resources/codegen/vue/views/index.vue.vm
| @@ -338,6 +338,7 @@ export default { | @@ -338,6 +338,7 @@ export default { | ||
| 338 | await this.#[[$modal]]#.confirm('是否确认删除?') | 338 | await this.#[[$modal]]#.confirm('是否确认删除?') |
| 339 | try { | 339 | try { |
| 340 | await ${simpleClassName}Api.delete${simpleClassName}List(this.checkedIds); | 340 | await ${simpleClassName}Api.delete${simpleClassName}List(this.checkedIds); |
| 341 | + this.checkedIds = []; | ||
| 341 | await this.getList(); | 342 | await this.getList(); |
| 342 | this.#[[$modal]]#.msgSuccess("删除成功"); | 343 | this.#[[$modal]]#.msgSuccess("删除成功"); |
| 343 | } catch {} | 344 | } catch {} |
yudao-module-infra/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm
| @@ -209,6 +209,7 @@ const handleDeleteBatch = async () => { | @@ -209,6 +209,7 @@ const handleDeleteBatch = async () => { | ||
| 209 | // 删除的二次确认 | 209 | // 删除的二次确认 |
| 210 | await message.delConfirm() | 210 | await message.delConfirm() |
| 211 | await ${simpleClassName}Api.delete${subSimpleClassName}List(checkedIds.value); | 211 | await ${simpleClassName}Api.delete${subSimpleClassName}List(checkedIds.value); |
| 212 | + checkedIds.value = []; | ||
| 212 | message.success(t('common.delSuccess')) | 213 | message.success(t('common.delSuccess')) |
| 213 | await getList(); | 214 | await getList(); |
| 214 | } catch {} | 215 | } catch {} |
yudao-module-infra/src/main/resources/codegen/vue3/views/index.vue.vm
| @@ -366,6 +366,7 @@ const handleDeleteBatch = async () => { | @@ -366,6 +366,7 @@ const handleDeleteBatch = async () => { | ||
| 366 | // 删除的二次确认 | 366 | // 删除的二次确认 |
| 367 | await message.delConfirm() | 367 | await message.delConfirm() |
| 368 | await ${simpleClassName}Api.delete${simpleClassName}List(checkedIds.value); | 368 | await ${simpleClassName}Api.delete${simpleClassName}List(checkedIds.value); |
| 369 | + checkedIds.value = []; | ||
| 369 | message.success(t('common.delSuccess')) | 370 | message.success(t('common.delSuccess')) |
| 370 | await getList(); | 371 | await getList(); |
| 371 | } catch {} | 372 | } catch {} |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/index.vue.vm
| @@ -168,6 +168,7 @@ async function handleDeleteBatch() { | @@ -168,6 +168,7 @@ async function handleDeleteBatch() { | ||
| 168 | }); | 168 | }); |
| 169 | try { | 169 | try { |
| 170 | await delete${simpleClassName}List(checkedIds.value); | 170 | await delete${simpleClassName}List(checkedIds.value); |
| 171 | + checkedIds.value = []; | ||
| 171 | message.success( $t('ui.actionMessage.deleteSuccess') ); | 172 | message.success( $t('ui.actionMessage.deleteSuccess') ); |
| 172 | await getList(); | 173 | await getList(); |
| 173 | } finally { | 174 | } finally { |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/general/views/modules/list_sub_erp.vue.vm
| @@ -92,6 +92,7 @@ async function handleDeleteBatch() { | @@ -92,6 +92,7 @@ async function handleDeleteBatch() { | ||
| 92 | }); | 92 | }); |
| 93 | try { | 93 | try { |
| 94 | await delete${subSimpleClassName}List(checkedIds.value); | 94 | await delete${subSimpleClassName}List(checkedIds.value); |
| 95 | + checkedIds.value = []; | ||
| 95 | message.success( $t('ui.actionMessage.deleteSuccess') ); | 96 | message.success( $t('ui.actionMessage.deleteSuccess') ); |
| 96 | await getList(); | 97 | await getList(); |
| 97 | } finally { | 98 | } finally { |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/index.vue.vm
| @@ -102,6 +102,7 @@ async function handleDeleteBatch() { | @@ -102,6 +102,7 @@ async function handleDeleteBatch() { | ||
| 102 | }); | 102 | }); |
| 103 | try { | 103 | try { |
| 104 | await delete${simpleClassName}List(checkedIds.value); | 104 | await delete${simpleClassName}List(checkedIds.value); |
| 105 | + checkedIds.value = []; | ||
| 105 | message.success({ | 106 | message.success({ |
| 106 | content: $t('ui.actionMessage.deleteSuccess'), | 107 | content: $t('ui.actionMessage.deleteSuccess'), |
| 107 | key: 'action_key_msg', | 108 | key: 'action_key_msg', |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_antd/schema/views/modules/list_sub_erp.vue.vm
| @@ -82,6 +82,7 @@ async function handleDeleteBatch() { | @@ -82,6 +82,7 @@ async function handleDeleteBatch() { | ||
| 82 | }); | 82 | }); |
| 83 | try { | 83 | try { |
| 84 | await delete${subSimpleClassName}List(checkedIds.value); | 84 | await delete${subSimpleClassName}List(checkedIds.value); |
| 85 | + checkedIds.value = []; | ||
| 85 | message.success({ | 86 | message.success({ |
| 86 | content: $t('ui.actionMessage.deleteSuccess', [row.id]), | 87 | content: $t('ui.actionMessage.deleteSuccess', [row.id]), |
| 87 | key: 'action_key_msg', | 88 | key: 'action_key_msg', |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_ele/general/views/index.vue.vm
| @@ -163,6 +163,7 @@ async function handleDeleteBatch() { | @@ -163,6 +163,7 @@ async function handleDeleteBatch() { | ||
| 163 | }); | 163 | }); |
| 164 | try { | 164 | try { |
| 165 | await delete${simpleClassName}List(checkedIds.value); | 165 | await delete${simpleClassName}List(checkedIds.value); |
| 166 | + checkedIds.value = []; | ||
| 166 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); | 167 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); |
| 167 | await getList(); | 168 | await getList(); |
| 168 | } finally { | 169 | } finally { |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_ele/general/views/modules/list_sub_erp.vue.vm
| @@ -87,6 +87,7 @@ async function handleDeleteBatch() { | @@ -87,6 +87,7 @@ async function handleDeleteBatch() { | ||
| 87 | }); | 87 | }); |
| 88 | try { | 88 | try { |
| 89 | await delete${subSimpleClassName}List(checkedIds.value); | 89 | await delete${subSimpleClassName}List(checkedIds.value); |
| 90 | + checkedIds.value = []; | ||
| 90 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); | 91 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); |
| 91 | await getList(); | 92 | await getList(); |
| 92 | } finally { | 93 | } finally { |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_ele/schema/views/index.vue.vm
| @@ -99,6 +99,7 @@ async function handleDeleteBatch() { | @@ -99,6 +99,7 @@ async function handleDeleteBatch() { | ||
| 99 | }); | 99 | }); |
| 100 | try { | 100 | try { |
| 101 | await delete${simpleClassName}List(checkedIds.value); | 101 | await delete${simpleClassName}List(checkedIds.value); |
| 102 | + checkedIds.value = []; | ||
| 102 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); | 103 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); |
| 103 | onRefresh(); | 104 | onRefresh(); |
| 104 | } finally { | 105 | } finally { |
yudao-module-infra/src/main/resources/codegen/vue3_vben5_ele/schema/views/modules/list_sub_erp.vue.vm
| @@ -79,6 +79,7 @@ async function handleDeleteBatch() { | @@ -79,6 +79,7 @@ async function handleDeleteBatch() { | ||
| 79 | }); | 79 | }); |
| 80 | try { | 80 | try { |
| 81 | await delete${subSimpleClassName}List(checkedIds.value); | 81 | await delete${subSimpleClassName}List(checkedIds.value); |
| 82 | + checkedIds.value = []; | ||
| 82 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); | 83 | ElMessage.success($t('ui.actionMessage.deleteSuccess')); |
| 83 | onRefresh(); | 84 | onRefresh(); |
| 84 | } finally { | 85 | } finally { |
yudao-module-pay/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java
| @@ -585,7 +585,7 @@ public class PayOrderServiceImpl implements PayOrderService { | @@ -585,7 +585,7 @@ public class PayOrderServiceImpl implements PayOrderService { | ||
| 585 | log.error("[expireOrder][order({}) 更新为支付关闭失败]", order.getId()); | 585 | log.error("[expireOrder][order({}) 更新为支付关闭失败]", order.getId()); |
| 586 | return false; | 586 | return false; |
| 587 | } | 587 | } |
| 588 | - log.info("[expireOrder][order({}) 更新为支付关闭失败]", order.getId()); | 588 | + log.info("[expireOrder][order({}) 更新为支付关闭成功]", order.getId()); |
| 589 | return true; | 589 | return true; |
| 590 | } catch (Throwable e) { | 590 | } catch (Throwable e) { |
| 591 | log.error("[expireOrder][order({}) 过期订单异常]", order.getId(), e); | 591 | log.error("[expireOrder][order({}) 过期订单异常]", order.getId(), e); |