Authored by zhaoqing

砍价

@@ -35,7 +35,7 @@ public class CutDownPriceProductConsumer implements YhConsumer { @@ -35,7 +35,7 @@ public class CutDownPriceProductConsumer implements YhConsumer {
35 if (CollectionUtils.isEmpty(cutDownPriceProductList)) { 35 if (CollectionUtils.isEmpty(cutDownPriceProductList)) {
36 return; 36 return;
37 } 37 }
38 - if (null != cutDownPriceProductList.get(0).getStatus() && cutDownPriceProductList.get(0).getStatus() == 2){ 38 + if (cutDownPriceProductList.size() == 1 && null != cutDownPriceProductList.get(0).getStatus() && cutDownPriceProductList.get(0).getStatus() == 2){
39 cutDownPriceProductMapper.updateCutDownPriceProductStatus(cutDownPriceProductList.get(0).getProductSkn(),cutDownPriceProductList.get(0).getStatus()); 39 cutDownPriceProductMapper.updateCutDownPriceProductStatus(cutDownPriceProductList.get(0).getProductSkn(),cutDownPriceProductList.get(0).getStatus());
40 }else{ 40 }else{
41 cutDownPriceProductMapper.updateCutDownPriceProduct(cutDownPriceProductList); 41 cutDownPriceProductMapper.updateCutDownPriceProduct(cutDownPriceProductList);
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){
@@ -153,10 +153,11 @@ public class ProductLimitUserHelpServiceImpl implements IProductLimitUserHelpSer @@ -153,10 +153,11 @@ public class ProductLimitUserHelpServiceImpl implements IProductLimitUserHelpSer
153 153
154 //推送获得限购码消息 154 //推送获得限购码消息
155 try { 155 try {
  156 + String saleTimeStr = DateUtils.getDateString(limitProductBo.getSaleTime());
156 logger.info("ProductLimitUserHelpServiceImpl: push getLimitCode message param : uid is {}, productName is {},saleTime is {} limitProductCode is {}",limitProductHelpUserRequestBO.getUserId(), 157 logger.info("ProductLimitUserHelpServiceImpl: push getLimitCode message param : uid is {}, productName is {},saleTime is {} limitProductCode is {}",limitProductHelpUserRequestBO.getUserId(),
157 - limitProductBo.getProductName(), limitProductBo.getSaleTimeStr(), limitProductHelpUserRequestBO.getLimitProductCode()); 158 + limitProductBo.getProductName(), saleTimeStr, limitProductHelpUserRequestBO.getLimitProductCode());
158 SendMessageRspBo responseMessage = iSendLimitCodeMessage.getLimitCodeSuccess(String.valueOf(limitProductHelpUserRequestBO.getUserId()), 159 SendMessageRspBo responseMessage = iSendLimitCodeMessage.getLimitCodeSuccess(String.valueOf(limitProductHelpUserRequestBO.getUserId()),
159 - limitProductBo.getProductName(), limitProductBo.getSaleTimeStr(), limitProductHelpUserRequestBO.getLimitProductCode()); 160 + limitProductBo.getProductName(), saleTimeStr, limitProductHelpUserRequestBO.getLimitProductCode());
160 logger.info("ProductLimitUserHelpServiceImpl: push getLimitCode message success, code is {}, message is {}",responseMessage.getCode(),responseMessage.getMessage()); 161 logger.info("ProductLimitUserHelpServiceImpl: push getLimitCode message success, code is {}, message is {}",responseMessage.getCode(),responseMessage.getMessage());
161 }catch (Exception e){ 162 }catch (Exception e){
162 logger.error("推送助力成功信息失败!", e); 163 logger.error("推送助力成功信息失败!", e);