mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 加注释 and 特定站点id走新的分账逻辑
This commit is contained in:
@@ -78,7 +78,7 @@ public class RabbitConfig {
|
||||
// 预加载消息数量 -- QOS
|
||||
containerFactory.setPrefetchCount(1);
|
||||
// 应答模式(此处设置为手动)
|
||||
// containerFactory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
|
||||
// containerFactory.setAcknowledgeMode(AcknowledgeMode.MANUAL); // 2024年12月26日16点27分 取消了手动应答配置
|
||||
// 消息序列化方式
|
||||
containerFactory.setMessageConverter(new Jackson2JsonMessageConverter());
|
||||
// 设置通知调用链 (这里设置的是重试机制的调用链)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.jsowell.mq;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import com.jsowell.common.constant.RabbitConstants;
|
||||
import com.jsowell.pile.dto.AfterSettleOrderDTO;
|
||||
import com.jsowell.pile.service.OrderBasicInfoService;
|
||||
@@ -11,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监听RabbitMQ消息 订单
|
||||
@@ -21,6 +24,8 @@ public class OrderRabbitListener {
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
private List<String> stationIdList = Lists.newArrayList();
|
||||
|
||||
/**
|
||||
* 多线程消费请求消息
|
||||
* @param message
|
||||
@@ -29,12 +34,15 @@ public class OrderRabbitListener {
|
||||
public void receiveChargeOrderData(AfterSettleOrderDTO afterSettleOrderDTO, Channel channel, Message message) throws IOException {
|
||||
log.info("接收到订单结算数据:{}", afterSettleOrderDTO);
|
||||
|
||||
// try {
|
||||
// orderBasicInfoService.realTimeOrderSplit(afterSettleOrderDTO);
|
||||
// } catch (BaseAdaPayException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
if (stationIdList.contains(afterSettleOrderDTO.getStationId())) {
|
||||
try {
|
||||
orderBasicInfoService.realTimeOrderSplit(afterSettleOrderDTO);
|
||||
} catch (BaseAdaPayException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
// 2024年12月26日16点27分 取消了手动应答配置
|
||||
//由于配置设置了手动应答,所以这里要进行一个手动应答。注意:如果设置了自动应答,这里又进行手动应答,会出现double ack,那么程序会报错。
|
||||
// channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user