UFOSendServiceImpl.java
9.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package com.yoho.message.sdk.service.ufo;
import com.yoho.message.sdk.common.constants.UFOScenes;
import com.yoho.message.sdk.common.handler.MessageCenterMqHandler;
import com.yoho.message.sdk.common.model.MessageCenterCommonEvent;
import com.yoho.message.sdk.common.model.SendMessageRspBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/**
* Created by min.ling on 2019/1/29.
*/
@Service
public class UFOSendServiceImpl implements IUFOSendService{
@Autowired
private MessageCenterMqHandler messageCenterMqHandler;
@Override
public SendMessageRspBo sendAdjustPrice(String uid,int productCount) {
MessageCenterCommonEvent messageCenterCommonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_PRICE_ADJUST,uid,0,uid);
messageCenterCommonEvent.putInParams("productCount", productCount);
messageCenterMqHandler.sendMessageToMq(messageCenterCommonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
public MessageCenterCommonEvent genMessageCenterCommonEvent(String sendScene, String sendSceneKey,int miniappType,String uid) {
List<String> uids = Collections.singletonList(uid);
return new MessageCenterCommonEvent(sendScene, sendSceneKey,miniappType, uids);
}
/**
* 更低出售价提醒 商家已入驻
* @param uid
* @param productName 商品名称
* @param size 尺寸
* @param goodsNumber 货号
* @param salePrice 提醒的更低售价
* @param productSkn 商品skn
* @return
*/
public SendMessageRspBo sendLessPriceEnter(String uid,String productName,String size,String goodsNumber,String salePrice,String productSkn){
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_LESS_PRICE_ENTER,uid,0,uid);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
commonEvent.putInParams("productSkn",productSkn);
commonEvent.putInParams("salePrice",salePrice);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
/**
* 更低出售价提醒 商家未入驻
* @param uid
* @param productName 商品名称
* @param size 尺寸
* @param goodsNumber 货号
* @param salePrice 提醒的更低售价
* @param orderCode 订单编号
* @return
*/
public SendMessageRspBo sendLessPrice(String uid,String productName,String size,String goodsNumber,String salePrice,String orderCode){
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_LESS_PRICE,uid,0,uid);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
commonEvent.putInParams("orderCode",orderCode);
commonEvent.putInParams("salePrice",salePrice);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
public SendMessageRspBo sellerCancelTrade(String uid,String orderCode){
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_SELLER_CANCEL,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
public SendMessageRspBo platformNotPass(String uid,String orderCode){
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_PLAT_NOT_PASS,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerFlawConfirm(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_BUYER_FLAW_CONFIRM,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo identifyFail(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_IDENTIFY_FAIL,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo skuClosedNotice(String uid, String productName, String size, String goodsNumber) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_SKU_CLOSE,uid,0,uid);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo sellerGoodsSend(String uid, String orderCode, String productName, String size, String goodsNumber, String limitTimeStr) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_SELLER_GOODS_SEND,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
commonEvent.putInParams("limitTimeStr",limitTimeStr);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerCancelBooking(String uid, String orderCode, String productName, String size, String goodsNumber) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_BUYER_CANCEL_BOOKING,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerCancel(String uid, String orderCode, String productName, String size, String goodsNumber) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_BUYER_CANCEL,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerCancelSend(String uid, String orderCode, String productName, String size, String goodsNumber) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.UFO_BUYER_CANCEL_SENDED,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
commonEvent.putInParams("productName",productName);
commonEvent.putInParams("size",size);
commonEvent.putInParams("goodsNumber",goodsNumber);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo sellerDeliverNotice(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.SELLER_DELIVER_NOTICE,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerConfirmFlawExceed(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.BUYER_CONFIRM_FLAW_EXCEED,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo sellerDeliverHours(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.SELLER_DELIVER_HOURS,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo sellerFalseDeliver(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.SELLER_FALSE_DELIVER,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo platformDeliverBuyer(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.PLATFORM_DELIVER_BUYER,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
@Override
public SendMessageRspBo buyerNotPay(String uid, String orderCode) {
MessageCenterCommonEvent commonEvent = genMessageCenterCommonEvent(UFOScenes.BUYER_NOT_PAY,uid,0,uid);
commonEvent.putInParams("orderCode",orderCode);
messageCenterMqHandler.sendMessageToMq(commonEvent);
return new SendMessageRspBo(200, "SUCCESS");
}
}