| | |
| | | import com.ruoyi.system.api.service.RemoteActivityService; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteCouponService; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | | import com.ruoyi.system.api.service.RemoteOrderService; |
| | | import lombok.extern.log4j.Log4j2; |
| | | import org.springframework.data.redis.connection.Message; |
| | |
| | | @Resource |
| | | private RemoteOrderService remoteOrderService; |
| | | |
| | | @Resource |
| | | private RemoteGoodsService remoteGoodsService; |
| | | |
| | | public RedisListener(RedisMessageListenerContainer listenerContainer, |
| | | RedisTemplate redisTemplate) { |
| | | super(listenerContainer); |
| | |
| | | }else if(DelayTaskEnum.ORDER_AUTOMATIC_CANCEL.getCode().equals(operation)){ |
| | | //自动结束任务 |
| | | autoCancelOrder(split[1]); |
| | | } else if (DelayTaskEnum.LIVE_APPOINTMENT_TASK.getCode().equals(operation)) { |
| | | push(Long.valueOf(split[1])); |
| | | } |
| | | |
| | | //删除失效的key |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 推送消息 |
| | | * @param appointmentId |
| | | */ |
| | | private void push(Long appointmentId) { |
| | | remoteGoodsService.push(appointmentId); |
| | | //删除定时任务 |
| | | remoteConfigService.deleteDelayTask(DelayTaskEnum.LIVE_APPOINTMENT_TASK.getCode()+"-"+appointmentId); |
| | | } |
| | | |
| | | public <T> T getAndSet(final String key, T value){ |
| | | T oldValue=null; |
| | | try { |