瑞利声电固定资产管理系统
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
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.PurchaseService;
 
/**
 * 采购申请流程终止监听器:单据改为已终止
 * @author ycq
 * @date 2026-10-16
 */
public class PurchaseTerminateListener implements ExecutionListener {
 
    private static final Logger LOGGER = LoggerFactory.getLogger(PurchaseTerminateListener.class);
 
    @Override
    public void notify(DelegateExecution execution) {
        if (!(execution instanceof FlowRuntimeExecution)) {
            LOGGER.error("流程终止监听器收到的执行对象类型不支持:{},采购申请状态未更新", execution == null ? null : execution.getClass());
            return;
        }
        PurchaseService service = (PurchaseService) SpringContextUtil.getBean(PurchaseService.class);
        service.terminatePurchase(((FlowRuntimeExecution) execution).getKeyId());
    }
}