From e5c4c747a4ef397f161688a94fc8dd1c562cbddc Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 19 Aug 2022 20:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=B8=AD=EF=BC=8C=E7=82=B9=E5=87=BB=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=EF=BC=8C=E4=BC=9A=E6=B8=85=E9=99=A4=E5=B7=B2=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=B9=B6=E5=AD=98=E5=9C=A8=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/codegen/CodegenServiceImpl.java | 4 +- .../promotion/api/rpc/price/PriceFeign.java | 21 -- .../rpc/price/dto/PriceProductCalcReqDTO.java | 67 ------ .../rpc/price/dto/PriceProductCalcRespDTO.java | 200 ---------------- .../controller/trade/CartController.java | 83 ------- .../controller/trade/TradeOrderController.http | 31 --- .../controller/trade/TradeOrderController.java | 84 ------- .../controller/trade/vo/cart/CartDetailVO.java | 213 ----------------- .../TradeOrderConfirmCreateInfoRespVO.java | 216 ------------------ .../vo/order/TradeOrderCreateFromCartReqVO.java | 23 -- .../trade/vo/order/TradeOrderCreateReqVO.java | 45 ---- .../trade/vo/order/TradeOrderItemRespVO.java | 53 ----- .../trade/vo/order/TradeOrderPageReqVO.java | 17 -- .../trade/vo/order/TradeOrderRespVO.java | 70 ------ 14 files changed, 2 insertions(+), 1125 deletions(-) delete mode 100644 归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/PriceFeign.java delete mode 100644 归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcReqDTO.java delete mode 100644 归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcRespDTO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderItemRespVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderPageReqVO.java delete mode 100644 归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderRespVO.java diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java index e3a1dd862..8cab42784 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java @@ -154,12 +154,12 @@ public class CodegenServiceImpl implements CodegenService { // 构建 CodegenColumnDO 数组,只同步新增的字段 List codegenColumns = codegenColumnMapper.selectListByTableId(tableId); Set codegenColumnNames = CollectionUtils.convertSet(codegenColumns, CodegenColumnDO::getColumnName); - // 移除已经存在的字段 - tableFields.removeIf(column -> codegenColumnNames.contains(column.getColumnName())); // 计算需要删除的字段 Set tableFieldNames = CollectionUtils.convertSet(tableFields, TableField::getName); Set deleteColumnIds = codegenColumns.stream().filter(column -> !tableFieldNames.contains(column.getColumnName())) .map(CodegenColumnDO::getId).collect(Collectors.toSet()); + // 移除已经存在的字段 + tableFields.removeIf(column -> codegenColumnNames.contains(column.getColumnName())); if (CollUtil.isEmpty(tableFields) && CollUtil.isEmpty(deleteColumnIds)) { throw exception(CODEGEN_SYNC_NONE_CHANGE); } diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/PriceFeign.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/PriceFeign.java deleted file mode 100644 index e87f7f16b..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/PriceFeign.java +++ /dev/null @@ -1,21 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.price; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcReqDTO; -import cn.iocoder.mall.promotion.api.rpc.price.dto.PriceProductCalcRespDTO; -import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -/** - * Title: - * Description: - * - * @author zhuyang - * @version 1.0 2021/10/9 - */ -@FeignClient("promotion-service") -public interface PriceFeign { - @PostMapping("/promotion/price/calcProductPrice") - public CommonResult calcProductPrice(@RequestBody PriceProductCalcReqDTO calcReqDTO) ; -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcReqDTO.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcReqDTO.java deleted file mode 100644 index 1943d7c38..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcReqDTO.java +++ /dev/null @@ -1,67 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.price.dto; - -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; -import java.io.Serializable; -import java.util.List; - -/** - * 商品价格计算 Request DTO - */ -@Data -@Accessors(chain = true) -public class PriceProductCalcReqDTO implements Serializable { - - /** - * 用户编号 - */ - private Integer userId; - - /** - * 优惠劵编号 - */ - private Integer couponCardId; - - /** - * 商品 SKU 数组 - */ - @NotNull(message = "商品数组不能为空") - private List items; - - /** - * 商品 SKU - */ - @Data - @Accessors(chain = true) - public static class Item implements Serializable { - - /** - * SKU 编号 - */ - @NotNull(message = "商品 SKU 编号不能为空") - private Integer skuId; - /** - * 数量 - */ - @NotNull(message = "商品 SKU 数量不能为空") - private Integer quantity; - /** - * 是否选中 - */ - @NotNull(message = "是否选中不能为空") - private Boolean selected; - - public Item() { - } - - public Item(Integer skuId, Integer quantity, Boolean selected) { - this.skuId = skuId; - this.quantity = quantity; - this.selected = selected; - } - - } - -} diff --git a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcRespDTO.java b/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcRespDTO.java deleted file mode 100644 index d3225698f..000000000 --- a/归档/promotion-service-project/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/rpc/price/dto/PriceProductCalcRespDTO.java +++ /dev/null @@ -1,200 +0,0 @@ -package cn.iocoder.mall.promotion.api.rpc.price.dto; - -import cn.iocoder.mall.promotion.api.enums.activity.PromotionActivityTypeEnum; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.io.Serializable; -import java.util.List; - -/** - * 商品价格计算 Request DTO - */ -@Data -@Accessors(chain = true) -public class PriceProductCalcRespDTO implements Serializable { - - /** - * 商品分组数组 - */ - private List itemGroups; - /** - * 优惠劵编号 - */ - private Integer couponCardId; - /** - * 优惠劵减少的金额 - * - * 1. 若未使用优惠劵,返回 null - * 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。 - */ - private Integer couponCardDiscountTotal; - /** - * 邮费信息 - * - * TODO 芋艿,暂时未弄 - */ - private Postage postage; - /** - * 费用 - */ - private Fee fee; - - /** - * 商品分组 - * - * 多个商品,参加同一个活动,从而形成分组。 - */ - @Data - @Accessors(chain = true) - public static class ItemGroup implements Serializable { - - /** - * 优惠活动 - * - * 目前会有满减送 {@link PromotionActivityTypeEnum#FULL_PRIVILEGE} 类型的活动 - * - * // TODO 芋艿,目前只会有【满减送】的情况,未来有新的促销方式,可能需要改成数组 - */ - private Integer activityId; - /** - * 促销减少的金额 - * - * 1. 若未参与促销活动,或不满足促销条件,返回 null - * 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。 - */ - private Integer activityDiscountTotal; - /** - * 商品数组 - */ - private List items; -// /** -// * 费用 -// * -// * TODO 芋艿,这里先偷懒,postageTotal 字段用不到。 -// */ -// private Fee fee; // 注释原因,不用这里了 - - } - - @Data - @Accessors(chain = true) - public static class Item implements Serializable { - - /** - * 商品 SPU 编号 - */ - private Integer spuId; - /** - * 商品 SKU 编号 - */ - private Integer skuId; - /** - * 商品 Category 编号 - */ - private Integer cid; - - // 非 SKU 自带信息 - - /** - * 是否选中 - */ - private Boolean selected; - /** - * 购买数量 - */ - private Integer buyQuantity; - /** - * 优惠活动 - * - * 目前会有限时折扣 {@link PromotionActivityTypeEnum#TIME_LIMITED_DISCOUNT} 类型的活动 - */ - private Integer activityId; - /** - * 原始单价,单位:分。 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终价格,单位:分。 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - * - * 用途类似 {@link #presentTotal} - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分。 - * - * 注意,presentPrice * quantity 不一定等于 presentTotal 。 - * 因为,存在无法整除的情况。 - * 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。 - * 所以,需要存储一个该字段。 - */ - private Integer presentTotal; - - } - - /** - * 费用(合计) - */ - @Data - @Accessors(chain = true) - public static class Fee implements Serializable { - - /** - * 购买总价 - */ - private Integer buyTotal; - /** - * 优惠总价 - * - * 注意,满多少元包邮,不算在优惠中。 - */ - private Integer discountTotal; - /** - * 邮费 TODO 芋艿,将 postage 改成 logistics - */ - private Integer postageTotal; - /** - * 最终价格 - * - * 计算公式 = 总价 - 优惠总价 + 邮费 - */ - private Integer presentTotal; - - public Fee() { - } - - public Fee(Integer buyTotal, Integer discountTotal, Integer postageTotal, Integer presentTotal) { - this.buyTotal = buyTotal; - this.discountTotal = discountTotal; - this.postageTotal = postageTotal; - this.presentTotal = presentTotal; - } - } - - /** - * 邮费信息 - */ - @Data - @Accessors(chain = true) - public static class Postage implements Serializable { - - /** - * 需要满足多少钱,可以包邮。单位:分 - */ - private Integer threshold; - - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java deleted file mode 100644 index d1d069bcf..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/CartController.java +++ /dev/null @@ -1,83 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade; - -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; -import cn.iocoder.mall.shopweb.service.trade.CartManager; -import cn.iocoder.security.annotations.RequiresAuthenticate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.Set; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api(tags = "购物车 API") -@RestController -@RequestMapping("/cart") -@Validated -public class CartController { - - @Autowired - private CartManager cartManager; - - @PostMapping("add") - @ApiOperation("添加商品到购物车") - @ApiImplicitParams({ - @ApiImplicitParam(name = "skuId", value = "商品 SKU 编号", required = true, example = "1"), - @ApiImplicitParam(name = "quantity", value = "增加数量", required = true, example = "1024") - }) - @RequiresAuthenticate - public CommonResult addCartItem(@RequestParam("skuId") Integer skuId, - @RequestParam("quantity") Integer quantity) { - cartManager.addCartItem(UserSecurityContextHolder.getUserId(), skuId, quantity); - return success(true); - } - - @GetMapping("sum-quantity") - @ApiOperation("查询用户在购物车中的商品数量") - @RequiresAuthenticate - public CommonResult sumCartItemQuantity() { - return success(cartManager.sumCartItemQuantity(UserSecurityContextHolder.getUserId())); - } - - @GetMapping("/get-detail") - @ApiOperation("查询用户的购物车的商品列表") - @RequiresAuthenticate - public CommonResult getCartDetail() { - return success(cartManager.getCartDetail(UserSecurityContextHolder.getUserId())); - } - - @PostMapping("update-quantity") - @ApiOperation("更新购物车商品数量") - @ApiImplicitParams({ - @ApiImplicitParam(name = "skuId", value = "商品 SKU 编号", required = true, example = "1"), - @ApiImplicitParam(name = "quantity", value = "增加数量", required = true, example = "1024") - }) - @RequiresAuthenticate - public CommonResult updateCartItemQuantity(@RequestParam("skuId") Integer skuId, - @RequestParam("quantity") Integer quantity) { - cartManager.updateCartItemQuantity(UserSecurityContextHolder.getUserId(), skuId, quantity); - return success(true); - } - - @PostMapping("update-selected") - @ApiOperation("更新购物车商品是否选中") - @ApiImplicitParams({ - @ApiImplicitParam(name = "skuIds", value = "商品 SKU 编号数组", required = true, example = "1,3"), - @ApiImplicitParam(name = "selected", value = "是否选中", required = true, example = "true") - }) - @RequiresAuthenticate - public CommonResult updateCartItemSelected(@RequestParam("skuIds") Set skuIds, - @RequestParam("selected") Boolean selected) { - cartManager.updateCartItemSelected(UserSecurityContextHolder.getUserId(), skuIds, selected); - // 获得目前购物车明细 - return success(true); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http deleted file mode 100644 index 2a6622ef9..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.http +++ /dev/null @@ -1,31 +0,0 @@ -### /trade-order/confirm-create-order-info 基于商品,确认创建订单 -GET {{shop-api-base-url}}/trade-order/confirm-create-order-info?skuId=33&quantity=1 -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /trade-order/confirm-create-order-info-from-cart 基于购物车,确认创建订单 -GET {{shop-api-base-url}}/trade-order/confirm-create-order-info-from-cart -Content-Type: application/x-www-form-urlencoded -Authorization: Bearer {{user-access-token}} - -### /trade-order/confirm-create-order-info-from-cart 基于商品,创建订单 -POST {{shop-api-base-url}}/trade-order/create -Content-Type: application/json -Authorization: Bearer {{user-access-token}} - -{ - "userAddressId": 19, - "remark": "我是备注", - "orderItems": [ - { - "skuId": 3, - "quantity": 1 - } - ] -} - -### /trade-order/page 获得订单交易分页 -GET {{shop-api-base-url}}/trade-order/page?status=1&pageNo=1&pageSize=10 -Content-Type: application/x-www-form-urlencoded - -### diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java deleted file mode 100644 index 7eb17a848..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/TradeOrderController.java +++ /dev/null @@ -1,84 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade; - -import cn.iocoder.common.framework.util.HttpUtil; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.common.framework.vo.PageResult; -import cn.iocoder.mall.security.user.core.context.UserSecurityContextHolder; -import cn.iocoder.mall.shopweb.controller.trade.vo.order.*; -import cn.iocoder.mall.shopweb.service.trade.TradeOrderService; -import cn.iocoder.security.annotations.RequiresAuthenticate; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; - -import static cn.iocoder.common.framework.vo.CommonResult.success; - -@Api(tags = "交易订单 API") -@RestController -@RequestMapping("/trade-order") -@Validated -public class TradeOrderController { - - @Autowired - private TradeOrderService tradeOrderService; - - @GetMapping("confirm-create-order-info") - @ApiOperation("基于商品,确认创建订单") - @ApiImplicitParams({ - @ApiImplicitParam(name = "skuId", required = true, value = "商品 SKU 编号", example = "1024"), - @ApiImplicitParam(name = "quantity", required = true, value = "购买数量", example = "2"), - @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1"), - }) - @RequiresAuthenticate - public CommonResult getTradeOrderConfirmCreateInfo( - @RequestParam("skuId") Integer skuId, - @RequestParam("quantity") Integer quantity, - @RequestParam(value = "couponCardId", required = false) Integer couponCardId) { - return success(tradeOrderService.getOrderConfirmCreateInfo(UserSecurityContextHolder.getUserId(), skuId, quantity, couponCardId)); - } - - @GetMapping("confirm-create-order-info-from-cart") - @ApiOperation("基于购物车,确认创建订单") - @ApiImplicitParam(name = "couponCardId", value = "优惠劵编号", example = "1") - @RequiresAuthenticate - public CommonResult getTradeOrderConfirmCreateInfoFromCart( - @RequestParam(value = "couponCardId", required = false) Integer couponCardId) { - return success(tradeOrderService.getOrderConfirmCreateInfoFromCart(UserSecurityContextHolder.getUserId(), couponCardId)); - } - - @PostMapping("create") - @ApiOperation("基于商品,创建订单") - @RequiresAuthenticate - public CommonResult createTradeOrder(@RequestBody TradeOrderCreateReqVO createReqVO, - HttpServletRequest servletRequest) { - return success(tradeOrderService.createTradeOrder(UserSecurityContextHolder.getUserId(), - HttpUtil.getIp(servletRequest), createReqVO)); - } - - @GetMapping("create-from-cart") - @ApiOperation("基于购物车,创建订单") - @RequiresAuthenticate - public CommonResult createTradeOrder(TradeOrderCreateFromCartReqVO createReqVO) { - return null; - } - - @GetMapping("/get") - @ApiOperation("获得交易订单") - @ApiImplicitParam(name = "tradeOrderId", value = "交易订单编号", required = true) - public CommonResult getTradeOrder(@RequestParam("tradeOrderId") Integer tradeOrderId) { - return success(tradeOrderService.getTradeOrder(tradeOrderId)); - } - - @GetMapping("/page") - @ApiOperation("获得订单交易分页") - public CommonResult> pageTradeOrder(TradeOrderPageReqVO pageVO) { - return success(tradeOrderService.pageTradeOrder(UserSecurityContextHolder.getUserId(), pageVO)); - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java deleted file mode 100644 index 4b1427390..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/cart/CartDetailVO.java +++ /dev/null @@ -1,213 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.cart; - -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO; -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "用户的购物车明细 Response VO") // TODO 芋艿:swagger 文档完善 -@Data -@Accessors(chain = true) -public class CartDetailVO { - - /** - * 商品分组数组 - */ - private List itemGroups; - /** - * 费用 - */ - private Fee fee; - - /** - * 商品分组 - * - * 多个商品,参加同一个活动,从而形成分组。 - */ - @Data - @Accessors(chain = true) - public static class ItemGroup { - - /** - * 优惠活动 - */ - private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒 - /** - * 促销减少的金额 - * - * 1. 若未参与促销活动,或不满足促销条件,返回 null - * 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。 - */ - private Integer activityDiscountTotal; - /** - * 商品数组 - */ - private List items; - - } - - @Data - @Accessors(chain = true) - public static class Sku { - - // SKU 自带信息 - /** - * sku 编号 - */ - private Integer id; - /** - * SPU 信息 - */ - private Spu spu; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; // TODO 后面改下 - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - // 非 SKU 自带信息 - - /** - * 购买数量 - */ - private Integer buyQuantity; - /** - * 是否选中 - */ - private Boolean selected; - /** - * 优惠活动 - */ - private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒 - /** - * 原始单价,单位:分。 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终价格,单位:分。 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - * - * 用途类似 {@link #presentTotal} - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分。 - * - * 注意,presentPrice * quantity 不一定等于 presentTotal 。 - * 因为,存在无法整除的情况。 - * 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。 - * 所以,需要存储一个该字段。 - */ - private Integer presentTotal; - - } - - @Data - @Accessors(chain = true) - public static class Spu { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 分类编号 - */ - private Integer cid; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - } - - /** - * 费用(合计) - */ - @Data - @Accessors(chain = true) - public static class Fee { - - /** - * 购买总价 - */ - private Integer buyTotal; - /** - * 优惠总价 - * - * 注意,满多少元包邮,不算在优惠中。 - */ - private Integer discountTotal; - /** - * 邮费 - */ - private Integer postageTotal; - /** - * 最终价格 - * - * 计算公式 = 总价 - 优惠总价 + 邮费 - */ - private Integer presentTotal; - - public Fee() { - } - - public Fee(Integer buyTotal, Integer discountTotal, Integer postageTotal, Integer presentTotal) { - this.buyTotal = buyTotal; - this.discountTotal = discountTotal; - this.postageTotal = postageTotal; - this.presentTotal = presentTotal; - } - - } - - /** - * 邮费信息 TODO 芋艿,未完成 - */ - @Data - @Accessors(chain = true) - public static class Postage { - - /** - * 需要满足多少钱,可以包邮。单位:分 - */ - private Integer threshold; - - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java deleted file mode 100644 index d963db314..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderConfirmCreateInfoRespVO.java +++ /dev/null @@ -1,216 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import cn.iocoder.mall.promotion.api.rpc.activity.dto.PromotionActivityRespDTO; -import cn.iocoder.mall.promotion.api.rpc.coupon.dto.card.CouponCardAvailableRespDTO; -import cn.iocoder.mall.shopweb.controller.trade.vo.cart.CartDetailVO; -import cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO; -import io.swagger.annotations.ApiModel; -import lombok.Data; -import lombok.experimental.Accessors; - -import java.util.List; - -@ApiModel(value = "订单确认创建信息 Response VO") // TODO 芋艿:swagger 文档完善 -@Data -@Accessors(chain = true) // TODO 芋艿:和 CartDetailVO、ProductSkuCalcPriceRespVO 有点重复,后续要优化下; -public class TradeOrderConfirmCreateInfoRespVO { - - /** - * 商品分组数组 - */ - private List itemGroups; - /** - * 费用 - */ - private Fee fee; - - /** - * 优惠劵列表 TODO 芋艿,后续改改 - */ - private List couponCards; - - /** - * 商品分组 - * - * 多个商品,参加同一个活动,从而形成分组。 - */ - @Data - @Accessors(chain = true) - public static class ItemGroup { - - /** - * 优惠活动 - */ - private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒 - /** - * 促销减少的金额 - * - * 1. 若未参与促销活动,或不满足促销条件,返回 null - * 2. 该金额,已经分摊到每个 Item 的 discountTotal ,需要注意。 - */ - private Integer activityDiscountTotal; - /** - * 商品数组 - */ - private List items; - - } - - @Data - @Accessors(chain = true) - public static class Sku { - - // SKU 自带信息 - /** - * sku 编号 - */ - private Integer id; - /** - * SPU 信息 - */ - private Spu spu; - /** - * 图片地址 - */ - private String picURL; - /** - * 规格值数组 - */ - private List attrs; // TODO 后面改下 - /** - * 价格,单位:分 - */ - private Integer price; - /** - * 库存数量 - */ - private Integer quantity; - - // 非 SKU 自带信息 - - /** - * 购买数量 - */ - private Integer buyQuantity; - /** - * 优惠活动 - */ - private PromotionActivityRespDTO activity; // TODO 芋艿,偷懒 - /** - * 原始单价,单位:分。 - */ - private Integer originPrice; - /** - * 购买单价,单位:分 - */ - private Integer buyPrice; - /** - * 最终价格,单位:分。 - */ - private Integer presentPrice; - /** - * 购买总金额,单位:分 - * - * 用途类似 {@link #presentTotal} - */ - private Integer buyTotal; - /** - * 优惠总金额,单位:分。 - */ - private Integer discountTotal; - /** - * 最终总金额,单位:分。 - * - * 注意,presentPrice * quantity 不一定等于 presentTotal 。 - * 因为,存在无法整除的情况。 - * 举个例子,presentPrice = 8.33 ,quantity = 3 的情况,presentTotal 有可能是 24.99 ,也可能是 25 。 - * 所以,需要存储一个该字段。 - */ - private Integer presentTotal; - - } - - @Data - @Accessors(chain = true) - public static class Spu { - - /** - * SPU 编号 - */ - private Integer id; - - // ========== 基本信息 ========= - /** - * SPU 名字 - */ - private String name; - /** - * 分类编号 - */ - private Integer cid; - /** - * 商品主图地址 - * - * 数组,以逗号分隔 - * - * 建议尺寸:800*800像素,你可以拖拽图片调整顺序,最多上传15张 - */ - private List picUrls; - - } - - /** - * 费用(合计) - */ - @Data - @Accessors(chain = true) - public static class Fee { - - /** - * 购买总价 - */ - private Integer buyTotal; - /** - * 优惠总价 - * - * 注意,满多少元包邮,不算在优惠中。 - */ - private Integer discountTotal; - /** - * 邮费 - */ - private Integer postageTotal; - /** - * 最终价格 - * - * 计算公式 = 总价 - 优惠总价 + 邮费 - */ - private Integer presentTotal; - - public Fee() { - } - - public Fee(Integer buyTotal, Integer discountTotal, Integer postageTotal, Integer presentTotal) { - this.buyTotal = buyTotal; - this.discountTotal = discountTotal; - this.postageTotal = postageTotal; - this.presentTotal = presentTotal; - } - - } - - /** - * 邮费信息 TODO 芋艿,未完成 - */ - @Data - @Accessors(chain = true) - public static class Postage { - - /** - * 需要满足多少钱,可以包邮。单位:分 - */ - private Integer threshold; - - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java deleted file mode 100644 index 9bab1073b..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateFromCartReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.NotNull; - -@ApiModel(value = "创建交易订单 VO,基于购物车") -@Data -@Accessors(chain = true) -public class TradeOrderCreateFromCartReqVO { - - @ApiModelProperty(name = "收件地址编号", required = true, example = "1") - @NotNull(message = "用户地址不能为空") - private Integer userAddressId; - @ApiModelProperty(name = "优惠劵编号", example = "1024") - private Integer couponCardId; - @ApiModelProperty(name = "备注", example = "1024") - private String remark; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java deleted file mode 100644 index 346bd7692..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderCreateReqVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.experimental.Accessors; - -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import java.util.List; - -@ApiModel(value = "创建交易订单 VO,基于商品") -@Data -@Accessors(chain = true) -public class TradeOrderCreateReqVO { - - @ApiModelProperty(name = "收件地址编号", required = true, example = "1") - @NotNull(message = "收件地址不能为空") - private Integer userAddressId; - @ApiModelProperty(name = "优惠劵编号", example = "1024") - private Integer couponCardId; - @ApiModelProperty(name = "备注", example = "1024") - private String remark; - - /** - * 订单商品项列表 - */ - @NotNull(message = "必须选择购买的商品") - private List orderItems; - - @ApiModel(value = "订单商品项") - @Data - @Accessors(chain = true) - public static class OrderItem { - - @ApiModelProperty(name = "商品 SKU 编号", required = true, example = "111") - @NotNull(message = "商品 SKU 编号不能为空") - private Integer skuId; - @ApiModelProperty(name = "商品 SKU 购买数量", required = true, example = "1024") - @NotNull(message = "商品 SKU 购买数量不能为空") - @Min(value = 1, message = "商品 SKU 购买数量必须大于 0") - private Integer quantity; - } - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderItemRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderItemRespVO.java deleted file mode 100644 index 2dd9de216..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderItemRespVO.java +++ /dev/null @@ -1,53 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.util.Date; - -@ApiModel("交易订单项 Response VO") -@Data -public class TradeOrderItemRespVO { - - @ApiModelProperty(value = "id自增长", required = true) - private Integer id; - @ApiModelProperty(value = "订单编号", required = true) - private Integer orderId; - @ApiModelProperty(value = "订单项状态", required = true) - private Integer status; - @ApiModelProperty(value = "商品 SKU 编号", required = true) - private Integer skuId; - @ApiModelProperty(value = "商品 SPU 编号", required = true) - private Integer spuId; - @ApiModelProperty(value = "商品名字", required = true) - private String skuName; - @ApiModelProperty(value = "图片名字", required = true) - private String skuImage; - @ApiModelProperty(value = "商品数量", required = true) - private Integer quantity; - @ApiModelProperty(value = "原始单价,单位:分", required = true) - private Integer originPrice; - @ApiModelProperty(value = "购买单价,单位:分", required = true) - private Integer buyPrice; - @ApiModelProperty(value = "最终价格,单位:分", required = true) - private Integer presentPrice; - @ApiModelProperty(value = "购买总金额,单位:分", required = true) - private Integer buyTotal; - @ApiModelProperty(value = "优惠总金额,单位:分", required = true) - private Integer discountTotal; - @ApiModelProperty(value = "最终总金额,单位:分", required = true) - private Integer presentTotal; - @ApiModelProperty(value = "退款总金额,单位:分", required = true) - private Integer refundTotal; - @ApiModelProperty(value = "物流id") - private Integer logisticsId; - @ApiModelProperty(value = "售后状态", required = true) - private Integer afterSaleStatus; - @ApiModelProperty(value = "售后订单编号") - private Integer afterSaleOrderId; - @ApiModelProperty(value = "创建时间", required = true) - private Date createTime; - - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderPageReqVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderPageReqVO.java deleted file mode 100644 index cacc25cd9..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderPageReqVO.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import lombok.EqualsAndHashCode; - -@ApiModel("交易订单分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -public class TradeOrderPageReqVO extends PageParam { - - @ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举") - private Integer orderStatus; - -} diff --git a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderRespVO.java b/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderRespVO.java deleted file mode 100644 index 427fe9aa9..000000000 --- a/归档/shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/trade/vo/order/TradeOrderRespVO.java +++ /dev/null @@ -1,70 +0,0 @@ -package cn.iocoder.mall.shopweb.controller.trade.vo.order; - -import lombok.*; -import io.swagger.annotations.*; -import java.util.*; - -@ApiModel("订单交易 Response VO") -@Data -public class TradeOrderRespVO { - - @ApiModelProperty(value = "订单编号", required = true) - private Integer id; - @ApiModelProperty(value = "用户编号", required = true) - private Integer userId; - @ApiModelProperty(value = "订单单号", required = true) - private String orderNo; - @ApiModelProperty(value = "订单状态", required = true) - private Integer orderStatus; - @ApiModelProperty(value = "备注") - private String remark; - @ApiModelProperty(value = "订单结束时间") - private Date endTime; - @ApiModelProperty(value = "订单金额(总金额),单位:分", required = true) - private Integer buyPrice; - @ApiModelProperty(value = "优惠总金额,单位:分", required = true) - private Integer discountPrice; - @ApiModelProperty(value = "物流金额,单位:分", required = true) - private Integer logisticsPrice; - @ApiModelProperty(value = "最终金额,单位:分", required = true) - private Integer presentPrice; - @ApiModelProperty(value = "支付金额,单位:分", required = true) - private Integer payPrice; - @ApiModelProperty(value = "退款金额,单位:分", required = true) - private Integer refundPrice; - @ApiModelProperty(value = "付款时间") - private Date payTime; - @ApiModelProperty(value = "支付订单编号") - private Integer payTransactionId; - @ApiModelProperty(value = "支付渠道") - private Integer payChannel; - @ApiModelProperty(value = "配送类型", required = true) - private Integer deliveryType; - @ApiModelProperty(value = "发货时间") - private Date deliveryTime; - @ApiModelProperty(value = "收货时间") - private Date receiveTime; - @ApiModelProperty(value = "收件人名称", required = true) - private String receiverName; - @ApiModelProperty(value = "手机号", required = true) - private String receiverMobile; - @ApiModelProperty(value = "地区编码", required = true) - private Integer receiverAreaCode; - @ApiModelProperty(value = "收件详细地址", required = true) - private String receiverDetailAddress; - @ApiModelProperty(value = "售后状态", required = true) - private Integer afterSaleStatus; - @ApiModelProperty(value = "优惠劵编号") - private Integer couponCardId; - @ApiModelProperty(value = "创建时间", required = true) - private Date createTime; - - /** - * 订单项数组 - * - * // TODO 芋艿,后续考虑怎么优化下,目前是内嵌了别的 dto - */ - private List orderItems; - - -}