diff --git a/pom.xml b/pom.xml index 9cb1fc48c..b3651b59a 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ yudao-module-member yudao-module-system yudao-module-infra - + yudao-module-pay diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java index 45d42f41b..5c4ee9bb7 100644 --- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java +++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/api/spu/dto/ProductSpuRespDTO.java @@ -79,7 +79,7 @@ public class ProductSpuRespDTO { *

* 枚举 {@link ProductSpuSpecTypeEnum} */ - private Integer specType; + private Boolean specType; /** * 最小价格,单位使用:分 *

diff --git a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java index af455bece..24488df62 100644 --- a/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java +++ b/yudao-module-mall/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/spu/ProductSpuSpecTypeEnum.java @@ -16,15 +16,15 @@ import java.util.Arrays; @Deprecated public enum ProductSpuSpecTypeEnum implements IntArrayValuable { - RECYCLE(1, "统一规格"), - DISABLE(2, "多规格"); - - public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuSpecTypeEnum::getType).toArray(); + RECYCLE(false, "统一规格"), + DISABLE(true, "多规格"); + //public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ProductSpuSpecTypeEnum::getType).toArray();// TODO 暂时先这样跑起来 + public static final int[] ARRAYS = {}; /** * 规格类型 */ - private final Integer type; + private final Boolean type; /** * 规格名称 */ diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java index 3f0c94a74..f69006364 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/spu/vo/ProductSpuBaseVO.java @@ -57,8 +57,7 @@ public class ProductSpuBaseVO { @Schema(description = "规格类型", required = true, example = "1") @NotNull(message = "规格类型不能为空") - @InEnum(ProductSpuSpecTypeEnum.class) - private Integer specType; + private Boolean specType; @Schema(description = "是否展示库存", required = true, example = "true") @NotNull(message = "是否展示库存不能为空") diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java index cf5471cba..424843bc7 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/spu/vo/AppProductSpuDetailRespVO.java @@ -35,8 +35,8 @@ public class AppProductSpuDetailRespVO { // ========== SKU 相关字段 ========= - @Schema(description = "规格类型", required = true, example = "1") - private Integer specType; + @Schema(description = "规格类型", required = true, example = "true") + private Boolean specType; @Schema(description = "是否展示库存", required = true, example = "true") private Boolean showStock; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java index f397dfc48..9b7714bb9 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/sku/ProductSkuConvert.java @@ -37,7 +37,8 @@ public interface ProductSkuConvert { default List convertList06(List list, Long spuId, String spuName) { List result = convertList06(list); - result.forEach(item -> item.setSpuId(spuId).setSpuName(spuName)); + // result.forEach(item -> item.setSpuId(spuId).setSpuName(spuName)); TODO ProductSkuDO中已经没有name相关属性 + result.forEach(item -> item.setSpuId(spuId)); return result; } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java index 56bc54499..96378faf7 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/sku/ProductSkuMapper.java @@ -26,8 +26,8 @@ public interface ProductSkuMapper extends BaseMapperX { default List selectListBySpuIdAndStatus(Long spuId, Integer status) { return selectList(new LambdaQueryWrapperX() - .eq(ProductSkuDO::getSpuId, spuId) - .eqIfPresent(ProductSkuDO::getStatus, status)); + .eq(ProductSkuDO::getSpuId, spuId)// eqIfPresent(ProductSkuDO::getStatus, status) TODO ProductSkuDO已经没有status属性 + ); } default List selectListBySpuId(Collection spuIds) { diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java index 57a3125d8..256bc43f1 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/spu/ProductSpuMapper.java @@ -52,7 +52,8 @@ public interface ProductSpuMapper extends BaseMapperX { .eqIfPresent(ProductSpuDO::getStatus, status); // 排序逻辑 if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_PRICE)) { - query.orderBy(true, pageReqVO.getSortAsc(), ProductSpuDO::getMaxPrice); + // TODO ProductSpuDO 已经没有maxPrice 属性 + //query.orderBy(true, pageReqVO.getSortAsc(), ProductSpuDO::getMaxPrice); } else if (Objects.equals(pageReqVO.getSortField(), AppProductSpuPageReqVO.SORT_FIELD_SALES_COUNT)) { query.orderBy(true, pageReqVO.getSortAsc(), ProductSpuDO::getSalesCount); } diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java index 621e12d9f..8db4911ab 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuService.java @@ -50,7 +50,7 @@ public interface ProductSkuService { * * @param list sku组合的集合 */ - void validateSkuList(List list, Integer specType); + void validateSkuList(List list, Boolean specType); /** * 批量创建 SKU diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java index 1ab2523cc..058699aeb 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java @@ -79,7 +79,7 @@ public class ProductSkuServiceImpl implements ProductSkuService { } @Override - public void validateSkuList(List skus, Integer specType) { + public void validateSkuList(List skus, Boolean specType) { // 非多规格,不需要校验 if (ObjectUtil.notEqual(specType, ProductSpuSpecTypeEnum.DISABLE.getType())) { return; diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java index 0dd9cdf55..352c8b341 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java @@ -102,9 +102,10 @@ public class ProductSpuServiceImpl implements ProductSpuService { */ private void initSpuFromSkus(ProductSpuDO spu, List skus) { spu.setMarketPrice(getMaxValue(skus, ProductSkuCreateOrUpdateReqVO::getMarketPrice)); - spu.setMaxPrice(getMaxValue(skus, ProductSkuCreateOrUpdateReqVO::getPrice)); - spu.setMinPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getPrice)); - spu.setTotalStock(getSumValue(skus, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); + // TODO ProductSpuDO中已没有相关属性 + //spu.setMaxPrice(getMaxValue(skus, ProductSkuCreateOrUpdateReqVO::getPrice)); + //spu.setMinPrice(getMinValue(skus, ProductSkuCreateOrUpdateReqVO::getPrice)); + //spu.setTotalStock(getSumValue(skus, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); } /** diff --git a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java index fbd50cad7..17027fc55 100755 --- a/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java +++ b/yudao-module-mall/yudao-module-product-biz/src/test/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImplTest.java @@ -94,6 +94,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { ProductSpuDO productSpuDO = productSpuMapper.selectById(spu); createReqVO.setMarketPrice(CollectionUtils.getMaxValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getMarketPrice)); + // TODO ProductSpuCreateReqVO中已没有相关属性 // createReqVO.setMaxPrice(CollectionUtils.getMaxValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getPrice)); // createReqVO.setMinPrice(CollectionUtils.getMinValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getPrice)); // createReqVO.setTotalStock(CollectionUtils.getSumValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); @@ -118,6 +119,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { List skuCreateReqList = reqVO.getSkus(); reqVO.setMarketPrice(CollectionUtils.getMaxValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getMarketPrice)); + // TODO ProductSpuUpdateReqVO中已没有相关属性 // reqVO.setMaxPrice(CollectionUtils.getMaxValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getPrice)); // reqVO.setMinPrice(CollectionUtils.getMinValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getPrice)); // reqVO.setTotalStock(CollectionUtils.getSumValue(skuCreateReqList, ProductSkuCreateOrUpdateReqVO::getStock, Integer::sum)); @@ -193,21 +195,21 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { // 准备参数 ProductSpuDO createReqVO = randomPojo(ProductSpuDO.class, o->{ o.setStatus(ProductSpuStatusEnum.ENABLE.getStatus()); - o.setTotalStock(500); - o.setMinPrice(1); - o.setMaxPrice(50); + //o.setTotalStock(500); + //o.setMinPrice(1); // TODO ProductSpuDO中已没有相关属性 + //o.setMaxPrice(50); o.setMarketPrice(25); o.setSpecType(ProductSpuSpecTypeEnum.RECYCLE.getType()); o.setBrandId(brandId); o.setCategoryId(categoryId); - o.setClickCount(100); - o.setCode(code); + //o.setClickCount(100); + //o.setCode(code); // TODO ProductSpuDO中已没有相关属性 o.setDescription("测试商品"); o.setSliderPicUrls(new ArrayList<>()); o.setName("测试"); o.setSalesCount(100); - o.setSellPoint("超级加倍"); - o.setShowStock(true); + //o.setSellPoint("超级加倍"); + //o.setShowStock(true); // TODO ProductSpuDO中已没有相关属性 o.setVideoUrl(""); }); productSpuMapper.insert(createReqVO); @@ -241,21 +243,21 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { // 准备参数 ProductSpuDO createReqVO = randomPojo(ProductSpuDO.class, o->{ o.setStatus(ProductSpuStatusEnum.ENABLE.getStatus()); - o.setTotalStock(1); - o.setMinPrice(1); - o.setMaxPrice(1); + //o.setTotalStock(1); + //o.setMinPrice(1); // TODO ProductSpuDO中已没有相关属性 + //o.setMaxPrice(1); o.setMarketPrice(1); o.setSpecType(ProductSpuSpecTypeEnum.RECYCLE.getType()); o.setBrandId(brandId); o.setCategoryId(categoryId); - o.setClickCount(1); - o.setCode(generateNo()); + //o.setClickCount(1); // TODO ProductSpuDO中已没有相关属性 + //o.setCode(generateNo()); o.setDescription("测试商品"); o.setSliderPicUrls(new ArrayList<>()); o.setName("测试"); o.setSalesCount(1); - o.setSellPoint("卖点"); - o.setShowStock(true); + //o.setSellPoint("卖点"); + //o.setShowStock(true); // TODO ProductSpuDO中已没有相关属性 }); // 准备参数 @@ -345,15 +347,15 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { public void testUpdateSpuStock() { // 准备参数 Map stockIncrCounts = MapUtil.builder(1L, 10).put(2L, -20).build(); - // mock 方法(数据) - productSpuMapper.insert(randomPojo(ProductSpuDO.class, o -> o.setId(1L).setTotalStock(20))); - productSpuMapper.insert(randomPojo(ProductSpuDO.class, o -> o.setId(2L).setTotalStock(30))); + // mock 方法(数据) // TODO ProductSpuDO中已没有相关属性 + //productSpuMapper.insert(randomPojo(ProductSpuDO.class, o -> o.setId(1L).setTotalStock(20))); + //productSpuMapper.insert(randomPojo(ProductSpuDO.class, o -> o.setId(2L).setTotalStock(30))); // 调用 productSpuService.updateSpuStock(stockIncrCounts); - // 断言 - assertEquals(productSpuService.getSpu(1L).getTotalStock(), 30); - assertEquals(productSpuService.getSpu(2L).getTotalStock(), 10); + // 断言 // TODO ProductSpuDO中已没有相关属性 + //assertEquals(productSpuService.getSpu(1L).getTotalStock(), 30); + //assertEquals(productSpuService.getSpu(2L).getTotalStock(), 10); } } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java index f64d1376c..4a36d4acc 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.controller.app.order; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO; import cn.iocoder.yudao.module.product.api.property.ProductPropertyValueApi;