疯狂的狮子Li
2024-10-17 abfa995a320ba69faf35fb84535e913cef4a13b3
ruoyi-modules/ruoyi-workflow/src/main/java/org/dromara/workflow/service/impl/TestLeaveServiceImpl.java
@@ -142,11 +142,16 @@
     *
     * @param processTaskEvent 参数
     */
    @EventListener(condition = "#processTaskEvent.key=='leave1' && #processTaskEvent.taskDefinitionKey=='Activity_14633hx'")
    @EventListener(condition = "#processTaskEvent.key.startsWith('leave')")
    public void processTaskHandler(ProcessTaskEvent processTaskEvent) {
        log.info("当前任务执行了{}", processTaskEvent.toString());
        TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
        testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
        baseMapper.updateById(testLeave);
        // 所有demo案例的申请人节点id
        String[] ids = {"Activity_14633hx", "Activity_19b1i4j", "Activity_0uscrk3",
            "Activity_0uscrk3", "Activity_0x6b71j", "Activity_0zy3g6j", "Activity_06a55t0"};
        if (StringUtils.equalsAny(processTaskEvent.getTaskDefinitionKey(), ids)) {
            log.info("当前任务执行了{}", processTaskEvent.toString());
            TestLeave testLeave = baseMapper.selectById(Long.valueOf(processTaskEvent.getBusinessKey()));
            testLeave.setStatus(BusinessStatusEnum.WAITING.getStatus());
            baseMapper.updateById(testLeave);
        }
    }
}