Merge branch 'master-jdk17' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into develop

This commit is contained in:
YunaiV 2025-08-09 16:06:46 +08:00
commit be39a26380
15 changed files with 41 additions and 33 deletions

View File

@ -7,35 +7,44 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
import lombok.Setter;
import org.flowable.bpmn.model.*;
import org.flowable.bpmn.model.Activity;
import org.flowable.bpmn.model.CallActivity;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.UserTask;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import org.flowable.engine.impl.bpmn.behavior.ParallelMultiInstanceBehavior;
import java.util.List;
import java.util.Set;
/**
* 自定义的串行多个流程任务的 assignee 负责人的分配
* 自定义的并行多个流程任务的 assignee 负责人的分配
* 第一步基于分配规则计算出分配任务的多个候选人们
* 第二步多个任务候选人们设置到 DelegateExecution collectionVariable 变量中以便 BpmUserTaskActivityBehavior 使用它
*
* 本质上实现和 {@link BpmParallelMultiInstanceBehavior} 一样只是继承的类不一样
*
* @author 芋道源码
* @author kemengkai
* @since 2022-04-21 16:57
*/
@Setter
public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceBehavior {
public class BpmParallelMultiInstanceBehavior extends ParallelMultiInstanceBehavior {
private BpmTaskCandidateInvoker taskCandidateInvoker;
public BpmSequentialMultiInstanceBehavior(Activity activity, AbstractBpmnActivityBehavior innerActivityBehavior) {
public BpmParallelMultiInstanceBehavior(Activity activity,
AbstractBpmnActivityBehavior innerActivityBehavior) {
super(activity, innerActivityBehavior);
}
/**
* 逻辑和 {@link BpmParallelMultiInstanceBehavior#resolveNrOfInstances(DelegateExecution)} 类似
* 重写该方法主要实现两个功能
* 1. 忽略原有的 collectionVariablecollectionElementVariable 表达式而是采用自己定义的
* 2. 获得任务的处理人并设置到 collectionVariable 用于 BpmUserTaskActivityBehavior 从中可以获取任务的处理人
*
* 差异的点是在第二步的时候需要返回 LinkedHashSet 集合因为它需要有序
* 注意多个任务实例每个任务实例对应一个处理人所以返回的数量就是任务处理人的数量
*
* @param execution 执行任务
* @return 数量
*/
@Override
protected int resolveNrOfInstances(DelegateExecution execution) {
@ -49,9 +58,8 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB
super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId());
// 第二步获取任务的所有处理人
// 不使用 execution.getVariable 原因目前依次审批任务回退后 collectionVariable 变量没有清理 如果重新进入该任务不会重新分配审批人
@SuppressWarnings("unchecked")
Set<Long> assigneeUserIds = (Set<Long>) execution.getVariableLocal(super.collectionVariable, Set.class);
Set<Long> assigneeUserIds = (Set<Long>) execution.getVariable(super.collectionVariable, Set.class);
if (assigneeUserIds == null) {
assigneeUserIds = taskCandidateInvoker.calculateUsersByTask(execution);
if (CollUtil.isEmpty(assigneeUserIds)) {
@ -80,19 +88,4 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB
return super.resolveNrOfInstances(execution);
}
@Override
protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) {
// 参见 https://t.zsxq.com/53Meo 情况
if (execution.getCurrentFlowElement() instanceof CallActivity
|| execution.getCurrentFlowElement() instanceof SubProcess) {
super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter);
return;
}
// 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F
super.collectionExpression = null;
super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId());
super.collectionElementVariable = FlowableUtils.formatExecutionCollectionElementVariable(execution.getCurrentActivityId());
super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter);
}
}

View File

