如下 Skill-service的add方法执和到redisTemplate.boundHashOps(SKILL_GOODS_PHONE).put(skillGoods.getId(), skillGoods);报错
执行到这一步时会报异常!这是什么原因呢 ?
redisTemplate.boundHashOps(SKILL_GOODS_PHONE).put(skillGoods.getId(), skillGoods);
if (skillGoods.getStockCount() > 0) {
SkillOrder skillOrder = new SkillOrder();
skillOrder.setMoney(skillGoods.getCostPrice());
skillOrder.setPayTime(new Date());
skillOrder.setStatus("0");
skillOrder.setUserId(userId);
skillOrder.setCreateTime(new Date());
skillOrder.setSkillId(productId);
skillOrderRepository.save(skillOrder);
skillGoods.setStockCount(skillGoods.getStockCount() - 1);
redisTemplate.boundHashOps(SKILL_GOODS_PHONE).put(skillGoods.getId(), skillGoods);
System.out.println("成功秒杀 剩余库存:"+skillGoods.getStockCount());
}