diff --git a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java index 620e188a..bf92738d 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java @@ -113,6 +113,12 @@ public class HighOrderServiceImpl implements HighOrderService { @Resource private RedisTemplate redisTemplate; + @Resource + private WebSocket webSocket; + + @Resource + private BaiduVoiceService baiduVoiceService; + @Override @Transactional( isolation = Isolation.SERIALIZABLE, @@ -367,7 +373,6 @@ public class HighOrderServiceImpl implements HighOrderService { // 扣预存款 this.redisTemplate.boundListOps(MsgTopic.MerStoreAccount.getName()).leftPush(pushParam); } - new Thread(() -> { try { SpPrinterConfig sp = new SpPrinterConfig(); @@ -398,7 +403,6 @@ public class HighOrderServiceImpl implements HighOrderService { e.printStackTrace(); } }).start(); - } else if (store.getSourceType().equals(2)) { // 推送团油订单 Map paramMap = new HashMap<>(); @@ -501,6 +505,14 @@ public class HighOrderServiceImpl implements HighOrderService { } updateOrder(highOrder); + + if (highOrder.getHighChildOrderList().get(0).getGoodsType().equals(3)) { + Map message = new HashMap<>(); + message.put("order", highOrderService.getOrderByOrderNo(highOrder.getOrderNo())); + message.put("voice", baiduVoiceService.text2audio(highOrder.getHighChildOrderList().get(0).getGoodsName() + "加油站,收款:" + highOrder.getTotalPrice())); + webSocket.SenderMessage(highOrder.getHighChildOrderList().get(0).getGoodsId().toString() + , JSONObject.toJSONString(message)); + } } @Override