@ -7,10 +7,7 @@ import cn.iocoder.yudao.module.bpm.framework.flowable.core.candidate.BpmTaskCand
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.FlowableUtils;
import lombok.Setter;
import org.flowable.bpmn.model.Activity;
import org.flowable.bpmn.model.CallActivity;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.UserTask;
import org.flowable.bpmn.model.*;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior;
import org.flowable.engine.impl.bpmn.behavior.SequentialMultiInstanceBehavior;
@ -85,6 +82,12 @@ public class BpmSequentialMultiInstanceBehavior extends SequentialMultiInstanceB
@Override
protected void executeOriginalBehavior(DelegateExecution execution, ExecutionEntity multiInstanceRootExecution, int loopCounter) {
// 参见 https://t.zsxq.com/53Meo 情况
if (execution.getCurrentFlowElement() instanceof CallActivity
|| execution.getCurrentFlowElement() instanceof SubProcess) {
super.executeOriginalBehavior(execution, multiInstanceRootExecution, loopCounter);
return;
}
// 参见 https://gitee.com/zhijiantianya/yudao-cloud/issues/IC239F
super.collectionExpression = null;
super.collectionVariable = FlowableUtils.formatExecutionCollectionVariable(execution.getCurrentActivityId());

View File

@ -170,6 +170,7 @@
await this.#[[$modal]]#.confirm('是否确认删除?')
try {
await ${simpleClassName}Api.delete${subSimpleClassName}List(this.checkedIds);
this.checkedIds = [];
await this.getList();
this.#[[$modal]]#.msgSuccess("删除成功");
} catch {}

View File

@ -338,6 +338,7 @@ export default {
await this.#[[$modal]]#.confirm('是否确认删除?')
try {
await ${simpleClassName}Api.delete${simpleClassName}List(this.checkedIds);
this.checkedIds = [];
await this.getList();
this.#[[$modal]]#.msgSuccess("删除成功");
} catch {}

View File

@ -209,6 +209,7 @@ const handleDeleteBatch = async () => {
// 删除的二次确认
await message.delConfirm()
await ${simpleClassName}Api.delete${subSimpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success(t('common.delSuccess'))
await getList();
} catch {}

View File

@ -366,6 +366,7 @@ const handleDeleteBatch = async () => {
// 删除的二次确认
await message.delConfirm()
await ${simpleClassName}Api.delete${simpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success(t('common.delSuccess'))
await getList();
} catch {}

View File

@ -168,6 +168,7 @@ async function handleDeleteBatch() {
});
try {
await delete${simpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success( $t('ui.actionMessage.deleteSuccess') );
await getList();
} finally {

View File

@ -92,6 +92,7 @@ async function handleDeleteBatch() {
});
try {
await delete${subSimpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success( $t('ui.actionMessage.deleteSuccess') );
await getList();
} finally {

View File

@ -102,6 +102,7 @@ async function handleDeleteBatch() {
});
try {
await delete${simpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success({
content: $t('ui.actionMessage.deleteSuccess'),
key: 'action_key_msg',

View File

@ -82,6 +82,7 @@ async function handleDeleteBatch() {
});
try {
await delete${subSimpleClassName}List(checkedIds.value);
checkedIds.value = [];
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
key: 'action_key_msg',

View File

@ -163,6 +163,7 @@ async function handleDeleteBatch() {
});
try {
await delete${simpleClassName}List(checkedIds.value);
checkedIds.value = [];
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
await getList();
} finally {

View File

@ -87,6 +87,7 @@ async function handleDeleteBatch() {
});
try {
await delete${subSimpleClassName}List(checkedIds.value);
checkedIds.value = [];
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
await getList();
} finally {

View File

@ -99,6 +99,7 @@ async function handleDeleteBatch() {
});
try {
await delete${simpleClassName}List(checkedIds.value);
checkedIds.value = [];
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
onRefresh();
} finally {

View File

@ -79,6 +79,7 @@ async function handleDeleteBatch() {
});
try {
await delete${subSimpleClassName}List(checkedIds.value);
checkedIds.value = [];
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
onRefresh();
} finally {

View File

@ -585,7 +585,7 @@ public class PayOrderServiceImpl implements PayOrderService {
log.error("[expireOrder][order({}) 更新为支付关闭失败]", order.getId());
return false;
}
log.info("[expireOrder][order({}) 更新为支付关闭失败]", order.getId());
log.info("[expireOrder][order({}) 更新为支付关闭成功]", order.getId());
return true;
} catch (Throwable e) {
log.error("[expireOrder][order({}) 过期订单异常]", order.getId(), e);