fix
Helius
2024-01-30 7eb522243fb5dce2b7268fdf0927409d5a3b0d70
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
@@ -73,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("邮费模板不能为空");
                }
            }
        }