Browse Source

推送包件数据逻辑优化,延迟2秒处理

dist.1.3.0
zhenghaoyu 8 months ago
parent
commit
fdbf1d2212
  1. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java
  2. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/controller/FactoryCommonController.java

@ -98,7 +98,7 @@ public class FactoryCommonController {
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_STATUS_EXCHANGE, RabbitConstant.ORDER_STATUS_ROUTING, map);
map.put("type", "DealWith");
rabbitTemplate.convertAndSend(RabbitConstant.DEAL_WITH_EXCHANGE, RabbitConstant.DEAL_WITH_ROUTING, map,message->{
message.getMessageProperties().setHeader("x-delay",10000);
message.getMessageProperties().setHeader("x-delay",2000);
return message;
});

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java

@ -167,6 +167,10 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
} catch (Exception e) {
log.error(">>>> 数据推送异常", e);
Boolean exists = bladeRedis.exists(redisKey);
if(Boolean.TRUE.equals(exists)){
bladeRedis.del(redisKey);
}
orderPackageStatusPushFailLogService.saveOrderPackageStatusFaleLog(unitNo, currentWarehouseId, status, operationTime, trayId);
log.error(">>>> 保存到错误数据推送记录 {}", unitNo);
}
@ -174,6 +178,10 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService {
}
}
} else {
Boolean exists = bladeRedis.exists(redisKey);
if(Boolean.TRUE.equals(exists)){
bladeRedis.del(redisKey);
}
orderPackageStatusPushFailLogService.saveOrderPackageStatusFaleLog(unitNo, currentWarehouseId, status, operationTime, trayId);
}
}

Loading…
Cancel
Save