1
|
package com.yoho.message.sdk.service.order.impl;
|
1
|
package com.yoho.message.sdk.service.order.impl;
|
2
|
|
2
|
|
|
|
3
|
+import com.yoho.message.sdk.utils.DateUtils;
|
3
|
import org.springframework.beans.factory.annotation.Autowired;
|
4
|
import org.springframework.beans.factory.annotation.Autowired;
|
4
|
import org.springframework.stereotype.Service;
|
5
|
import org.springframework.stereotype.Service;
|
5
|
|
6
|
|
|
@@ -275,7 +276,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -275,7 +276,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
275
|
|
276
|
|
276
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
277
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
277
|
if (miniappFlg == 1){
|
278
|
if (miniappFlg == 1){
|
278
|
- messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
279
|
+ messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_ORDER_CANCEL, orderCode, uid);
|
279
|
}else{
|
280
|
}else{
|
280
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.ORDER_CANCEL, orderCode, uid);
|
281
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.ORDER_CANCEL, orderCode, uid);
|
281
|
}
|
282
|
}
|
|
@@ -286,9 +287,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -286,9 +287,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
286
|
messageCenterCommonEvent.putInParams("address", address);
|
287
|
messageCenterCommonEvent.putInParams("address", address);
|
287
|
|
288
|
|
288
|
messageCenterCommonEvent.putInParams("cancelReason", cancelReason);
|
289
|
messageCenterCommonEvent.putInParams("cancelReason", cancelReason);
|
289
|
- messageCenterCommonEvent.putInParams("cancelTime", cancelTime);
|
|
|
290
|
- messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
291
|
- messageCenterCommonEvent.putInParams("msgCode", 1002); // 订单取消
|
290
|
+ messageCenterCommonEvent.putInParams("cancelTime", DateUtils.long2DateStr(cancelTime, DateUtils.fullDateTimeFormat));
|
292
|
|
291
|
|
293
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
292
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
294
|
|
293
|
|
|
@@ -307,15 +306,12 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -307,15 +306,12 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
307
|
*/
|
306
|
*/
|
308
|
public SendMessageRspBo waitingPay(String uid, String orderCode, String orderAmount, String productName) {
|
307
|
public SendMessageRspBo waitingPay(String uid, String orderCode, String orderAmount, String productName) {
|
309
|
|
308
|
|
310
|
- MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
309
|
+ MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_WAITING_PAY, orderCode, uid);
|
311
|
|
310
|
|
312
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
311
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
313
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
312
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
314
|
messageCenterCommonEvent.putInParams("productName", productName);
|
313
|
messageCenterCommonEvent.putInParams("productName", productName);
|
315
|
|
314
|
|
316
|
- messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
317
|
- messageCenterCommonEvent.putInParams("msgCode", 1001); // 待支付
|
|
|
318
|
-
|
|
|
319
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
315
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
320
|
|
316
|
|
321
|
return new SendMessageRspBo(200, "SUCCESS");
|
317
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
@@ -332,14 +328,11 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -332,14 +328,11 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
332
|
*/
|
328
|
*/
|
333
|
public SendMessageRspBo confirmOrder(String uid, String orderCode, int goodReceiptTime, String productName) {
|
329
|
public SendMessageRspBo confirmOrder(String uid, String orderCode, int goodReceiptTime, String productName) {
|
334
|
|
330
|
|
335
|
- MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
331
|
+ MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_GOODS_RECEIPT, orderCode, uid);
|
336
|
|
332
|
|
337
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
333
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
338
|
messageCenterCommonEvent.putInParams("productName", productName);
|
334
|
messageCenterCommonEvent.putInParams("productName", productName);
|
339
|
- messageCenterCommonEvent.putInParams("goodReceiptTime", goodReceiptTime);
|
|
|
340
|
-
|
|
|
341
|
- messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
342
|
- messageCenterCommonEvent.putInParams("msgCode", 1004); // 确认收货
|
335
|
+ messageCenterCommonEvent.putInParams("goodReceiptTime", DateUtils.long2DateStr(goodReceiptTime, DateUtils.fullDateTimeFormat));
|
343
|
|
336
|
|
344
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
337
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
345
|
|
338
|
|
|
@@ -357,17 +350,14 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -357,17 +350,14 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
357
|
*/
|
350
|
*/
|
358
|
public SendMessageRspBo paySucess(String uid, String orderCode, int payTime, String productName, String goodReceiptAddress, String orderAmount) {
|
351
|
public SendMessageRspBo paySucess(String uid, String orderCode, int payTime, String productName, String goodReceiptAddress, String orderAmount) {
|
359
|
|
352
|
|
360
|
- MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
353
|
+ MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_PAY_SUCCESS, orderCode, uid);
|
361
|
|
354
|
|
362
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
355
|
messageCenterCommonEvent.putInParams("orderCode", orderCode);
|
363
|
messageCenterCommonEvent.putInParams("productName", productName);
|
356
|
messageCenterCommonEvent.putInParams("productName", productName);
|
364
|
- messageCenterCommonEvent.putInParams("payTime", payTime);
|
357
|
+ messageCenterCommonEvent.putInParams("payTime", DateUtils.long2DateStr(payTime, DateUtils.fullDateTimeFormat));
|
365
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
358
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
366
|
messageCenterCommonEvent.putInParams("goodReceiptAddress", goodReceiptAddress);
|
359
|
messageCenterCommonEvent.putInParams("goodReceiptAddress", goodReceiptAddress);
|
367
|
|
360
|
|
368
|
- messageCenterCommonEvent.putInParams("miniappFlg", 1);
|
|
|
369
|
- messageCenterCommonEvent.putInParams("msgCode", 1000); // 订单支付成功
|
|
|
370
|
-
|
|
|
371
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
361
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
372
|
|
362
|
|
373
|
return new SendMessageRspBo(200, "SUCCESS");
|
363
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
@@ -390,7 +380,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -390,7 +380,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
390
|
|
380
|
|
391
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
381
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
392
|
if (miniappFlg == 1){
|
382
|
if (miniappFlg == 1){
|
393
|
- messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
383
|
+ messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_GOODS_REFUND, orderCode, uid);
|
394
|
}else{
|
384
|
}else{
|
395
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.REFUND_SUCCESS, orderCode, uid);
|
385
|
messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.REFUND_SUCCESS, orderCode, uid);
|
396
|
}
|
386
|
}
|
|
@@ -399,12 +389,9 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -399,12 +389,9 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
399
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
389
|
messageCenterCommonEvent.putInParams("orderAmount", orderAmount);
|
400
|
messageCenterCommonEvent.putInParams("payType", payType);
|
390
|
messageCenterCommonEvent.putInParams("payType", payType);
|
401
|
messageCenterCommonEvent.putInParams("productName", productName);
|
391
|
messageCenterCommonEvent.putInParams("productName", productName);
|
402
|
- messageCenterCommonEvent.putInParams("refundTime", refundTime); // 时间戳
|
392
|
+ messageCenterCommonEvent.putInParams("refundTime", DateUtils.long2DateStr(refundTime, DateUtils.fullDateTimeFormat)); // 时间戳
|
403
|
messageCenterCommonEvent.putInParams("refundId", refundId);
|
393
|
messageCenterCommonEvent.putInParams("refundId", refundId);
|
404
|
|
394
|
|
405
|
- messageCenterCommonEvent.putInParams("msgCode", 1005); // 退货成功
|
|
|
406
|
- messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
407
|
-
|
|
|
408
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
395
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
409
|
|
396
|
|
410
|
return new SendMessageRspBo(200, "SUCCESS");
|
397
|
return new SendMessageRspBo(200, "SUCCESS");
|
|
@@ -441,7 +428,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -441,7 +428,7 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
441
|
|
428
|
|
442
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
429
|
MessageCenterCommonEvent messageCenterCommonEvent = null;
|
443
|
if (miniappFlg == 1){
|
430
|
if (miniappFlg == 1){
|
444
|
- messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINIAPP_MSG, orderCode, uid);
|
431
|
+ messageCenterCommonEvent = genMessageCenterCommonEvent(SendScenes.MINI_ORDER_DELIVERY, orderCode, uid);
|
445
|
}else{
|
432
|
}else{
|
446
|
messageCenterCommonEvent = genMessageCenterCommonEvent(sendScene, orderCode, uid);
|
433
|
messageCenterCommonEvent = genMessageCenterCommonEvent(sendScene, orderCode, uid);
|
447
|
}
|
434
|
}
|
|
@@ -455,13 +442,10 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
|
@@ -455,13 +442,10 @@ public class SendOrderMessageImpl extends AbstractSendMessage implements ISendOr |
455
|
messageCenterCommonEvent.putInParams("arriveDate", arriveDate);
|
442
|
messageCenterCommonEvent.putInParams("arriveDate", arriveDate);
|
456
|
|
443
|
|
457
|
|
444
|
|
458
|
- messageCenterCommonEvent.putInParams("miniappFlg", miniappFlg);
|
|
|
459
|
- messageCenterCommonEvent.putInParams("msgCode",1003); // 订单发货 参见MsgTemplateTypeEnum
|
|
|
460
|
messageCenterCommonEvent.putInParams("productName",productName);
|
445
|
messageCenterCommonEvent.putInParams("productName",productName);
|
461
|
messageCenterCommonEvent.putInParams("deliveryType", deliveryType);
|
446
|
messageCenterCommonEvent.putInParams("deliveryType", deliveryType);
|
462
|
// 发货时间
|
447
|
// 发货时间
|
463
|
- messageCenterCommonEvent.putInParams("deliveryTime", deliveryTime);
|
|
|
464
|
-
|
448
|
+ messageCenterCommonEvent.putInParams("deliveryTime", DateUtils.long2DateStr(deliveryTime, DateUtils.fullDateTimeFormat));
|
465
|
|
449
|
|
466
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
450
|
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
|
467
|
|
451
|
|