From e89fa51bb8592aae31ed345400c5a632e394739d Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Wed, 13 Dec 2023 15:06:43 +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