diff --git a/framework/src/main/java/cn/lili/common/utils/ThreadPoolUtil.java b/framework/src/main/java/cn/lili/common/utils/ThreadPoolUtil.java index 5a62281a..eee0a12b 100644 --- a/framework/src/main/java/cn/lili/common/utils/ThreadPoolUtil.java +++ b/framework/src/main/java/cn/lili/common/utils/ThreadPoolUtil.java @@ -23,7 +23,8 @@ public class ThreadPoolUtil { * 线程缓冲队列 */ private static final BlockingQueue BQUEUE = new ArrayBlockingQueue(100); - private static final ThreadPoolExecutor POOL = new ThreadPoolExecutor(SIZE_CORE_POOL, SIZE_MAX_POOL, ALIVE_TIME, TimeUnit.MILLISECONDS, BQUEUE, new ThreadPoolExecutor.CallerRunsPolicy()); + private static final ThreadPoolExecutor POOL = new ThreadPoolExecutor(SIZE_CORE_POOL, SIZE_MAX_POOL, ALIVE_TIME, TimeUnit.MILLISECONDS, BQUEUE, + new ThreadPoolExecutor.CallerRunsPolicy()); /** * volatile禁止指令重排 */ @@ -34,7 +35,7 @@ public class ThreadPoolUtil { } /** - * 无返回值直接执行, 管他娘的 + * 执行方法 * * @param runnable */ @@ -43,7 +44,7 @@ public class ThreadPoolUtil { } /** - * 返回值直接执行, 管他娘的 + * 提交返回值 * * @param callable */ diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java index edeced2e..ba0a1f34 100644 --- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsGalleryServiceImpl.java @@ -101,7 +101,7 @@ public class GoodsGalleryServiceImpl extends ServiceImpl implements LambdaUpdateWrapper lambdaUpdateWrapper = Wrappers.lambdaUpdate(); lambdaUpdateWrapper.set(Goods::getTemplateId, templateId); lambdaUpdateWrapper.in(Goods::getId, goodsIds); - cache.multiDel(goodsIds); + List goodsCache = goodsIds.stream().map(item -> CachePrefix.GOODS.getPrefix() + item).collect(Collectors.toList()); + cache.multiDel(goodsCache); return this.update(lambdaUpdateWrapper); } @@ -548,7 +550,8 @@ public class GoodsServiceImpl extends ServiceImpl implements if (!GoodsStatusEnum.UPPER.name().equals(goods.getMarketEnable()) || !GoodsAuthEnum.PASS.name().equals(goods.getAuthFlag())) { return; } - applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("生成商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.GENERATOR_GOODS_INDEX.name(), goods.getId())); + applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("生成商品", rocketmqCustomProperties.getGoodsTopic(), + GoodsTagsEnum.GENERATOR_GOODS_INDEX.name(), goods.getId())); } /** @@ -558,7 +561,8 @@ public class GoodsServiceImpl extends ServiceImpl implements */ @Transactional public void updateEsGoods(List goodsIds) { - applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("更新商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.UPDATE_GOODS_INDEX.name(), goodsIds)); + applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("更新商品", rocketmqCustomProperties.getGoodsTopic(), + GoodsTagsEnum.UPDATE_GOODS_INDEX.name(), goodsIds)); } /** @@ -568,7 +572,8 @@ public class GoodsServiceImpl extends ServiceImpl implements */ @Transactional public void deleteEsGoods(List goodsIds) { - applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("删除商品", rocketmqCustomProperties.getGoodsTopic(), GoodsTagsEnum.GOODS_DELETE.name(), JSONUtil.toJsonStr(goodsIds))); + applicationEventPublisher.publishEvent(new TransactionCommitSendMQEvent("删除商品", rocketmqCustomProperties.getGoodsTopic(), + GoodsTagsEnum.GOODS_DELETE.name(), JSONUtil.toJsonStr(goodsIds))); } /**