From c83278063eba3316d24553c88ae75c5f711e8d23 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 11 十二月 2025 16:01:43 +0800
Subject: [PATCH] 经销商管理
---
server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java | 14 +++++++-------
server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java | 29 +----------------------------
server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java | 11 ++++++++++-
3 files changed, 18 insertions(+), 36 deletions(-)
diff --git a/server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java b/server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java
index a1c3242..e30d720 100644
--- a/server/dmmall_admin/src/main/java/com/doumee/api/business/GoodsSkuController.java
+++ b/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));
}
diff --git a/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java b/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java
index e5d96bb..cc24bb9 100644
--- a/server/dmmall_service/src/main/java/com/doumee/dao/business/model/Banner.java
+++ b/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;
}
diff --git a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java b/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
index 2f111b1..e3eee49 100644
--- a/server/dmmall_service/src/main/java/com/doumee/service/business/impl/GoodsServiceImpl.java
+++ b/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());
- }
- }*/
}
--
Gitblit v1.9.3