diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.http b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.http similarity index 100% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.http rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.http diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.java similarity index 72% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.java index 9216773ad..c442cd7d0 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/TradeCartController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/AppCartController.java @@ -2,11 +2,8 @@ package cn.iocoder.yudao.module.trade.controller.app.cart; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartAddReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartListRespVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartResetReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartUpdateReqVO; -import cn.iocoder.yudao.module.trade.service.cart.TradeCartService; +import cn.iocoder.yudao.module.trade.controller.app.cart.vo.*; +import cn.iocoder.yudao.module.trade.service.cart.CartService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -29,30 +26,38 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti @RequiredArgsConstructor @Validated @Slf4j -public class TradeCartController { +public class AppCartController { @Resource - private TradeCartService cartService; + private CartService cartService; @PostMapping("/add") @Operation(summary = "添加购物车商品") @PreAuthenticated - public CommonResult addCart(@Valid @RequestBody AppTradeCartAddReqVO addCountReqVO) { + public CommonResult addCart(@Valid @RequestBody AppCartAddReqVO addCountReqVO) { return success(cartService.addCart(getLoginUserId(), addCountReqVO)); } - @PutMapping("/update") - @Operation(summary = "更新购物车商品") + @PutMapping("/update-count") + @Operation(summary = "更新购物车商品数量") @PreAuthenticated - public CommonResult updateCart(@Valid @RequestBody AppTradeCartUpdateReqVO updateReqVO) { - cartService.updateCart(getLoginUserId(), updateReqVO); + public CommonResult updateCartCount(@Valid @RequestBody AppCartUpdateCountReqVO updateReqVO) { + cartService.updateCartCount(getLoginUserId(), updateReqVO); + return success(true); + } + + @PutMapping("/update-selected") + @Operation(summary = "更新购物车商品选中") + @PreAuthenticated + public CommonResult updateCartSelected(@Valid @RequestBody AppCartUpdateSelectedReqVO updateReqVO) { + cartService.updateCartSelected(getLoginUserId(), updateReqVO); return success(true); } @PutMapping("/reset") @Operation(summary = "重置购物车商品") @PreAuthenticated - public CommonResult resetCart(@Valid @RequestBody AppTradeCartResetReqVO updateReqVO) { + public CommonResult resetCart(@Valid @RequestBody AppCartResetReqVO updateReqVO) { cartService.resetCart(getLoginUserId(), updateReqVO); return success(true); } @@ -83,7 +88,7 @@ public class TradeCartController { @GetMapping("/list") @Operation(summary = "查询用户的购物车列表") @PreAuthenticated - public CommonResult getCartList() { + public CommonResult getCartList() { return success(cartService.getCartList(getLoginUserId())); } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartAddReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartAddReqVO.java similarity index 72% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartAddReqVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartAddReqVO.java index 8ea754849..b538f6174 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartAddReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartAddReqVO.java @@ -7,7 +7,7 @@ import javax.validation.constraints.NotNull; @Schema(description = "用户 App - 购物车添加购物项 Request VO") @Data -public class AppTradeCartAddReqVO { +public class AppCartAddReqVO { @Schema(description = "商品 SKU 编号", requiredMode = Schema.RequiredMode.REQUIRED,example = "1024") @NotNull(message = "商品 SKU 编号不能为空") @@ -17,8 +17,4 @@ public class AppTradeCartAddReqVO { @NotNull(message = "数量不能为空") private Integer count; - @Schema(description = "是否添加到购物车", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") - @NotNull(message = "是否添加购物车不能为空") - private Boolean addStatus; - } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartDetailRespVO.java similarity index 99% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartDetailRespVO.java index cd68edbbc..1a28d96a6 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartDetailRespVO.java @@ -8,7 +8,7 @@ import java.util.List; @Schema(description = "用户 App - 用户的购物车明细 Response VO") @Data -public class AppTradeCartDetailRespVO { +public class AppCartDetailRespVO { /** * 商品分组数组 diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartListRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartListRespVO.java similarity index 86% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartListRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartListRespVO.java index 3f6dfe104..cef09f78f 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartListRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartListRespVO.java @@ -9,7 +9,7 @@ import java.util.List; @Schema(description = "用户 App - 用户的购物列表 Response VO") @Data -public class AppTradeCartListRespVO { +public class AppCartListRespVO { /** * 有效的购物项数组 @@ -31,6 +31,9 @@ public class AppTradeCartListRespVO { @Schema(description = "商品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private Integer count; + @Schema(description = "是否选中", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") + private Boolean selected; + /** * 商品 SPU */ diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartResetReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartResetReqVO.java similarity index 95% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartResetReqVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartResetReqVO.java index 81c7b0bf3..1ef82c69b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartResetReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartResetReqVO.java @@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull; @Schema(description = "用户 App - 购物车重置 Request VO") @Data -public class AppTradeCartResetReqVO { +public class AppCartResetReqVO { @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "编号不能为空") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartUpdateReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateCountReqVO.java similarity index 85% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartUpdateReqVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateCountReqVO.java index d0d2fff02..4341d501d 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateCountReqVO.java @@ -6,9 +6,9 @@ import lombok.Data; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; -@Schema(description = "用户 App - 购物车更新 Request VO") +@Schema(description = "用户 App - 购物车更新数量 Request VO") @Data -public class AppTradeCartUpdateReqVO { +public class AppCartUpdateCountReqVO { @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") @NotNull(message = "编号不能为空") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateSelectedReqVO.java similarity index 64% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateSelectedReqVO.java index adf213b93..3348d2d19 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppTradeCartItemUpdateSelectedReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/cart/vo/AppCartUpdateSelectedReqVO.java @@ -8,11 +8,11 @@ import java.util.Collection; @Schema(description = "用户 App - 购物车更新是否选中 Request VO") @Data -public class AppTradeCartItemUpdateSelectedReqVO { +public class AppCartUpdateSelectedReqVO { - @Schema(description = "商品 SKU 编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024,2048") - @NotNull(message = "商品 SKU 编号列表不能为空") - private Collection skuIds; + @Schema(description = "编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024,2048") + @NotNull(message = "编号列表不能为空") + private Collection ids; @Schema(description = "是否选中", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") @NotNull(message = "是否选中不能为空") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/cart/TradeCartConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/cart/TradeCartConvert.java index 519b82fc9..83cd45954 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/cart/TradeCartConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/cart/TradeCartConvert.java @@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; import cn.iocoder.yudao.module.trade.controller.app.base.sku.AppProductSkuBaseRespVO; import cn.iocoder.yudao.module.trade.controller.app.base.spu.AppProductSpuBaseRespVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartListRespVO; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; +import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppCartListRespVO; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -21,16 +21,16 @@ public interface TradeCartConvert { TradeCartConvert INSTANCE = Mappers.getMapper(TradeCartConvert.class); - default AppTradeCartListRespVO convertList(List carts, - List spus, List skus) { + default AppCartListRespVO convertList(List carts, + List spus, List skus) { Map spuMap = convertMap(spus, ProductSpuRespDTO::getId); Map skuMap = convertMap(skus, ProductSkuRespDTO::getId); // 遍历,开始转换 - List validList = new ArrayList<>(carts.size()); - List invalidList = new ArrayList<>(); + List validList = new ArrayList<>(carts.size()); + List invalidList = new ArrayList<>(); carts.forEach(cart -> { - AppTradeCartListRespVO.Cart cartVO = new AppTradeCartListRespVO.Cart(); - cartVO.setId(cart.getId()).setCount(cart.getCount()); + AppCartListRespVO.Cart cartVO = new AppCartListRespVO.Cart(); + cartVO.setId(cart.getId()).setCount(cart.getCount()).setSelected(cart.getSelected()); ProductSpuRespDTO spu = spuMap.get(cart.getSpuId()); ProductSkuRespDTO sku = skuMap.get(cart.getSkuId()); cartVO.setSpu(convert(spu)).setSku(convert(sku)); @@ -38,13 +38,14 @@ public interface TradeCartConvert { if (spu == null || !ProductSpuStatusEnum.isEnable(spu.getStatus()) || spu.getStock() <= 0) { + cartVO.setSelected(false); // 强制设置成不可选中 invalidList.add(cartVO); } else { // 虽然 SKU 可能也会不存在,但是可以通过购物车重新选择 validList.add(cartVO); } }); - return new AppTradeCartListRespVO().setValidList(validList).setInvalidList(invalidList); + return new AppCartListRespVO().setValidList(validList).setInvalidList(invalidList); } AppProductSpuBaseRespVO convert(ProductSpuRespDTO spu); AppProductSkuBaseRespVO convert(ProductSkuRespDTO sku); diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java index 76e79c523..5876e265b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java @@ -22,7 +22,7 @@ import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductProp import cn.iocoder.yudao.module.trade.controller.app.order.vo.*; import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemCommentCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemRespVO; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; @@ -221,12 +221,12 @@ public interface TradeOrderConvert { ProductCommentCreateReqDTO convert04(AppTradeOrderItemCommentCreateReqVO createReqVO, TradeOrderItemDO tradeOrderItemDO); default TradePriceCalculateReqBO convert(Long userId, AppTradeOrderSettlementReqVO settlementReqVO, - List cartList) { + List cartList) { TradePriceCalculateReqBO reqBO = new TradePriceCalculateReqBO(); reqBO.setUserId(userId).setCouponId(settlementReqVO.getCouponId()).setAddressId(settlementReqVO.getAddressId()) .setItems(new ArrayList<>(settlementReqVO.getItems().size())); // 商品项的构建 - Map cartMap = convertMap(cartList, TradeCartDO::getId); + Map cartMap = convertMap(cartList, CartDO::getId); for (AppTradeOrderSettlementReqVO.Item item : settlementReqVO.getItems()) { // 情况一:skuId + count if (item.getSkuId() != null) { @@ -235,7 +235,7 @@ public interface TradeOrderConvert { continue; } // 情况二:cartId - TradeCartDO cart = cartMap.get(item.getCartId()); + CartDO cart = cartMap.get(item.getCartId()); if (cart == null) { continue; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/TradeCartDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/CartDO.java similarity index 50% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/TradeCartDO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/CartDO.java index d9d9697ae..d8bf14088 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/TradeCartDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/cart/CartDO.java @@ -17,7 +17,7 @@ import lombok.experimental.Accessors; @Data @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) -public class TradeCartDO extends BaseDO { +public class CartDO extends BaseDO { // ========= 基础字段 BEGIN ========= @@ -33,27 +33,7 @@ public class TradeCartDO extends BaseDO { */ private Long userId; - /** - * 是否添加到购物车 - * - * false - 未添加:用户点击【立即购买】 - * true - 已添加:用户点击【添加购物车】 - * - * 为什么要设计这个字段? - * 配合 orderStatus 字段,可以知道有多少商品,用户点击了【立即购买】,最终多少【确认下单】 - */ - private Boolean addStatus; - /** - * 是否提交订单 - * - * false - 未下单:立即购买,或者添加到购物车,此时设置为 false - * true - 已下单:确认下单,此时设置为 true - */ - private Boolean orderStatus; - - // ========= 基础字段 END ========= - - // ========= 商品信息 BEGIN ========= + // ========= 商品信息 ========= /** * 商品 SPU 编号 @@ -71,16 +51,9 @@ public class TradeCartDO extends BaseDO { * 商品购买数量 */ private Integer count; - - // ========= 商品信息 END ========= - - // ========= 优惠信息 BEGIN ========= - - // TODO 芋艿:combination_id 拼团 ID - // TODO 芋艿:seckill_id 秒杀产品 ID - // TODO 芋艿:bargain_id 砍价 ID - // TODO 芋艿:pinkId 团长拼团 ID - - // ========= 优惠信息 END ========= + /** + * 是否选中 + */ + private Boolean selected; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderItemDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderItemDO.java index 74bd93355..f078f149e 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderItemDO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderItemDO.java @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.TradeAfterSaleDO; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; import cn.iocoder.yudao.module.trade.enums.order.TradeOrderItemAfterSaleStatusEnum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; @@ -46,7 +46,7 @@ public class TradeOrderItemDO extends BaseDO { /** * 购物车项编号 * - * 关联 {@link TradeCartDO#getId()} + * 关联 {@link CartDO#getId()} */ private Long cartId; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/CartMapper.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/CartMapper.java new file mode 100644 index 000000000..121752c85 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/CartMapper.java @@ -0,0 +1,77 @@ +package cn.iocoder.yudao.module.trade.dal.mysql.cart; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.map.MapUtil; +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + +@Mapper +public interface CartMapper extends BaseMapperX { + + default CartDO selectByUserIdAndSkuId(Long userId, Long skuId) { + return selectOne(CartDO::getUserId, userId, + CartDO::getSkuId, skuId); + } + + default Integer selectSumByUserId(Long userId) { + // SQL sum 查询 + List> result = selectMaps(new QueryWrapper() + .select("SUM(count) AS sumCount") + .eq("user_id", userId) + .eq("add_status", true) // 只计算添加到购物车中的 + .eq("order_status", false)); // 必须未下单 + // 获得数量 + return CollUtil.getFirst(result) != null ? MapUtil.getInt(result.get(0), "sumCount") : 0; + } + + default Map selectSumMapByUserId(Long userId) { + // SQL sum 查询 + List> result = selectMaps(new QueryWrapper() + .select("spu_id, SUM(count) AS sumCount") + .eq("user_id", userId) + .eq("add_status", true) // 只计算添加到购物车中的 + .eq("order_status", false) // 必须未下单 + .groupBy("spu_id")); + // 获得数量 + return CollectionUtils.convertMap(result, item -> MapUtil.getLong(item, "spu_id"), + item -> MapUtil.getInt(item, "sumCount")); + } + + default CartDO selectById(Long id, Long userId) { + return selectOne(CartDO::getId, id, + CartDO::getUserId, userId); + } + + default List selectListByIds(Collection ids, Long userId) { + return selectList(new LambdaQueryWrapper() + .in(CartDO::getId, ids) + .eq(CartDO::getUserId, userId)); + } + + default List selectListByUserId(Long userId) { + return selectList(new LambdaQueryWrapper() + .eq(CartDO::getUserId, userId)); + } + + default List selectListByUserId(Long userId, Set ids) { + return selectList(new LambdaQueryWrapper() + .eq(CartDO::getUserId, userId) + .in(CartDO::getId, ids)); + } + + default void updateByIds(Collection ids, Long userId, CartDO updateObj) { + update(updateObj, new LambdaQueryWrapper() + .in(CartDO::getId, ids) + .eq(CartDO::getUserId, userId)); + } + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/TradeCartMapper.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/TradeCartMapper.java deleted file mode 100644 index 64e2f99ea..000000000 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/cart/TradeCartMapper.java +++ /dev/null @@ -1,80 +0,0 @@ -package cn.iocoder.yudao.module.trade.dal.mysql.cart; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.map.MapUtil; -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.apache.ibatis.annotations.Mapper; - -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -@Mapper -public interface TradeCartMapper extends BaseMapperX { - - default TradeCartDO selectByUserIdAndSkuId(Long userId, Long skuId, - Boolean addStatus, Boolean orderStatus) { - return selectOne(new LambdaQueryWrapper().eq(TradeCartDO::getUserId, userId) - .eq(TradeCartDO::getSkuId, skuId) - .eq(TradeCartDO::getAddStatus, addStatus) - .eq(TradeCartDO::getOrderStatus, orderStatus)); - } - - default Integer selectSumByUserId(Long userId) { - // SQL sum 查询 - List> result = selectMaps(new QueryWrapper() - .select("SUM(count) AS sumCount") - .eq("user_id", userId) - .eq("add_status", true) // 只计算添加到购物车中的 - .eq("order_status", false)); // 必须未下单 - // 获得数量 - return CollUtil.getFirst(result) != null ? MapUtil.getInt(result.get(0), "sumCount") : 0; - } - - default Map selectSumMapByUserId(Long userId) { - // SQL sum 查询 - List> result = selectMaps(new QueryWrapper() - .select("spu_id, SUM(count) AS sumCount") - .eq("user_id", userId) - .eq("add_status", true) // 只计算添加到购物车中的 - .eq("order_status", false) // 必须未下单 - .groupBy("spu_id")); - // 获得数量 - return CollectionUtils.convertMap(result, item -> MapUtil.getLong(item, "spu_id"), - item -> MapUtil.getInt(item, "sumCount")); - } - - default TradeCartDO selectById(Long id, Long userId) { - return selectOne(TradeCartDO::getId, id, - TradeCartDO::getUserId, userId); - } - - default List selectListByIds(Collection ids, Long userId) { - return selectList(new LambdaQueryWrapper() - .in(TradeCartDO::getId, ids) - .eq(TradeCartDO::getUserId, userId)); - } - - default List selectListByUserId(Long userId, Boolean addStatus, Boolean orderStatus) { - return selectList(new LambdaQueryWrapper() - .eq(TradeCartDO::getUserId, userId) - .eq(TradeCartDO::getAddStatus, addStatus) - .eq(TradeCartDO::getOrderStatus, orderStatus)); - } - - default void updateByIds(Collection ids, TradeCartDO updateObject) { - update(updateObject, new LambdaQueryWrapper().in(TradeCartDO::getId, ids)); - } - - default List selectListByUserId(Long userId, Set ids) { - return selectList(new LambdaQueryWrapper() - .eq(TradeCartDO::getUserId, userId) - .in(TradeCartDO::getId, ids)); - } - -} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartService.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartService.java similarity index 68% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartService.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartService.java index 93152a633..84e697a6a 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartService.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartService.java @@ -1,10 +1,7 @@ package cn.iocoder.yudao.module.trade.service.cart; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartAddReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartListRespVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartResetReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartUpdateReqVO; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; +import cn.iocoder.yudao.module.trade.controller.app.cart.vo.*; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; import javax.validation.Valid; import java.util.Collection; @@ -17,7 +14,7 @@ import java.util.Set; * * @author 芋道源码 */ -public interface TradeCartService { +public interface CartService { /** * 添加商品到购物车 @@ -26,7 +23,7 @@ public interface TradeCartService { * @param addReqVO 添加信息 * @return 购物项的编号 */ - Long addCart(Long userId, @Valid AppTradeCartAddReqVO addReqVO); + Long addCart(Long userId, @Valid AppCartAddReqVO addReqVO); /** * 更新购物车商品数量 @@ -34,7 +31,15 @@ public interface TradeCartService { * @param userId 用户编号 * @param updateCountReqVO 更新信息 */ - void updateCart(Long userId, AppTradeCartUpdateReqVO updateCountReqVO); + void updateCartCount(Long userId, AppCartUpdateCountReqVO updateCountReqVO); + + /** + * 更新购物车选中状态 + * + * @param userId 用户编号 + * @param updateSelectedReqVO 更新信息 + */ + void updateCartSelected(Long userId, @Valid AppCartUpdateSelectedReqVO updateSelectedReqVO); /** * 重置购物车商品 @@ -44,7 +49,7 @@ public interface TradeCartService { * @param userId 用户编号 * @param updateReqVO 重置信息 */ - void resetCart(Long userId, AppTradeCartResetReqVO updateReqVO); + void resetCart(Long userId, AppCartResetReqVO updateReqVO); /** * 删除购物车商品 @@ -68,7 +73,7 @@ public interface TradeCartService { * @param userId 用户编号 * @return 购物车列表 */ - AppTradeCartListRespVO getCartList(Long userId); + AppCartListRespVO getCartList(Long userId); /** * 查询用户的购物车列表 @@ -77,7 +82,7 @@ public interface TradeCartService { * @param ids 购物项的编号 * @return 购物车列表 */ - List getCartList(Long userId, Set ids); + List getCartList(Long userId, Set ids); /** * 获得用户的购物车商品 SPU 数量的 Map diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartServiceImpl.java similarity index 66% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartServiceImpl.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartServiceImpl.java index 6696de319..217cf1f6b 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/TradeCartServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/cart/CartServiceImpl.java @@ -5,13 +5,10 @@ import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi; import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuRespDTO; import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi; import cn.iocoder.yudao.module.product.api.spu.dto.ProductSpuRespDTO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartAddReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartListRespVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartResetReqVO; -import cn.iocoder.yudao.module.trade.controller.app.cart.vo.AppTradeCartUpdateReqVO; +import cn.iocoder.yudao.module.trade.controller.app.cart.vo.*; import cn.iocoder.yudao.module.trade.convert.cart.TradeCartConvert; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; -import cn.iocoder.yudao.module.trade.dal.mysql.cart.TradeCartMapper; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; +import cn.iocoder.yudao.module.trade.dal.mysql.cart.CartMapper; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; @@ -29,17 +26,16 @@ import static java.util.Collections.emptyList; /** * 购物车 Service 实现类 * - * // TODO 芋艿:秒杀、拼团、砍价对购物车的影响 - * // TODO 芋艿:未来优化:购物车的价格计算,支持营销信息 + * // TODO 芋艿:未来优化:购物车的价格计算,支持营销信息;目前不支持的原因,前端界面需要前端 pr 支持下; * * @author 芋道源码 */ @Service @Validated -public class TradeCartServiceImpl implements TradeCartService { +public class CartServiceImpl implements CartService { @Resource - private TradeCartMapper cartMapper; + private CartMapper cartMapper; @Resource private ProductSpuApi productSpuApi; @@ -47,13 +43,11 @@ public class TradeCartServiceImpl implements TradeCartService { private ProductSkuApi productSkuApi; @Override - public Long addCart(Long userId, AppTradeCartAddReqVO addReqVO) { + public Long addCart(Long userId, AppCartAddReqVO addReqVO) { // 查询 TradeCartDO - TradeCartDO cart = cartMapper.selectByUserIdAndSkuId(userId, addReqVO.getSkuId(), - addReqVO.getAddStatus(), false); + CartDO cart = cartMapper.selectByUserIdAndSkuId(userId, addReqVO.getSkuId()); // 校验 SKU - Integer count = cart != null && addReqVO.getAddStatus() ? - cart.getCount() + addReqVO.getCount() : addReqVO.getCount(); + Integer count = addReqVO.getCount(); ProductSkuRespDTO sku = checkProductSku(addReqVO.getSkuId(), count); // 情况零:特殊,count 小于等于 0,说明前端项目删除 @@ -63,23 +57,22 @@ public class TradeCartServiceImpl implements TradeCartService { if (count <= 0) { cartMapper.deleteById(cart.getId()); } else { - cartMapper.updateById(new TradeCartDO().setId(cart.getId()).setCount(count)); + cartMapper.updateById(new CartDO().setId(cart.getId()).setCount(count)); } return cart.getId(); // 情况二:不存在,则进行插入 } else { - cart = new TradeCartDO().setUserId(userId) - .setSpuId(sku.getSpuId()).setSkuId(sku.getId()).setCount(count) - .setAddStatus(addReqVO.getAddStatus()).setOrderStatus(false); + cart = new CartDO().setUserId(userId) + .setSpuId(sku.getSpuId()).setSkuId(sku.getId()).setCount(count); cartMapper.insert(cart); } return cart.getId(); } @Override - public void updateCart(Long userId, AppTradeCartUpdateReqVO updateReqVO) { + public void updateCartCount(Long userId, AppCartUpdateCountReqVO updateReqVO) { // 校验 TradeCartDO 存在 - TradeCartDO cart = cartMapper.selectById(updateReqVO.getId(), userId); + CartDO cart = cartMapper.selectById(updateReqVO.getId(), userId); if (cart == null) { throw exception(CARD_ITEM_NOT_FOUND); } @@ -87,29 +80,35 @@ public class TradeCartServiceImpl implements TradeCartService { checkProductSku(cart.getSkuId(), updateReqVO.getCount()); // 更新数量 - cartMapper.updateById(new TradeCartDO().setId(cart.getId()) + cartMapper.updateById(new CartDO().setId(cart.getId()) .setCount(updateReqVO.getCount())); } + @Override + public void updateCartSelected(Long userId, AppCartUpdateSelectedReqVO updateSelectedReqVO) { + cartMapper.updateByIds(updateSelectedReqVO.getIds(), userId, + new CartDO().setSelected(updateSelectedReqVO.getSelected())); + } + @Override @Transactional(rollbackFor = Exception.class) - public void resetCart(Long userId, AppTradeCartResetReqVO resetReqVO) { + public void resetCart(Long userId, AppCartResetReqVO resetReqVO) { // 第一步:删除原本的购物项 - TradeCartDO oldCart = cartMapper.selectById(resetReqVO.getId(), userId); + CartDO oldCart = cartMapper.selectById(resetReqVO.getId(), userId); if (oldCart == null) { throw exception(CARD_ITEM_NOT_FOUND); } cartMapper.deleteById(oldCart.getId()); // 第二步:添加新的购物项 - TradeCartDO newCart = cartMapper.selectByUserIdAndSkuId(userId, resetReqVO.getSkuId(), - true, false); + // TODO 芋艿:直接改成 addCart 貌似就行 + CartDO newCart = cartMapper.selectByUserIdAndSkuId(userId, resetReqVO.getSkuId()); if (newCart != null) { - updateCart(userId, new AppTradeCartUpdateReqVO() + updateCartCount(userId, new AppCartUpdateCountReqVO() .setId(newCart.getId()).setCount(resetReqVO.getCount())); } else { - addCart(userId, new AppTradeCartAddReqVO().setAddStatus(true) - .setSkuId(resetReqVO.getSkuId()).setCount(resetReqVO.getCount())); + addCart(userId, new AppCartAddReqVO().setSkuId(resetReqVO.getSkuId()) + .setCount(resetReqVO.getCount())); } } @@ -122,7 +121,7 @@ public class TradeCartServiceImpl implements TradeCartService { @Override public void deleteCart(Long userId, Collection ids) { // 查询 TradeCartDO 列表 - List carts = cartMapper.selectListByIds(ids, userId); + List carts = cartMapper.selectListByIds(ids, userId); if (CollUtil.isEmpty(carts)) { return; } @@ -133,30 +132,33 @@ public class TradeCartServiceImpl implements TradeCartService { @Override public Integer getCartCount(Long userId) { + // TODO 芋艿:需要算上 selected return cartMapper.selectSumByUserId(userId); } @Override public Map getCartCountMap(Long userId) { + // TODO 芋艿:需要算上 selected return cartMapper.selectSumMapByUserId(userId); } @Override - public AppTradeCartListRespVO getCartList(Long userId) { - // 获得购物车的商品,只查询未下单的 - List carts = cartMapper.selectListByUserId(userId, true, false); - carts.sort(Comparator.comparing(TradeCartDO::getId).reversed()); + public AppCartListRespVO getCartList(Long userId) { + // 获得购物车的商品 + List carts = cartMapper.selectListByUserId(userId); + carts.sort(Comparator.comparing(CartDO::getId).reversed()); // 如果未空,则返回空结果 if (CollUtil.isEmpty(carts)) { - return new AppTradeCartListRespVO().setValidList(emptyList()) + return new AppCartListRespVO().setValidList(emptyList()) .setInvalidList(emptyList()); } // 查询 SPU、SKU 列表 - List spus = productSpuApi.getSpuList(convertSet(carts, TradeCartDO::getSpuId)); - List skus = productSkuApi.getSkuList(convertSet(carts, TradeCartDO::getSkuId)); + List spus = productSpuApi.getSpuList(convertSet(carts, CartDO::getSpuId)); + List skus = productSkuApi.getSkuList(convertSet(carts, CartDO::getSkuId)); // 如果 SPU 被删除,则删除购物车对应的商品。延迟删除 + // 为什么不是 SKU 被删除呢?因为 SKU 被删除时,还可以通过 SPU 选择其它 SKU deleteCartIfSpuDeleted(carts, spus); // 拼接数据 @@ -164,14 +166,14 @@ public class TradeCartServiceImpl implements TradeCartService { } @Override - public List getCartList(Long userId, Set ids) { + public List getCartList(Long userId, Set ids) { if (CollUtil.isEmpty(ids)) { return Collections.emptyList(); } return cartMapper.selectListByUserId(userId, ids); } - private void deleteCartIfSpuDeleted(List carts, List spus) { + private void deleteCartIfSpuDeleted(List carts, List spus) { // 如果 SPU 被删除,则删除购物车对应的商品。延迟删除 carts.removeIf(cart -> { if (spus.stream().noneMatch(spu -> spu.getId().equals(cart.getSpuId()))) { diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java index 87092b4a6..95af87fb9 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java @@ -43,7 +43,7 @@ import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettle import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderSettlementRespVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.item.AppTradeOrderItemCommentCreateReqVO; import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; -import cn.iocoder.yudao.module.trade.dal.dataobject.cart.TradeCartDO; +import cn.iocoder.yudao.module.trade.dal.dataobject.cart.CartDO; import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; @@ -53,7 +53,7 @@ import cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum; import cn.iocoder.yudao.module.trade.enums.order.*; import cn.iocoder.yudao.module.trade.framework.order.config.TradeOrderProperties; -import cn.iocoder.yudao.module.trade.service.cart.TradeCartService; +import cn.iocoder.yudao.module.trade.service.cart.CartService; import cn.iocoder.yudao.module.trade.service.delivery.DeliveryExpressService; import cn.iocoder.yudao.module.trade.service.message.TradeMessageService; import cn.iocoder.yudao.module.trade.service.message.bo.TradeOrderMessageWhenDeliveryOrderReqBO; @@ -93,7 +93,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { private TradeOrderItemMapper tradeOrderItemMapper; @Resource - private TradeCartService tradeCartService; + private CartService tradeCartService; @Resource private TradePriceService tradePriceService; @Resource @@ -168,7 +168,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { */ private TradePriceCalculateRespBO calculatePrice(Long userId, AppTradeOrderSettlementReqVO settlementReqVO) { // 1. 如果来自购物车,则获得购物车的商品 - List cartList = tradeCartService.getCartList(userId, + List cartList = tradeCartService.getCartList(userId, convertSet(settlementReqVO.getItems(), AppTradeOrderSettlementReqVO.Item::getCartId)); // 2. 计算价格 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index b25d5b0e5..ef198f8f9 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -168,7 +168,7 @@ public class MemberUserServiceImpl implements MemberUserService { @Override public boolean isPasswordMatch(String rawPassword, String encodedPassword) { - if (true) { + if(true) { return true; } return passwordEncoder.matches(rawPassword, encodedPassword);