Commit fe5c5e42236c6524c0183687d2acc430aed8e7dc
1 parent
722b3351
✨ MALL:调整商品 SPU 字段,简化部分接口
Showing
17 changed files
with
23 additions
and
260 deletions
yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/DictTypeConstants.java
| @@ -7,7 +7,6 @@ package cn.iocoder.yudao.module.product.enums; | @@ -7,7 +7,6 @@ package cn.iocoder.yudao.module.product.enums; | ||
| 7 | */ | 7 | */ |
| 8 | public interface DictTypeConstants { | 8 | public interface DictTypeConstants { |
| 9 | 9 | ||
| 10 | - String PRODUCT_UNIT = "product_unit"; // 商品单位 | ||
| 11 | String PRODUCT_SPU_STATUS = "product_spu_status"; // 商品 SPU 状态 | 10 | String PRODUCT_SPU_STATUS = "product_spu_status"; // 商品 SPU 状态 |
| 12 | 11 | ||
| 13 | } | 12 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
| 1 | package cn.iocoder.yudao.module.product.controller.admin.property; | 1 | package cn.iocoder.yudao.module.product.controller.admin.property; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*; | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*; |
| 7 | import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; | 6 | import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; |
| 8 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | ||
| 9 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; | ||
| 10 | import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; | 7 | import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; |
| 11 | -import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService; | ||
| 12 | import io.swagger.v3.oas.annotations.Operation; | 8 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | import io.swagger.v3.oas.annotations.Parameter; | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 14 | import io.swagger.v3.oas.annotations.tags.Tag; | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.Resource; | ||
| 12 | +import jakarta.validation.Valid; | ||
| 15 | import org.springframework.security.access.prepost.PreAuthorize; | 13 | import org.springframework.security.access.prepost.PreAuthorize; |
| 16 | import org.springframework.validation.annotation.Validated; | 14 | import org.springframework.validation.annotation.Validated; |
| 17 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| 18 | 16 | ||
| 19 | -import jakarta.annotation.Resource; | ||
| 20 | -import jakarta.validation.Valid; | ||
| 21 | -import java.util.Collections; | ||
| 22 | import java.util.List; | 17 | import java.util.List; |
| 23 | 18 | ||
| 24 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 25 | -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; | ||
| 26 | 20 | ||
| 27 | @Tag(name = "管理后台 - 商品属性项") | 21 | @Tag(name = "管理后台 - 商品属性项") |
| 28 | @RestController | 22 | @RestController |
| @@ -32,8 +26,6 @@ public class ProductPropertyController { | @@ -32,8 +26,6 @@ public class ProductPropertyController { | ||
| 32 | 26 | ||
| 33 | @Resource | 27 | @Resource |
| 34 | private ProductPropertyService productPropertyService; | 28 | private ProductPropertyService productPropertyService; |
| 35 | - @Resource | ||
| 36 | - private ProductPropertyValueService productPropertyValueService; | ||
| 37 | 29 | ||
| 38 | @PostMapping("/create") | 30 | @PostMapping("/create") |
| 39 | @Operation(summary = "创建属性项") | 31 | @Operation(summary = "创建属性项") |
| @@ -81,20 +73,4 @@ public class ProductPropertyController { | @@ -81,20 +73,4 @@ public class ProductPropertyController { | ||
| 81 | return success(ProductPropertyConvert.INSTANCE.convertPage(productPropertyService.getPropertyPage(pageVO))); | 73 | return success(ProductPropertyConvert.INSTANCE.convertPage(productPropertyService.getPropertyPage(pageVO))); |
| 82 | } | 74 | } |
| 83 | 75 | ||
| 84 | - @PostMapping("/get-value-list") | ||
| 85 | - @Operation(summary = "获得属性项列表") | ||
| 86 | - @PreAuthorize("@ss.hasPermission('product:property:query')") | ||
| 87 | - public CommonResult<List<ProductPropertyAndValueRespVO>> getPropertyAndValueList( | ||
| 88 | - @Valid @RequestBody ProductPropertyListReqVO listReqVO) { | ||
| 89 | - // 查询属性项 | ||
| 90 | - List<ProductPropertyDO> keys = productPropertyService.getPropertyList(listReqVO); | ||
| 91 | - if (CollUtil.isEmpty(keys)) { | ||
| 92 | - return success(Collections.emptyList()); | ||
| 93 | - } | ||
| 94 | - // 查询属性值 | ||
| 95 | - List<ProductPropertyValueDO> values = productPropertyValueService.getPropertyValueListByPropertyId( | ||
| 96 | - convertSet(keys, ProductPropertyDO::getId)); | ||
| 97 | - return success(ProductPropertyConvert.INSTANCE.convertList(keys, values)); | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | } | 76 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; | ||
| 2 | - | ||
| 3 | -import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | -import lombok.Data; | ||
| 5 | - | ||
| 6 | -import java.util.List; | ||
| 7 | - | ||
| 8 | -@Schema(description = "管理后台 - 商品属性项 + 属性值 Response VO") | ||
| 9 | -@Data | ||
| 10 | -public class ProductPropertyAndValueRespVO { | ||
| 11 | - | ||
| 12 | - @Schema(description = "属性项的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 13 | - private Long id; | ||
| 14 | - | ||
| 15 | - @Schema(description = "属性项的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "颜色") | ||
| 16 | - private String name; | ||
| 17 | - | ||
| 18 | - /** | ||
| 19 | - * 属性值的集合 | ||
| 20 | - */ | ||
| 21 | - private List<Value> values; | ||
| 22 | - | ||
| 23 | - @Schema(description = "管理后台 - 属性值的简单 Response VO") | ||
| 24 | - @Data | ||
| 25 | - public static class Value { | ||
| 26 | - | ||
| 27 | - @Schema(description = "属性值的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2048") | ||
| 28 | - private Long id; | ||
| 29 | - | ||
| 30 | - @Schema(description = "属性值的名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "红色") | ||
| 31 | - private String name; | ||
| 32 | - | ||
| 33 | - } | ||
| 34 | - | ||
| 35 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java
| @@ -47,13 +47,6 @@ public class ProductSpuBaseVO { | @@ -47,13 +47,6 @@ public class ProductSpuBaseVO { | ||
| 47 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.iocoder.cn/xx.png, https://www.iocoder.cn/xxx.png]") | 47 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.iocoder.cn/xx.png, https://www.iocoder.cn/xxx.png]") |
| 48 | private List<String> sliderPicUrls; | 48 | private List<String> sliderPicUrls; |
| 49 | 49 | ||
| 50 | - @Schema(description = "商品视频", example = "https://www.iocoder.cn/xx.mp4") | ||
| 51 | - private String videoUrl; | ||
| 52 | - | ||
| 53 | - @Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 54 | - @NotNull(message = "商品单位不能为空") | ||
| 55 | - private Integer unit; | ||
| 56 | - | ||
| 57 | @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | 50 | @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 58 | @NotNull(message = "商品排序字段不能为空") | 51 | @NotNull(message = "商品排序字段不能为空") |
| 59 | private Integer sort; | 52 | private Integer sort; |
| @@ -66,32 +59,16 @@ public class ProductSpuBaseVO { | @@ -66,32 +59,16 @@ public class ProductSpuBaseVO { | ||
| 66 | 59 | ||
| 67 | // ========== 物流相关字段 ========= | 60 | // ========== 物流相关字段 ========= |
| 68 | 61 | ||
| 62 | + @Schema(description = "配送方式数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") | ||
| 63 | + @NotEmpty(message = "配送方式不能为空") | ||
| 64 | + private List<Integer> deliveryTypes; | ||
| 65 | + | ||
| 69 | @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") | 66 | @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") |
| 70 | @NotNull(message = "物流配置模板编号不能为空") | 67 | @NotNull(message = "物流配置模板编号不能为空") |
| 71 | private Long deliveryTemplateId; | 68 | private Long deliveryTemplateId; |
| 72 | 69 | ||
| 73 | // ========== 营销相关字段 ========= | 70 | // ========== 营销相关字段 ========= |
| 74 | 71 | ||
| 75 | - @Schema(description = "是否热卖推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 76 | - @NotNull(message = "商品推荐不能为空") | ||
| 77 | - private Boolean recommendHot; | ||
| 78 | - | ||
| 79 | - @Schema(description = "是否优惠推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 80 | - @NotNull(message = "商品推荐不能为空") | ||
| 81 | - private Boolean recommendBenefit; | ||
| 82 | - | ||
| 83 | - @Schema(description = "是否精品推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 84 | - @NotNull(message = "商品推荐不能为空") | ||
| 85 | - private Boolean recommendBest; | ||
| 86 | - | ||
| 87 | - @Schema(description = "是否新品推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 88 | - @NotNull(message = "商品推荐不能为空") | ||
| 89 | - private Boolean recommendNew; | ||
| 90 | - | ||
| 91 | - @Schema(description = "是否优品推荐", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | ||
| 92 | - @NotNull(message = "商品推荐不能为空") | ||
| 93 | - private Boolean recommendGood; | ||
| 94 | - | ||
| 95 | @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") | 72 | @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") |
| 96 | @NotNull(message = "商品赠送积分不能为空") | 73 | @NotNull(message = "商品赠送积分不能为空") |
| 97 | private Integer giveIntegral; | 74 | private Integer giveIntegral; |
| @@ -100,9 +77,6 @@ public class ProductSpuBaseVO { | @@ -100,9 +77,6 @@ public class ProductSpuBaseVO { | ||
| 100 | @NotNull(message = "商品分销类型不能为空") | 77 | @NotNull(message = "商品分销类型不能为空") |
| 101 | private Boolean subCommissionType; | 78 | private Boolean subCommissionType; |
| 102 | 79 | ||
| 103 | - @Schema(description = "活动展示顺序", example = "[1, 3, 2, 4, 5]") | ||
| 104 | - private List<Integer> activityOrders; | ||
| 105 | - | ||
| 106 | // ========== 统计相关字段 ========= | 80 | // ========== 统计相关字段 ========= |
| 107 | 81 | ||
| 108 | @Schema(description = "虚拟销量", example = "66") | 82 | @Schema(description = "虚拟销量", example = "66") |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuExcelVO.java
| @@ -44,13 +44,6 @@ public class ProductSpuExcelVO { | @@ -44,13 +44,6 @@ public class ProductSpuExcelVO { | ||
| 44 | @ExcelProperty("商品封面图") | 44 | @ExcelProperty("商品封面图") |
| 45 | private String picUrl; | 45 | private String picUrl; |
| 46 | 46 | ||
| 47 | - @ExcelProperty("商品视频") | ||
| 48 | - private String videoUrl; | ||
| 49 | - | ||
| 50 | - @ExcelProperty(value = "商品单位", converter = DictConvert.class) | ||
| 51 | - @DictFormat(DictTypeConstants.PRODUCT_UNIT) | ||
| 52 | - private Integer unit; | ||
| 53 | - | ||
| 54 | @ExcelProperty("排序字段") | 47 | @ExcelProperty("排序字段") |
| 55 | private Integer sort; | 48 | private Integer sort; |
| 56 | 49 | ||
| @@ -76,21 +69,6 @@ public class ProductSpuExcelVO { | @@ -76,21 +69,6 @@ public class ProductSpuExcelVO { | ||
| 76 | @ExcelProperty("物流配置模板编号") | 69 | @ExcelProperty("物流配置模板编号") |
| 77 | private Long deliveryTemplateId; | 70 | private Long deliveryTemplateId; |
| 78 | 71 | ||
| 79 | - @ExcelProperty("是否热卖推荐") | ||
| 80 | - private Boolean recommendHot; | ||
| 81 | - | ||
| 82 | - @ExcelProperty("是否优惠推荐") | ||
| 83 | - private Boolean recommendBenefit; | ||
| 84 | - | ||
| 85 | - @ExcelProperty("是否精品推荐") | ||
| 86 | - private Boolean recommendBest; | ||
| 87 | - | ||
| 88 | - @ExcelProperty("是否新品推荐") | ||
| 89 | - private Boolean recommendNew; | ||
| 90 | - | ||
| 91 | - @ExcelProperty("是否优品推荐") | ||
| 92 | - private Boolean recommendGood; | ||
| 93 | - | ||
| 94 | @ExcelProperty("赠送积分") | 72 | @ExcelProperty("赠送积分") |
| 95 | private Integer giveIntegral; | 73 | private Integer giveIntegral; |
| 96 | 74 |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java
| @@ -33,17 +33,8 @@ public class AppProductSpuDetailRespVO { | @@ -33,17 +33,8 @@ public class AppProductSpuDetailRespVO { | ||
| 33 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) | 33 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) |
| 34 | private List<String> sliderPicUrls; | 34 | private List<String> sliderPicUrls; |
| 35 | 35 | ||
| 36 | - @Schema(description = "商品视频", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 37 | - private String videoUrl; | ||
| 38 | - | ||
| 39 | - @Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") | ||
| 40 | - private String unitName; | ||
| 41 | - | ||
| 42 | // ========== 营销相关字段 ========= | 36 | // ========== 营销相关字段 ========= |
| 43 | 37 | ||
| 44 | - @Schema(description = "活动排序数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 45 | - private List<Integer> activityOrders; | ||
| 46 | - | ||
| 47 | // ========== SKU 相关字段 ========= | 38 | // ========== SKU 相关字段 ========= |
| 48 | 39 | ||
| 49 | @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | 40 | @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuPageRespVO.java
| @@ -27,9 +27,6 @@ public class AppProductSpuPageRespVO { | @@ -27,9 +27,6 @@ public class AppProductSpuPageRespVO { | ||
| 27 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) | 27 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) |
| 28 | private List<String> sliderPicUrls; | 28 | private List<String> sliderPicUrls; |
| 29 | 29 | ||
| 30 | - @Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") | ||
| 31 | - private String unitName; | ||
| 32 | - | ||
| 33 | // ========== SKU 相关字段 ========= | 30 | // ========== SKU 相关字段 ========= |
| 34 | 31 | ||
| 35 | @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") | 32 | @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| @@ -43,15 +40,12 @@ public class AppProductSpuPageRespVO { | @@ -43,15 +40,12 @@ public class AppProductSpuPageRespVO { | ||
| 43 | 40 | ||
| 44 | @Schema(description = "VIP 价格,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "968") // 通过会员等级,计算出折扣后价格 | 41 | @Schema(description = "VIP 价格,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "968") // 通过会员等级,计算出折扣后价格 |
| 45 | private Integer vipPrice; | 42 | private Integer vipPrice; |
| 46 | - | 43 | + |
| 47 | @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "666") | 44 | @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "666") |
| 48 | private Integer stock; | 45 | private Integer stock; |
| 49 | 46 | ||
| 50 | // ========== 营销相关字段 ========= | 47 | // ========== 营销相关字段 ========= |
| 51 | 48 | ||
| 52 | - @Schema(description = "活动排序数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | ||
| 53 | - private List<Integer> activityOrders; | ||
| 54 | - | ||
| 55 | // ========== 统计相关字段 ========= | 49 | // ========== 统计相关字段 ========= |
| 56 | 50 | ||
| 57 | @Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") | 51 | @Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java
| 1 | package cn.iocoder.yudao.module.product.convert.property; | 1 | package cn.iocoder.yudao.module.product.convert.property; |
| 2 | 2 | ||
| 3 | -import cn.hutool.core.collection.CollUtil; | ||
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | ||
| 6 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; | ||
| 7 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO; | 4 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO; |
| 8 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyRespVO; | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyRespVO; |
| 9 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO; | 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO; |
| 10 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | 7 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 11 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; | ||
| 12 | import org.mapstruct.Mapper; | 8 | import org.mapstruct.Mapper; |
| 13 | import org.mapstruct.factory.Mappers; | 9 | import org.mapstruct.factory.Mappers; |
| 14 | 10 | ||
| 15 | -import java.util.Collections; | ||
| 16 | import java.util.List; | 11 | import java.util.List; |
| 17 | -import java.util.Map; | ||
| 18 | - | ||
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 20 | 12 | ||
| 21 | /** | 13 | /** |
| 22 | * 属性项 Convert | 14 | * 属性项 Convert |
| @@ -38,20 +30,4 @@ public interface ProductPropertyConvert { | @@ -38,20 +30,4 @@ public interface ProductPropertyConvert { | ||
| 38 | 30 | ||
| 39 | PageResult<ProductPropertyRespVO> convertPage(PageResult<ProductPropertyDO> page); | 31 | PageResult<ProductPropertyRespVO> convertPage(PageResult<ProductPropertyDO> page); |
| 40 | 32 | ||
| 41 | - default List<ProductPropertyAndValueRespVO> convertList(List<ProductPropertyDO> keys, List<ProductPropertyValueDO> values) { | ||
| 42 | - Map<Long, List<ProductPropertyValueDO>> valueMap = CollectionUtils.convertMultiMap(values, ProductPropertyValueDO::getPropertyId); | ||
| 43 | - return CollectionUtils.convertList(keys, key -> { | ||
| 44 | - ProductPropertyAndValueRespVO respVO = convert02(key); | ||
| 45 | - // 如果属性值为空value不为null,返回空列表 | ||
| 46 | - if (CollUtil.isEmpty(values)) { | ||
| 47 | - respVO.setValues(Collections.emptyList()); | ||
| 48 | - }else { | ||
| 49 | - respVO.setValues(convertList02(valueMap.get(key.getId()))); | ||
| 50 | - } | ||
| 51 | - return respVO; | ||
| 52 | - }); | ||
| 53 | - } | ||
| 54 | - ProductPropertyAndValueRespVO convert02(ProductPropertyDO bean); | ||
| 55 | - List<ProductPropertyAndValueRespVO.Value> convertList02(List<ProductPropertyValueDO> list); | ||
| 56 | - | ||
| 57 | } | 33 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/spu/ProductSpuConvert.java
| @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.product.convert.spu; | @@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.product.convert.spu; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | ||
| 6 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; | 5 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 7 | import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; | 6 | import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; |
| 8 | import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuDetailRespVO; | 7 | import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuDetailRespVO; |
| @@ -11,7 +10,6 @@ import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageRe | @@ -11,7 +10,6 @@ import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageRe | ||
| 11 | import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; | 10 | import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; |
| 12 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| 13 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; | 12 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; |
| 14 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | ||
| 15 | import org.mapstruct.Mapper; | 13 | import org.mapstruct.Mapper; |
| 16 | import org.mapstruct.Mapping; | 14 | import org.mapstruct.Mapping; |
| 17 | import org.mapstruct.Named; | 15 | import org.mapstruct.Named; |
| @@ -74,13 +72,7 @@ public interface ProductSpuConvert { | @@ -74,13 +72,7 @@ public interface ProductSpuConvert { | ||
| 74 | // 处理虚拟销量 | 72 | // 处理虚拟销量 |
| 75 | list.forEach(spu -> spu.setSalesCount(spu.getSalesCount() + spu.getVirtualSalesCount())); | 73 | list.forEach(spu -> spu.setSalesCount(spu.getSalesCount() + spu.getVirtualSalesCount())); |
| 76 | // 处理 VO 字段 | 74 | // 处理 VO 字段 |
| 77 | - List<AppProductSpuPageRespVO> voList = convertListForGetSpuList0(list); | ||
| 78 | - for (int i = 0; i < list.size(); i++) { | ||
| 79 | - ProductSpuDO spu = list.get(i); | ||
| 80 | - AppProductSpuPageRespVO spuVO = voList.get(i); | ||
| 81 | - spuVO.setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit())); | ||
| 82 | - } | ||
| 83 | - return voList; | 75 | + return convertListForGetSpuList0(list); |
| 84 | } | 76 | } |
| 85 | 77 | ||
| 86 | @Named("convertListForGetSpuList0") | 78 | @Named("convertListForGetSpuList0") |
| @@ -89,8 +81,7 @@ public interface ProductSpuConvert { | @@ -89,8 +81,7 @@ public interface ProductSpuConvert { | ||
| 89 | default AppProductSpuDetailRespVO convertForGetSpuDetail(ProductSpuDO spu, List<ProductSkuDO> skus) { | 81 | default AppProductSpuDetailRespVO convertForGetSpuDetail(ProductSpuDO spu, List<ProductSkuDO> skus) { |
| 90 | // 处理 SPU | 82 | // 处理 SPU |
| 91 | AppProductSpuDetailRespVO spuVO = convertForGetSpuDetail(spu) | 83 | AppProductSpuDetailRespVO spuVO = convertForGetSpuDetail(spu) |
| 92 | - .setSalesCount(spu.getSalesCount() + defaultIfNull(spu.getVirtualSalesCount(), 0)) | ||
| 93 | - .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit())); | 84 | + .setSalesCount(spu.getSalesCount() + defaultIfNull(spu.getVirtualSalesCount(), 0)); |
| 94 | // 处理 SKU | 85 | // 处理 SKU |
| 95 | spuVO.setSkus(convertListForGetSpuDetail(skus)); | 86 | spuVO.setSkus(convertListForGetSpuDetail(skus)); |
| 96 | return spuVO; | 87 | return spuVO; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java
| 1 | package cn.iocoder.yudao.module.product.dal.dataobject.spu; | 1 | package cn.iocoder.yudao.module.product.dal.dataobject.spu; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.type.IntegerListTypeHandler; | ||
| 4 | import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; | 5 | import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; |
| 5 | import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; | 6 | import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; |
| 6 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; | 7 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| @@ -80,18 +81,8 @@ public class ProductSpuDO extends BaseDO { | @@ -80,18 +81,8 @@ public class ProductSpuDO extends BaseDO { | ||
| 80 | */ | 81 | */ |
| 81 | @TableField(typeHandler = JacksonTypeHandler.class) | 82 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 82 | private List<String> sliderPicUrls; | 83 | private List<String> sliderPicUrls; |
| 83 | - /** | ||
| 84 | - * 商品视频 | ||
| 85 | - */ | ||
| 86 | - private String videoUrl; | ||
| 87 | 84 | ||
| 88 | /** | 85 | /** |
| 89 | - * 单位 | ||
| 90 | - * | ||
| 91 | - * 对应 product_unit 数据字典 | ||
| 92 | - */ | ||
| 93 | - private Integer unit; | ||
| 94 | - /** | ||
| 95 | * 排序字段 | 86 | * 排序字段 |
| 96 | */ | 87 | */ |
| 97 | private Integer sort; | 88 | private Integer sort; |
| @@ -139,6 +130,13 @@ public class ProductSpuDO extends BaseDO { | @@ -139,6 +130,13 @@ public class ProductSpuDO extends BaseDO { | ||
| 139 | // ========== 物流相关字段 ========= | 130 | // ========== 物流相关字段 ========= |
| 140 | 131 | ||
| 141 | /** | 132 | /** |
| 133 | + * 配送方式数组 | ||
| 134 | + * | ||
| 135 | + * 对应 DeliveryTypeEnum 枚举 | ||
| 136 | + */ | ||
| 137 | + @TableField(typeHandler = IntegerListTypeHandler.class) | ||
| 138 | + private List<Integer> deliveryTypes; | ||
| 139 | + /** | ||
| 142 | * 物流配置模板编号 | 140 | * 物流配置模板编号 |
| 143 | * | 141 | * |
| 144 | * 对应 TradeDeliveryExpressTemplateDO 的 id 编号 | 142 | * 对应 TradeDeliveryExpressTemplateDO 的 id 编号 |
| @@ -146,26 +144,6 @@ public class ProductSpuDO extends BaseDO { | @@ -146,26 +144,6 @@ public class ProductSpuDO extends BaseDO { | ||
| 146 | private Long deliveryTemplateId; | 144 | private Long deliveryTemplateId; |
| 147 | 145 | ||
| 148 | // ========== 营销相关字段 ========= | 146 | // ========== 营销相关字段 ========= |
| 149 | - /** | ||
| 150 | - * 是否热卖推荐 | ||
| 151 | - */ | ||
| 152 | - private Boolean recommendHot; | ||
| 153 | - /** | ||
| 154 | - * 是否优惠推荐 | ||
| 155 | - */ | ||
| 156 | - private Boolean recommendBenefit; | ||
| 157 | - /** | ||
| 158 | - * 是否精品推荐 | ||
| 159 | - */ | ||
| 160 | - private Boolean recommendBest; | ||
| 161 | - /** | ||
| 162 | - * 是否新品推荐 | ||
| 163 | - */ | ||
| 164 | - private Boolean recommendNew; | ||
| 165 | - /** | ||
| 166 | - * 是否优品推荐 | ||
| 167 | - */ | ||
| 168 | - private Boolean recommendGood; | ||
| 169 | 147 | ||
| 170 | /** | 148 | /** |
| 171 | * 赠送积分 | 149 | * 赠送积分 |
| @@ -188,14 +166,6 @@ public class ProductSpuDO extends BaseDO { | @@ -188,14 +166,6 @@ public class ProductSpuDO extends BaseDO { | ||
| 188 | */ | 166 | */ |
| 189 | private Boolean subCommissionType; | 167 | private Boolean subCommissionType; |
| 190 | 168 | ||
| 191 | - /** | ||
| 192 | - * 活动展示顺序 | ||
| 193 | - * | ||
| 194 | - * 对应 PromotionTypeEnum 枚举 | ||
| 195 | - */ | ||
| 196 | - @TableField(typeHandler = JacksonTypeHandler.class) | ||
| 197 | - private List<Integer> activityOrders; // TODO @芋艿: 活动顺序字段长度需要增加 | ||
| 198 | - | ||
| 199 | // ========== 统计相关字段 ========= | 169 | // ========== 统计相关字段 ========= |
| 200 | 170 | ||
| 201 | /** | 171 | /** |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java
| @@ -64,18 +64,6 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> { | @@ -64,18 +64,6 @@ public interface ProductSpuMapper extends BaseMapperX<ProductSpuDO> { | ||
| 64 | .inIfPresent(ProductSpuDO::getCategoryId, categoryIds); | 64 | .inIfPresent(ProductSpuDO::getCategoryId, categoryIds); |
| 65 | // 上架状态 且有库存 | 65 | // 上架状态 且有库存 |
| 66 | query.eq(ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus()); | 66 | query.eq(ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus()); |
| 67 | - // 推荐类型的过滤条件 | ||
| 68 | - if (ObjUtil.equal(pageReqVO.getRecommendType(), AppProductSpuPageReqVO.RECOMMEND_TYPE_HOT)) { | ||
| 69 | - query.eq(ProductSpuDO::getRecommendHot, true); | ||
| 70 | - } else if (ObjUtil.equal(pageReqVO.getRecommendType(), AppProductSpuPageReqVO.RECOMMEND_TYPE_BENEFIT)) { | ||
| 71 | - query.eq(ProductSpuDO::getRecommendBenefit, true); | ||
| 72 | - } else if (ObjUtil.equal(pageReqVO.getRecommendType(), AppProductSpuPageReqVO.RECOMMEND_TYPE_BEST)) { | ||
| 73 | - query.eq(ProductSpuDO::getRecommendBest, true); | ||
| 74 | - } else if (ObjUtil.equal(pageReqVO.getRecommendType(), AppProductSpuPageReqVO.RECOMMEND_TYPE_NEW)) { | ||
| 75 | - query.eq(ProductSpuDO::getRecommendNew, true); | ||
| 76 | - } else if (ObjUtil.equal(pageReqVO.getRecommendType(), AppProductSpuPageReqVO.RECOMMEND_TYPE_GOOD)) { | ||
| 77 | - query.eq(ProductSpuDO::getRecommendGood, true); | ||
| 78 | - } | ||
| 79 | 67 | ||
| 80 | // 排序逻辑 | 68 | // 排序逻辑 |
| 81 | if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_SALES_COUNT)) { | 69 | if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_SALES_COUNT)) { |
yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/category/ProductCategoryServiceImplTest.java
| @@ -152,8 +152,8 @@ public class ProductCategoryServiceImplTest extends BaseDbUnitTest { | @@ -152,8 +152,8 @@ public class ProductCategoryServiceImplTest extends BaseDbUnitTest { | ||
| 152 | reqVO.setParentId(PARENT_ID_NULL); | 152 | reqVO.setParentId(PARENT_ID_NULL); |
| 153 | 153 | ||
| 154 | // 调用 | 154 | // 调用 |
| 155 | - List<ProductCategoryDO> list = productCategoryService.getEnableCategoryList(reqVO); | ||
| 156 | - List<ProductCategoryDO> all = productCategoryService.getEnableCategoryList(new ProductCategoryListReqVO()); | 155 | + List<ProductCategoryDO> list = productCategoryService.getCategoryList(reqVO); |
| 156 | + List<ProductCategoryDO> all = productCategoryService.getCategoryList(new ProductCategoryListReqVO()); | ||
| 157 | // 断言 | 157 | // 断言 |
| 158 | assertEquals(1, list.size()); | 158 | assertEquals(1, list.size()); |
| 159 | assertEquals(4, all.size()); | 159 | assertEquals(4, all.size()); |
yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java
| @@ -103,11 +103,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -103,11 +103,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 103 | ProductSpuCreateReqVO createReqVO = randomPojo(ProductSpuCreateReqVO.class,o->{ | 103 | ProductSpuCreateReqVO createReqVO = randomPojo(ProductSpuCreateReqVO.class,o->{ |
| 104 | o.setCategoryId(generateId()); | 104 | o.setCategoryId(generateId()); |
| 105 | o.setBrandId(generateId()); | 105 | o.setBrandId(generateId()); |
| 106 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 107 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 106 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 108 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 107 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 109 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 108 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 110 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 111 | o.setSkus(newArrayList(skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO)); | 109 | o.setSkus(newArrayList(skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO)); |
| 112 | }); | 110 | }); |
| 113 | when(categoryService.getCategoryLevel(eq(createReqVO.getCategoryId()))).thenReturn(2); | 111 | when(categoryService.getCategoryLevel(eq(createReqVO.getCategoryId()))).thenReturn(2); |
| @@ -123,11 +121,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -123,11 +121,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 123 | o.setCategoryId(generateId()); | 121 | o.setCategoryId(generateId()); |
| 124 | o.setBrandId(generateId()); | 122 | o.setBrandId(generateId()); |
| 125 | o.setDeliveryTemplateId(generateId()); | 123 | o.setDeliveryTemplateId(generateId()); |
| 126 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 127 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 124 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 128 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 125 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 129 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 126 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 130 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 131 | o.setPrice(generaInt()); // 限制范围为正整数 | 127 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 132 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 128 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 133 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 129 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -156,11 +152,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -156,11 +152,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 156 | o.setId(createReqVO.getId()); // 设置更新的 ID | 152 | o.setId(createReqVO.getId()); // 设置更新的 ID |
| 157 | o.setCategoryId(generateId()); | 153 | o.setCategoryId(generateId()); |
| 158 | o.setBrandId(generateId()); | 154 | o.setBrandId(generateId()); |
| 159 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 160 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 155 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 161 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 156 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 162 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 157 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 163 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 164 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 158 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 165 | o.setSalesCount(generaInt()); // 限制范围为正整数 | 159 | o.setSalesCount(generaInt()); // 限制范围为正整数 |
| 166 | o.setBrowseCount(generaInt()); // 限制范围为正整数 | 160 | o.setBrowseCount(generaInt()); // 限制范围为正整数 |
| @@ -189,11 +183,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -189,11 +183,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 189 | o.setCategoryId(generateId()); | 183 | o.setCategoryId(generateId()); |
| 190 | o.setBrandId(generateId()); | 184 | o.setBrandId(generateId()); |
| 191 | o.setDeliveryTemplateId(generateId()); | 185 | o.setDeliveryTemplateId(generateId()); |
| 192 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 193 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 186 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 194 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 187 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 195 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 188 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 196 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 197 | o.setPrice(generaInt()); // 限制范围为正整数 | 189 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 198 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 190 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 199 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 191 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -218,11 +210,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -218,11 +210,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 218 | o.setCategoryId(generateId()); | 210 | o.setCategoryId(generateId()); |
| 219 | o.setBrandId(generateId()); | 211 | o.setBrandId(generateId()); |
| 220 | o.setDeliveryTemplateId(generateId()); | 212 | o.setDeliveryTemplateId(generateId()); |
| 221 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 222 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 213 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 223 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 214 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 224 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 215 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 225 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 226 | o.setPrice(generaInt()); // 限制范围为正整数 | 216 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 227 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 217 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 228 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 218 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -244,11 +234,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -244,11 +234,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 244 | o.setCategoryId(generateId()); | 234 | o.setCategoryId(generateId()); |
| 245 | o.setBrandId(generateId()); | 235 | o.setBrandId(generateId()); |
| 246 | o.setDeliveryTemplateId(generateId()); | 236 | o.setDeliveryTemplateId(generateId()); |
| 247 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 248 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 237 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 249 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 238 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 250 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 239 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 251 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 252 | o.setPrice(generaInt()); // 限制范围为正整数 | 240 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 253 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 241 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 254 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 242 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -260,11 +248,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -260,11 +248,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 260 | o.setCategoryId(generateId()); | 248 | o.setCategoryId(generateId()); |
| 261 | o.setBrandId(generateId()); | 249 | o.setBrandId(generateId()); |
| 262 | o.setDeliveryTemplateId(generateId()); | 250 | o.setDeliveryTemplateId(generateId()); |
| 263 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 264 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 251 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 265 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 252 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 266 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 253 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 267 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 268 | o.setPrice(generaInt()); // 限制范围为正整数 | 254 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 269 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 255 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 270 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 256 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -287,11 +273,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -287,11 +273,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 287 | o.setCategoryId(generateId()); | 273 | o.setCategoryId(generateId()); |
| 288 | o.setBrandId(generateId()); | 274 | o.setBrandId(generateId()); |
| 289 | o.setDeliveryTemplateId(generateId()); | 275 | o.setDeliveryTemplateId(generateId()); |
| 290 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 291 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 276 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 292 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 277 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 293 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 278 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 294 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 295 | o.setPrice(generaInt()); // 限制范围为正整数 | 279 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 296 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 280 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 297 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 281 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -303,11 +287,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -303,11 +287,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 303 | o.setCategoryId(generateId()); | 287 | o.setCategoryId(generateId()); |
| 304 | o.setBrandId(generateId()); | 288 | o.setBrandId(generateId()); |
| 305 | o.setDeliveryTemplateId(generateId()); | 289 | o.setDeliveryTemplateId(generateId()); |
| 306 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 307 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 290 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 308 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 291 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 309 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 292 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 310 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 311 | o.setPrice(generaInt()); // 限制范围为正整数 | 293 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 312 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 294 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 313 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 295 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -335,11 +317,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -335,11 +317,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 335 | o.setCategoryId(generateId()); | 317 | o.setCategoryId(generateId()); |
| 336 | o.setBrandId(generateId()); | 318 | o.setBrandId(generateId()); |
| 337 | o.setDeliveryTemplateId(generateId()); | 319 | o.setDeliveryTemplateId(generateId()); |
| 338 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 339 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 320 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 340 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 321 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 341 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 322 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 342 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 343 | o.setPrice(generaInt()); // 限制范围为正整数 | 323 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 344 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 324 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 345 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 325 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -351,11 +331,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -351,11 +331,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 351 | o.setCategoryId(generateId()); | 331 | o.setCategoryId(generateId()); |
| 352 | o.setBrandId(generateId()); | 332 | o.setBrandId(generateId()); |
| 353 | o.setDeliveryTemplateId(generateId()); | 333 | o.setDeliveryTemplateId(generateId()); |
| 354 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 355 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 334 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 356 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 335 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 357 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 336 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 358 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 359 | o.setPrice(generaInt()); // 限制范围为正整数 | 337 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 360 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 338 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 361 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 339 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -379,11 +357,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -379,11 +357,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 379 | o.setCategoryId(generateId()); | 357 | o.setCategoryId(generateId()); |
| 380 | o.setBrandId(generateId()); | 358 | o.setBrandId(generateId()); |
| 381 | o.setDeliveryTemplateId(generateId()); | 359 | o.setDeliveryTemplateId(generateId()); |
| 382 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 383 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 360 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 384 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 361 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 385 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 362 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 386 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 387 | o.setPrice(generaInt()); // 限制范围为正整数 | 363 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 388 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 364 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 389 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 365 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -462,11 +438,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -462,11 +438,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 462 | o.setCategoryId(generateId()); | 438 | o.setCategoryId(generateId()); |
| 463 | o.setBrandId(generateId()); | 439 | o.setBrandId(generateId()); |
| 464 | o.setDeliveryTemplateId(generateId()); | 440 | o.setDeliveryTemplateId(generateId()); |
| 465 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 466 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 441 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 467 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 442 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 468 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 443 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 469 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 470 | o.setPrice(generaInt()); // 限制范围为正整数 | 444 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 471 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 445 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 472 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 446 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| @@ -480,11 +454,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | @@ -480,11 +454,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { | ||
| 480 | o.setCategoryId(generateId()); | 454 | o.setCategoryId(generateId()); |
| 481 | o.setBrandId(generateId()); | 455 | o.setBrandId(generateId()); |
| 482 | o.setDeliveryTemplateId(generateId()); | 456 | o.setDeliveryTemplateId(generateId()); |
| 483 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | ||
| 484 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 | 457 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 485 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 | 458 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 486 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 | 459 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 487 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | ||
| 488 | o.setPrice(generaInt()); // 限制范围为正整数 | 460 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 489 | o.setMarketPrice(generaInt()); // 限制范围为正整数 | 461 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 490 | o.setCostPrice(generaInt()); // 限制范围为正整数 | 462 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/vo/activity/AppBargainActivityDetailRespVO.java
| @@ -42,9 +42,6 @@ public class AppBargainActivityDetailRespVO { | @@ -42,9 +42,6 @@ public class AppBargainActivityDetailRespVO { | ||
| 42 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "50") // 从 SPU 的 marketPrice 读取 | 42 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "50") // 从 SPU 的 marketPrice 读取 |
| 43 | private Integer marketPrice; | 43 | private Integer marketPrice; |
| 44 | 44 | ||
| 45 | - @Schema(description = "商品单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") // 从 SPU 的 unit 读取,然后转换 | ||
| 46 | - private String unitName; | ||
| 47 | - | ||
| 48 | @Schema(description = "砍价起始价格,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") | 45 | @Schema(description = "砍价起始价格,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") |
| 49 | private Integer bargainFirstPrice; | 46 | private Integer bargainFirstPrice; |
| 50 | 47 |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/activity/AppSeckillActivityRespVO.java
| @@ -19,8 +19,7 @@ public class AppSeckillActivityRespVO { | @@ -19,8 +19,7 @@ public class AppSeckillActivityRespVO { | ||
| 19 | @Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取 | 19 | @Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取 |
| 20 | example = "https://www.iocoder.cn/xx.png") | 20 | example = "https://www.iocoder.cn/xx.png") |
| 21 | private String picUrl; | 21 | private String picUrl; |
| 22 | - @Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") | ||
| 23 | - private String unitName; | 22 | + |
| 24 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取 | 23 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取 |
| 25 | example = "50") | 24 | example = "50") |
| 26 | private Integer marketPrice; | 25 | private Integer marketPrice; |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/bargain/BargainActivityConvert.java
| @@ -2,9 +2,7 @@ package cn.iocoder.yudao.module.promotion.convert.bargain; | @@ -2,9 +2,7 @@ package cn.iocoder.yudao.module.promotion.convert.bargain; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | ||
| 6 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; | 5 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 7 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | ||
| 8 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityBaseVO; | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityBaseVO; |
| 9 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityPageItemRespVO; | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityPageItemRespVO; |
| 10 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityRespVO; | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityRespVO; |
| @@ -64,8 +62,7 @@ public interface BargainActivityConvert { | @@ -64,8 +62,7 @@ public interface BargainActivityConvert { | ||
| 64 | default AppBargainActivityDetailRespVO convert(BargainActivityDO bean, Integer successUserCount, ProductSpuRespDTO spu) { | 62 | default AppBargainActivityDetailRespVO convert(BargainActivityDO bean, Integer successUserCount, ProductSpuRespDTO spu) { |
| 65 | AppBargainActivityDetailRespVO detail = convert1(bean).setSuccessUserCount(successUserCount); | 63 | AppBargainActivityDetailRespVO detail = convert1(bean).setSuccessUserCount(successUserCount); |
| 66 | if (spu != null) { | 64 | if (spu != null) { |
| 67 | - detail.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()) | ||
| 68 | - .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit())); | 65 | + detail.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()); |
| 69 | } | 66 | } |
| 70 | return detail; | 67 | return detail; |
| 71 | } | 68 | } |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/convert/seckill/seckillactivity/SeckillActivityConvert.java
| @@ -3,9 +3,7 @@ package cn.iocoder.yudao.module.promotion.convert.seckill.seckillactivity; | @@ -3,9 +3,7 @@ package cn.iocoder.yudao.module.promotion.convert.seckill.seckillactivity; | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; | 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 6 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | ||
| 7 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; | 6 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 8 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | ||
| 9 | import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO; | 7 | import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO; |
| 10 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityCreateReqVO; | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityCreateReqVO; |
| 11 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityDetailRespVO; | 9 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityDetailRespVO; |
| @@ -104,8 +102,7 @@ public interface SeckillActivityConvert { | @@ -104,8 +102,7 @@ public interface SeckillActivityConvert { | ||
| 104 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); | 102 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); |
| 105 | // spu 信息 | 103 | // spu 信息 |
| 106 | findAndThen(spuMap, item.getSpuId(), spu -> | 104 | findAndThen(spuMap, item.getSpuId(), spu -> |
| 107 | - item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()) | ||
| 108 | - .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit()))); | 105 | + item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); |
| 109 | return item; | 106 | return item; |
| 110 | })); | 107 | })); |
| 111 | return respVO; | 108 | return respVO; |
| @@ -121,8 +118,7 @@ public interface SeckillActivityConvert { | @@ -121,8 +118,7 @@ public interface SeckillActivityConvert { | ||
| 121 | // product 信息 | 118 | // product 信息 |
| 122 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); | 119 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); |
| 123 | // spu 信息 | 120 | // spu 信息 |
| 124 | - findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice()) | ||
| 125 | - .setUnitName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.PRODUCT_UNIT, spu.getUnit()))); | 121 | + findAndThen(spuMap, item.getSpuId(), spu -> item.setPicUrl(spu.getPicUrl()).setMarketPrice(spu.getMarketPrice())); |
| 126 | return item; | 122 | return item; |
| 127 | }); | 123 | }); |
| 128 | result.setList(list); | 124 | result.setList(list); |