危化品全生命周期管理后端
kongzy
2024-08-22 0c73654f55844e34772732914af8cc1e247aab63
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package com.gkhy.hazmat.common.listener;
 
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
 
@Component
@Slf4j
public class CustomEventPublisher {
    @Autowired
    private ApplicationEventPublisher publisher;
 
    public void publishEntry(Long entryRecordId,String codePrex,Long companyId,Long userId){
        EntryEvent entryEvent=new EntryEvent(this,entryRecordId,codePrex,companyId,userId);
        publisher.publishEvent(entryEvent);
        log.info("事件发布成功:entryRecordId={},codePrex={},companyId={},userId={}",entryRecordId,codePrex,companyId,userId);
    }
}