linwe
2023-12-21 7b91c99980e9db0c880bf3905a7cfd54ffca44cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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.<PropertyCapitalApplyEntity>lambdaQuery().eq(PropertyCapitalApplyEntity::getProcessInstanceId, delegateExecution.getProcessInstanceId()));
        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(5);
        } else if (delegateExecution.getCurrentActivityId().equals("applyNotPass")) {
            applyEntity.setApplyStatus(6);
        }
        bean.updateById(applyEntity);
    }
}