|  | @@ -6,6 +6,7 @@ import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver; |  | @@ -6,6 +6,7 @@ import com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver; | 
| 6 | import com.sunyo.wlpt.message.bus.service.response.ResultJson; | 6 | import com.sunyo.wlpt.message.bus.service.response.ResultJson; | 
| 7 | import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverService; | 7 | import com.sunyo.wlpt.message.bus.service.service.MessageRouterReciverService; | 
| 8 | import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | 8 | import com.sunyo.wlpt.message.bus.service.utils.IdUtils; | 
|  |  | 9 | +import lombok.extern.slf4j.Slf4j; | 
| 9 | import org.apache.commons.lang.StringUtils; | 10 | import org.apache.commons.lang.StringUtils; | 
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; | 
| 11 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; | 
|  | @@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; |  | @@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional; | 
| 14 | import javax.annotation.Resource; | 15 | import javax.annotation.Resource; | 
| 15 | import java.util.List; | 16 | import java.util.List; | 
| 16 |  | 17 |  | 
|  |  | 18 | +@Slf4j | 
| 17 | @Service | 19 | @Service | 
| 18 | public class MessageRouterReciverImpl implements MessageRouterReciverService { | 20 | public class MessageRouterReciverImpl implements MessageRouterReciverService { | 
| 19 |  | 21 |  | 
|  | @@ -43,11 +45,13 @@ public class MessageRouterReciverImpl implements MessageRouterReciverService { |  | @@ -43,11 +45,13 @@ public class MessageRouterReciverImpl implements MessageRouterReciverService { | 
| 43 | ) { | 45 | ) { | 
| 44 | if (StringUtils.isNotBlank(rcvr.getRcvrTopic())){ | 46 | if (StringUtils.isNotBlank(rcvr.getRcvrTopic())){ | 
| 45 | rcvr.setMessageRouterId(messageRouter.getId()); | 47 | rcvr.setMessageRouterId(messageRouter.getId()); | 
| 46 | -                        rcvr.setId(IdUtils.generateId()); |  |  | 
| 47 | List<MessageRouterReciver> list = messageRouterReciverMapper.selectByRouterKeyAndTopic(rcvr); | 48 | List<MessageRouterReciver> list = messageRouterReciverMapper.selectByRouterKeyAndTopic(rcvr); | 
| 48 | //判断是否已经有这条数据 | 49 | //判断是否已经有这条数据 | 
| 49 | if(list.isEmpty()){ | 50 | if(list.isEmpty()){ | 
|  |  | 51 | +                            rcvr.setId(IdUtils.generateId()); | 
| 50 | i += messageRouterReciverMapper.insertSelective(rcvr); | 52 | i += messageRouterReciverMapper.insertSelective(rcvr); | 
|  |  | 53 | +                            log.info("新增{}的类型{}订阅者{}成功,关联订阅者ID{}",messageRouter.getSndr(),messageRouter.getStype(),rcvr.getRcvrTopic(),rcvr.getId()); | 
|  |  | 54 | + | 
| 51 | }; | 55 | }; | 
| 52 | } | 56 | } | 
| 53 | } | 57 | } |