jyc před 3 týdny
rodič
revize
3fb5131529

+ 16 - 1
alien-lawyer/src/main/java/shop/alien/lawyer/service/impl/OrderExpirationServiceImpl.java

@@ -153,7 +153,7 @@ public class OrderExpirationServiceImpl implements OrderExpirationService, Comma
                 log.info("訂單退款成功,訂單no: {}", orderNo);
 
                 //通知
-                LifeNotice lifeNotice = buildLifeNotice(order, title, message);
+                LifeNotice lifeNotice = buildUserLifeNotice(order, title, message);
                 WebSocketVo webSocketVo = buildWebSocketVo(lifeNotice);
 
                 lifeNoticeMapper.insert(lifeNotice);
@@ -375,5 +375,20 @@ public class OrderExpirationServiceImpl implements OrderExpirationService, Comma
 
         return lifeNotice;
     }
+
+    private LifeNotice buildUserLifeNotice(LawyerConsultationOrder lawyerConsultationOrder,String title,String message){
+        LifeNotice lifeNotice = new LifeNotice();
+        lifeNotice.setSenderId(SYSTEM_SENDER_ID);
+        lifeNotice.setBusinessId(lawyerConsultationOrder.getId());
+        lifeNotice.setTitle(title);
+        lifeNotice.setReceiverId("user_" + lifeUserMapper.selectById(lawyerConsultationOrder.getClientUserId()).getUserPhone());
+
+        JSONObject jsonObject = new JSONObject();
+        jsonObject.put("message", message);
+        lifeNotice.setContext(jsonObject.toJSONString());
+        lifeNotice.setNoticeType(1);
+
+        return lifeNotice;
+    }
 }