package zbooksoft.fams.delegate; import com.ruili.wcp.common.SpringContextUtil; import com.ruili.wcp.engine.flow.delegate.DelegateTask; import com.ruili.wcp.engine.flow.delegate.TaskListener; import zbooksoft.fams.common.BusinessException; import zbooksoft.fams.service.PurchaseService; /** * 采购申请流程最后审批节点的“操作完成前”事件:审批通过,单据改为已通过、未到货 * @author ycq * @date 2026-10-16 */ public class PurchaseApproveListener implements TaskListener { @Override public void notify(DelegateTask delegateTask) throws Exception { PurchaseService service = (PurchaseService) SpringContextUtil.getBean(PurchaseService.class); try { service.approvePurchase(delegateTask.getProcessInstance().getKeyId()); } catch (BusinessException e) { throw new Exception(e.getMessage(), e); } } }