From 4b6a0f0cfdc0164ed007a2326777ac530d370f84 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 19 May 2022 13:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hai/service/impl/HighOrderServiceImpl.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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