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
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
| 1 | 1 | package cn.iocoder.yudao.module.product.controller.admin.property; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*; |
| 7 | 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 | 7 | import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; |
| 11 | -import cn.iocoder.yudao.module.product.service.property.ProductPropertyValueService; | |
| 12 | 8 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 14 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 11 | +import jakarta.annotation.Resource; | |
| 12 | +import jakarta.validation.Valid; | |
| 15 | 13 | import org.springframework.security.access.prepost.PreAuthorize; |
| 16 | 14 | import org.springframework.validation.annotation.Validated; |
| 17 | 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 | 17 | import java.util.List; |
| 23 | 18 | |
| 24 | 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 | 21 | @Tag(name = "管理后台 - 商品属性项") |
| 28 | 22 | @RestController |
| ... | ... | @@ -32,8 +26,6 @@ public class ProductPropertyController { |
| 32 | 26 | |
| 33 | 27 | @Resource |
| 34 | 28 | private ProductPropertyService productPropertyService; |
| 35 | - @Resource | |
| 36 | - private ProductPropertyValueService productPropertyValueService; | |
| 37 | 29 | |
| 38 | 30 | @PostMapping("/create") |
| 39 | 31 | @Operation(summary = "创建属性项") |
| ... | ... | @@ -81,20 +73,4 @@ public class ProductPropertyController { |
| 81 | 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 | 47 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.iocoder.cn/xx.png, https://www.iocoder.cn/xxx.png]") |
| 48 | 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 | 50 | @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") |
| 58 | 51 | @NotNull(message = "商品排序字段不能为空") |
| 59 | 52 | private Integer sort; |
| ... | ... | @@ -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 | 66 | @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") |
| 70 | 67 | @NotNull(message = "物流配置模板编号不能为空") |
| 71 | 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 | 72 | @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "111") |
| 96 | 73 | @NotNull(message = "商品赠送积分不能为空") |
| 97 | 74 | private Integer giveIntegral; |
| ... | ... | @@ -100,9 +77,6 @@ public class ProductSpuBaseVO { |
| 100 | 77 | @NotNull(message = "商品分销类型不能为空") |
| 101 | 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 | 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 | 44 | @ExcelProperty("商品封面图") |
| 45 | 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 | 47 | @ExcelProperty("排序字段") |
| 55 | 48 | private Integer sort; |
| 56 | 49 | |
| ... | ... | @@ -76,21 +69,6 @@ public class ProductSpuExcelVO { |
| 76 | 69 | @ExcelProperty("物流配置模板编号") |
| 77 | 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 | 72 | @ExcelProperty("赠送积分") |
| 95 | 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 | 33 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) |
| 34 | 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 | 38 | // ========== SKU 相关字段 ========= |
| 48 | 39 | |
| 49 | 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 | 27 | @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED) |
| 28 | 28 | private List<String> sliderPicUrls; |
| 29 | 29 | |
| 30 | - @Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") | |
| 31 | - private String unitName; | |
| 32 | - | |
| 33 | 30 | // ========== SKU 相关字段 ========= |
| 34 | 31 | |
| 35 | 32 | @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") |
| ... | ... | @@ -43,15 +40,12 @@ public class AppProductSpuPageRespVO { |
| 43 | 40 | |
| 44 | 41 | @Schema(description = "VIP 价格,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "968") // 通过会员等级,计算出折扣后价格 |
| 45 | 42 | private Integer vipPrice; |
| 46 | - | |
| 43 | + | |
| 47 | 44 | @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "666") |
| 48 | 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 | 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 | 1 | package cn.iocoder.yudao.module.product.convert.property; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.collection.CollUtil; | |
| 4 | 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 | 4 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO; |
| 8 | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyRespVO; |
| 9 | 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO; |
| 10 | 7 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 11 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; | |
| 12 | 8 | import org.mapstruct.Mapper; |
| 13 | 9 | import org.mapstruct.factory.Mappers; |
| 14 | 10 | |
| 15 | -import java.util.Collections; | |
| 16 | 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 | 14 | * 属性项 Convert |
| ... | ... | @@ -38,20 +30,4 @@ public interface ProductPropertyConvert { |
| 38 | 30 | |
| 39 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | |
| 6 | 5 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 7 | 6 | import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*; |
| 8 | 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 | 10 | import cn.iocoder.yudao.module.product.convert.sku.ProductSkuConvert; |
| 12 | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| 13 | 12 | import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; |
| 14 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | |
| 15 | 13 | import org.mapstruct.Mapper; |
| 16 | 14 | import org.mapstruct.Mapping; |
| 17 | 15 | import org.mapstruct.Named; |
| ... | ... | @@ -74,13 +72,7 @@ public interface ProductSpuConvert { |
| 74 | 72 | // 处理虚拟销量 |
| 75 | 73 | list.forEach(spu -> spu.setSalesCount(spu.getSalesCount() + spu.getVirtualSalesCount())); |
| 76 | 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 | 78 | @Named("convertListForGetSpuList0") |
| ... | ... | @@ -89,8 +81,7 @@ public interface ProductSpuConvert { |
| 89 | 81 | default AppProductSpuDetailRespVO convertForGetSpuDetail(ProductSpuDO spu, List<ProductSkuDO> skus) { |
| 90 | 82 | // 处理 SPU |
| 91 | 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 | 85 | // 处理 SKU |
| 95 | 86 | spuVO.setSkus(convertListForGetSpuDetail(skus)); |
| 96 | 87 | return spuVO; | ... | ... |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/spu/ProductSpuDO.java
| 1 | 1 | package cn.iocoder.yudao.module.product.dal.dataobject.spu; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.type.IntegerListTypeHandler; | |
| 4 | 5 | import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO; |
| 5 | 6 | import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO; |
| 6 | 7 | import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; |
| ... | ... | @@ -80,18 +81,8 @@ public class ProductSpuDO extends BaseDO { |
| 80 | 81 | */ |
| 81 | 82 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 82 | 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 | 88 | private Integer sort; |
| ... | ... | @@ -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 | 142 | * 对应 TradeDeliveryExpressTemplateDO 的 id 编号 |
| ... | ... | @@ -146,26 +144,6 @@ public class ProductSpuDO extends BaseDO { |
| 146 | 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 | 166 | */ |
| 189 | 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 | 64 | .inIfPresent(ProductSpuDO::getCategoryId, categoryIds); |
| 65 | 65 | // 上架状态 且有库存 |
| 66 | 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 | 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 | 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 | 158 | assertEquals(1, list.size()); |
| 159 | 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 | 103 | ProductSpuCreateReqVO createReqVO = randomPojo(ProductSpuCreateReqVO.class,o->{ |
| 104 | 104 | o.setCategoryId(generateId()); |
| 105 | 105 | o.setBrandId(generateId()); |
| 106 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 107 | 106 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 108 | 107 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 109 | 108 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 110 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 111 | 109 | o.setSkus(newArrayList(skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO,skuCreateOrUpdateReqVO)); |
| 112 | 110 | }); |
| 113 | 111 | when(categoryService.getCategoryLevel(eq(createReqVO.getCategoryId()))).thenReturn(2); |
| ... | ... | @@ -123,11 +121,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 123 | 121 | o.setCategoryId(generateId()); |
| 124 | 122 | o.setBrandId(generateId()); |
| 125 | 123 | o.setDeliveryTemplateId(generateId()); |
| 126 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 127 | 124 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 128 | 125 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 129 | 126 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 130 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 131 | 127 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 132 | 128 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 133 | 129 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -156,11 +152,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 156 | 152 | o.setId(createReqVO.getId()); // 设置更新的 ID |
| 157 | 153 | o.setCategoryId(generateId()); |
| 158 | 154 | o.setBrandId(generateId()); |
| 159 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 160 | 155 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 161 | 156 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 162 | 157 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 163 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 164 | 158 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 165 | 159 | o.setSalesCount(generaInt()); // 限制范围为正整数 |
| 166 | 160 | o.setBrowseCount(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -189,11 +183,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 189 | 183 | o.setCategoryId(generateId()); |
| 190 | 184 | o.setBrandId(generateId()); |
| 191 | 185 | o.setDeliveryTemplateId(generateId()); |
| 192 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 193 | 186 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 194 | 187 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 195 | 188 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 196 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 197 | 189 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 198 | 190 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 199 | 191 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -218,11 +210,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 218 | 210 | o.setCategoryId(generateId()); |
| 219 | 211 | o.setBrandId(generateId()); |
| 220 | 212 | o.setDeliveryTemplateId(generateId()); |
| 221 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 222 | 213 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 223 | 214 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 224 | 215 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 225 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 226 | 216 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 227 | 217 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 228 | 218 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -244,11 +234,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 244 | 234 | o.setCategoryId(generateId()); |
| 245 | 235 | o.setBrandId(generateId()); |
| 246 | 236 | o.setDeliveryTemplateId(generateId()); |
| 247 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 248 | 237 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 249 | 238 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 250 | 239 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 251 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 252 | 240 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 253 | 241 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 254 | 242 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -260,11 +248,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 260 | 248 | o.setCategoryId(generateId()); |
| 261 | 249 | o.setBrandId(generateId()); |
| 262 | 250 | o.setDeliveryTemplateId(generateId()); |
| 263 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 264 | 251 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 265 | 252 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 266 | 253 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 267 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 268 | 254 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 269 | 255 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 270 | 256 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -287,11 +273,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 287 | 273 | o.setCategoryId(generateId()); |
| 288 | 274 | o.setBrandId(generateId()); |
| 289 | 275 | o.setDeliveryTemplateId(generateId()); |
| 290 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 291 | 276 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 292 | 277 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 293 | 278 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 294 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 295 | 279 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 296 | 280 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 297 | 281 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -303,11 +287,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 303 | 287 | o.setCategoryId(generateId()); |
| 304 | 288 | o.setBrandId(generateId()); |
| 305 | 289 | o.setDeliveryTemplateId(generateId()); |
| 306 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 307 | 290 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 308 | 291 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 309 | 292 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 310 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 311 | 293 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 312 | 294 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 313 | 295 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -335,11 +317,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 335 | 317 | o.setCategoryId(generateId()); |
| 336 | 318 | o.setBrandId(generateId()); |
| 337 | 319 | o.setDeliveryTemplateId(generateId()); |
| 338 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 339 | 320 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 340 | 321 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 341 | 322 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 342 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 343 | 323 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 344 | 324 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 345 | 325 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -351,11 +331,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 351 | 331 | o.setCategoryId(generateId()); |
| 352 | 332 | o.setBrandId(generateId()); |
| 353 | 333 | o.setDeliveryTemplateId(generateId()); |
| 354 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 355 | 334 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 356 | 335 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 357 | 336 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 358 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 359 | 337 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 360 | 338 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 361 | 339 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -379,11 +357,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 379 | 357 | o.setCategoryId(generateId()); |
| 380 | 358 | o.setBrandId(generateId()); |
| 381 | 359 | o.setDeliveryTemplateId(generateId()); |
| 382 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 383 | 360 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 384 | 361 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 385 | 362 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 386 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 387 | 363 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 388 | 364 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 389 | 365 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -462,11 +438,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 462 | 438 | o.setCategoryId(generateId()); |
| 463 | 439 | o.setBrandId(generateId()); |
| 464 | 440 | o.setDeliveryTemplateId(generateId()); |
| 465 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 466 | 441 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 467 | 442 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 468 | 443 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 469 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 470 | 444 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 471 | 445 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 472 | 446 | o.setCostPrice(generaInt()); // 限制范围为正整数 |
| ... | ... | @@ -480,11 +454,9 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { |
| 480 | 454 | o.setCategoryId(generateId()); |
| 481 | 455 | o.setBrandId(generateId()); |
| 482 | 456 | o.setDeliveryTemplateId(generateId()); |
| 483 | - o.setUnit(RandomUtil.randomInt(1,20)); // 限制商品单位范围 | |
| 484 | 457 | o.setSort(RandomUtil.randomInt(1,100)); // 限制排序范围 |
| 485 | 458 | o.setGiveIntegral(generaInt()); // 限制范围为正整数 |
| 486 | 459 | o.setVirtualSalesCount(generaInt()); // 限制范围为正整数 |
| 487 | - o.setActivityOrders(newArrayList(1,3,2,4,5)); // 活动排序 | |
| 488 | 460 | o.setPrice(generaInt()); // 限制范围为正整数 |
| 489 | 461 | o.setMarketPrice(generaInt()); // 限制范围为正整数 |
| 490 | 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 | 42 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "50") // 从 SPU 的 marketPrice 读取 |
| 43 | 43 | private Integer marketPrice; |
| 44 | 44 | |
| 45 | - @Schema(description = "商品单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") // 从 SPU 的 unit 读取,然后转换 | |
| 46 | - private String unitName; | |
| 47 | - | |
| 48 | 45 | @Schema(description = "砍价起始价格,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") |
| 49 | 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 | 19 | @Schema(description = "商品图片", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 picUrl 读取 |
| 20 | 20 | example = "https://www.iocoder.cn/xx.png") |
| 21 | 21 | private String picUrl; |
| 22 | - @Schema(description = "单位名", requiredMode = Schema.RequiredMode.REQUIRED, example = "个") | |
| 23 | - private String unitName; | |
| 22 | + | |
| 24 | 23 | @Schema(description = "商品市场价,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, // 从 SPU 的 marketPrice 读取 |
| 25 | 24 | example = "50") |
| 26 | 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 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | |
| 6 | 5 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 7 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | |
| 8 | 6 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityBaseVO; |
| 9 | 7 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityPageItemRespVO; |
| 10 | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.bargain.vo.activity.BargainActivityRespVO; |
| ... | ... | @@ -64,8 +62,7 @@ public interface BargainActivityConvert { |
| 64 | 62 | default AppBargainActivityDetailRespVO convert(BargainActivityDO bean, Integer successUserCount, ProductSpuRespDTO spu) { |
| 65 | 63 | AppBargainActivityDetailRespVO detail = convert1(bean).setSuccessUserCount(successUserCount); |
| 66 | 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 | 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 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.util.collection.MapUtils; |
| 6 | -import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | |
| 7 | 6 | import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; |
| 8 | -import cn.iocoder.yudao.module.product.enums.DictTypeConstants; | |
| 9 | 7 | import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO; |
| 10 | 8 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityCreateReqVO; |
| 11 | 9 | import cn.iocoder.yudao.module.promotion.controller.admin.seckill.vo.activity.SeckillActivityDetailRespVO; |
| ... | ... | @@ -104,8 +102,7 @@ public interface SeckillActivityConvert { |
| 104 | 102 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); |
| 105 | 103 | // spu 信息 |
| 106 | 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 | 106 | return item; |
| 110 | 107 | })); |
| 111 | 108 | return respVO; |
| ... | ... | @@ -121,8 +118,7 @@ public interface SeckillActivityConvert { |
| 121 | 118 | // product 信息 |
| 122 | 119 | item.setSeckillPrice(getMinValue(productMap.get(item.getId()), SeckillProductDO::getSeckillPrice)); |
| 123 | 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 | 122 | return item; |
| 127 | 123 | }); |
| 128 | 124 | result.setList(list); | ... | ... |