|
|
@ -1,12 +1,16 @@ |
|
|
|
package com.logpm.factory.config; |
|
|
|
package com.logpm.factory.config; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.nacos.shaded.com.google.common.collect.Maps; |
|
|
|
import com.alibaba.nacos.shaded.com.google.common.collect.Maps; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
|
|
|
|
import com.logpm.factory.snm.entity.PanOrderStatusLog; |
|
|
|
|
|
|
|
import com.logpm.factory.snm.service.IPanOrderStatusLogService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
import org.springframework.amqp.core.*; |
|
|
|
import org.springframework.amqp.core.*; |
|
|
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory; |
|
|
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory; |
|
|
|
import org.springframework.amqp.rabbit.connection.CorrelationData; |
|
|
|
import org.springframework.amqp.rabbit.connection.CorrelationData; |
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
|
|
|
|
|
|
|
@ -21,6 +25,9 @@ import java.util.Map; |
|
|
|
@Configuration |
|
|
|
@Configuration |
|
|
|
public class RabbitMqConfiguration { |
|
|
|
public class RabbitMqConfiguration { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private IPanOrderStatusLogService panOrderStatusLogService; |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){ |
|
|
|
public RabbitTemplate createRabbitTemplate(ConnectionFactory connectionFactory){ |
|
|
|
RabbitTemplate template = new RabbitTemplate(); |
|
|
|
RabbitTemplate template = new RabbitTemplate(); |
|
|
@ -32,6 +39,13 @@ public class RabbitMqConfiguration { |
|
|
|
System.out.println("确认回调-相关数据:"+correlationData); |
|
|
|
System.out.println("确认回调-相关数据:"+correlationData); |
|
|
|
System.out.println("确认回调-确认情况:"+b); |
|
|
|
System.out.println("确认回调-确认情况:"+b); |
|
|
|
System.out.println("确认回调-原因:"+s); |
|
|
|
System.out.println("确认回调-原因:"+s); |
|
|
|
|
|
|
|
//修改处理日志为已处理
|
|
|
|
|
|
|
|
Long id = Long.parseLong(correlationData.getId()); |
|
|
|
|
|
|
|
UpdateWrapper<PanOrderStatusLog> updateWrapper = new UpdateWrapper<>(); |
|
|
|
|
|
|
|
updateWrapper.set("status",0) |
|
|
|
|
|
|
|
.eq("id",id); |
|
|
|
|
|
|
|
panOrderStatusLogService.update(updateWrapper); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
@ -78,9 +92,9 @@ public class RabbitMqConfiguration { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Bean
|
|
|
|
@Bean |
|
|
|
// DirectExchange lonelyDirectExchange() {
|
|
|
|
DirectExchange lonelyDirectExchange() { |
|
|
|
// return new DirectExchange("lonelyDirectExchange");
|
|
|
|
return new DirectExchange("lonelyDirectExchange"); |
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|