|
|
package com.yoho.message.sdk.service.order.impl;
|
|
|
|
|
|
import com.yoho.message.sdk.utils.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
...
|
...
|
@@ -275,7 +276,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
|
|
if (miniappFlg == 1){
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_ORDER_CANCEL, orderCode, uid);
|
|
|
}else{
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.ORDER_CANCEL, orderCode, uid);
|
|
|
}
|
...
|
...
|
@@ -286,9 +287,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
messageCenterCommonEvent.putInParams("address", address);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("cancelReason", cancelReason);
|
|
|
messageCenterCommonEvent.putInParams("cancelTime", cancelTime);
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
messageCenterCommonEvent.putInParams("msgCode", 1002); // 订单取消
|
|
|
messageCenterCommonEvent.putInParams("cancelTime", DateUtils.long2DateStr(cancelTime, DateUtils.fullDateTimeFormat));
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
...
|
...
|
@@ -307,15 +306,12 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
*/
|
|
|
public SendMessageRspBo waitingPay(String uid, String orderCode, String orderAmount, String productName) {
|
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_WAITING_PAY, orderCode, uid);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
|
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
|
|
messageCenterCommonEvent.putInParams("productName", productName);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
messageCenterCommonEvent.putInParams("msgCode", 1001); // 待支付
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
...
|
...
|
@@ -332,14 +328,11 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
*/
|
|
|
public SendMessageRspBo confirmOrder(String uid, String orderCode, int goodReceiptTime, String productName) {
|
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_GOODS_RECEIPT, orderCode, uid);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
|
|
messageCenterCommonEvent.putInParams("productName", productName);
|
|
|
messageCenterCommonEvent.putInParams("goodReceiptTime", goodReceiptTime);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
messageCenterCommonEvent.putInParams("msgCode", 1004); // 确认收货
|
|
|
messageCenterCommonEvent.putInParams("goodReceiptTime", DateUtils.long2DateStr(goodReceiptTime, DateUtils.fullDateTimeFormat));
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
...
|
...
|
@@ -357,17 +350,14 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
*/
|
|
|
public SendMessageRspBo paySucess(String uid, String orderCode, int payTime, String productName, String goodReceiptAddress, String orderAmount) {
|
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_PAY_SUCCESS, orderCode, uid);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
|
|
messageCenterCommonEvent.putInParams("productName", productName);
|
|
|
messageCenterCommonEvent.putInParams("payTime", payTime);
|
|
|
messageCenterCommonEvent.putInParams("payTime", DateUtils.long2DateStr(payTime, DateUtils.fullDateTimeFormat));
|
|
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
|
|
messageCenterCommonEvent.putInParams("goodReceiptAddress", goodReceiptAddress);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
messageCenterCommonEvent.putInParams("msgCode", 1000); // 订单支付成功
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
...
|
...
|
@@ -390,7 +380,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
|
|
if (miniappFlg == 1){
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_GOODS_REFUND, orderCode, uid);
|
|
|
}else{
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.REFUND_SUCCESS, orderCode, uid);
|
|
|
}
|
...
|
...
|
@@ -399,12 +389,9 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
|
|
messageCenterCommonEvent.putInParams("payType", payType);
|
|
|
messageCenterCommonEvent.putInParams("productName", productName);
|
|
|
messageCenterCommonEvent.putInParams("refundTime", refundTime); // 时间戳
|
|
|
messageCenterCommonEvent.putInParams("refundTime", DateUtils.long2DateStr(refundTime, DateUtils.fullDateTimeFormat)); // 时间戳
|
|
|
messageCenterCommonEvent.putInParams("refundId", refundId);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("msgCode", 1005); // 退货成功
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
|
|
return new SendMessageRspBo(200, "SUCCESS");
|
...
|
...
|
@@ -441,7 +428,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
|
|
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
|
|
if (miniappFlg == 1){
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_ORDER_DELIVERY, orderCode, uid);
|
|
|
}else{
|
|
|
messageCenterCommonEvent = genMessageCenterCommonEvent(sendScene, orderCode, uid);
|
|
|
}
|
...
|
...
|
@@ -455,13 +442,10 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
|
messageCenterCommonEvent.putInParams("arriveDate", arriveDate);
|
|
|
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
messageCenterCommonEvent.putInParams("msgCode",1003); // 订单发货 参见MsgTemplateTypeEnum
|
|
|
messageCenterCommonEvent.putInParams("productName",productName);
|
|
|
messageCenterCommonEvent.putInParams("deliveryType", deliveryType);
|
|
|
// 发货时间
|
|
|
messageCenterCommonEvent.putInParams("deliveryTime", deliveryTime);
|
|
|
|
|
|
messageCenterCommonEvent.putInParams("deliveryTime", DateUtils.long2DateStr(deliveryTime, DateUtils.fullDateTimeFormat));
|
|
|
|
|
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
|
|
|
...
|
...
|
|