linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
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
33
34
35
36
37
38
39
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 (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);
    }
}