Authored by zhaoqing

砍价

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