订单中的商品数量累加问题处理。
延时任务日志增加
This commit is contained in:
parent
095cf81ce8
commit
0f0f480b24
@ -10,7 +10,6 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.TimeZone;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,6 +39,9 @@ public abstract class AbstractDelayQueueMachineFactory {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延时队列机器开始运作
|
||||||
|
*/
|
||||||
private void startDelayQueueMachine() {
|
private void startDelayQueueMachine() {
|
||||||
log.info(String.format("延时队列机器{%s}开始运作", setDelayQueueName()));
|
log.info(String.format("延时队列机器{%s}开始运作", setDelayQueueName()));
|
||||||
|
|
||||||
@ -64,11 +66,11 @@ public abstract class AbstractDelayQueueMachineFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// log.warn(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
|
log.error(String.format("处理延时任务发生异常,异常原因为{%s}", e.getMessage()), e);
|
||||||
} finally {
|
} finally {
|
||||||
// 间隔一秒钟搞一次
|
// 间隔一秒钟搞一次
|
||||||
try {
|
try {
|
||||||
TimeUnit.SECONDS.sleep(1L);
|
TimeUnit.SECONDS.sleep(5L);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -52,13 +52,15 @@ public class RocketmqTimerTrigger implements TimeTrigger {
|
|||||||
if (StringUtils.isEmpty(uniqueKey)) {
|
if (StringUtils.isEmpty(uniqueKey)) {
|
||||||
uniqueKey = StringUtils.getRandStr(10);
|
uniqueKey = StringUtils.getRandStr(10);
|
||||||
}
|
}
|
||||||
|
//执行任务key
|
||||||
String generateKey = TimeTriggerUtil.generateKey(timeTriggerMsg.getTriggerExecutor(), timeTriggerMsg.getTriggerTime(), uniqueKey);
|
String generateKey = TimeTriggerUtil.generateKey(timeTriggerMsg.getTriggerExecutor(), timeTriggerMsg.getTriggerTime(), uniqueKey);
|
||||||
this.cache.put(generateKey, 1);
|
this.cache.put(generateKey, 1);
|
||||||
|
//设置延时任务
|
||||||
if (Boolean.TRUE.equals(promotionDelayQueue.addJobId(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
|
if (Boolean.TRUE.equals(promotionDelayQueue.addJobId(JSONUtil.toJsonStr(timeTriggerMsg), delayTime))) {
|
||||||
log.info("add Redis key {} --------------------------", generateKey);
|
log.info("add Redis key {}", generateKey);
|
||||||
log.info("定时执行在【" + DateUtil.toString(timeTriggerMsg.getTriggerTime(), "yyyy-MM-dd HH:mm:ss") + "】,消费【" + timeTriggerMsg.getParam().toString() + "】");
|
log.info("定时执行在【" + DateUtil.toString(timeTriggerMsg.getTriggerTime(), "yyyy-MM-dd HH:mm:ss") + "】,消费【" + timeTriggerMsg.getParam().toString() + "】");
|
||||||
} else {
|
} else {
|
||||||
log.info("延时任务添加失败!");
|
log.error("延时任务添加失败:{}", timeTriggerMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ public class CartVO extends CartBase implements Serializable {
|
|||||||
this.remark = "";
|
this.remark = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Integer goodsNum) {
|
public void addGoodsNum(Integer goodsNum) {
|
||||||
if (this.goodsNum == null) {
|
if (this.goodsNum == null) {
|
||||||
this.goodsNum = goodsNum;
|
this.goodsNum = goodsNum;
|
||||||
} else {
|
} else {
|
||||||
|
@ -8,7 +8,6 @@ import cn.lili.modules.order.cart.entity.vo.CartSkuVO;
|
|||||||
import cn.lili.modules.order.cart.entity.vo.CartVO;
|
import cn.lili.modules.order.cart.entity.vo.CartVO;
|
||||||
import cn.lili.modules.order.cart.render.CartRenderStep;
|
import cn.lili.modules.order.cart.render.CartRenderStep;
|
||||||
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
import cn.lili.modules.order.order.entity.dto.PriceDetailDTO;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -53,7 +52,7 @@ public class CartPriceRender implements CartRenderStep {
|
|||||||
if (Boolean.FALSE.equals(sku.getChecked())) {
|
if (Boolean.FALSE.equals(sku.getChecked())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cart.setGoodsNum(sku.getNum());
|
cart.addGoodsNum(sku.getNum());
|
||||||
if (cart.getStoreId().equals(sku.getStoreId()) && !cart.getSkuList().contains(sku)) {
|
if (cart.getStoreId().equals(sku.getStoreId()) && !cart.getSkuList().contains(sku)) {
|
||||||
cart.getSkuList().add(sku);
|
cart.getSkuList().add(sku);
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ public class IndexStatisticsServiceImpl implements IndexStatisticsService {
|
|||||||
//获取总会员数量
|
//获取总会员数量
|
||||||
indexStatisticsVO.setMemberNum(memberStatisticsDataService.getMemberCount());
|
indexStatisticsVO.setMemberNum(memberStatisticsDataService.getMemberCount());
|
||||||
//获取总上架商品数量
|
//获取总上架商品数量
|
||||||
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, null));
|
indexStatisticsVO.setGoodsNum(goodsService.goodsNum(GoodsStatusEnum.UPPER, GoodsAuthEnum.PASS));
|
||||||
//获取总店铺数量
|
//获取总店铺数量
|
||||||
indexStatisticsVO.setStoreNum(storeService.storeNum());
|
indexStatisticsVO.setStoreNum(storeService.storeNum());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user