|
|
package com.yoho.activity.queue.service.impl;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.netflix.config.DynamicLongProperty;
|
|
|
import com.netflix.config.DynamicPropertyFactory;
|
|
|
import com.yoho.activity.dal.ProductLimitUserHelpMapper;
|
|
|
import com.yoho.activity.dal.model.LimitProductHelpUser;
|
|
|
import com.yoho.activity.queue.convert.DrawlineQueueConvert;
|
|
|
import com.yoho.message.sdk.common.model.SendMessageRspBo;
|
|
|
import com.yoho.message.sdk.service.ISendLimitCodeMessage;
|
|
|
import com.yoho.service.model.activity.drawline.request.DrawlineActivityBo;
|
|
|
import com.yoho.service.model.activity.drawline.response.LimitProductHelpUserRespBO;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.yoho.activity.common.cache.RedisCache;
|
|
|
import com.yoho.activity.common.redis.CacheKeyEnum;
|
|
|
import com.yoho.activity.common.redis.RedisValueCache;
|
|
|
import com.yoho.activity.common.utils.DateUtils;
|
|
|
import com.yoho.activity.dal.ProductLimitUserHelpMapper;
|
|
|
import com.yoho.activity.dal.model.LimitProductHelpUser;
|
|
|
import com.yoho.activity.queue.convert.DrawlineQueueConvert;
|
|
|
import com.yoho.activity.queue.convert.DrawlineUserQueueConvert;
|
|
|
import com.yoho.activity.queue.service.IDrawlineList2MapService;
|
|
|
import com.yoho.activity.queue.service.IDrawlineUserQueueService;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.core.rest.client.hystrix.AsyncFuture;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.message.sdk.common.model.SendMessageRspBo;
|
|
|
import com.yoho.message.sdk.service.ISendLimitCodeMessage;
|
|
|
import com.yoho.product.model.LimitProductBo;
|
|
|
import com.yoho.queue.dal.IDrawlineActivityDAO;
|
|
|
import com.yoho.queue.dal.IDrawlineActivityLuckydrawDAO;
|
|
|
import com.yoho.queue.dal.IDrawlineUserQueueDAO;
|
|
|
import com.yoho.queue.dal.model.DrawlineActivity;
|
|
|
import com.yoho.queue.dal.model.DrawlineActivityLuckydraw;
|
|
|
import com.yoho.queue.dal.model.DrawlineLuckyUser;
|
|
|
import com.yoho.queue.dal.model.DrawlineUserQueue;
|
|
|
import com.yoho.queue.dal.model.DrawlineVirtualUser;
|
|
|
import com.yoho.queue.dal.model.*;
|
|
|
import com.yoho.service.model.activity.drawline.request.DrawlineActivityBo;
|
|
|
import com.yoho.service.model.activity.drawline.request.DrawlineUserQueueReqBO;
|
|
|
import com.yoho.service.model.activity.drawline.response.DrawlineUserQueueRespBO;
|
|
|
import com.yoho.service.model.activity.drawline.response.UserBaseRspBO;
|
|
|
import com.yoho.service.model.promotion.LimitCodeBo;
|
|
|
import com.yoho.service.model.promotion.request.LimitCodeReq;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Service
|
|
|
public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService {
|
...
|
...
|
@@ -192,10 +186,11 @@ public class DrawlineUserQueueServiceImpl implements IDrawlineUserQueueService { |
|
|
Integer queueCount = drawlineUserQueueDAO.selectHelpUserCount(activityId, uid, null);
|
|
|
if (queueCount == 1){
|
|
|
try {
|
|
|
String saleTimeStr = DateUtils.getDateString(limitProductBo.getSaleTime());
|
|
|
logger.info("addDrawlineUserQueue: push message param : uid is {}, productName is {}, limitProductCode is {}, queueNum is {}, saleTime is {}",uid, productName,
|
|
|
limitProductCode, drawlineUserQueue.getSort(), limitProductBo.getSaleTimeStr());
|
|
|
limitProductCode, drawlineUserQueue.getSort(), saleTimeStr);
|
|
|
SendMessageRspBo responseMessage = iSendLimitCodeMessage.queueSuccess(String.valueOf(uid), 4, productName,
|
|
|
limitProductCode, drawlineUserQueue.getSort(), limitProductBo.getSaleTimeStr());
|
|
|
limitProductCode, drawlineUserQueue.getSort(), saleTimeStr);
|
|
|
logger.info("addDrawlineUserQueue: push message success, result is {}",responseMessage);
|
|
|
logger.info("addDrawlineUserQueue: push message success, code is {}, message is {}",responseMessage.getCode(),responseMessage.getMessage());
|
|
|
}catch (Exception e){
|
...
|
...
|
|