库存字段类型不一致问题处理

This commit is contained in:
Chopper
2021-11-02 12:45:52 +08:00
parent 7e58b98e74
commit 394ee27525
3 changed files with 16 additions and 20 deletions

View File

@@ -2,6 +2,7 @@ package cn.lili.test.elasticsearch;
import cn.hutool.core.util.ReflectUtil;
import cn.hutool.json.JSONUtil;
import cn.lili.cache.Cache;
import cn.lili.common.vo.PageVO;
import cn.lili.modules.goods.entity.dos.GoodsSku;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
@@ -52,7 +53,7 @@ class EsTest {
private GoodsSkuService goodsSkuService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
private Cache cache;
@Autowired
private PromotionService promotionService;
@@ -161,7 +162,7 @@ class EsTest {
Map<String, Object> goodsCurrentPromotionMap = promotionService.getGoodsCurrentPromotionMap(index);
index.setPromotionMap(goodsCurrentPromotionMap);
esGoodsIndices.add(index);
stringRedisTemplate.opsForValue().set(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity().toString());
cache.put(GoodsSkuService.getStockCacheKey(goodsSku.getId()), goodsSku.getQuantity());
}
esGoodsIndexService.initIndex(esGoodsIndices);
Assertions.assertTrue(true);