diff --git a/sql/mysql/optional/mall.sql b/sql/mysql/optional/mall.sql
index 0e8483155..6a4b73e54 100644
--- a/sql/mysql/optional/mall.sql
+++ b/sql/mysql/optional/mall.sql
@@ -163,19 +163,20 @@ COMMIT;
-- Table structure for product_property
-- ----------------------------
DROP TABLE IF EXISTS `product_property`;
-CREATE TABLE `product_property` (
- `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
- `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规格名称',
- `status` tinyint NULL DEFAULT NULL COMMENT '状态: 0 开启 ,1 禁用',
- `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
- `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
- `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
- `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
- `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `idx_name`(`name`(32) ASC) USING BTREE COMMENT '规格名称索引'
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '规格名称';
+CREATE TABLE `product_property` (
+ `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '规格名称',
+ `status` tinyint DEFAULT NULL COMMENT '状态: 0 开启 ,1 禁用',
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+ `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
+ `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
+ `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
+ `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
+ `remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
+ PRIMARY KEY (`id`) USING BTREE,
+ KEY `idx_name` (`name`(32)) USING BTREE COMMENT '规格名称索引'
+) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='规格名称';
-- ----------------------------
-- Records of product_property
@@ -187,19 +188,20 @@ COMMIT;
-- Table structure for product_property_value
-- ----------------------------
DROP TABLE IF EXISTS `product_property_value`;
-CREATE TABLE `product_property_value` (
- `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
- `property_id` bigint NULL DEFAULT NULL COMMENT '规格键id',
- `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规格值名字',
- `status` tinyint NULL DEFAULT NULL COMMENT '状态: 1 开启 ,2 禁用',
- `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
- `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
- `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
- `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
- `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
- PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '规格值';
+CREATE TABLE `product_property_value` (
+ `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
+ `property_id` bigint DEFAULT NULL COMMENT '规格键id',
+ `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '规格值名字',
+ `status` tinyint DEFAULT NULL COMMENT '状态: 1 开启 ,2 禁用',
+ `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+ `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
+ `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
+ `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人',
+ `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号',
+ `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
+ `remark` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
+ PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='规格值';
-- ----------------------------
-- Records of product_property_value
@@ -325,3 +327,36 @@ INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `
INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0');
INSERT INTO `ruoyi-vue-pro`.`system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2029, 'Banner删除', 'market:banner:delete', 3, 4, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0');
+INSERT INTO `system_dict_data`(`sort`,`label`,`value`,`dict_type`,`status`,`color_type`,`css_class`,`remark`,`creator`,`create_time`,`updater`,`update_time`,`deleted`) VALUES
+ (1,'打',2,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'盒',3,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'袋',4,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'箱',5,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'套',6,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'包',7,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'双',8,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'卷',9,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'张',10,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'克',11,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'千克',12,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'毫克',13,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'微克',14,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'吨',15,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'升',16,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1,'毫升',17,'product_unit',0,'','','',1, NOW(),1, NOW(),0),
+ (1, '平方米', 18, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '平方千米', 19, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '平方英里', 20, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '平方码', 21, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '平方英尺', 22, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '立方米', 23, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '立方厘米', 24, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '立方英寸', 25, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '米', 26, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '千米', 27, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '厘米', 28, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '毫米', 29, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '英寸', 30, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '英尺', 31, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1, '码', 32, 'product_unit', 0, '', '', '', 1, NOW(), 1, NOW(), 0),
+ (1,'个',1,'product_unit',0,'','','',1, NOW(),1, NOW(),0);
\ No newline at end of file
diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java
index acce738a7..a11b52b7c 100644
--- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java
+++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java
@@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.product.api.spu.dto;
import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO;
-import cn.iocoder.yudao.module.product.enums.spu.ProductSpuSpecTypeEnum;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import lombok.Data;
diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java
deleted file mode 100644
index 24488df62..000000000
--- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package cn.iocoder.yudao.module.product.enums.spu;
-
-import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.Arrays;
-
-/**
- * 商品 SPU 规格类型
- *
- * @author 芋道源码
- */
-@Getter
-@AllArgsConstructor
-@Deprecated
-public enum ProductSpuSpecTypeEnum implements IntArrayValuable {
-
- RECYCLE(false, "统一规格"),
- DISABLE(true, "多规格");
-
- //public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuSpecTypeEnum::getType).toArray();// TODO 暂时先这样跑起来
- public static final int[] ARRAYS = {};
- /**
- * 规格类型
- */
- private final Boolean type;
- /**
- * 规格名称
- */
- private final String name;
-
- @Override
- public int[] array() {
- return ARRAYS;
- }
-
-}
diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuStatusEnum.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuStatusEnum.java
index 2223cf23d..4ba6124e0 100644
--- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuStatusEnum.java
+++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuStatusEnum.java
@@ -17,7 +17,7 @@ public enum ProductSpuStatusEnum implements IntArrayValuable {
RECYCLE(-1, "回收站"),
DISABLE(0, "下架"),
- ENABLE(1, "上架"),;
+ ENABLE(1, "上架");
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuStatusEnum::getStatus).toArray();
diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuTabTypeEnum.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuTabTypeEnum.java
new file mode 100644
index 000000000..13dfc1a06
--- /dev/null
+++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuTabTypeEnum.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.product.enums.spu;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 商品spu标签枚举类型
+ *
+ * @author HUIHUI
+ */
+@Getter
+@AllArgsConstructor
+public enum ProductSpuTabTypeEnum {
+ FOR_SALE(0,"出售中商品"),
+ IN_WAREHOUSE(1,"仓库中商品"),
+ SOLD_OUT(2,"已售空商品"),
+ ALERT_STOCK(3,"警戒库存"),
+ RECYCLE_BIN(4,"商品回收站");
+ /**
+ * 状态
+ */
+ private final Integer type;
+ /**
+ * 状态名
+ */
+ private final String name;
+}
diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductUnitEnum.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductUnitEnum.java
new file mode 100644
index 000000000..6d463ffb5
--- /dev/null
+++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductUnitEnum.java
@@ -0,0 +1,65 @@
+package cn.iocoder.yudao.module.product.enums.spu;
+
+import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Arrays;
+
+/**
+ * 产品单位枚举
+ *
+ * @author HUIHUI
+ */
+@Getter
+@AllArgsConstructor
+public enum ProductUnitEnum implements IntArrayValuable {
+ PIECE(1, "个"),
+ DOZEN(2, "打"),
+ BOX(3, "盒"),
+ BAG(4, "袋"),
+ CASE(5, "箱"),
+ SET(6, "套"),
+ PACK(7, "包"),
+ PAIR(8, "双"),
+ ROLL(9, "卷"),
+ SHEET(10, "张"),
+ WEIGHT(11, "克"),
+ KILOGRAM(12, "千克"),
+ MILLIGRAM(13, "毫克"),
+ MICROGRAM(14, "微克"),
+ TON(15, "吨"),
+ LITER(16, "升"),
+ MILLILITER(17, "毫升"),
+ SQUARE_METER(19, "平方米"),
+ SQUARE_KILOMETER(20, "平方千米"),
+ SQUARE_MILE(21, "平方英里"),
+ SQUARE_YARD(22, "平方码"),
+ SQUARE_FOOT(23, "平方英尺"),
+ CUBIC_METER(24, "立方米"),
+ CUBIC_CENTIMETER(25, "立方厘米"),
+ CUBIC_INCH(26, "立方英寸"),
+ METER(27, "米"),
+ CENTIMETER(29, "厘米"),
+ MILLIMETER(30, "毫米"),
+ INCH(31, "英寸"),
+ FOOT(32, "英尺"),
+ YARD(33, "码"),
+ ;
+
+ public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductUnitEnum::getStatus).toArray();
+
+ /**
+ * 状态
+ */
+ private final Integer status;
+ /**
+ * 状态名
+ */
+ private final String name;
+
+ @Override
+ public int[] array() {
+ return ARRAYS;
+ }
+}
diff --git a/yudao-module-mall/yudao-module-product-biz/pom.xml b/yudao-module-mall/yudao-module-product-biz/pom.xml
index 8a06a4cde..72c37cb20 100644
--- a/yudao-module-mall/yudao-module-product-biz/pom.xml
+++ b/yudao-module-mall/yudao-module-product-biz/pom.xml
@@ -35,6 +35,10 @@
cn.iocoder.boot
yudao-spring-boot-starter-biz-operatelog
+
+ cn.iocoder.boot
+ yudao-spring-boot-starter-biz-tenant
+
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
index bd063e0ec..0c203b551 100644
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
@@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueServ
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import oracle.jdbc.proxy.annotation.Post;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -81,10 +82,10 @@ public class ProductPropertyController {
return success(ProductPropertyConvert.INSTANCE.convertPage(productPropertyService.getPropertyPage(pageVO)));
}
- @GetMapping("/get-value-list")
+ @PostMapping("/get-value-list")
@Operation(summary = "获得属性项列表")
@PreAuthorize("@ss.hasPermission('product:property:query')")
- public CommonResult> getPropertyAndValueList(@Valid ProductPropertyListReqVO listReqVO) {
+ public CommonResult> getPropertyAndValueList(@Valid @RequestBody ProductPropertyListReqVO listReqVO) {
// 查询属性项
List keys = productPropertyService.getPropertyList(listReqVO);
if (CollUtil.isEmpty(keys)) {
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java
index 92ce6bee0..fbac32712 100644
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyValueController.java
@@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.product.controller.admin.property;
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.crypto.symmetric.AES;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO;
@@ -18,6 +20,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
+import java.util.Arrays;
+import java.util.List;
+
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 商品属性值")
@@ -32,14 +37,14 @@ public class ProductPropertyValueController {
@PostMapping("/create")
@Operation(summary = "创建属性值")
@PreAuthorize("@ss.hasPermission('product:property:create')")
- public CommonResult createProperty(@Valid @RequestBody ProductPropertyValueCreateReqVO createReqVO) {
+ public CommonResult createPropertyValue(@Valid @RequestBody ProductPropertyValueCreateReqVO createReqVO) {
return success(productPropertyValueService.createPropertyValue(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新属性值")
@PreAuthorize("@ss.hasPermission('product:property:update')")
- public CommonResult updateProperty(@Valid @RequestBody ProductPropertyValueUpdateReqVO updateReqVO) {
+ public CommonResult updatePropertyValue(@Valid @RequestBody ProductPropertyValueUpdateReqVO updateReqVO) {
productPropertyValueService.updatePropertyValue(updateReqVO);
return success(true);
}
@@ -48,7 +53,7 @@ public class ProductPropertyValueController {
@Operation(summary = "删除属性值")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('product:property:delete')")
- public CommonResult deleteProperty(@RequestParam("id") Long id) {
+ public CommonResult deletePropertyValue(@RequestParam("id") Long id) {
productPropertyValueService.deletePropertyValue(id);
return success(true);
}
@@ -57,7 +62,7 @@ public class ProductPropertyValueController {
@Operation(summary = "获得属性值")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('product:property:query')")
- public CommonResult getProperty(@RequestParam("id") Long id) {
+ public CommonResult getPropertyValue(@RequestParam("id") Long id) {
return success(ProductPropertyValueConvert.INSTANCE.convert(productPropertyValueService.getPropertyValue(id)));
}
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java
index 242caff84..44935147c 100644
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyListReqVO.java
@@ -4,12 +4,17 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
@Schema(description = "管理后台 - 属性项 List Request VO")
@Data
@ToString(callSuper = true)
public class ProductPropertyListReqVO {
- @Schema(description = "名称", example = "颜色")
+ @Schema(description = "属性名称", example = "颜色")
private String name;
+ @Schema(description = "属性ids", example = "1,2")
+ private List propertyIds;
}
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java
index f28220046..dde623b50 100755
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuBaseVO.java
@@ -38,11 +38,6 @@ public class ProductSkuBaseVO {
@NotNull(message = "图片地址不能为空")
private String picUrl;
- @Schema(description = "SKU 状态", required = true, example = "1")
- @NotNull(message = "SKU 状态不能为空")
- @InEnum(CommonStatusEnum.class)
- private Integer status;
-
@Schema(description = "库存", required = true, example = "1")
@NotNull(message = "库存不能为空")
private Integer stock;
@@ -55,21 +50,14 @@ public class ProductSkuBaseVO {
@Schema(description = "商品体积", example = "1024") // 单位:m^3 平米
private Double volume;
-
- @Schema(description = "商品属性")
- @Data
- @AllArgsConstructor
- @NoArgsConstructor
- public static class Property {
-
- @Schema(description = "属性编号", required = true, example = "1")
- @NotNull(message = "属性编号不能为空")
- private Long propertyId;
-
- @Schema(description = "属性值编号", required = true, example = "1024")
- @NotNull(message = "属性值编号不能为空")
- private Long valueId;
-
- }
-
+ /**
+ * 一级分销的佣金,单位:分
+ */
+ @Schema(description = "一级分销的佣金", example = "1024")
+ private Integer subCommissionFirstPrice;
+ /**
+ * 二级分销的佣金,单位:分
+ */
+ @Schema(description = "二级分销的佣金", example = "1024")
+ private Integer subCommissionSecondPrice;
}
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java
index 496475f99..54de91cf1 100755
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuCreateOrUpdateReqVO.java
@@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
+import lombok.*;
+import javax.validation.constraints.NotNull;
import java.util.List;
@Schema(description = "管理后台 - 商品 SKU 创建/更新 Request VO")
@@ -12,6 +11,21 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductSkuCreateOrUpdateReqVO extends ProductSkuBaseVO {
+ @Schema(description = "商品属性")
+ @Data
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class Property {
+
+ @Schema(description = "属性编号", required = true, example = "1")
+ @NotNull(message = "属性编号不能为空")
+ private Long propertyId;
+
+ @Schema(description = "属性值编号", required = true, example = "1024")
+ @NotNull(message = "属性值编号不能为空")
+ private Long valueId;
+
+ }
/**
* 属性数组
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java
index 95e394ada..11bf4a734 100755
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/ProductSkuRespVO.java
@@ -1,13 +1,15 @@
package cn.iocoder.yudao.module.product.controller.admin.sku.vo;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
+import lombok.*;
+import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;
+/**
+ * @author HUIHUI
+ */
@Schema(description = "管理后台 - 商品 SKU Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@@ -17,9 +19,23 @@ public class ProductSkuRespVO extends ProductSkuBaseVO {
@Schema(description = "主键", required = true, example = "1024")
private Long id;
- @Schema(description = "创建时间")
- private LocalDateTime createTime;
+ @Schema(description = "商品属性")
+ @Data
+ @AllArgsConstructor
+ @NoArgsConstructor
+ public static class Property {
+ @Schema(description = "属性编号", required = true, example = "1")
+ @NotNull(message = "属性编号不能为空")
+ private Long propertyId;
+
+ @Schema(description = "属性值编号", required = true, example = "1024")
+ @NotNull(message = "属性值编号不能为空")
+ private Long valueId;
+
+ @Schema(description = "属性值", example = "1024")
+ private String valueName;
+ }
/**
* 属性数组
*/
diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java
index 85fa93f8e..3a4923bbe 100755
--- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java
+++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/ProductSpuController.java
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;
+import java.util.Map;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@@ -54,6 +55,14 @@ public class ProductSpuController {
return success(true);
}
+ @PutMapping("/updateStatus")
+ @Operation(summary = "更新商品 SPU Status")
+ @PreAuthorize("@ss.hasPermission('product:spu:update')")
+ public CommonResult updateStatus(@Valid @RequestBody ProductSpuUpdateStatusReqVO updateReqVO) {
+ productSpuService.updateStatus(updateReqVO);
+ return success(true);
+ }
+
@DeleteMapping("/delete")
@Operation(summary = "删除商品 SPU")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@@ -68,19 +77,7 @@ public class ProductSpuController {
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('product:spu:query')")
public CommonResult getSpuDetail(@RequestParam("id") Long id) {
- // 获得商品 SPU
- ProductSpuDO spu = productSpuService.getSpu(id);
- if (spu == null) {
- throw exception(SPU_NOT_EXISTS);
- }
-
- // 查询商品 SKU
- List skus = productSkuService.getSkuListBySpuIdAndStatus(spu.getId(), null);
- // 查询商品属性
- List propertyValues = productPropertyValueService
- .getPropertyValueDetailList(ProductSkuConvert.INSTANCE.convertPropertyValueIds(skus));
- // 拼接
- return success(ProductSpuConvert.INSTANCE.convert03(spu, skus, propertyValues));
+ return success(productSpuService.getSpuDetail(id));
}
@GetMapping("/get-simple-list")
@@ -94,8 +91,14 @@ public class ProductSpuController {
@GetMapping("/page")
@Operation(summary = "获得商品 SPU 分页")
@PreAuthorize("@ss.hasPermission('product:spu:query')")
- public CommonResult> getSpuPage(@Valid ProductSpuPageReqVO pageVO) {
+ public CommonResult> getSpuPage(@Valid ProductSpuPageReqVO pageVO) {
return success(ProductSpuConvert.INSTANCE.convertPage(productSpuService.getSpuPage(pageVO)));
}
+ @GetMapping("/tabsCount")
+ @Operation(summary = "获得商品 SPU tabsCount")
+ @PreAuthorize("@ss.hasPermission('product:spu:query')")
+ public CommonResult