From 356642ecea9136ef0458085e84d17de352df8944 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 25 Oct 2022 22:13:31 +0800 Subject: [PATCH] =?UTF-8?q?review=20=E5=95=86=E5=93=81=E7=9A=84=20save=20?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../category/ProductCategoryDO.java | 2 - .../spu/ProductSpuServiceImplTest.java | 12 ++--- .../dal/dataobject/order/TradeOrderDO.java | 2 +- .../service/order/TradeOrderServiceImpl.java | 2 +- .../src/views/mall/product/spu/save.vue | 51 +++++++++---------- 5 files changed, 30 insertions(+), 39 deletions(-) diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/ProductCategoryDO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/ProductCategoryDO.java index 6671e9b44..93ec925a9 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/ProductCategoryDO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/category/ProductCategoryDO.java @@ -64,6 +64,4 @@ public class ProductCategoryDO extends BaseDO { */ private Integer status; - // TODO 芋艿:is_recommend 是否首页推荐:1-是;0-否 - } 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 a254f636d..8f76cf7b2 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 @@ -29,9 +29,7 @@ import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Import; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -221,15 +219,15 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { // randomPojo(ProductSkuDO.class, o -> o.setSpuId(createReqVO.getId())) ); - Mockito.when(productSkuService.getRemindSpuIds()).thenReturn(remindSpuIds); +// Mockito.when(productSkuService.getRemindSpuIds()).thenReturn(remindSpuIds); // 调用 ProductSpuPageReqVO productSpuPageReqVO = new ProductSpuPageReqVO(); - productSpuPageReqVO.setTabStatus(2); +// productSpuPageReqVO.setTabStatus(2); PageResult spuPage = productSpuService.getSpuPage(productSpuPageReqVO); - ArrayList resultRemindSpuIds = new ArrayList<>(); + Set resultRemindSpuIds = new HashSet<>(); resultRemindSpuIds.add(null); PageResult result = ProductSpuConvert.INSTANCE.convertPage(productSpuMapper.selectPage(productSpuPageReqVO, resultRemindSpuIds)); Assertions.assertIterableEquals(result.getList(), spuPage.getList()); @@ -249,7 +247,7 @@ public class ProductSpuServiceImplTest extends BaseDbUnitTest { // randomPojo(ProductSkuDO.class, o -> o.setSpuId(createReqVO.getId())) ); - Mockito.when(productSkuService.getRemindSpuIds()).thenReturn(remindSpuIds); +// Mockito.when(productSkuService.getRemindSpuIds()).thenReturn(remindSpuIds); // 调用 AppSpuPageReqVO appSpuPageReqVO = new AppSpuPageReqVO(); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java index 77bdf66b0..0be06c418 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java @@ -38,7 +38,7 @@ public class TradeOrderDO extends BaseDO { * * 例如说,1146347329394184195 */ - private String sn; + private String no; /** * 订单类型 * diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java index f47152150..a6943909d 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceImpl.java @@ -123,7 +123,7 @@ public class TradeOrderServiceImpl implements TradeOrderService { Long loginUserId, String clientIp) { tradeOrderDO.setUserId(loginUserId); tradeOrderDO.setUserIp(clientIp); - tradeOrderDO.setSn(IdUtil.getSnowflakeNextId() + ""); // TODO @LeeYan9: 思考下, 怎么生成好点哈; 这个是会展示给用户的; + tradeOrderDO.setNo(IdUtil.getSnowflakeNextId() + ""); // TODO @LeeYan9: 思考下, 怎么生成好点哈; 这个是会展示给用户的; tradeOrderDO.setStatus(TradeOrderStatusEnum.WAITING_PAYMENT.getStatus()); tradeOrderDO.setType(TradeOrderTypeEnum.NORMAL.getType()); tradeOrderDO.setRefundStatus(TradeOrderRefundStatusEnum.NONE.getStatus()); diff --git a/yudao-ui-admin/src/views/mall/product/spu/save.vue b/yudao-ui-admin/src/views/mall/product/spu/save.vue index f24644135..b06c6b736 100644 --- a/yudao-ui-admin/src/views/mall/product/spu/save.vue +++ b/yudao-ui-admin/src/views/mall/product/spu/save.vue @@ -1,11 +1,14 @@ - 添加规格项目 - + 添加规格项目 @@ -76,15 +77,13 @@ @@ -112,17 +110,14 @@ @@ -134,17 +129,17 @@