| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.iocoder.yudao.module.crm.service.receivable.listener; |
| | | |
| | | import cn.iocoder.yudao.module.bpm.api.event.BpmProcessInstanceStatusEvent; |
| | | import cn.iocoder.yudao.module.bpm.api.event.BpmProcessInstanceStatusEventListener; |
| | | import cn.iocoder.yudao.module.crm.service.receivable.CrmReceivableService; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** 忬¾å®¡æ¹ç»æååã */ |
| | | @Component |
| | | @Slf4j |
| | | public class CrmReceivableStatusListener extends BpmProcessInstanceStatusEventListener { |
| | | |
| | | @Resource |
| | | private CrmReceivableService receivableService; |
| | | |
| | | @Override |
| | | protected String getProcessDefinitionKey() { |
| | | return "crm-receivable-audit"; |
| | | } |
| | | |
| | | @Override |
| | | protected void onEvent(BpmProcessInstanceStatusEvent event) { |
| | | try { |
| | | receivableService.updateReceivableAuditStatus(Long.parseLong(event.getBusinessKey()), event.getStatus()); |
| | | } catch (NumberFormatException e) { |
| | | log.warn("[onEvent] æ æç忬¾ä¸å¡ç¼å·: {}", event.getBusinessKey()); |
| | | } |
| | | } |
| | | } |