From 90fc70c610edae974b9d6e365dd6fbaf93730ff1 Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Wed, 15 May 2024 15:49:23 +0800 Subject: [PATCH] 测试环境 --- src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java | 47 ++++++++++++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 21 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 28e95b3..69c9eb2 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 @@ -2,6 +2,7 @@ import cc.mrbird.febs.common.entity.FebsResponse; import cc.mrbird.febs.common.entity.QueryRequest; +import cc.mrbird.febs.common.utils.AppContants; import cc.mrbird.febs.mall.conversion.MallGoodsConversion; import cc.mrbird.febs.mall.dto.*; import cc.mrbird.febs.mall.entity.*; @@ -72,16 +73,18 @@ return new FebsResponse().fail().message("商品编号不能重复"); } Integer carriageType = addMallGoodsDto.getCarriageType(); - if(1 == carriageType){ - if(ObjectUtil.isEmpty(addMallGoodsDto.getCarriageAmount()) - || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) > 0){ - return new FebsResponse().fail().message("固定邮费不能小于零"); - } - }else{ - Long carriageRuleId = addMallGoodsDto.getCarriageRuleId(); - MallCarriageRule mallCarriageRule = mallCarriageRuleMapper.selectById(carriageRuleId); - if(ObjectUtil.isEmpty(mallCarriageRule)){ - return new FebsResponse().fail().message("邮费模板不能为空"); + if (addMallGoodsDto.getGoodsType() == 1) { + if (1 == carriageType) { + if (ObjectUtil.isEmpty(addMallGoodsDto.getCarriageAmount()) + || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) > 0) { + return new FebsResponse().fail().message("固定邮费不能小于零"); + } + } else { + Long carriageRuleId = addMallGoodsDto.getCarriageRuleId(); + MallCarriageRule mallCarriageRule = mallCarriageRuleMapper.selectById(carriageRuleId); + if (ObjectUtil.isEmpty(mallCarriageRule)) { + return new FebsResponse().fail().message("邮费模板不能为空"); + } } } @@ -123,11 +126,11 @@ if (StrUtil.isEmpty(presentPrice)) { return new FebsResponse().fail().message("商品规格现价不能为空"); } - if (StrUtil.isEmpty(addSku.getLevelOnePrice()) - || StrUtil.isEmpty(addSku.getLevelTwoPrice()) - || StrUtil.isEmpty(addSku.getLevelThreePrice())) { - return new FebsResponse().fail().message("商品规格级别价格不能为空"); - } +// if (StrUtil.isEmpty(addSku.getLevelOnePrice()) +// || StrUtil.isEmpty(addSku.getLevelTwoPrice()) +// || StrUtil.isEmpty(addSku.getLevelThreePrice())) { +// return new FebsResponse().fail().message("商品规格级别价格不能为空"); +// } BigDecimal goodsWeight = addSku.getGoodsWeight(); if(BigDecimal.ZERO.compareTo(goodsWeight) > 0){ return new FebsResponse().fail().message("重量不能小于零"); @@ -236,8 +239,8 @@ mallGoodsSku.setStock(addMallGoodsSkuDto.getStock() == null ? 0 : addMallGoodsSkuDto.getStock()); mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); mallGoodsSku.setOriginalPrice(new BigDecimal(addMallGoodsSkuDto.getOriginalPrice())); -// mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getPresentPrice())); - mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getOriginalPrice())); + mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getPresentPrice())); +// mallGoodsSku.setPresentPrice(new BigDecimal(addMallGoodsSkuDto.getOriginalPrice())); mallGoodsSku.setLevelOnePrice(new BigDecimal(addMallGoodsSkuDto.getLevelOnePrice())); mallGoodsSku.setLevelTwoPrice(new BigDecimal(addMallGoodsSkuDto.getLevelTwoPrice())); @@ -551,8 +554,8 @@ mallGoodsSku.setStock(addMallGoodsSkuDto.getStock() == null ? 0 : addMallGoodsSkuDto.getStock()); mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); -// mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); - mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getOriginalPrice()); + mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); +// mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getOriginalPrice()); mallGoodsSku.setLevelOnePrice(addMallGoodsSkuDto.getLevelOnePrice()); mallGoodsSku.setLevelTwoPrice(addMallGoodsSkuDto.getLevelTwoPrice()); mallGoodsSku.setLevelThreePrice(addMallGoodsSkuDto.getLevelThreePrice()); @@ -571,8 +574,8 @@ mallGoodsSku.setStock(addMallGoodsSkuDto.getStock() == null ? 0 : addMallGoodsSkuDto.getStock()); mallGoodsSku.setSkuVolume(addMallGoodsSkuDto.getSkuVolume() == null ? 0 : addMallGoodsSkuDto.getSkuVolume()); mallGoodsSku.setOriginalPrice(addMallGoodsSkuDto.getOriginalPrice()); -// mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); - mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getOriginalPrice()); + mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getPresentPrice()); +// mallGoodsSku.setPresentPrice(addMallGoodsSkuDto.getOriginalPrice()); mallGoodsSku.setLevelOnePrice(addMallGoodsSkuDto.getLevelOnePrice()); mallGoodsSku.setLevelTwoPrice(addMallGoodsSkuDto.getLevelTwoPrice()); mallGoodsSku.setLevelThreePrice(addMallGoodsSkuDto.getLevelThreePrice()); @@ -863,6 +866,7 @@ mallGoodsCoupon.setName(name); mallGoodsCoupon.setExpireDay(couponRuleAddDto.getExpireDay()); mallGoodsCoupon.setCostAmount(couponRuleAddDto.getCostAmount()); + mallGoodsCoupon.setType(couponRuleAddDto.getType()); mallGoodsCoupon.setRealAmount(couponRuleAddDto.getRealAmount()); mallGoodsCouponMapper.insert(mallGoodsCoupon); @@ -945,6 +949,7 @@ mallGoodsCoupon.setName(adminMallGoodsCouponVo.getName()); mallGoodsCoupon.setExpireDay(adminMallGoodsCouponVo.getExpireDay()); mallGoodsCoupon.setCostAmount(adminMallGoodsCouponVo.getCostAmount()); + mallGoodsCoupon.setType(adminMallGoodsCouponVo.getType()); mallGoodsCoupon.setRealAmount(adminMallGoodsCouponVo.getRealAmount()); mallGoodsCouponMapper.updateById(mallGoodsCoupon); -- Gitblit v1.9.1