package org.springblade.flow.listener; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.flowable.engine.delegate.DelegateExecution; import org.flowable.engine.delegate.ExecutionListener; import org.springblade.common.utils.SpringUtils; import org.springblade.modules.property.entity.PropertyCapitalApplyEntity; import org.springblade.modules.property.service.IPropertyCapitalApplyService; public class MyExecutionListener implements ExecutionListener { @Override public void notify(DelegateExecution delegateExecution) { System.out.println("***************************DelegateExecution"); IPropertyCapitalApplyService bean = SpringUtils.getBean(IPropertyCapitalApplyService.class); PropertyCapitalApplyEntity applyEntity = bean.getOne(Wrappers.lambdaQuery().eq(PropertyCapitalApplyEntity::getProcessInstanceId, delegateExecution.getProcessInstanceId())); if (applyEntity == null) { return; } if (delegateExecution.getCurrentActivityId().equals("ownersCommittee1")) { applyEntity.setApplyStatus(1); } else if (delegateExecution.getCurrentActivityId().equals("ownersCommitteePass")) { applyEntity.setApplyStatus(2); } else if (delegateExecution.getCurrentActivityId().equals("streePass")) { applyEntity.setApplyStatus(3); } else if (delegateExecution.getCurrentActivityId().equals("apply")) { applyEntity.setApplyStatus(4); } else if (delegateExecution.getCurrentActivityId().equals("constructionPass")) { applyEntity.setApplyStatus(7); } else if (delegateExecution.getCurrentActivityId().equals("applyNotPass")) { applyEntity.setApplyStatus(6); } else if (delegateExecution.getCurrentActivityId().equals("ownersCommitteeFlag0")) { applyEntity.setApplyStatus(2); } else if (delegateExecution.getCurrentActivityId().equals("srConstructionPass")) { applyEntity.setApplyStatus(5); } bean.updateById(applyEntity); } }