Helius
2022-05-17 45924fd6aefe68b6703120ee8018a202cb5a46a8
src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
@@ -73,6 +73,7 @@
                return new FebsResponse().fail().message("商品分类不能为空");
            }
            if (addMallGoodsDto.getIsSku() == 1) {
            List<AddMallGoodsSkuDto> addSkus = addMallGoodsDto.getAddMallGoodsSkuDtos();
            if (CollUtil.isEmpty(addSkus)) {
                return new FebsResponse().fail().message("商品规格不能为空");
@@ -101,6 +102,7 @@
                String presentPrice = addSku.getPresentPrice();
                if (StrUtil.isEmpty(presentPrice)) {
                    return new FebsResponse().fail().message("商品规格现价不能为空");
                    }
                }
            }
        }
@@ -262,10 +264,14 @@
        if (mallGoodsByGoodsNo > 0) {
            return new FebsResponse().fail().message("商品编号不能重复");
        }
        if (mallGoodsUpdateDto.getGoodsType() != 2) {
        Long categoryId = mallGoodsUpdateDto.getCategoryId();
        if (ObjectUtil.isEmpty(categoryId)) {
            return new FebsResponse().fail().message("商品分类不能为空");
        }
            if (mallGoodsUpdateDto.getIsSku() == 1) {
        List<MailGoodsSkuDto> addSkus = mallGoodsUpdateDto.getMailGoodsSkuDto();
        if (CollUtil.isEmpty(addSkus)) {
            return new FebsResponse().fail().message("商品规格不能为空");
@@ -297,6 +303,9 @@
            }
        }
            }
        }
        //新增商品
        MallGoods mallGoods = mallGoodsMapper.selectById(mallGoodsUpdateDto.getId());
        BeanUtil.copyProperties(mallGoodsUpdateDto, mallGoods);
@@ -319,6 +328,10 @@
            }
        }
        if (mallGoodsUpdateDto.getGoodsType() == 2) {
            return new FebsResponse().success().message("编辑成功");
        }
        // 删除已存在sku
        List<Long> delSkuIds = mallGoodsUpdateDto.getDelSkuId();
        if (CollUtil.isNotEmpty(delSkuIds)) {