doum
2025-12-11 c83278063eba3316d24553c88ae75c5f711e8d23
经销商管理
已修改3个文件
54 ■■■■■ 文件已修改
server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java
@@ -33,14 +33,14 @@
    @PreventRepeat
    @ApiOperation("新建")
    @PostMapping("/create")
    @RequiresPermissions("business:goodssku:create")
    @RequiresPermissions("business:goods:create")
    public ApiResponse create(@RequestBody GoodsSku goodsSku) {
        return ApiResponse.success(goodsSkuService.create(goodsSku));
    }
    @ApiOperation("根据ID删除")
    @GetMapping("/delete/{id}")
    @RequiresPermissions("business:goodssku:delete")
    @RequiresPermissions("business:goods:delete")
    public ApiResponse deleteById(@PathVariable Integer id) {
        goodsSkuService.deleteById(id);
        return ApiResponse.success(null);
@@ -48,7 +48,7 @@
    @ApiOperation("批量删除")
    @GetMapping("/delete/batch")
    @RequiresPermissions("business:goodssku:delete")
    @RequiresPermissions("business:goods:delete")
    public ApiResponse deleteByIdInBatch(@RequestParam String ids) {
        String [] idArray = ids.split(",");
        List<Integer> idList = new ArrayList<>();
@@ -61,7 +61,7 @@
    @ApiOperation("根据ID修改")
    @PostMapping("/updateById")
    @RequiresPermissions("business:goodssku:update")
    @RequiresPermissions("business:goods:update")
    public ApiResponse updateById(@RequestBody GoodsSku goodsSku) {
        goodsSkuService.updateById(goodsSku);
        return ApiResponse.success(null);
@@ -69,21 +69,21 @@
    @ApiOperation("分页查询")
    @PostMapping("/page")
    @RequiresPermissions("business:goodssku:query")
    @RequiresPermissions("business:goods:query")
    public ApiResponse<PageData<GoodsSku>> findPage (@RequestBody PageWrap<GoodsSku> pageWrap) {
        return ApiResponse.success(goodsSkuService.findPage(pageWrap));
    }
    @ApiOperation("导出Excel")
    @PostMapping("/exportExcel")
    @RequiresPermissions("business:goodssku:exportExcel")
    @RequiresPermissions("business:goods:exportExcel")
    public void exportExcel (@RequestBody PageWrap<GoodsSku> pageWrap, HttpServletResponse response) {
        ExcelExporter.build(GoodsSku.class).export(goodsSkuService.findPage(pageWrap).getRecords(), "商品SKU规格组信息表", response);
    }
    @ApiOperation("根据ID查询")
    @GetMapping("/{id}")
    @RequiresPermissions("business:goodssku:query")
    @RequiresPermissions("business:goods:query")
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(goodsSkuService.findById(id));
    }
server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java
@@ -10,6 +10,7 @@
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import java.util.List;
/**
 * 轮播图信息表
@@ -125,7 +126,15 @@
    @ApiModelProperty(value = "产品名称")
    @TableField(exist = false)
    private String goodsName;
    @ApiModelProperty(value = "产品数量")
    @TableField(exist = false)
    private int goodsNum;
    @ApiModelProperty(value = "产品数量")
    @TableField(exist = false)
    private List<Integer> goodsIdList;
    @ApiModelProperty(value = "产品集合")
    @TableField(exist = false)
    private List<Goods> goodsList;
}
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
@@ -146,42 +146,15 @@
    }
    public void isCreateParamValid(Goods goods, LoginUserInfo user) {
/*        if (goods.getType() == null) {
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage());
        }*/
    /*    if (Constants.equalsInteger(goods.getType(), Constants.ZERO)) {*/
            //平台商城
            if (StringUtils.isBlank(goods.getName())
                    || goods.getParentCategoryId() == null
                    || goods.getCategoryId() == null
                    || StringUtils.isBlank(goods.getImgurl())
                    || org.apache.commons.collections.CollectionUtils.isEmpty(goods.getFileList())
            ) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage());
            }
     /*   }*/
     /*   if (Constants.equalsInteger(goods.getType(), Constants.ONE)) {
            //咖豆商城
            if (StringUtils.isBlank(goods.getName())
                    || goods.getCategoryId() == null
                    || goods.getBrandId() == null
                    || StringUtils.isBlank(goods.getImgurl())
                    || Objects.isNull(goods.getFileList())
            ) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage());
            }
        }
        if (Constants.equalsInteger(goods.getType(), Constants.TWO)) {
            //咖啡计划商品
            if (StringUtils.isBlank(goods.getName())
                    || StringUtils.isBlank(goods.getImgurl())
                    || StringUtils.isBlank(goods.getLabels())
            ) {
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), ResponseStatus.BAD_REQUEST.getMessage());
            }
        }*/
    }