lidongdong
2023-08-31 480f4b49dde7d746031b6054327474d24a2e15ce
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerCreditsExchangeServiceImpl.java
@@ -92,25 +92,25 @@
            return R.fail("兑换用户id不能为空");
        }
        if(StringUtils.isEmpty(goods.getGoodNum()))
        {
            return R.fail("商品库存不足");
        }
        else
        {
            int goodNum=Integer.valueOf(goods.getGoodNum());
            if(goodNum<=0)
            {
                return R.fail("商品库存不足");
            }
            goodNum--;
            VolunteerIntegralMerchantVO vo=new VolunteerIntegralMerchantVO();
            vo.setId(goods.getId());
            vo.setGoodNum(goodNum+"");
            goodsService.updateById(vo);
        }
//        if(StringUtils.isEmpty(goods.getGoodNum()))
//        {
//            return R.fail("商品库存不足");
//        }
//        else
//        {
//            int goodNum=Integer.valueOf(goods.getGoodNum());
//            if(goodNum<=0)
//            {
//                return R.fail("商品库存不足");
//            }
//
//            goodNum--;
//
//            VolunteerIntegralMerchantVO vo=new VolunteerIntegralMerchantVO();
//            vo.setId(goods.getId());
//            vo.setGoodNum(goodNum+"");
//            goodsService.updateById(vo);
//        }
        //增加积分明细记录