Commit 2bbfa402651482fe5bc68cebbc46c581549c95a3
1 parent
657e4d03
调整商品代码生成模块
Showing
41 changed files
with
510 additions
and
689 deletions
sql/mall.sql
| ... | ... | @@ -112,36 +112,40 @@ CREATE TABLE `market_activity` ( |
| 112 | 112 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='促销活动'; |
| 113 | 113 | |
| 114 | 114 | |
| 115 | + | |
| 116 | + | |
| 115 | 117 | -- 规格名称表 |
| 116 | -drop table if exists product_attr_key; | |
| 117 | -create table product_attr_key | |
| 118 | +drop table if exists product_property; | |
| 119 | +create table product_property | |
| 118 | 120 | ( |
| 119 | - id int comment '主键', | |
| 120 | - create_time datetime default current_timestamp comment '创建时间', | |
| 121 | - update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 121 | + id bigint comment '主键', | |
| 122 | + name varchar(64) comment '规格名称', | |
| 123 | + status tinyint comment '状态: 0 开启 ,1 禁用', | |
| 124 | + create_time datetime default current_timestamp comment '创建时间', | |
| 125 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 122 | 126 | creator varchar(64) comment '创建人', |
| 123 | 127 | updater varchar(64) comment '更新人', |
| 128 | + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', | |
| 124 | 129 | deleted bit(1) comment '状态', |
| 125 | - attr_name varchar(64) comment '规格名称', | |
| 126 | - status tinyint comment '状态: 1 开启 ,2 禁用', | |
| 127 | 130 | primary key (id), |
| 128 | - key idx_name (attr_name(32)) comment '规格名称索引' | |
| 131 | + key idx_name (name(32)) comment '规格名称索引' | |
| 129 | 132 | ) comment '规格名称' character set utf8mb4 |
| 130 | 133 | collate utf8mb4_general_ci; |
| 131 | 134 | |
| 132 | 135 | -- 规格值表 |
| 133 | -drop table if exists product_attr_value; | |
| 134 | -create table product_attr_value | |
| 136 | +drop table if exists product_property_value; | |
| 137 | +create table product_property_value | |
| 135 | 138 | ( |
| 136 | - id int comment '主键', | |
| 137 | - create_time datetime default current_timestamp comment '创建时间', | |
| 138 | - update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 139 | - creator varchar(64) comment '创建人', | |
| 140 | - updater varchar(64) comment '更新人', | |
| 141 | - deleted bit(1) comment '状态', | |
| 142 | - attr_key_id varchar(64) comment '规格键id', | |
| 143 | - attr_value_name varchar(128) comment '规格值名字', | |
| 144 | - status tinyint comment '状态: 1 开启 ,2 禁用', | |
| 139 | + id int comment '主键', | |
| 140 | + property_id bigint comment '规格键id', | |
| 141 | + name varchar(128) comment '规格值名字', | |
| 142 | + status tinyint comment '状态: 1 开启 ,2 禁用', | |
| 143 | + create_time datetime default current_timestamp comment '创建时间', | |
| 144 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 145 | + creator varchar(64) comment '创建人', | |
| 146 | + updater varchar(64) comment '更新人', | |
| 147 | + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', | |
| 148 | + deleted bit(1) comment '状态', | |
| 145 | 149 | primary key (id) |
| 146 | 150 | ) comment '规格值' character set utf8mb4 |
| 147 | 151 | collate utf8mb4_general_ci; |
| ... | ... | @@ -150,23 +154,23 @@ create table product_attr_value |
| 150 | 154 | drop table if exists product_spu; |
| 151 | 155 | create table product_spu |
| 152 | 156 | ( |
| 153 | - id int comment '主键', | |
| 154 | - create_time datetime default current_timestamp comment '创建时间', | |
| 155 | - update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 156 | - creator varchar(64) comment '创建人', | |
| 157 | - updater varchar(64) comment '更新人', | |
| 158 | - deleted bit(1) comment '状态', | |
| 159 | - name varchar(128) comment '商品名称', | |
| 160 | - visible bit(1) comment '上下架状态: true 上架,false 下架', | |
| 161 | - sell_point varchar(128) not null comment '卖点', | |
| 162 | - description text not null comment '描述', | |
| 163 | - cid int not null comment '分类id', | |
| 164 | - list_pic_url varchar(128) comment '列表图', | |
| 165 | - pic_urls varchar(1024) not null default '' comment '商品主图地址, 数组,以逗号分隔, 最多上传15张', | |
| 166 | - sort int not null default 0 comment '排序字段', | |
| 167 | - like_count int comment '点赞初始人数', | |
| 168 | - price int comment '价格', | |
| 169 | - quantity int comment '库存数量', | |
| 157 | + id int comment '主键', | |
| 158 | + name varchar(128) comment '商品名称', | |
| 159 | + sell_point varchar(128) not null comment '卖点', | |
| 160 | + description text not null comment '描述', | |
| 161 | + category_id bigint not null comment '分类id', | |
| 162 | + pic_urls varchar(1024) not null default '' comment '商品主图地址\n *\n * 数组,以逗号分隔\n 最多上传15张', | |
| 163 | + sort int not null default 0 comment '排序字段', | |
| 164 | + like_count int comment '点赞初始人数', | |
| 165 | + price int comment '价格 单位使用:分', | |
| 166 | + quantity int comment '库存数量', | |
| 167 | + status bit(1) comment '上下架状态: 0 上架(开启) 1 下架(禁用)', | |
| 168 | + create_time datetime default current_timestamp comment '创建时间', | |
| 169 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 170 | + creator varchar(64) comment '创建人', | |
| 171 | + updater varchar(64) comment '更新人', | |
| 172 | + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', | |
| 173 | + deleted bit(1) comment '状态', | |
| 170 | 174 | primary key (id) |
| 171 | 175 | ) comment '商品spu' character set utf8mb4 |
| 172 | 176 | collate utf8mb4_general_ci; |
| ... | ... | @@ -177,19 +181,22 @@ drop table if exists product_sku; |
| 177 | 181 | create table product_sku |
| 178 | 182 | ( |
| 179 | 183 | id int comment '主键', |
| 180 | - create_time datetime default current_timestamp comment '创建时间', | |
| 181 | - update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 182 | - creator varchar(64) comment '创建人', | |
| 183 | - updater varchar(64) comment '更新人', | |
| 184 | - deleted bit(1) comment '状态', | |
| 185 | - spu_id int not null comment 'spu编号', | |
| 186 | - sku_status tinyint comment '状态: 1-正常 2-禁用', | |
| 187 | - attrs varchar(64) not null comment '规格值数组, 以逗号隔开', | |
| 184 | + spu_id bigint not null comment 'spu编号', | |
| 185 | + properties varchar(64) not null comment '规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]', | |
| 188 | 186 | price int not null DEFAULT -1 comment '销售价格,单位:分', |
| 189 | 187 | original_price int not null DEFAULT -1 comment '原价, 单位: 分', |
| 190 | 188 | cost_price int not null DEFAULT -1 comment '成本价,单位: 分', |
| 191 | 189 | bar_code varchar(64) not null comment '条形码', |
| 192 | 190 | pic_url VARCHAR(128) not null comment '图片地址', |
| 191 | + status tinyint comment '状态: 0-正常 1-禁用', | |
| 192 | + create_time datetime default current_timestamp comment '创建时间', | |
| 193 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 194 | + creator varchar(64) comment '创建人', | |
| 195 | + updater varchar(64) comment '更新人', | |
| 196 | + tenant_id bigint NOT NULL DEFAULT '0' COMMENT '租户编号', | |
| 197 | + deleted bit(1) comment '状态', | |
| 193 | 198 | primary key (id) |
| 194 | 199 | ) comment '商品sku' character set utf8mb4 |
| 195 | - collate utf8mb4_general_ci; | |
| 196 | 200 | \ No newline at end of file |
| 201 | + collate utf8mb4_general_ci; | |
| 202 | + | |
| 203 | + | ... | ... |
yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
| ... | ... | @@ -18,10 +18,10 @@ public interface ErrorCodeConstants { |
| 18 | 18 | ErrorCode BRAND_NOT_EXISTS = new ErrorCode(1008002000, "品牌不存在"); |
| 19 | 19 | |
| 20 | 20 | // ========== 规格名称 1008003000 ========== |
| 21 | - ErrorCode ATTR_KEY_NOT_EXISTS = new ErrorCode(1008003000, "规格名称不存在"); | |
| 21 | + ErrorCode PROPERTY_NOT_EXISTS = new ErrorCode(1008003000, "规格名称不存在"); | |
| 22 | 22 | |
| 23 | 23 | // ========== 规格值 1008004000 ========== |
| 24 | - ErrorCode ATTR_VALUE_NOT_EXISTS = new ErrorCode(1008004000, "规格值不存在"); | |
| 24 | + ErrorCode PROPERTY_VALUE_NOT_EXISTS = new ErrorCode(1008004000, "规格值不存在"); | |
| 25 | 25 | |
| 26 | 26 | // ========== 商品spu 1008005000 ========== |
| 27 | 27 | ErrorCode SPU_NOT_EXISTS = new ErrorCode(1008005000, "商品spu不存在"); | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/AttrKeyController.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/PropertyController.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property; | |
| 2 | 2 | |
| 3 | 3 | import org.springframework.web.bind.annotation.*; |
| 4 | 4 | import javax.annotation.Resource; |
| ... | ... | @@ -21,80 +21,80 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 21 | 21 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 22 | 22 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; |
| 23 | 23 | |
| 24 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 25 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 26 | -import cn.iocoder.yudao.module.product.convert.attrkey.AttrKeyConvert; | |
| 27 | -import cn.iocoder.yudao.module.product.service.attrkey.AttrKeyService; | |
| 24 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | |
| 25 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | |
| 26 | +import cn.iocoder.yudao.module.product.convert.property.PropertyConvert; | |
| 27 | +import cn.iocoder.yudao.module.product.service.property.PropertyService; | |
| 28 | 28 | |
| 29 | 29 | @Api(tags = "管理后台 - 规格名称") |
| 30 | 30 | @RestController |
| 31 | -@RequestMapping("/product/attr-key") | |
| 31 | +@RequestMapping("/product/property") | |
| 32 | 32 | @Validated |
| 33 | -public class AttrKeyController { | |
| 33 | +public class PropertyController { | |
| 34 | 34 | |
| 35 | 35 | @Resource |
| 36 | - private AttrKeyService attrKeyService; | |
| 36 | + private PropertyService propertyService; | |
| 37 | 37 | |
| 38 | 38 | @PostMapping("/create") |
| 39 | 39 | @ApiOperation("创建规格名称") |
| 40 | - @PreAuthorize("@ss.hasPermission('product:attr-key:create')") | |
| 41 | - public CommonResult<Integer> createAttrKey(@Valid @RequestBody AttrKeyCreateReqVO createReqVO) { | |
| 42 | - return success(attrKeyService.createAttrKey(createReqVO)); | |
| 40 | + @PreAuthorize("@ss.hasPermission('product:property:create')") | |
| 41 | + public CommonResult<Long> createProperty(@Valid @RequestBody PropertyCreateReqVO createReqVO) { | |
| 42 | + return success(propertyService.createProperty(createReqVO)); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | @PutMapping("/update") |
| 46 | 46 | @ApiOperation("更新规格名称") |
| 47 | - @PreAuthorize("@ss.hasPermission('product:attr-key:update')") | |
| 48 | - public CommonResult<Boolean> updateAttrKey(@Valid @RequestBody AttrKeyUpdateReqVO updateReqVO) { | |
| 49 | - attrKeyService.updateAttrKey(updateReqVO); | |
| 47 | + @PreAuthorize("@ss.hasPermission('product:property:update')") | |
| 48 | + public CommonResult<Boolean> updateProperty(@Valid @RequestBody PropertyUpdateReqVO updateReqVO) { | |
| 49 | + propertyService.updateProperty(updateReqVO); | |
| 50 | 50 | return success(true); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | @DeleteMapping("/delete") |
| 54 | 54 | @ApiOperation("删除规格名称") |
| 55 | - @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) | |
| 56 | - @PreAuthorize("@ss.hasPermission('product:attr-key:delete')") | |
| 57 | - public CommonResult<Boolean> deleteAttrKey(@RequestParam("id") Integer id) { | |
| 58 | - attrKeyService.deleteAttrKey(id); | |
| 55 | + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | |
| 56 | + @PreAuthorize("@ss.hasPermission('product:property:delete')") | |
| 57 | + public CommonResult<Boolean> deleteProperty(@RequestParam("id") Long id) { | |
| 58 | + propertyService.deleteProperty(id); | |
| 59 | 59 | return success(true); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | @GetMapping("/get") |
| 63 | 63 | @ApiOperation("获得规格名称") |
| 64 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) | |
| 65 | - @PreAuthorize("@ss.hasPermission('product:attr-key:query')") | |
| 66 | - public CommonResult<AttrKeyRespVO> getAttrKey(@RequestParam("id") Integer id) { | |
| 67 | - AttrKeyDO attrKey = attrKeyService.getAttrKey(id); | |
| 68 | - return success(AttrKeyConvert.INSTANCE.convert(attrKey)); | |
| 64 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 65 | + @PreAuthorize("@ss.hasPermission('product:property:query')") | |
| 66 | + public CommonResult<PropertyRespVO> getProperty(@RequestParam("id") Long id) { | |
| 67 | + PropertyDO property = propertyService.getProperty(id); | |
| 68 | + return success(PropertyConvert.INSTANCE.convert(property)); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @GetMapping("/list") |
| 72 | 72 | @ApiOperation("获得规格名称列表") |
| 73 | 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | - @PreAuthorize("@ss.hasPermission('product:attr-key:query')") | |
| 75 | - public CommonResult<List<AttrKeyRespVO>> getAttrKeyList(@RequestParam("ids") Collection<Integer> ids) { | |
| 76 | - List<AttrKeyDO> list = attrKeyService.getAttrKeyList(ids); | |
| 77 | - return success(AttrKeyConvert.INSTANCE.convertList(list)); | |
| 74 | + @PreAuthorize("@ss.hasPermission('product:property:query')") | |
| 75 | + public CommonResult<List<PropertyRespVO>> getPropertyList(@RequestParam("ids") Collection<Long> ids) { | |
| 76 | + List<PropertyDO> list = propertyService.getPropertyList(ids); | |
| 77 | + return success(PropertyConvert.INSTANCE.convertList(list)); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | @GetMapping("/page") |
| 81 | 81 | @ApiOperation("获得规格名称分页") |
| 82 | - @PreAuthorize("@ss.hasPermission('product:attr-key:query')") | |
| 83 | - public CommonResult<PageResult<AttrKeyRespVO>> getAttrKeyPage(@Valid AttrKeyPageReqVO pageVO) { | |
| 84 | - PageResult<AttrKeyDO> pageResult = attrKeyService.getAttrKeyPage(pageVO); | |
| 85 | - return success(AttrKeyConvert.INSTANCE.convertPage(pageResult)); | |
| 82 | + @PreAuthorize("@ss.hasPermission('product:property:query')") | |
| 83 | + public CommonResult<PageResult<PropertyRespVO>> getPropertyPage(@Valid PropertyPageReqVO pageVO) { | |
| 84 | + PageResult<PropertyDO> pageResult = propertyService.getPropertyPage(pageVO); | |
| 85 | + return success(PropertyConvert.INSTANCE.convertPage(pageResult)); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | @GetMapping("/export-excel") |
| 89 | 89 | @ApiOperation("导出规格名称 Excel") |
| 90 | - @PreAuthorize("@ss.hasPermission('product:attr-key:export')") | |
| 90 | + @PreAuthorize("@ss.hasPermission('product:property:export')") | |
| 91 | 91 | @OperateLog(type = EXPORT) |
| 92 | - public void exportAttrKeyExcel(@Valid AttrKeyExportReqVO exportReqVO, | |
| 92 | + public void exportPropertyExcel(@Valid PropertyExportReqVO exportReqVO, | |
| 93 | 93 | HttpServletResponse response) throws IOException { |
| 94 | - List<AttrKeyDO> list = attrKeyService.getAttrKeyList(exportReqVO); | |
| 94 | + List<PropertyDO> list = propertyService.getPropertyList(exportReqVO); | |
| 95 | 95 | // 导出 Excel |
| 96 | - List<AttrKeyExcelVO> datas = AttrKeyConvert.INSTANCE.convertList02(list); | |
| 97 | - ExcelUtils.write(response, "规格名称.xls", "数据", AttrKeyExcelVO.class, datas); | |
| 96 | + List<PropertyExcelVO> datas = PropertyConvert.INSTANCE.convertList02(list); | |
| 97 | + ExcelUtils.write(response, "规格名称.xls", "数据", PropertyExcelVO.class, datas); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -9,6 +9,6 @@ import javax.validation.constraints.*; |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class AttrKeyCreateReqVO extends AttrKeyBaseVO { | |
| 12 | +public class PropertyCreateReqVO extends PropertyBaseVO { | |
| 13 | 13 | |
| 14 | 14 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyExcelVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyExcelVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -12,18 +12,18 @@ import com.alibaba.excel.annotation.ExcelProperty; |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | 14 | @Data |
| 15 | -public class AttrKeyExcelVO { | |
| 15 | +public class PropertyExcelVO { | |
| 16 | 16 | |
| 17 | 17 | @ExcelProperty("主键") |
| 18 | - private Integer id; | |
| 19 | - | |
| 20 | - @ExcelProperty("创建时间") | |
| 21 | - private Date createTime; | |
| 18 | + private Long id; | |
| 22 | 19 | |
| 23 | 20 | @ExcelProperty("规格名称") |
| 24 | - private String attrName; | |
| 21 | + private String name; | |
| 25 | 22 | |
| 26 | - @ExcelProperty("状态: 1 开启 ,2 禁用") | |
| 23 | + @ExcelProperty("状态: 0 开启 ,1 禁用") | |
| 27 | 24 | private Integer status; |
| 28 | 25 | |
| 26 | + @ExcelProperty("创建时间") | |
| 27 | + private Date createTime; | |
| 28 | + | |
| 29 | 29 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyExportReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyExportReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -8,9 +8,15 @@ import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 8 | |
| 9 | 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 10 | 10 | |
| 11 | -@ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 AttrKeyPageReqVO 是一致的") | |
| 11 | +@ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 PropertyPageReqVO 是一致的") | |
| 12 | 12 | @Data |
| 13 | -public class AttrKeyExportReqVO { | |
| 13 | +public class PropertyExportReqVO { | |
| 14 | + | |
| 15 | + @ApiModelProperty(value = "规格名称") | |
| 16 | + private String name; | |
| 17 | + | |
| 18 | + @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") | |
| 19 | + private Integer status; | |
| 14 | 20 | |
| 15 | 21 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 16 | 22 | @ApiModelProperty(value = "开始创建时间") |
| ... | ... | @@ -20,10 +26,4 @@ public class AttrKeyExportReqVO { |
| 20 | 26 | @ApiModelProperty(value = "结束创建时间") |
| 21 | 27 | private Date endCreateTime; |
| 22 | 28 | |
| 23 | - @ApiModelProperty(value = "规格名称") | |
| 24 | - private String attrName; | |
| 25 | - | |
| 26 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 27 | - private Integer status; | |
| 28 | - | |
| 29 | 29 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyPageReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -12,7 +12,13 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 12 | 12 | @Data |
| 13 | 13 | @EqualsAndHashCode(callSuper = true) |
| 14 | 14 | @ToString(callSuper = true) |
| 15 | -public class AttrKeyPageReqVO extends PageParam { | |
| 15 | +public class PropertyPageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "规格名称") | |
| 18 | + private String name; | |
| 19 | + | |
| 20 | + @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") | |
| 21 | + private Integer status; | |
| 16 | 22 | |
| 17 | 23 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 18 | 24 | @ApiModelProperty(value = "开始创建时间") |
| ... | ... | @@ -22,10 +28,4 @@ public class AttrKeyPageReqVO extends PageParam { |
| 22 | 28 | @ApiModelProperty(value = "结束创建时间") |
| 23 | 29 | private Date endCreateTime; |
| 24 | 30 | |
| 25 | - @ApiModelProperty(value = "规格名称") | |
| 26 | - private String attrName; | |
| 27 | - | |
| 28 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 29 | - private Integer status; | |
| 30 | - | |
| 31 | 31 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyRespVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -8,10 +8,10 @@ import io.swagger.annotations.*; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class AttrKeyRespVO extends AttrKeyBaseVO { | |
| 11 | +public class PropertyRespVO extends PropertyBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "主键", required = true) |
| 14 | - private Integer id; | |
| 14 | + private Long id; | |
| 15 | 15 | |
| 16 | 16 | @ApiModelProperty(value = "创建时间") |
| 17 | 17 | private Date createTime; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrkey/vo/AttrKeyUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrkey.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -9,10 +9,10 @@ import javax.validation.constraints.*; |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class AttrKeyUpdateReqVO extends AttrKeyBaseVO { | |
| 12 | +public class PropertyUpdateReqVO extends PropertyBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @ApiModelProperty(value = "主键", required = true) |
| 15 | 15 | @NotNull(message = "主键不能为空") |
| 16 | - private Integer id; | |
| 16 | + private Long id; | |
| 17 | 17 | |
| 18 | 18 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/AttrValueController.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/PropertyValueController.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue; | |
| 2 | 2 | |
| 3 | 3 | import org.springframework.web.bind.annotation.*; |
| 4 | 4 | import javax.annotation.Resource; |
| ... | ... | @@ -21,80 +21,80 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| 21 | 21 | import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; |
| 22 | 22 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; |
| 23 | 23 | |
| 24 | -import cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo.*; | |
| 25 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrvalue.AttrValueDO; | |
| 26 | -import cn.iocoder.yudao.module.product.convert.attrvalue.AttrValueConvert; | |
| 27 | -import cn.iocoder.yudao.module.product.service.attrvalue.AttrValueService; | |
| 24 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 25 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 26 | +import cn.iocoder.yudao.module.product.convert.propertyvalue.PropertyValueConvert; | |
| 27 | +import cn.iocoder.yudao.module.product.service.propertyvalue.PropertyValueService; | |
| 28 | 28 | |
| 29 | 29 | @Api(tags = "管理后台 - 规格值") |
| 30 | 30 | @RestController |
| 31 | -@RequestMapping("/product/attr-value") | |
| 31 | +@RequestMapping("/product/property-value") | |
| 32 | 32 | @Validated |
| 33 | -public class AttrValueController { | |
| 33 | +public class PropertyValueController { | |
| 34 | 34 | |
| 35 | 35 | @Resource |
| 36 | - private AttrValueService attrValueService; | |
| 36 | + private PropertyValueService propertyValueService; | |
| 37 | 37 | |
| 38 | 38 | @PostMapping("/create") |
| 39 | 39 | @ApiOperation("创建规格值") |
| 40 | - @PreAuthorize("@ss.hasPermission('product:attr-value:create')") | |
| 41 | - public CommonResult<Integer> createAttrValue(@Valid @RequestBody AttrValueCreateReqVO createReqVO) { | |
| 42 | - return success(attrValueService.createAttrValue(createReqVO)); | |
| 40 | + @PreAuthorize("@ss.hasPermission('product:property-value:create')") | |
| 41 | + public CommonResult<Integer> createPropertyValue(@Valid @RequestBody PropertyValueCreateReqVO createReqVO) { | |
| 42 | + return success(propertyValueService.createPropertyValue(createReqVO)); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | @PutMapping("/update") |
| 46 | 46 | @ApiOperation("更新规格值") |
| 47 | - @PreAuthorize("@ss.hasPermission('product:attr-value:update')") | |
| 48 | - public CommonResult<Boolean> updateAttrValue(@Valid @RequestBody AttrValueUpdateReqVO updateReqVO) { | |
| 49 | - attrValueService.updateAttrValue(updateReqVO); | |
| 47 | + @PreAuthorize("@ss.hasPermission('product:property-value:update')") | |
| 48 | + public CommonResult<Boolean> updatePropertyValue(@Valid @RequestBody PropertyValueUpdateReqVO updateReqVO) { | |
| 49 | + propertyValueService.updatePropertyValue(updateReqVO); | |
| 50 | 50 | return success(true); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | @DeleteMapping("/delete") |
| 54 | 54 | @ApiOperation("删除规格值") |
| 55 | 55 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Integer.class) |
| 56 | - @PreAuthorize("@ss.hasPermission('product:attr-value:delete')") | |
| 57 | - public CommonResult<Boolean> deleteAttrValue(@RequestParam("id") Integer id) { | |
| 58 | - attrValueService.deleteAttrValue(id); | |
| 56 | + @PreAuthorize("@ss.hasPermission('product:property-value:delete')") | |
| 57 | + public CommonResult<Boolean> deletePropertyValue(@RequestParam("id") Integer id) { | |
| 58 | + propertyValueService.deletePropertyValue(id); | |
| 59 | 59 | return success(true); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | @GetMapping("/get") |
| 63 | 63 | @ApiOperation("获得规格值") |
| 64 | 64 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Integer.class) |
| 65 | - @PreAuthorize("@ss.hasPermission('product:attr-value:query')") | |
| 66 | - public CommonResult<AttrValueRespVO> getAttrValue(@RequestParam("id") Integer id) { | |
| 67 | - AttrValueDO attrValue = attrValueService.getAttrValue(id); | |
| 68 | - return success(AttrValueConvert.INSTANCE.convert(attrValue)); | |
| 65 | + @PreAuthorize("@ss.hasPermission('product:property-value:query')") | |
| 66 | + public CommonResult<PropertyValueRespVO> getPropertyValue(@RequestParam("id") Integer id) { | |
| 67 | + PropertyValueDO propertyValue = propertyValueService.getPropertyValue(id); | |
| 68 | + return success(PropertyValueConvert.INSTANCE.convert(propertyValue)); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @GetMapping("/list") |
| 72 | 72 | @ApiOperation("获得规格值列表") |
| 73 | 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | - @PreAuthorize("@ss.hasPermission('product:attr-value:query')") | |
| 75 | - public CommonResult<List<AttrValueRespVO>> getAttrValueList(@RequestParam("ids") Collection<Integer> ids) { | |
| 76 | - List<AttrValueDO> list = attrValueService.getAttrValueList(ids); | |
| 77 | - return success(AttrValueConvert.INSTANCE.convertList(list)); | |
| 74 | + @PreAuthorize("@ss.hasPermission('product:property-value:query')") | |
| 75 | + public CommonResult<List<PropertyValueRespVO>> getPropertyValueList(@RequestParam("ids") Collection<Integer> ids) { | |
| 76 | + List<PropertyValueDO> list = propertyValueService.getPropertyValueList(ids); | |
| 77 | + return success(PropertyValueConvert.INSTANCE.convertList(list)); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | @GetMapping("/page") |
| 81 | 81 | @ApiOperation("获得规格值分页") |
| 82 | - @PreAuthorize("@ss.hasPermission('product:attr-value:query')") | |
| 83 | - public CommonResult<PageResult<AttrValueRespVO>> getAttrValuePage(@Valid AttrValuePageReqVO pageVO) { | |
| 84 | - PageResult<AttrValueDO> pageResult = attrValueService.getAttrValuePage(pageVO); | |
| 85 | - return success(AttrValueConvert.INSTANCE.convertPage(pageResult)); | |
| 82 | + @PreAuthorize("@ss.hasPermission('product:property-value:query')") | |
| 83 | + public CommonResult<PageResult<PropertyValueRespVO>> getPropertyValuePage(@Valid PropertyValuePageReqVO pageVO) { | |
| 84 | + PageResult<PropertyValueDO> pageResult = propertyValueService.getPropertyValuePage(pageVO); | |
| 85 | + return success(PropertyValueConvert.INSTANCE.convertPage(pageResult)); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | @GetMapping("/export-excel") |
| 89 | 89 | @ApiOperation("导出规格值 Excel") |
| 90 | - @PreAuthorize("@ss.hasPermission('product:attr-value:export')") | |
| 90 | + @PreAuthorize("@ss.hasPermission('product:property-value:export')") | |
| 91 | 91 | @OperateLog(type = EXPORT) |
| 92 | - public void exportAttrValueExcel(@Valid AttrValueExportReqVO exportReqVO, | |
| 92 | + public void exportPropertyValueExcel(@Valid PropertyValueExportReqVO exportReqVO, | |
| 93 | 93 | HttpServletResponse response) throws IOException { |
| 94 | - List<AttrValueDO> list = attrValueService.getAttrValueList(exportReqVO); | |
| 94 | + List<PropertyValueDO> list = propertyValueService.getPropertyValueList(exportReqVO); | |
| 95 | 95 | // 导出 Excel |
| 96 | - List<AttrValueExcelVO> datas = AttrValueConvert.INSTANCE.convertList02(list); | |
| 97 | - ExcelUtils.write(response, "规格值.xls", "数据", AttrValueExcelVO.class, datas); | |
| 96 | + List<PropertyValueExcelVO> datas = PropertyValueConvert.INSTANCE.convertList02(list); | |
| 97 | + ExcelUtils.write(response, "规格值.xls", "数据", PropertyValueExcelVO.class, datas); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueBaseVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueBaseVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -10,13 +10,13 @@ import javax.validation.constraints.*; |
| 10 | 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 11 | 11 | */ |
| 12 | 12 | @Data |
| 13 | -public class AttrValueBaseVO { | |
| 13 | +public class PropertyValueBaseVO { | |
| 14 | 14 | |
| 15 | 15 | @ApiModelProperty(value = "规格键id") |
| 16 | - private String attrKeyId; | |
| 16 | + private Long propertyId; | |
| 17 | 17 | |
| 18 | 18 | @ApiModelProperty(value = "规格值名字") |
| 19 | - private String attrValueName; | |
| 19 | + private String name; | |
| 20 | 20 | |
| 21 | 21 | @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") |
| 22 | 22 | private Integer status; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -9,6 +9,6 @@ import javax.validation.constraints.*; |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class AttrValueCreateReqVO extends AttrValueBaseVO { | |
| 12 | +public class PropertyValueCreateReqVO extends PropertyValueBaseVO { | |
| 13 | 13 | |
| 14 | 14 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueExcelVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueExcelVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -12,21 +12,21 @@ import com.alibaba.excel.annotation.ExcelProperty; |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | 14 | @Data |
| 15 | -public class AttrValueExcelVO { | |
| 15 | +public class PropertyValueExcelVO { | |
| 16 | 16 | |
| 17 | 17 | @ExcelProperty("主键") |
| 18 | 18 | private Integer id; |
| 19 | 19 | |
| 20 | - @ExcelProperty("创建时间") | |
| 21 | - private Date createTime; | |
| 22 | - | |
| 23 | 20 | @ExcelProperty("规格键id") |
| 24 | - private String attrKeyId; | |
| 21 | + private Long propertyId; | |
| 25 | 22 | |
| 26 | 23 | @ExcelProperty("规格值名字") |
| 27 | - private String attrValueName; | |
| 24 | + private String name; | |
| 28 | 25 | |
| 29 | 26 | @ExcelProperty("状态: 1 开启 ,2 禁用") |
| 30 | 27 | private Integer status; |
| 31 | 28 | |
| 29 | + @ExcelProperty("创建时间") | |
| 30 | + private Date createTime; | |
| 31 | + | |
| 32 | 32 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueExportReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueExportReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -8,9 +8,18 @@ import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 8 | |
| 9 | 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 10 | 10 | |
| 11 | -@ApiModel(value = "管理后台 - 规格值 Excel 导出 Request VO", description = "参数和 AttrValuePageReqVO 是一致的") | |
| 11 | +@ApiModel(value = "管理后台 - 规格值 Excel 导出 Request VO", description = "参数和 PropertyValuePageReqVO 是一致的") | |
| 12 | 12 | @Data |
| 13 | -public class AttrValueExportReqVO { | |
| 13 | +public class PropertyValueExportReqVO { | |
| 14 | + | |
| 15 | + @ApiModelProperty(value = "规格键id") | |
| 16 | + private Long propertyId; | |
| 17 | + | |
| 18 | + @ApiModelProperty(value = "规格值名字") | |
| 19 | + private String name; | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 22 | + private Integer status; | |
| 14 | 23 | |
| 15 | 24 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 16 | 25 | @ApiModelProperty(value = "开始创建时间") |
| ... | ... | @@ -20,13 +29,4 @@ public class AttrValueExportReqVO { |
| 20 | 29 | @ApiModelProperty(value = "结束创建时间") |
| 21 | 30 | private Date endCreateTime; |
| 22 | 31 | |
| 23 | - @ApiModelProperty(value = "规格键id") | |
| 24 | - private String attrKeyId; | |
| 25 | - | |
| 26 | - @ApiModelProperty(value = "规格值名字") | |
| 27 | - private String attrValueName; | |
| 28 | - | |
| 29 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 30 | - private Integer status; | |
| 31 | - | |
| 32 | 32 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValuePageReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValuePageReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -12,7 +12,16 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 12 | 12 | @Data |
| 13 | 13 | @EqualsAndHashCode(callSuper = true) |
| 14 | 14 | @ToString(callSuper = true) |
| 15 | -public class AttrValuePageReqVO extends PageParam { | |
| 15 | +public class PropertyValuePageReqVO extends PageParam { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "规格键id") | |
| 18 | + private Long propertyId; | |
| 19 | + | |
| 20 | + @ApiModelProperty(value = "规格值名字") | |
| 21 | + private String name; | |
| 22 | + | |
| 23 | + @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 24 | + private Integer status; | |
| 16 | 25 | |
| 17 | 26 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| 18 | 27 | @ApiModelProperty(value = "开始创建时间") |
| ... | ... | @@ -22,13 +31,4 @@ public class AttrValuePageReqVO extends PageParam { |
| 22 | 31 | @ApiModelProperty(value = "结束创建时间") |
| 23 | 32 | private Date endCreateTime; |
| 24 | 33 | |
| 25 | - @ApiModelProperty(value = "规格键id") | |
| 26 | - private String attrKeyId; | |
| 27 | - | |
| 28 | - @ApiModelProperty(value = "规格值名字") | |
| 29 | - private String attrValueName; | |
| 30 | - | |
| 31 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | |
| 32 | - private Integer status; | |
| 33 | - | |
| 34 | 34 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueRespVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.*; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class AttrValueRespVO extends AttrValueBaseVO { | |
| 11 | +public class PropertyValueRespVO extends PropertyValueBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "主键", required = true) |
| 14 | 14 | private Integer id; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/attrvalue/vo/AttrValueUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/PropertyValueUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo; | |
| 1 | +package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | 4 | import java.util.*; |
| ... | ... | @@ -9,7 +9,7 @@ import javax.validation.constraints.*; |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class AttrValueUpdateReqVO extends AttrValueBaseVO { | |
| 12 | +public class PropertyValueUpdateReqVO extends PropertyValueBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @ApiModelProperty(value = "主键", required = true) |
| 15 | 15 | @NotNull(message = "主键不能为空") | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/SkuBaseVO.java
| ... | ... | @@ -14,14 +14,11 @@ public class SkuBaseVO { |
| 14 | 14 | |
| 15 | 15 | @ApiModelProperty(value = "spu编号", required = true) |
| 16 | 16 | @NotNull(message = "spu编号不能为空") |
| 17 | - private Integer spuId; | |
| 17 | + private Long spuId; | |
| 18 | 18 | |
| 19 | - @ApiModelProperty(value = "状态: 1-正常 2-禁用") | |
| 20 | - private Integer skuStatus; | |
| 21 | - | |
| 22 | - @ApiModelProperty(value = "规格值数组, 以逗号隔开", required = true) | |
| 23 | - @NotNull(message = "规格值数组, 以逗号隔开不能为空") | |
| 24 | - private String attrs; | |
| 19 | + @ApiModelProperty(value = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]", required = true) | |
| 20 | + @NotNull(message = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]不能为空") | |
| 21 | + private String properties; | |
| 25 | 22 | |
| 26 | 23 | @ApiModelProperty(value = "销售价格,单位:分", required = true) |
| 27 | 24 | @NotNull(message = "销售价格,单位:分不能为空") |
| ... | ... | @@ -43,4 +40,7 @@ public class SkuBaseVO { |
| 43 | 40 | @NotNull(message = "图片地址不能为空") |
| 44 | 41 | private String picUrl; |
| 45 | 42 | |
| 43 | + @ApiModelProperty(value = "状态: 0-正常 1-禁用") | |
| 44 | + private Integer status; | |
| 45 | + | |
| 46 | 46 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/SkuExcelVO.java
| ... | ... | @@ -17,17 +17,11 @@ public class SkuExcelVO { |
| 17 | 17 | @ExcelProperty("主键") |
| 18 | 18 | private Integer id; |
| 19 | 19 | |
| 20 | - @ExcelProperty("创建时间") | |
| 21 | - private Date createTime; | |
| 22 | - | |
| 23 | 20 | @ExcelProperty("spu编号") |
| 24 | - private Integer spuId; | |
| 25 | - | |
| 26 | - @ExcelProperty("状态: 1-正常 2-禁用") | |
| 27 | - private Integer skuStatus; | |
| 21 | + private Long spuId; | |
| 28 | 22 | |
| 29 | - @ExcelProperty("规格值数组, 以逗号隔开") | |
| 30 | - private String attrs; | |
| 23 | + @ExcelProperty("规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") | |
| 24 | + private String properties; | |
| 31 | 25 | |
| 32 | 26 | @ExcelProperty("销售价格,单位:分") |
| 33 | 27 | private Integer price; |
| ... | ... | @@ -44,4 +38,10 @@ public class SkuExcelVO { |
| 44 | 38 | @ExcelProperty("图片地址") |
| 45 | 39 | private String picUrl; |
| 46 | 40 | |
| 41 | + @ExcelProperty("状态: 0-正常 1-禁用") | |
| 42 | + private Integer status; | |
| 43 | + | |
| 44 | + @ExcelProperty("创建时间") | |
| 45 | + private Date createTime; | |
| 46 | + | |
| 47 | 47 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/SkuExportReqVO.java
| ... | ... | @@ -12,22 +12,11 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 12 | 12 | @Data |
| 13 | 13 | public class SkuExportReqVO { |
| 14 | 14 | |
| 15 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 16 | - @ApiModelProperty(value = "开始创建时间") | |
| 17 | - private Date beginCreateTime; | |
| 18 | - | |
| 19 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 20 | - @ApiModelProperty(value = "结束创建时间") | |
| 21 | - private Date endCreateTime; | |
| 22 | - | |
| 23 | 15 | @ApiModelProperty(value = "spu编号") |
| 24 | - private Integer spuId; | |
| 25 | - | |
| 26 | - @ApiModelProperty(value = "状态: 1-正常 2-禁用") | |
| 27 | - private Integer skuStatus; | |
| 16 | + private Long spuId; | |
| 28 | 17 | |
| 29 | - @ApiModelProperty(value = "规格值数组, 以逗号隔开") | |
| 30 | - private String attrs; | |
| 18 | + @ApiModelProperty(value = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") | |
| 19 | + private String properties; | |
| 31 | 20 | |
| 32 | 21 | @ApiModelProperty(value = "销售价格,单位:分") |
| 33 | 22 | private Integer price; |
| ... | ... | @@ -44,4 +33,15 @@ public class SkuExportReqVO { |
| 44 | 33 | @ApiModelProperty(value = "图片地址") |
| 45 | 34 | private String picUrl; |
| 46 | 35 | |
| 36 | + @ApiModelProperty(value = "状态: 0-正常 1-禁用") | |
| 37 | + private Integer status; | |
| 38 | + | |
| 39 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 40 | + @ApiModelProperty(value = "开始创建时间") | |
| 41 | + private Date beginCreateTime; | |
| 42 | + | |
| 43 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 44 | + @ApiModelProperty(value = "结束创建时间") | |
| 45 | + private Date endCreateTime; | |
| 46 | + | |
| 47 | 47 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/sku/vo/SkuPageReqVO.java
| ... | ... | @@ -14,22 +14,11 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 14 | 14 | @ToString(callSuper = true) |
| 15 | 15 | public class SkuPageReqVO extends PageParam { |
| 16 | 16 | |
| 17 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 18 | - @ApiModelProperty(value = "开始创建时间") | |
| 19 | - private Date beginCreateTime; | |
| 20 | - | |
| 21 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 22 | - @ApiModelProperty(value = "结束创建时间") | |
| 23 | - private Date endCreateTime; | |
| 24 | - | |
| 25 | 17 | @ApiModelProperty(value = "spu编号") |
| 26 | - private Integer spuId; | |
| 27 | - | |
| 28 | - @ApiModelProperty(value = "状态: 1-正常 2-禁用") | |
| 29 | - private Integer skuStatus; | |
| 18 | + private Long spuId; | |
| 30 | 19 | |
| 31 | - @ApiModelProperty(value = "规格值数组, 以逗号隔开") | |
| 32 | - private String attrs; | |
| 20 | + @ApiModelProperty(value = "规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }]") | |
| 21 | + private String properties; | |
| 33 | 22 | |
| 34 | 23 | @ApiModelProperty(value = "销售价格,单位:分") |
| 35 | 24 | private Integer price; |
| ... | ... | @@ -46,4 +35,15 @@ public class SkuPageReqVO extends PageParam { |
| 46 | 35 | @ApiModelProperty(value = "图片地址") |
| 47 | 36 | private String picUrl; |
| 48 | 37 | |
| 38 | + @ApiModelProperty(value = "状态: 0-正常 1-禁用") | |
| 39 | + private Integer status; | |
| 40 | + | |
| 41 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 42 | + @ApiModelProperty(value = "开始创建时间") | |
| 43 | + private Date beginCreateTime; | |
| 44 | + | |
| 45 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 46 | + @ApiModelProperty(value = "结束创建时间") | |
| 47 | + private Date endCreateTime; | |
| 48 | + | |
| 49 | 49 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuBaseVO.java
| ... | ... | @@ -15,9 +15,6 @@ public class SpuBaseVO { |
| 15 | 15 | @ApiModelProperty(value = "商品名称") |
| 16 | 16 | private String name; |
| 17 | 17 | |
| 18 | - @ApiModelProperty(value = "上下架状态: true 上架,false 下架") | |
| 19 | - private Boolean visible; | |
| 20 | - | |
| 21 | 18 | @ApiModelProperty(value = "卖点", required = true) |
| 22 | 19 | @NotNull(message = "卖点不能为空") |
| 23 | 20 | private String sellPoint; |
| ... | ... | @@ -28,13 +25,10 @@ public class SpuBaseVO { |
| 28 | 25 | |
| 29 | 26 | @ApiModelProperty(value = "分类id", required = true) |
| 30 | 27 | @NotNull(message = "分类id不能为空") |
| 31 | - private Integer cid; | |
| 32 | - | |
| 33 | - @ApiModelProperty(value = "列表图") | |
| 34 | - private String listPicUrl; | |
| 28 | + private Long categoryId; | |
| 35 | 29 | |
| 36 | - @ApiModelProperty(value = "商品主图地址, 数组,以逗号分隔, 最多上传15张", required = true) | |
| 37 | - @NotNull(message = "商品主图地址, 数组,以逗号分隔, 最多上传15张不能为空") | |
| 30 | + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张", required = true) | |
| 31 | + @NotNull(message = "商品主图地址,* 数组,以逗号分隔,最多上传15张不能为空") | |
| 38 | 32 | private String picUrls; |
| 39 | 33 | |
| 40 | 34 | @ApiModelProperty(value = "排序字段", required = true) |
| ... | ... | @@ -44,10 +38,13 @@ public class SpuBaseVO { |
| 44 | 38 | @ApiModelProperty(value = "点赞初始人数") |
| 45 | 39 | private Integer likeCount; |
| 46 | 40 | |
| 47 | - @ApiModelProperty(value = "价格") | |
| 41 | + @ApiModelProperty(value = "价格 单位使用:分") | |
| 48 | 42 | private Integer price; |
| 49 | 43 | |
| 50 | 44 | @ApiModelProperty(value = "库存数量") |
| 51 | 45 | private Integer quantity; |
| 52 | 46 | |
| 47 | + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") | |
| 48 | + private Boolean status; | |
| 49 | + | |
| 53 | 50 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExcelVO.java
| ... | ... | @@ -17,15 +17,9 @@ public class SpuExcelVO { |
| 17 | 17 | @ExcelProperty("主键") |
| 18 | 18 | private Integer id; |
| 19 | 19 | |
| 20 | - @ExcelProperty("创建时间") | |
| 21 | - private Date createTime; | |
| 22 | - | |
| 23 | 20 | @ExcelProperty("商品名称") |
| 24 | 21 | private String name; |
| 25 | 22 | |
| 26 | - @ExcelProperty("上下架状态: true 上架,false 下架") | |
| 27 | - private Boolean visible; | |
| 28 | - | |
| 29 | 23 | @ExcelProperty("卖点") |
| 30 | 24 | private String sellPoint; |
| 31 | 25 | |
| ... | ... | @@ -33,12 +27,9 @@ public class SpuExcelVO { |
| 33 | 27 | private String description; |
| 34 | 28 | |
| 35 | 29 | @ExcelProperty("分类id") |
| 36 | - private Integer cid; | |
| 37 | - | |
| 38 | - @ExcelProperty("列表图") | |
| 39 | - private String listPicUrl; | |
| 30 | + private Long categoryId; | |
| 40 | 31 | |
| 41 | - @ExcelProperty("商品主图地址, 数组,以逗号分隔, 最多上传15张") | |
| 32 | + @ExcelProperty("商品主图地址,* 数组,以逗号分隔,最多上传15张") | |
| 42 | 33 | private String picUrls; |
| 43 | 34 | |
| 44 | 35 | @ExcelProperty("排序字段") |
| ... | ... | @@ -47,10 +38,16 @@ public class SpuExcelVO { |
| 47 | 38 | @ExcelProperty("点赞初始人数") |
| 48 | 39 | private Integer likeCount; |
| 49 | 40 | |
| 50 | - @ExcelProperty("价格") | |
| 41 | + @ExcelProperty("价格 单位使用:分") | |
| 51 | 42 | private Integer price; |
| 52 | 43 | |
| 53 | 44 | @ExcelProperty("库存数量") |
| 54 | 45 | private Integer quantity; |
| 55 | 46 | |
| 47 | + @ExcelProperty("上下架状态: 0 上架(开启) 1 下架(禁用)") | |
| 48 | + private Boolean status; | |
| 49 | + | |
| 50 | + @ExcelProperty("创建时间") | |
| 51 | + private Date createTime; | |
| 52 | + | |
| 56 | 53 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuExportReqVO.java
| ... | ... | @@ -12,20 +12,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 12 | 12 | @Data |
| 13 | 13 | public class SpuExportReqVO { |
| 14 | 14 | |
| 15 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 16 | - @ApiModelProperty(value = "开始创建时间") | |
| 17 | - private Date beginCreateTime; | |
| 18 | - | |
| 19 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 20 | - @ApiModelProperty(value = "结束创建时间") | |
| 21 | - private Date endCreateTime; | |
| 22 | - | |
| 23 | 15 | @ApiModelProperty(value = "商品名称") |
| 24 | 16 | private String name; |
| 25 | 17 | |
| 26 | - @ApiModelProperty(value = "上下架状态: true 上架,false 下架") | |
| 27 | - private Boolean visible; | |
| 28 | - | |
| 29 | 18 | @ApiModelProperty(value = "卖点") |
| 30 | 19 | private String sellPoint; |
| 31 | 20 | |
| ... | ... | @@ -33,12 +22,9 @@ public class SpuExportReqVO { |
| 33 | 22 | private String description; |
| 34 | 23 | |
| 35 | 24 | @ApiModelProperty(value = "分类id") |
| 36 | - private Integer cid; | |
| 37 | - | |
| 38 | - @ApiModelProperty(value = "列表图") | |
| 39 | - private String listPicUrl; | |
| 25 | + private Long categoryId; | |
| 40 | 26 | |
| 41 | - @ApiModelProperty(value = "商品主图地址, 数组,以逗号分隔, 最多上传15张") | |
| 27 | + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张") | |
| 42 | 28 | private String picUrls; |
| 43 | 29 | |
| 44 | 30 | @ApiModelProperty(value = "排序字段") |
| ... | ... | @@ -47,10 +33,21 @@ public class SpuExportReqVO { |
| 47 | 33 | @ApiModelProperty(value = "点赞初始人数") |
| 48 | 34 | private Integer likeCount; |
| 49 | 35 | |
| 50 | - @ApiModelProperty(value = "价格") | |
| 36 | + @ApiModelProperty(value = "价格 单位使用:分") | |
| 51 | 37 | private Integer price; |
| 52 | 38 | |
| 53 | 39 | @ApiModelProperty(value = "库存数量") |
| 54 | 40 | private Integer quantity; |
| 55 | 41 | |
| 42 | + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") | |
| 43 | + private Boolean status; | |
| 44 | + | |
| 45 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 46 | + @ApiModelProperty(value = "开始创建时间") | |
| 47 | + private Date beginCreateTime; | |
| 48 | + | |
| 49 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 50 | + @ApiModelProperty(value = "结束创建时间") | |
| 51 | + private Date endCreateTime; | |
| 52 | + | |
| 56 | 53 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/SpuPageReqVO.java
| ... | ... | @@ -14,20 +14,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 14 | 14 | @ToString(callSuper = true) |
| 15 | 15 | public class SpuPageReqVO extends PageParam { |
| 16 | 16 | |
| 17 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 18 | - @ApiModelProperty(value = "开始创建时间") | |
| 19 | - private Date beginCreateTime; | |
| 20 | - | |
| 21 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 22 | - @ApiModelProperty(value = "结束创建时间") | |
| 23 | - private Date endCreateTime; | |
| 24 | - | |
| 25 | 17 | @ApiModelProperty(value = "商品名称") |
| 26 | 18 | private String name; |
| 27 | 19 | |
| 28 | - @ApiModelProperty(value = "上下架状态: true 上架,false 下架") | |
| 29 | - private Boolean visible; | |
| 30 | - | |
| 31 | 20 | @ApiModelProperty(value = "卖点") |
| 32 | 21 | private String sellPoint; |
| 33 | 22 | |
| ... | ... | @@ -35,12 +24,9 @@ public class SpuPageReqVO extends PageParam { |
| 35 | 24 | private String description; |
| 36 | 25 | |
| 37 | 26 | @ApiModelProperty(value = "分类id") |
| 38 | - private Integer cid; | |
| 39 | - | |
| 40 | - @ApiModelProperty(value = "列表图") | |
| 41 | - private String listPicUrl; | |
| 27 | + private Long categoryId; | |
| 42 | 28 | |
| 43 | - @ApiModelProperty(value = "商品主图地址, 数组,以逗号分隔, 最多上传15张") | |
| 29 | + @ApiModelProperty(value = "商品主图地址,* 数组,以逗号分隔,最多上传15张") | |
| 44 | 30 | private String picUrls; |
| 45 | 31 | |
| 46 | 32 | @ApiModelProperty(value = "排序字段") |
| ... | ... | @@ -49,10 +35,21 @@ public class SpuPageReqVO extends PageParam { |
| 49 | 35 | @ApiModelProperty(value = "点赞初始人数") |
| 50 | 36 | private Integer likeCount; |
| 51 | 37 | |
| 52 | - @ApiModelProperty(value = "价格") | |
| 38 | + @ApiModelProperty(value = "价格 单位使用:分") | |
| 53 | 39 | private Integer price; |
| 54 | 40 | |
| 55 | 41 | @ApiModelProperty(value = "库存数量") |
| 56 | 42 | private Integer quantity; |
| 57 | 43 | |
| 44 | + @ApiModelProperty(value = "上下架状态: 0 上架(开启) 1 下架(禁用)") | |
| 45 | + private Boolean status; | |
| 46 | + | |
| 47 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 48 | + @ApiModelProperty(value = "开始创建时间") | |
| 49 | + private Date beginCreateTime; | |
| 50 | + | |
| 51 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 52 | + @ApiModelProperty(value = "结束创建时间") | |
| 53 | + private Date endCreateTime; | |
| 54 | + | |
| 58 | 55 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/attrvalue/AttrValueConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.product.convert.attrvalue; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | - | |
| 7 | -import org.mapstruct.Mapper; | |
| 8 | -import org.mapstruct.factory.Mappers; | |
| 9 | -import cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo.*; | |
| 10 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrvalue.AttrValueDO; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 规格值 Convert | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface AttrValueConvert { | |
| 19 | - | |
| 20 | - AttrValueConvert INSTANCE = Mappers.getMapper(AttrValueConvert.class); | |
| 21 | - | |
| 22 | - AttrValueDO convert(AttrValueCreateReqVO bean); | |
| 23 | - | |
| 24 | - AttrValueDO convert(AttrValueUpdateReqVO bean); | |
| 25 | - | |
| 26 | - AttrValueRespVO convert(AttrValueDO bean); | |
| 27 | - | |
| 28 | - List<AttrValueRespVO> convertList(List<AttrValueDO> list); | |
| 29 | - | |
| 30 | - PageResult<AttrValueRespVO> convertPage(PageResult<AttrValueDO> page); | |
| 31 | - | |
| 32 | - List<AttrValueExcelVO> convertList02(List<AttrValueDO> list); | |
| 33 | - | |
| 34 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/attrkey/AttrKeyConvert.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/PropertyConvert.java
| 1 | -package cn.iocoder.yudao.module.product.convert.attrkey; | |
| 1 | +package cn.iocoder.yudao.module.product.convert.property; | |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | 4 | |
| ... | ... | @@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | |
| 7 | 7 | import org.mapstruct.Mapper; |
| 8 | 8 | import org.mapstruct.factory.Mappers; |
| 9 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 10 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 9 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * 规格名称 Convert |
| ... | ... | @@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; |
| 15 | 15 | * @author 芋道源码 |
| 16 | 16 | */ |
| 17 | 17 | @Mapper |
| 18 | -public interface AttrKeyConvert { | |
| 18 | +public interface PropertyConvert { | |
| 19 | 19 | |
| 20 | - AttrKeyConvert INSTANCE = Mappers.getMapper(AttrKeyConvert.class); | |
| 20 | + PropertyConvert INSTANCE = Mappers.getMapper(PropertyConvert.class); | |
| 21 | 21 | |
| 22 | - AttrKeyDO convert(AttrKeyCreateReqVO bean); | |
| 22 | + PropertyDO convert(PropertyCreateReqVO bean); | |
| 23 | 23 | |
| 24 | - AttrKeyDO convert(AttrKeyUpdateReqVO bean); | |
| 24 | + PropertyDO convert(PropertyUpdateReqVO bean); | |
| 25 | 25 | |
| 26 | - AttrKeyRespVO convert(AttrKeyDO bean); | |
| 26 | + PropertyRespVO convert(PropertyDO bean); | |
| 27 | 27 | |
| 28 | - List<AttrKeyRespVO> convertList(List<AttrKeyDO> list); | |
| 28 | + List<PropertyRespVO> convertList(List<PropertyDO> list); | |
| 29 | 29 | |
| 30 | - PageResult<AttrKeyRespVO> convertPage(PageResult<AttrKeyDO> page); | |
| 30 | + PageResult<PropertyRespVO> convertPage(PageResult<PropertyDO> page); | |
| 31 | 31 | |
| 32 | - List<AttrKeyExcelVO> convertList02(List<AttrKeyDO> list); | |
| 32 | + List<PropertyExcelVO> convertList02(List<PropertyDO> list); | |
| 33 | 33 | |
| 34 | 34 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/PropertyValueConvert.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.product.convert.propertyvalue; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import org.mapstruct.Mapper; | |
| 8 | +import org.mapstruct.factory.Mappers; | |
| 9 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 10 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 规格值 Convert | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface PropertyValueConvert { | |
| 19 | + | |
| 20 | + PropertyValueConvert INSTANCE = Mappers.getMapper(PropertyValueConvert.class); | |
| 21 | + | |
| 22 | + PropertyValueDO convert(PropertyValueCreateReqVO bean); | |
| 23 | + | |
| 24 | + PropertyValueDO convert(PropertyValueUpdateReqVO bean); | |
| 25 | + | |
| 26 | + PropertyValueRespVO convert(PropertyValueDO bean); | |
| 27 | + | |
| 28 | + List<PropertyValueRespVO> convertList(List<PropertyValueDO> list); | |
| 29 | + | |
| 30 | + PageResult<PropertyValueRespVO> convertPage(PageResult<PropertyValueDO> page); | |
| 31 | + | |
| 32 | + List<PropertyValueExcelVO> convertList02(List<PropertyValueDO> list); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/sku/SkuDO.java
| ... | ... | @@ -28,15 +28,11 @@ public class SkuDO extends BaseDO { |
| 28 | 28 | /** |
| 29 | 29 | * spu编号 |
| 30 | 30 | */ |
| 31 | - private Integer spuId; | |
| 31 | + private Long spuId; | |
| 32 | 32 | /** |
| 33 | - * 状态: 1-正常 2-禁用 | |
| 33 | + * 规格值数组-json格式, [{propertId: , valueId: }, {propertId: , valueId: }] | |
| 34 | 34 | */ |
| 35 | - private Integer skuStatus; | |
| 36 | - /** | |
| 37 | - * 规格值数组, 以逗号隔开 | |
| 38 | - */ | |
| 39 | - private String attrs; | |
| 35 | + private String properties; | |
| 40 | 36 | /** |
| 41 | 37 | * 销售价格,单位:分 |
| 42 | 38 | */ |
| ... | ... | @@ -57,5 +53,9 @@ public class SkuDO extends BaseDO { |
| 57 | 53 | * 图片地址 |
| 58 | 54 | */ |
| 59 | 55 | private String picUrl; |
| 56 | + /** | |
| 57 | + * 状态: 0-正常 1-禁用 | |
| 58 | + */ | |
| 59 | + private Integer status; | |
| 60 | 60 | |
| 61 | 61 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/SpuDO.java
| ... | ... | @@ -30,10 +30,6 @@ public class SpuDO extends BaseDO { |
| 30 | 30 | */ |
| 31 | 31 | private String name; |
| 32 | 32 | /** |
| 33 | - * 上下架状态: true 上架,false 下架 | |
| 34 | - */ | |
| 35 | - private Boolean visible; | |
| 36 | - /** | |
| 37 | 33 | * 卖点 |
| 38 | 34 | */ |
| 39 | 35 | private String sellPoint; |
| ... | ... | @@ -44,13 +40,9 @@ public class SpuDO extends BaseDO { |
| 44 | 40 | /** |
| 45 | 41 | * 分类id |
| 46 | 42 | */ |
| 47 | - private Integer cid; | |
| 48 | - /** | |
| 49 | - * 列表图 | |
| 50 | - */ | |
| 51 | - private String listPicUrl; | |
| 43 | + private Long categoryId; | |
| 52 | 44 | /** |
| 53 | - * 商品主图地址, 数组,以逗号分隔, 最多上传15张 | |
| 45 | + * 商品主图地址,* 数组,以逗号分隔,最多上传15张 | |
| 54 | 46 | */ |
| 55 | 47 | private String picUrls; |
| 56 | 48 | /** |
| ... | ... | @@ -62,12 +54,16 @@ public class SpuDO extends BaseDO { |
| 62 | 54 | */ |
| 63 | 55 | private Integer likeCount; |
| 64 | 56 | /** |
| 65 | - * 价格 | |
| 57 | + * 价格 单位使用:分 | |
| 66 | 58 | */ |
| 67 | 59 | private Integer price; |
| 68 | 60 | /** |
| 69 | 61 | * 库存数量 |
| 70 | 62 | */ |
| 71 | 63 | private Integer quantity; |
| 64 | + /** | |
| 65 | + * 上下架状态: 0 上架(开启) 1 下架(禁用) | |
| 66 | + */ | |
| 67 | + private Boolean status; | |
| 72 | 68 | |
| 73 | 69 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/attrkey/AttrKeyMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.product.dal.mysql.attrkey; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 规格名称 Mapper | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface AttrKeyMapper extends BaseMapperX<AttrKeyDO> { | |
| 19 | - | |
| 20 | - default PageResult<AttrKeyDO> selectPage(AttrKeyPageReqVO reqVO) { | |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<AttrKeyDO>() | |
| 22 | - .betweenIfPresent(AttrKeyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 23 | - .likeIfPresent(AttrKeyDO::getAttrName, reqVO.getAttrName()) | |
| 24 | - .eqIfPresent(AttrKeyDO::getStatus, reqVO.getStatus()) | |
| 25 | - .orderByDesc(AttrKeyDO::getId)); | |
| 26 | - } | |
| 27 | - | |
| 28 | - default List<AttrKeyDO> selectList(AttrKeyExportReqVO reqVO) { | |
| 29 | - return selectList(new LambdaQueryWrapperX<AttrKeyDO>() | |
| 30 | - .betweenIfPresent(AttrKeyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 31 | - .likeIfPresent(AttrKeyDO::getAttrName, reqVO.getAttrName()) | |
| 32 | - .eqIfPresent(AttrKeyDO::getStatus, reqVO.getStatus()) | |
| 33 | - .orderByDesc(AttrKeyDO::getId)); | |
| 34 | - } | |
| 35 | - | |
| 36 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/attrvalue/AttrValueMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.product.dal.mysql.attrvalue; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrvalue.AttrValueDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo.*; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 规格值 Mapper | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface AttrValueMapper extends BaseMapperX<AttrValueDO> { | |
| 19 | - | |
| 20 | - default PageResult<AttrValueDO> selectPage(AttrValuePageReqVO reqVO) { | |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<AttrValueDO>() | |
| 22 | - .betweenIfPresent(AttrValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 23 | - .eqIfPresent(AttrValueDO::getAttrKeyId, reqVO.getAttrKeyId()) | |
| 24 | - .likeIfPresent(AttrValueDO::getAttrValueName, reqVO.getAttrValueName()) | |
| 25 | - .eqIfPresent(AttrValueDO::getStatus, reqVO.getStatus()) | |
| 26 | - .orderByDesc(AttrValueDO::getId)); | |
| 27 | - } | |
| 28 | - | |
| 29 | - default List<AttrValueDO> selectList(AttrValueExportReqVO reqVO) { | |
| 30 | - return selectList(new LambdaQueryWrapperX<AttrValueDO>() | |
| 31 | - .betweenIfPresent(AttrValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 32 | - .eqIfPresent(AttrValueDO::getAttrKeyId, reqVO.getAttrKeyId()) | |
| 33 | - .likeIfPresent(AttrValueDO::getAttrValueName, reqVO.getAttrValueName()) | |
| 34 | - .eqIfPresent(AttrValueDO::getStatus, reqVO.getStatus()) | |
| 35 | - .orderByDesc(AttrValueDO::getId)); | |
| 36 | - } | |
| 37 | - | |
| 38 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/PropertyMapper.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.product.dal.mysql.property; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 规格名称 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface PropertyMapper extends BaseMapperX<PropertyDO> { | |
| 19 | + | |
| 20 | + default PageResult<PropertyDO> selectPage(PropertyPageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<PropertyDO>() | |
| 22 | + .likeIfPresent(PropertyDO::getName, reqVO.getName()) | |
| 23 | + .eqIfPresent(PropertyDO::getStatus, reqVO.getStatus()) | |
| 24 | + .betweenIfPresent(PropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 25 | + .orderByDesc(PropertyDO::getId)); | |
| 26 | + } | |
| 27 | + | |
| 28 | + default List<PropertyDO> selectList(PropertyExportReqVO reqVO) { | |
| 29 | + return selectList(new LambdaQueryWrapperX<PropertyDO>() | |
| 30 | + .likeIfPresent(PropertyDO::getName, reqVO.getName()) | |
| 31 | + .eqIfPresent(PropertyDO::getStatus, reqVO.getStatus()) | |
| 32 | + .betweenIfPresent(PropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 33 | + .orderByDesc(PropertyDO::getId)); | |
| 34 | + } | |
| 35 | + | |
| 36 | +} | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/PropertyValueMapper.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.product.dal.mysql.propertyvalue; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 规格值 Mapper | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 17 | +@Mapper | |
| 18 | +public interface PropertyValueMapper extends BaseMapperX<PropertyValueDO> { | |
| 19 | + | |
| 20 | + default PageResult<PropertyValueDO> selectPage(PropertyValuePageReqVO reqVO) { | |
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<PropertyValueDO>() | |
| 22 | + .eqIfPresent(PropertyValueDO::getPropertyId, reqVO.getPropertyId()) | |
| 23 | + .likeIfPresent(PropertyValueDO::getName, reqVO.getName()) | |
| 24 | + .eqIfPresent(PropertyValueDO::getStatus, reqVO.getStatus()) | |
| 25 | + .betweenIfPresent(PropertyValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 26 | + .orderByDesc(PropertyValueDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default List<PropertyValueDO> selectList(PropertyValueExportReqVO reqVO) { | |
| 30 | + return selectList(new LambdaQueryWrapperX<PropertyValueDO>() | |
| 31 | + .eqIfPresent(PropertyValueDO::getPropertyId, reqVO.getPropertyId()) | |
| 32 | + .likeIfPresent(PropertyValueDO::getName, reqVO.getName()) | |
| 33 | + .eqIfPresent(PropertyValueDO::getStatus, reqVO.getStatus()) | |
| 34 | + .betweenIfPresent(PropertyValueDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 35 | + .orderByDesc(PropertyValueDO::getId)); | |
| 36 | + } | |
| 37 | + | |
| 38 | +} | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/SkuMapper.java
| ... | ... | @@ -19,29 +19,29 @@ public interface SkuMapper extends BaseMapperX<SkuDO> { |
| 19 | 19 | |
| 20 | 20 | default PageResult<SkuDO> selectPage(SkuPageReqVO reqVO) { |
| 21 | 21 | return selectPage(reqVO, new LambdaQueryWrapperX<SkuDO>() |
| 22 | - .betweenIfPresent(SkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 23 | 22 | .eqIfPresent(SkuDO::getSpuId, reqVO.getSpuId()) |
| 24 | - .eqIfPresent(SkuDO::getSkuStatus, reqVO.getSkuStatus()) | |
| 25 | - .eqIfPresent(SkuDO::getAttrs, reqVO.getAttrs()) | |
| 23 | + .eqIfPresent(SkuDO::getProperties, reqVO.getProperties()) | |
| 26 | 24 | .eqIfPresent(SkuDO::getPrice, reqVO.getPrice()) |
| 27 | 25 | .eqIfPresent(SkuDO::getOriginalPrice, reqVO.getOriginalPrice()) |
| 28 | 26 | .eqIfPresent(SkuDO::getCostPrice, reqVO.getCostPrice()) |
| 29 | 27 | .eqIfPresent(SkuDO::getBarCode, reqVO.getBarCode()) |
| 30 | 28 | .eqIfPresent(SkuDO::getPicUrl, reqVO.getPicUrl()) |
| 29 | + .eqIfPresent(SkuDO::getStatus, reqVO.getStatus()) | |
| 30 | + .betweenIfPresent(SkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 31 | 31 | .orderByDesc(SkuDO::getId)); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | default List<SkuDO> selectList(SkuExportReqVO reqVO) { |
| 35 | 35 | return selectList(new LambdaQueryWrapperX<SkuDO>() |
| 36 | - .betweenIfPresent(SkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 37 | 36 | .eqIfPresent(SkuDO::getSpuId, reqVO.getSpuId()) |
| 38 | - .eqIfPresent(SkuDO::getSkuStatus, reqVO.getSkuStatus()) | |
| 39 | - .eqIfPresent(SkuDO::getAttrs, reqVO.getAttrs()) | |
| 37 | + .eqIfPresent(SkuDO::getProperties, reqVO.getProperties()) | |
| 40 | 38 | .eqIfPresent(SkuDO::getPrice, reqVO.getPrice()) |
| 41 | 39 | .eqIfPresent(SkuDO::getOriginalPrice, reqVO.getOriginalPrice()) |
| 42 | 40 | .eqIfPresent(SkuDO::getCostPrice, reqVO.getCostPrice()) |
| 43 | 41 | .eqIfPresent(SkuDO::getBarCode, reqVO.getBarCode()) |
| 44 | 42 | .eqIfPresent(SkuDO::getPicUrl, reqVO.getPicUrl()) |
| 43 | + .eqIfPresent(SkuDO::getStatus, reqVO.getStatus()) | |
| 44 | + .betweenIfPresent(SkuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 45 | 45 | .orderByDesc(SkuDO::getId)); |
| 46 | 46 | } |
| 47 | 47 | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/SpuMapper.java
| ... | ... | @@ -19,35 +19,33 @@ public interface SpuMapper extends BaseMapperX<SpuDO> { |
| 19 | 19 | |
| 20 | 20 | default PageResult<SpuDO> selectPage(SpuPageReqVO reqVO) { |
| 21 | 21 | return selectPage(reqVO, new LambdaQueryWrapperX<SpuDO>() |
| 22 | - .betweenIfPresent(SpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 23 | 22 | .likeIfPresent(SpuDO::getName, reqVO.getName()) |
| 24 | - .eqIfPresent(SpuDO::getVisible, reqVO.getVisible()) | |
| 25 | 23 | .eqIfPresent(SpuDO::getSellPoint, reqVO.getSellPoint()) |
| 26 | 24 | .eqIfPresent(SpuDO::getDescription, reqVO.getDescription()) |
| 27 | - .eqIfPresent(SpuDO::getCid, reqVO.getCid()) | |
| 28 | - .eqIfPresent(SpuDO::getListPicUrl, reqVO.getListPicUrl()) | |
| 25 | + .eqIfPresent(SpuDO::getCategoryId, reqVO.getCategoryId()) | |
| 29 | 26 | .eqIfPresent(SpuDO::getPicUrls, reqVO.getPicUrls()) |
| 30 | 27 | .eqIfPresent(SpuDO::getSort, reqVO.getSort()) |
| 31 | 28 | .eqIfPresent(SpuDO::getLikeCount, reqVO.getLikeCount()) |
| 32 | 29 | .eqIfPresent(SpuDO::getPrice, reqVO.getPrice()) |
| 33 | 30 | .eqIfPresent(SpuDO::getQuantity, reqVO.getQuantity()) |
| 31 | + .eqIfPresent(SpuDO::getStatus, reqVO.getStatus()) | |
| 32 | + .betweenIfPresent(SpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 34 | 33 | .orderByDesc(SpuDO::getId)); |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | 36 | default List<SpuDO> selectList(SpuExportReqVO reqVO) { |
| 38 | 37 | return selectList(new LambdaQueryWrapperX<SpuDO>() |
| 39 | - .betweenIfPresent(SpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 40 | 38 | .likeIfPresent(SpuDO::getName, reqVO.getName()) |
| 41 | - .eqIfPresent(SpuDO::getVisible, reqVO.getVisible()) | |
| 42 | 39 | .eqIfPresent(SpuDO::getSellPoint, reqVO.getSellPoint()) |
| 43 | 40 | .eqIfPresent(SpuDO::getDescription, reqVO.getDescription()) |
| 44 | - .eqIfPresent(SpuDO::getCid, reqVO.getCid()) | |
| 45 | - .eqIfPresent(SpuDO::getListPicUrl, reqVO.getListPicUrl()) | |
| 41 | + .eqIfPresent(SpuDO::getCategoryId, reqVO.getCategoryId()) | |
| 46 | 42 | .eqIfPresent(SpuDO::getPicUrls, reqVO.getPicUrls()) |
| 47 | 43 | .eqIfPresent(SpuDO::getSort, reqVO.getSort()) |
| 48 | 44 | .eqIfPresent(SpuDO::getLikeCount, reqVO.getLikeCount()) |
| 49 | 45 | .eqIfPresent(SpuDO::getPrice, reqVO.getPrice()) |
| 50 | 46 | .eqIfPresent(SpuDO::getQuantity, reqVO.getQuantity()) |
| 47 | + .eqIfPresent(SpuDO::getStatus, reqVO.getStatus()) | |
| 48 | + .betweenIfPresent(SpuDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | |
| 51 | 49 | .orderByDesc(SpuDO::getId)); |
| 52 | 50 | } |
| 53 | 51 | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/attrkey/AttrKeyService.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/PropertyService.java
| 1 | -package cn.iocoder.yudao.module.product.service.attrkey; | |
| 1 | +package cn.iocoder.yudao.module.product.service.property; | |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | 4 | import javax.validation.*; |
| 5 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 6 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | |
| 6 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 8 | |
| 9 | 9 | /** |
| ... | ... | @@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 11 | * |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | -public interface AttrKeyService { | |
| 14 | +public interface PropertyService { | |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * 创建规格名称 |
| ... | ... | @@ -19,21 +19,21 @@ public interface AttrKeyService { |
| 19 | 19 | * @param createReqVO 创建信息 |
| 20 | 20 | * @return 编号 |
| 21 | 21 | */ |
| 22 | - Integer createAttrKey(@Valid AttrKeyCreateReqVO createReqVO); | |
| 22 | + Long createProperty(@Valid PropertyCreateReqVO createReqVO); | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * 更新规格名称 |
| 26 | 26 | * |
| 27 | 27 | * @param updateReqVO 更新信息 |
| 28 | 28 | */ |
| 29 | - void updateAttrKey(@Valid AttrKeyUpdateReqVO updateReqVO); | |
| 29 | + void updateProperty(@Valid PropertyUpdateReqVO updateReqVO); | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * 删除规格名称 |
| 33 | 33 | * |
| 34 | 34 | * @param id 编号 |
| 35 | 35 | */ |
| 36 | - void deleteAttrKey(Integer id); | |
| 36 | + void deleteProperty(Long id); | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * 获得规格名称 |
| ... | ... | @@ -41,7 +41,7 @@ public interface AttrKeyService { |
| 41 | 41 | * @param id 编号 |
| 42 | 42 | * @return 规格名称 |
| 43 | 43 | */ |
| 44 | - AttrKeyDO getAttrKey(Integer id); | |
| 44 | + PropertyDO getProperty(Long id); | |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * 获得规格名称列表 |
| ... | ... | @@ -49,7 +49,7 @@ public interface AttrKeyService { |
| 49 | 49 | * @param ids 编号 |
| 50 | 50 | * @return 规格名称列表 |
| 51 | 51 | */ |
| 52 | - List<AttrKeyDO> getAttrKeyList(Collection<Integer> ids); | |
| 52 | + List<PropertyDO> getPropertyList(Collection<Long> ids); | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * 获得规格名称分页 |
| ... | ... | @@ -57,7 +57,7 @@ public interface AttrKeyService { |
| 57 | 57 | * @param pageReqVO 分页查询 |
| 58 | 58 | * @return 规格名称分页 |
| 59 | 59 | */ |
| 60 | - PageResult<AttrKeyDO> getAttrKeyPage(AttrKeyPageReqVO pageReqVO); | |
| 60 | + PageResult<PropertyDO> getPropertyPage(PropertyPageReqVO pageReqVO); | |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * 获得规格名称列表, 用于 Excel 导出 |
| ... | ... | @@ -65,6 +65,6 @@ public interface AttrKeyService { |
| 65 | 65 | * @param exportReqVO 查询条件 |
| 66 | 66 | * @return 规格名称列表 |
| 67 | 67 | */ |
| 68 | - List<AttrKeyDO> getAttrKeyList(AttrKeyExportReqVO exportReqVO); | |
| 68 | + List<PropertyDO> getPropertyList(PropertyExportReqVO exportReqVO); | |
| 69 | 69 | |
| 70 | 70 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/attrkey/AttrKeyServiceImpl.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/PropertyServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.product.service.attrkey; | |
| 1 | +package cn.iocoder.yudao.module.product.service.property; | |
| 2 | 2 | |
| 3 | 3 | import org.springframework.stereotype.Service; |
| 4 | 4 | import javax.annotation.Resource; |
| 5 | 5 | import org.springframework.validation.annotation.Validated; |
| 6 | 6 | |
| 7 | 7 | import java.util.*; |
| 8 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 9 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | |
| 9 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | |
| 10 | 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 11 | |
| 12 | -import cn.iocoder.yudao.module.product.convert.attrkey.AttrKeyConvert; | |
| 13 | -import cn.iocoder.yudao.module.product.dal.mysql.attrkey.AttrKeyMapper; | |
| 12 | +import cn.iocoder.yudao.module.product.convert.property.PropertyConvert; | |
| 13 | +import cn.iocoder.yudao.module.product.dal.mysql.property.PropertyMapper; | |
| 14 | 14 | |
| 15 | 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | 16 | import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; |
| ... | ... | @@ -22,61 +22,61 @@ import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; |
| 22 | 22 | */ |
| 23 | 23 | @Service |
| 24 | 24 | @Validated |
| 25 | -public class AttrKeyServiceImpl implements AttrKeyService { | |
| 25 | +public class PropertyServiceImpl implements PropertyService { | |
| 26 | 26 | |
| 27 | 27 | @Resource |
| 28 | - private AttrKeyMapper attrKeyMapper; | |
| 28 | + private PropertyMapper propertyMapper; | |
| 29 | 29 | |
| 30 | 30 | @Override |
| 31 | - public Integer createAttrKey(AttrKeyCreateReqVO createReqVO) { | |
| 31 | + public Long createProperty(PropertyCreateReqVO createReqVO) { | |
| 32 | 32 | // 插入 |
| 33 | - AttrKeyDO attrKey = AttrKeyConvert.INSTANCE.convert(createReqVO); | |
| 34 | - attrKeyMapper.insert(attrKey); | |
| 33 | + PropertyDO property = PropertyConvert.INSTANCE.convert(createReqVO); | |
| 34 | + propertyMapper.insert(property); | |
| 35 | 35 | // 返回 |
| 36 | - return attrKey.getId(); | |
| 36 | + return property.getId(); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | @Override |
| 40 | - public void updateAttrKey(AttrKeyUpdateReqVO updateReqVO) { | |
| 40 | + public void updateProperty(PropertyUpdateReqVO updateReqVO) { | |
| 41 | 41 | // 校验存在 |
| 42 | - this.validateAttrKeyExists(updateReqVO.getId()); | |
| 42 | + this.validatePropertyExists(updateReqVO.getId()); | |
| 43 | 43 | // 更新 |
| 44 | - AttrKeyDO updateObj = AttrKeyConvert.INSTANCE.convert(updateReqVO); | |
| 45 | - attrKeyMapper.updateById(updateObj); | |
| 44 | + PropertyDO updateObj = PropertyConvert.INSTANCE.convert(updateReqVO); | |
| 45 | + propertyMapper.updateById(updateObj); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | @Override |
| 49 | - public void deleteAttrKey(Integer id) { | |
| 49 | + public void deleteProperty(Long id) { | |
| 50 | 50 | // 校验存在 |
| 51 | - this.validateAttrKeyExists(id); | |
| 51 | + this.validatePropertyExists(id); | |
| 52 | 52 | // 删除 |
| 53 | - attrKeyMapper.deleteById(id); | |
| 53 | + propertyMapper.deleteById(id); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - private void validateAttrKeyExists(Integer id) { | |
| 57 | - if (attrKeyMapper.selectById(id) == null) { | |
| 58 | - throw exception(ATTR_KEY_NOT_EXISTS); | |
| 56 | + private void validatePropertyExists(Long id) { | |
| 57 | + if (propertyMapper.selectById(id) == null) { | |
| 58 | + throw exception(PROPERTY_NOT_EXISTS); | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | @Override |
| 63 | - public AttrKeyDO getAttrKey(Integer id) { | |
| 64 | - return attrKeyMapper.selectById(id); | |
| 63 | + public PropertyDO getProperty(Long id) { | |
| 64 | + return propertyMapper.selectById(id); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | @Override |
| 68 | - public List<AttrKeyDO> getAttrKeyList(Collection<Integer> ids) { | |
| 69 | - return attrKeyMapper.selectBatchIds(ids); | |
| 68 | + public List<PropertyDO> getPropertyList(Collection<Long> ids) { | |
| 69 | + return propertyMapper.selectBatchIds(ids); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | @Override |
| 73 | - public PageResult<AttrKeyDO> getAttrKeyPage(AttrKeyPageReqVO pageReqVO) { | |
| 74 | - return attrKeyMapper.selectPage(pageReqVO); | |
| 73 | + public PageResult<PropertyDO> getPropertyPage(PropertyPageReqVO pageReqVO) { | |
| 74 | + return propertyMapper.selectPage(pageReqVO); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | @Override |
| 78 | - public List<AttrKeyDO> getAttrKeyList(AttrKeyExportReqVO exportReqVO) { | |
| 79 | - return attrKeyMapper.selectList(exportReqVO); | |
| 78 | + public List<PropertyDO> getPropertyList(PropertyExportReqVO exportReqVO) { | |
| 79 | + return propertyMapper.selectList(exportReqVO); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/attrvalue/AttrValueService.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/PropertyValueService.java
| 1 | -package cn.iocoder.yudao.module.product.service.attrvalue; | |
| 1 | +package cn.iocoder.yudao.module.product.service.propertyvalue; | |
| 2 | 2 | |
| 3 | 3 | import java.util.*; |
| 4 | 4 | import javax.validation.*; |
| 5 | -import cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo.*; | |
| 6 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrvalue.AttrValueDO; | |
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 6 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 8 | |
| 9 | 9 | /** |
| ... | ... | @@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 11 | * |
| 12 | 12 | * @author 芋道源码 |
| 13 | 13 | */ |
| 14 | -public interface AttrValueService { | |
| 14 | +public interface PropertyValueService { | |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * 创建规格值 |
| ... | ... | @@ -19,21 +19,21 @@ public interface AttrValueService { |
| 19 | 19 | * @param createReqVO 创建信息 |
| 20 | 20 | * @return 编号 |
| 21 | 21 | */ |
| 22 | - Integer createAttrValue(@Valid AttrValueCreateReqVO createReqVO); | |
| 22 | + Integer createPropertyValue(@Valid PropertyValueCreateReqVO createReqVO); | |
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * 更新规格值 |
| 26 | 26 | * |
| 27 | 27 | * @param updateReqVO 更新信息 |
| 28 | 28 | */ |
| 29 | - void updateAttrValue(@Valid AttrValueUpdateReqVO updateReqVO); | |
| 29 | + void updatePropertyValue(@Valid PropertyValueUpdateReqVO updateReqVO); | |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * 删除规格值 |
| 33 | 33 | * |
| 34 | 34 | * @param id 编号 |
| 35 | 35 | */ |
| 36 | - void deleteAttrValue(Integer id); | |
| 36 | + void deletePropertyValue(Integer id); | |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * 获得规格值 |
| ... | ... | @@ -41,7 +41,7 @@ public interface AttrValueService { |
| 41 | 41 | * @param id 编号 |
| 42 | 42 | * @return 规格值 |
| 43 | 43 | */ |
| 44 | - AttrValueDO getAttrValue(Integer id); | |
| 44 | + PropertyValueDO getPropertyValue(Integer id); | |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * 获得规格值列表 |
| ... | ... | @@ -49,7 +49,7 @@ public interface AttrValueService { |
| 49 | 49 | * @param ids 编号 |
| 50 | 50 | * @return 规格值列表 |
| 51 | 51 | */ |
| 52 | - List<AttrValueDO> getAttrValueList(Collection<Integer> ids); | |
| 52 | + List<PropertyValueDO> getPropertyValueList(Collection<Integer> ids); | |
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * 获得规格值分页 |
| ... | ... | @@ -57,7 +57,7 @@ public interface AttrValueService { |
| 57 | 57 | * @param pageReqVO 分页查询 |
| 58 | 58 | * @return 规格值分页 |
| 59 | 59 | */ |
| 60 | - PageResult<AttrValueDO> getAttrValuePage(AttrValuePageReqVO pageReqVO); | |
| 60 | + PageResult<PropertyValueDO> getPropertyValuePage(PropertyValuePageReqVO pageReqVO); | |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * 获得规格值列表, 用于 Excel 导出 |
| ... | ... | @@ -65,6 +65,6 @@ public interface AttrValueService { |
| 65 | 65 | * @param exportReqVO 查询条件 |
| 66 | 66 | * @return 规格值列表 |
| 67 | 67 | */ |
| 68 | - List<AttrValueDO> getAttrValueList(AttrValueExportReqVO exportReqVO); | |
| 68 | + List<PropertyValueDO> getPropertyValueList(PropertyValueExportReqVO exportReqVO); | |
| 69 | 69 | |
| 70 | 70 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/attrvalue/AttrValueServiceImpl.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/propertyvalue/PropertyValueServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.product.service.attrvalue; | |
| 1 | +package cn.iocoder.yudao.module.product.service.propertyvalue; | |
| 2 | 2 | |
| 3 | 3 | import org.springframework.stereotype.Service; |
| 4 | 4 | import javax.annotation.Resource; |
| 5 | 5 | import org.springframework.validation.annotation.Validated; |
| 6 | 6 | |
| 7 | 7 | import java.util.*; |
| 8 | -import cn.iocoder.yudao.module.product.controller.admin.attrvalue.vo.*; | |
| 9 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrvalue.AttrValueDO; | |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | |
| 9 | +import cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue.PropertyValueDO; | |
| 10 | 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 11 | |
| 12 | -import cn.iocoder.yudao.module.product.convert.attrvalue.AttrValueConvert; | |
| 13 | -import cn.iocoder.yudao.module.product.dal.mysql.attrvalue.AttrValueMapper; | |
| 12 | +import cn.iocoder.yudao.module.product.convert.propertyvalue.PropertyValueConvert; | |
| 13 | +import cn.iocoder.yudao.module.product.dal.mysql.propertyvalue.PropertyValueMapper; | |
| 14 | 14 | |
| 15 | 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | 16 | import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; |
| ... | ... | @@ -22,61 +22,61 @@ import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; |
| 22 | 22 | */ |
| 23 | 23 | @Service |
| 24 | 24 | @Validated |
| 25 | -public class AttrValueServiceImpl implements AttrValueService { | |
| 25 | +public class PropertyValueServiceImpl implements PropertyValueService { | |
| 26 | 26 | |
| 27 | 27 | @Resource |
| 28 | - private AttrValueMapper attrValueMapper; | |
| 28 | + private PropertyValueMapper propertyValueMapper; | |
| 29 | 29 | |
| 30 | 30 | @Override |
| 31 | - public Integer createAttrValue(AttrValueCreateReqVO createReqVO) { | |
| 31 | + public Integer createPropertyValue(PropertyValueCreateReqVO createReqVO) { | |
| 32 | 32 | // 插入 |
| 33 | - AttrValueDO attrValue = AttrValueConvert.INSTANCE.convert(createReqVO); | |
| 34 | - attrValueMapper.insert(attrValue); | |
| 33 | + PropertyValueDO propertyValue = PropertyValueConvert.INSTANCE.convert(createReqVO); | |
| 34 | + propertyValueMapper.insert(propertyValue); | |
| 35 | 35 | // 返回 |
| 36 | - return attrValue.getId(); | |
| 36 | + return propertyValue.getId(); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | @Override |
| 40 | - public void updateAttrValue(AttrValueUpdateReqVO updateReqVO) { | |
| 40 | + public void updatePropertyValue(PropertyValueUpdateReqVO updateReqVO) { | |
| 41 | 41 | // 校验存在 |
| 42 | - this.validateAttrValueExists(updateReqVO.getId()); | |
| 42 | + this.validatePropertyValueExists(updateReqVO.getId()); | |
| 43 | 43 | // 更新 |
| 44 | - AttrValueDO updateObj = AttrValueConvert.INSTANCE.convert(updateReqVO); | |
| 45 | - attrValueMapper.updateById(updateObj); | |
| 44 | + PropertyValueDO updateObj = PropertyValueConvert.INSTANCE.convert(updateReqVO); | |
| 45 | + propertyValueMapper.updateById(updateObj); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | @Override |
| 49 | - public void deleteAttrValue(Integer id) { | |
| 49 | + public void deletePropertyValue(Integer id) { | |
| 50 | 50 | // 校验存在 |
| 51 | - this.validateAttrValueExists(id); | |
| 51 | + this.validatePropertyValueExists(id); | |
| 52 | 52 | // 删除 |
| 53 | - attrValueMapper.deleteById(id); | |
| 53 | + propertyValueMapper.deleteById(id); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - private void validateAttrValueExists(Integer id) { | |
| 57 | - if (attrValueMapper.selectById(id) == null) { | |
| 58 | - throw exception(ATTR_VALUE_NOT_EXISTS); | |
| 56 | + private void validatePropertyValueExists(Integer id) { | |
| 57 | + if (propertyValueMapper.selectById(id) == null) { | |
| 58 | + throw exception(PROPERTY_VALUE_NOT_EXISTS); | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | @Override |
| 63 | - public AttrValueDO getAttrValue(Integer id) { | |
| 64 | - return attrValueMapper.selectById(id); | |
| 63 | + public PropertyValueDO getPropertyValue(Integer id) { | |
| 64 | + return propertyValueMapper.selectById(id); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | @Override |
| 68 | - public List<AttrValueDO> getAttrValueList(Collection<Integer> ids) { | |
| 69 | - return attrValueMapper.selectBatchIds(ids); | |
| 68 | + public List<PropertyValueDO> getPropertyValueList(Collection<Integer> ids) { | |
| 69 | + return propertyValueMapper.selectBatchIds(ids); | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | @Override |
| 73 | - public PageResult<AttrValueDO> getAttrValuePage(AttrValuePageReqVO pageReqVO) { | |
| 74 | - return attrValueMapper.selectPage(pageReqVO); | |
| 73 | + public PageResult<PropertyValueDO> getPropertyValuePage(PropertyValuePageReqVO pageReqVO) { | |
| 74 | + return propertyValueMapper.selectPage(pageReqVO); | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | @Override |
| 78 | - public List<AttrValueDO> getAttrValueList(AttrValueExportReqVO exportReqVO) { | |
| 79 | - return attrValueMapper.selectList(exportReqVO); | |
| 78 | + public List<PropertyValueDO> getPropertyValueList(PropertyValueExportReqVO exportReqVO) { | |
| 79 | + return propertyValueMapper.selectList(exportReqVO); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | } | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/attrkey/AttrKeyServiceImplTest.java deleted
| 1 | -package cn.iocoder.yudao.module.product.service.attrkey; | |
| 2 | - | |
| 3 | -import org.junit.jupiter.api.Disabled; | |
| 4 | -import org.junit.jupiter.api.Test; | |
| 5 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 6 | - | |
| 7 | -import javax.annotation.Resource; | |
| 8 | - | |
| 9 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 10 | - | |
| 11 | -import cn.iocoder.yudao.module.product.controller.admin.attrkey.vo.*; | |
| 12 | -import cn.iocoder.yudao.module.product.dal.dataobject.attrkey.AttrKeyDO; | |
| 13 | -import cn.iocoder.yudao.module.product.dal.mysql.attrkey.AttrKeyMapper; | |
| 14 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 15 | - | |
| 16 | -import javax.annotation.Resource; | |
| 17 | -import org.springframework.context.annotation.Import; | |
| 18 | -import java.util.*; | |
| 19 | - | |
| 20 | -import static cn.hutool.core.util.RandomUtil.*; | |
| 21 | -import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*; | |
| 22 | -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; | |
| 23 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 24 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; | |
| 25 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; | |
| 26 | -import static org.junit.jupiter.api.Assertions.*; | |
| 27 | -import static org.mockito.Mockito.*; | |
| 28 | - | |
| 29 | -/** | |
| 30 | -* {@link AttrKeyServiceImpl} 的单元测试类 | |
| 31 | -* | |
| 32 | -* @author 芋道源码 | |
| 33 | -*/ | |
| 34 | -@Import(AttrKeyServiceImpl.class) | |
| 35 | -public class AttrKeyServiceImplTest extends BaseDbUnitTest { | |
| 36 | - | |
| 37 | - @Resource | |
| 38 | - private AttrKeyServiceImpl attrKeyService; | |
| 39 | - | |
| 40 | - @Resource | |
| 41 | - private AttrKeyMapper attrKeyMapper; | |
| 42 | - | |
| 43 | - @Test | |
| 44 | - public void testCreateAttrKey_success() { | |
| 45 | - // 准备参数 | |
| 46 | - AttrKeyCreateReqVO reqVO = randomPojo(AttrKeyCreateReqVO.class); | |
| 47 | - | |
| 48 | - // 调用 | |
| 49 | - Integer attrKeyId = attrKeyService.createAttrKey(reqVO); | |
| 50 | - // 断言 | |
| 51 | - assertNotNull(attrKeyId); | |
| 52 | - // 校验记录的属性是否正确 | |
| 53 | - AttrKeyDO attrKey = attrKeyMapper.selectById(attrKeyId); | |
| 54 | - assertPojoEquals(reqVO, attrKey); | |
| 55 | - } | |
| 56 | - | |
| 57 | - @Test | |
| 58 | - public void testUpdateAttrKey_success() { | |
| 59 | - // mock 数据 | |
| 60 | - AttrKeyDO dbAttrKey = randomPojo(AttrKeyDO.class); | |
| 61 | - attrKeyMapper.insert(dbAttrKey);// @Sql: 先插入出一条存在的数据 | |
| 62 | - // 准备参数 | |
| 63 | - AttrKeyUpdateReqVO reqVO = randomPojo(AttrKeyUpdateReqVO.class, o -> { | |
| 64 | - o.setId(dbAttrKey.getId()); // 设置更新的 ID | |
| 65 | - }); | |
| 66 | - | |
| 67 | - // 调用 | |
| 68 | - attrKeyService.updateAttrKey(reqVO); | |
| 69 | - // 校验是否更新正确 | |
| 70 | - AttrKeyDO attrKey = attrKeyMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 71 | - assertPojoEquals(reqVO, attrKey); | |
| 72 | - } | |
| 73 | - | |
| 74 | - @Test | |
| 75 | - public void testUpdateAttrKey_notExists() { | |
| 76 | - // 准备参数 | |
| 77 | - AttrKeyUpdateReqVO reqVO = randomPojo(AttrKeyUpdateReqVO.class); | |
| 78 | - | |
| 79 | - // 调用, 并断言异常 | |
| 80 | - assertServiceException(() -> attrKeyService.updateAttrKey(reqVO), ATTR_KEY_NOT_EXISTS); | |
| 81 | - } | |
| 82 | - | |
| 83 | - @Test | |
| 84 | - public void testDeleteAttrKey_success() { | |
| 85 | - // mock 数据 | |
| 86 | - AttrKeyDO dbAttrKey = randomPojo(AttrKeyDO.class); | |
| 87 | - attrKeyMapper.insert(dbAttrKey);// @Sql: 先插入出一条存在的数据 | |
| 88 | - // 准备参数 | |
| 89 | - Integer id = dbAttrKey.getId(); | |
| 90 | - | |
| 91 | - // 调用 | |
| 92 | - attrKeyService.deleteAttrKey(id); | |
| 93 | - // 校验数据不存在了 | |
| 94 | - assertNull(attrKeyMapper.selectById(id)); | |
| 95 | - } | |
| 96 | - | |
| 97 | - @Test | |
| 98 | - public void testDeleteAttrKey_notExists() { | |
| 99 | - // 准备参数 | |
| 100 | -// Integer id = randomIntegerId(); | |
| 101 | - Integer id = 1; | |
| 102 | - | |
| 103 | - // 调用, 并断言异常 | |
| 104 | - assertServiceException(() -> attrKeyService.deleteAttrKey(id), ATTR_KEY_NOT_EXISTS); | |
| 105 | - } | |
| 106 | - | |
| 107 | - @Test | |
| 108 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 109 | - public void testGetAttrKeyPage() { | |
| 110 | - // mock 数据 | |
| 111 | - AttrKeyDO dbAttrKey = randomPojo(AttrKeyDO.class, o -> { // 等会查询到 | |
| 112 | - o.setCreateTime(null); | |
| 113 | - o.setAttrName(null); | |
| 114 | - o.setStatus(null); | |
| 115 | - }); | |
| 116 | - attrKeyMapper.insert(dbAttrKey); | |
| 117 | - // 测试 createTime 不匹配 | |
| 118 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setCreateTime(null))); | |
| 119 | - // 测试 attrName 不匹配 | |
| 120 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setAttrName(null))); | |
| 121 | - // 测试 status 不匹配 | |
| 122 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setStatus(null))); | |
| 123 | - // 准备参数 | |
| 124 | - AttrKeyPageReqVO reqVO = new AttrKeyPageReqVO(); | |
| 125 | - reqVO.setBeginCreateTime(null); | |
| 126 | - reqVO.setEndCreateTime(null); | |
| 127 | - reqVO.setAttrName(null); | |
| 128 | - reqVO.setStatus(null); | |
| 129 | - | |
| 130 | - // 调用 | |
| 131 | - PageResult<AttrKeyDO> pageResult = attrKeyService.getAttrKeyPage(reqVO); | |
| 132 | - // 断言 | |
| 133 | - assertEquals(1, pageResult.getTotal()); | |
| 134 | - assertEquals(1, pageResult.getList().size()); | |
| 135 | - assertPojoEquals(dbAttrKey, pageResult.getList().get(0)); | |
| 136 | - } | |
| 137 | - | |
| 138 | - @Test | |
| 139 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 140 | - public void testGetAttrKeyList() { | |
| 141 | - // mock 数据 | |
| 142 | - AttrKeyDO dbAttrKey = randomPojo(AttrKeyDO.class, o -> { // 等会查询到 | |
| 143 | - o.setCreateTime(null); | |
| 144 | - o.setAttrName(null); | |
| 145 | - o.setStatus(null); | |
| 146 | - }); | |
| 147 | - attrKeyMapper.insert(dbAttrKey); | |
| 148 | - // 测试 createTime 不匹配 | |
| 149 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setCreateTime(null))); | |
| 150 | - // 测试 attrName 不匹配 | |
| 151 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setAttrName(null))); | |
| 152 | - // 测试 status 不匹配 | |
| 153 | - attrKeyMapper.insert(cloneIgnoreId(dbAttrKey, o -> o.setStatus(null))); | |
| 154 | - // 准备参数 | |
| 155 | - AttrKeyExportReqVO reqVO = new AttrKeyExportReqVO(); | |
| 156 | - reqVO.setBeginCreateTime(null); | |
| 157 | - reqVO.setEndCreateTime(null); | |
| 158 | - reqVO.setAttrName(null); | |
| 159 | - reqVO.setStatus(null); | |
| 160 | - | |
| 161 | - // 调用 | |
| 162 | - List<AttrKeyDO> list = attrKeyService.getAttrKeyList(reqVO); | |
| 163 | - // 断言 | |
| 164 | - assertEquals(1, list.size()); | |
| 165 | - assertPojoEquals(dbAttrKey, list.get(0)); | |
| 166 | - } | |
| 167 | - | |
| 168 | -} |