1
|
package com.yoho.activity.queue.service.impl;
|
1
|
package com.yoho.activity.queue.service.impl;
|
2
|
|
2
|
|
3
|
-import java.util.ArrayList;
|
|
|
4
|
-import java.util.List;
|
|
|
5
|
-import java.util.Map;
|
|
|
6
|
-import java.util.concurrent.TimeUnit;
|
|
|
7
|
-
|
|
|
8
|
-import javax.annotation.Resource;
|
|
|
9
|
-
|
3
|
+import com.alibaba.fastjson.JSONArray;
|
10
|
import com.netflix.config.DynamicLongProperty;
|
4
|
import com.netflix.config.DynamicLongProperty;
|
11
|
import com.netflix.config.DynamicPropertyFactory;
|
5
|
import com.netflix.config.DynamicPropertyFactory;
|
12
|
-import com.yoho.activity.dal.ProductLimitUserHelpMapper;
|
|
|
13
|
-import com.yoho.activity.dal.model.LimitProductHelpUser;
|
|
|
14
|
-import com.yoho.activity.queue.convert.DrawlineQueueConvert;
|
|
|
15
|
-import com.yoho.message.sdk.common.model.SendMessageRspBo;
|
|
|
16
|
-import com.yoho.message.sdk.service.ISendLimitCodeMessage;
|
|
|
17
|
-import com.yoho.service.model.activity.drawline.request.DrawlineActivityBo;
|
|
|
18
|
-import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserRespBO;
|
|
|
19
|
-import org.apache.commons.collections.CollectionUtils;
|
|
|
20
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
21
|
-import org.slf4j.Logger;
|
|
|
22
|
-import org.slf4j.LoggerFactory;
|
|
|
23
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
24
|
-import org.springframework.stereotype.Service;
|
|
|
25
|
-
|
|
|
26
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
27
|
import com.yoho.activity.common.cache.RedisCache;
|
6
|
import com.yoho.activity.common.cache.RedisCache;
|
28
|
import com.yoho.activity.common.redis.CacheKeyEnum;
|
7
|
import com.yoho.activity.common.redis.CacheKeyEnum;
|
29
|
import com.yoho.activity.common.redis.RedisValueCache;
|
8
|
import com.yoho.activity.common.redis.RedisValueCache;
|
|
|
9
|
+import com.yoho.activity.common.utils.DateUtils;
|
|
|
10
|
+import com.yoho.activity.dal.ProductLimitUserHelpMapper;
|
|
|
11
|
+import com.yoho.activity.dal.model.LimitProductHelpUser;
|
|
|
12
|
+import com.yoho.activity.queue.convert.DrawlineQueueConvert;
|
30
|
import com.yoho.activity.queue.convert.DrawlineUserQueueConvert;
|
13
|
import com.yoho.activity.queue.convert.DrawlineUserQueueConvert;
|
31
|
import com.yoho.activity.queue.service.IDrawlineList2MapService;
|
14
|
import com.yoho.activity.queue.service.IDrawlineList2MapService;
|
32
|
import com.yoho.activity.queue.service.IDrawlineUserQueueService;
|
15
|
import com.yoho.activity.queue.service.IDrawlineUserQueueService;
|
33
|
import com.yoho.core.rest.client.ServiceCaller;
|
16
|
import com.yoho.core.rest.client.ServiceCaller;
|
34
|
import com.yoho.core.rest.client.hystrix.AsyncFuture;
|
17
|
import com.yoho.core.rest.client.hystrix.AsyncFuture;
|
35
|
import com.yoho.error.exception.ServiceException;
|
18
|
import com.yoho.error.exception.ServiceException;
|
|
|
19
|
+import com.yoho.message.sdk.common.model.SendMessageRspBo;
|
|
|
20
|
+import com.yoho.message.sdk.service.ISendLimitCodeMessage;
|
36
|
import com.yoho.product.model.LimitProductBo;
|
21
|
import com.yoho.product.model.LimitProductBo;
|
37
|
import com.yoho.queue.dal.IDrawlineActivityDAO;
|
22
|
import com.yoho.queue.dal.IDrawlineActivityDAO;
|
38
|
import com.yoho.queue.dal.IDrawlineActivityLuckydrawDAO;
|
23
|
import com.yoho.queue.dal.IDrawlineActivityLuckydrawDAO;
|
39
|
import com.yoho.queue.dal.IDrawlineUserQueueDAO;
|
24
|
import com.yoho.queue.dal.IDrawlineUserQueueDAO;
|
40
|
-import com.yoho.queue.dal.model.DrawlineActivity;
|
|
|
41
|
-import com.yoho.queue.dal.model.DrawlineActivityLuckydraw;
|
|
|
42
|
-import com.yoho.queue.dal.model.DrawlineLuckyUser;
|
|
|
43
|
-import com.yoho.queue.dal.model.DrawlineUserQueue;
|
|
|
44
|
-import com.yoho.queue.dal.model.DrawlineVirtualUser;
|
25
|
+import com.yoho.queue.dal.model.*;
|
|
|
26
|
+import com.yoho.service.model.activity.drawline.request.DrawlineActivityBo;
|
45
|
import com.yoho.service.model.activity.drawline.request.DrawlineUserQueueReqBO;
|
27
|
import com.yoho.service.model.activity.drawline.request.DrawlineUserQueueReqBO;
|
46
|
import com.yoho.service.model.activity.drawline.response.DrawlineUserQueueRespBO;
|
28
|
import com.yoho.service.model.activity.drawline.response.DrawlineUserQueueRespBO;
|
47
|
import com.yoho.service.model.activity.drawline.response.UserBaseRspBO;
|
29
|
import com.yoho.service.model.activity.drawline.response.UserBaseRspBO;
|
48
|
import com.yoho.service.model.promotion.LimitCodeBo;
|
30
|
import com.yoho.service.model.promotion.LimitCodeBo;
|
49
|
import com.yoho.service.model.promotion.request.LimitCodeReq;
|
31
|
import com.yoho.service.model.promotion.request.LimitCodeReq;
|
|
|
32
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
33
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
34
|
+import org.slf4j.Logger;
|
|
|
35
|
+import org.slf4j.LoggerFactory;
|
|
|
36
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
37
|
+import org.springframework.stereotype.Service;
|
|
|
38
|
+
|
|
|
39
|
+import javax.annotation.Resource;
|
|
|
40
|
+import java.util.ArrayList;
|
|
|
41
|
+import java.util.List;
|
|
|
42
|
+import java.util.Map;
|
|
|
43
|
+import java.util.concurrent.TimeUnit;
|
50
|
|
44
|
|
51
|
@Service
|
45
|
@Service
|
52
|
public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
|
46
|
public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
|
|
@@ -192,10 +186,11 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService { |
|
@@ -192,10 +186,11 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService { |
192
|
Integer queueCount = drawlineUserQueueDAO.selectHelpUserCount(activityId, uid, null);
|
186
|
Integer queueCount = drawlineUserQueueDAO.selectHelpUserCount(activityId, uid, null);
|
193
|
if (queueCount == 1){
|
187
|
if (queueCount == 1){
|
194
|
try {
|
188
|
try {
|
|
|
189
|
+ String saleTimeStr = DateUtils.getDateString(limitProductBo.getSaleTime());
|
195
|
logger.info("addDrawlineUserQueue: push message param : uid is {}, productName is {}, limitProductCode is {}, queueNum is {}, saleTime is {}",uid, productName,
|
190
|
logger.info("addDrawlineUserQueue: push message param : uid is {}, productName is {}, limitProductCode is {}, queueNum is {}, saleTime is {}",uid, productName,
|
196
|
- limitProductCode, drawlineUserQueue.getSort(), limitProductBo.getSaleTimeStr());
|
191
|
+ limitProductCode, drawlineUserQueue.getSort(), saleTimeStr);
|
197
|
SendMessageRspBo responseMessage = iSendLimitCodeMessage.queueSuccess(String.valueOf(uid), 4, productName,
|
192
|
SendMessageRspBo responseMessage = iSendLimitCodeMessage.queueSuccess(String.valueOf(uid), 4, productName,
|
198
|
- limitProductCode, drawlineUserQueue.getSort(), limitProductBo.getSaleTimeStr());
|
193
|
+ limitProductCode, drawlineUserQueue.getSort(), saleTimeStr);
|
199
|
logger.info("addDrawlineUserQueue: push message success, result is {}",responseMessage);
|
194
|
logger.info("addDrawlineUserQueue: push message success, result is {}",responseMessage);
|
200
|
logger.info("addDrawlineUserQueue: push message success, code is {}, message is {}",responseMessage.getCode(),responseMessage.getMessage());
|
195
|
logger.info("addDrawlineUserQueue: push message success, code is {}, message is {}",responseMessage.getCode(),responseMessage.getMessage());
|
201
|
}catch (Exception e){
|
196
|
}catch (Exception e){
|