From e6667c792be898c41cda7d850dda02a403ef79c2 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Thu, 06 Apr 2023 10:35:20 +0800 Subject: [PATCH] 关于积分凭证 --- src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java index ea09b5f..0c29ffa 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java @@ -323,7 +323,7 @@ return new FebsResponse().fail().message("商品规格原价不能小于0"); } BigDecimal presentPrice = addSku.getPresentPrice(); - if (presentPrice.compareTo(BigDecimal.ZERO) <= 0) { + if (presentPrice.compareTo(BigDecimal.ZERO) < 0) { return new FebsResponse().fail().message("商品规格现价不能小于0"); } @@ -341,7 +341,7 @@ } BeanUtil.copyProperties(mallGoodsUpdateDto, mallGoods); - if (mallGoods.getHasCarriage() == 2) { + if (mallGoodsUpdateDto.getHasCarriage() == 2) { mallGoods.setCarriage(BigDecimal.ZERO); } @@ -473,5 +473,27 @@ return mallGoodsMapper.getAllGoodsTree(); } + @Override + public FebsResponse goodsHot(Long id) { + MallGoods mallGoods = mallGoodsMapper.selectById(id); + if (ObjectUtil.isEmpty(mallGoods)) { + return new FebsResponse().fail().message("商品不存在,请刷新当前页面"); + } + mallGoods.setIsHot(MallGoods.ISHOT_STATE_YES); + mallGoodsMapper.updateById(mallGoods); + return new FebsResponse().success(); + } + + @Override + public FebsResponse goodsNotHot(Long id) { + MallGoods mallGoods = mallGoodsMapper.selectById(id); + if (ObjectUtil.isEmpty(mallGoods)) { + return new FebsResponse().fail().message("商品不存在,请刷新当前页面"); + } + mallGoods.setIsHot(MallGoods.ISHOT_STATE_NO); + mallGoodsMapper.updateById(mallGoods); + return new FebsResponse().success(); + } + } -- Gitblit v1.9.1