瑞利声电固定资产管理系统
ycq
2026-10-16 dbbadb021c2fc171466cc82bd9a7a82cc47165f5
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
package zbooksoft.fams.delegate;
 
import com.ruili.wcp.common.SpringContextUtil;
import com.ruili.wcp.data.entity.management.FlowRuntimeExecution;
import com.ruili.wcp.engine.flow.delegate.DelegateExecution;
import com.ruili.wcp.engine.flow.delegate.ExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import zbooksoft.fams.service.AssetApplyService;
 
/**
 * 资产使用流程的流程终止监听器:解除资产在途锁,单据改为已终止
 * @author ycq
 * @date 2026-10-16
 */
public class AssetApplyTerminateListener implements ExecutionListener {
 
    private static final Logger LOGGER = LoggerFactory.getLogger(AssetApplyTerminateListener.class);
 
    @Override
    public void notify(DelegateExecution execution) {
        if (!(execution instanceof FlowRuntimeExecution)) {
            LOGGER.error("流程终止监听器收到的执行对象类型不支持:{},资产锁未释放", execution == null ? null : execution.getClass());
            return;
        }
        FlowRuntimeExecution runtime = (FlowRuntimeExecution) execution;
        AssetApplyService service = (AssetApplyService) SpringContextUtil.getBean(AssetApplyService.class);
        service.terminate(service.typeOfTable(runtime.getTableId()), runtime.getKeyId());
    }
}