Browse Source

1.mq接收数据逻辑修复

dev-warehouse
zhenghaoyu 2 years ago
parent
commit
0f4310a00a
  1. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java
  2. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DirectQueueOneHandler.java
  3. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java
  4. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java

@ -78,9 +78,9 @@ public class RabbitMqConfiguration {
} }
@Bean // @Bean
DirectExchange lonelyDirectExchange() { // DirectExchange lonelyDirectExchange() {
return new DirectExchange("lonelyDirectExchange"); // return new DirectExchange("lonelyDirectExchange");
} // }
} }

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DirectQueueOneHandler.java

@ -42,7 +42,7 @@ public class DirectQueueOneHandler {
} catch (IOException e) { } catch (IOException e) {
try { try {
// 处理失败,重新压入MQ // 处理失败,重新压入MQ
channel.basicRecover(); channel.basicReject(deliveryTag,true);
} catch (IOException e1) { } catch (IOException e1) {
e1.printStackTrace(); e1.printStackTrace();
} }

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/controller/PanFactoryDataController.java

@ -170,6 +170,8 @@ public class PanFactoryDataController extends BladeController {
//将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange //将消息携带绑定键值:TestDirectRouting 发送到交换机TestDirectExchange
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map); rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map);
panOrderStatusLog.setStatus(0);
panOrderStatusLogService.saveOrUpdate(panOrderStatusLog);
// R r = factoryDataService.handleData(orderInfoDTO); // R r = factoryDataService.handleData(orderInfoDTO);
return R.success("调用成功"); return R.success("调用成功");

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/snm/service/impl/PanFactoryDataServiceImpl.java

@ -147,8 +147,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
String message = payload.getString("data"); String message = payload.getString("data");
if(code.equals(1)){ if(code.equals(1)){
logger.info("##########handleData: 物流状态传递成功"); logger.info("##########handleData: 物流状态传递成功");
panOrderStatusLog.setStatus(0);
panOrderStatusLogService.saveOrUpdate(panOrderStatusLog);
}else{ }else{
return R.fail(400,message); return R.fail(400,message);
} }

Loading…
Cancel
Save