he2802 3 anni fa
parent
commit
2095aba23c

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -323,7 +323,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 throw new CustomException("该商品已被购买过,无法改变状态");
             }
         }
-        if(entity.getGoodsType().longValue()==1&&Validator.isNotEmpty(entity.getStudyCount())&&entity.getGoodsId().longValue()>0){
+        if(entity.getGoodsType().longValue()==1&&Validator.isNotEmpty(entity.getStudyCount())&&Validator.isNotEmpty(entity.getGoodsId())){
             //判断学习次数有没有变化
             GoodsVo old = this.queryById(entity.getGoodsId());
             if(Validator.isEmpty(old.getStudyCount())){