diff --git a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java index cb9e530b7..e698bb76a 100644 --- a/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java +++ b/yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/enums/TerminalEnum.java @@ -15,10 +15,9 @@ import java.util.Arrays; @Getter public enum TerminalEnum implements IntArrayValuable { - //TODO terminal 重复,请参考 '订单来源终端:[1:小程序 2:H5 3:iOS 4:安卓]' MINI_PROGRAM(1, "小程序"), H5(2, "H5"), - IOS(3, "iOS"), + IOS(3, "苹果"), ANDROID(3, "安卓"),; public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray(); diff --git a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderStatusEnum.java b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderStatusEnum.java index bf5686ba3..06fc3821e 100644 --- a/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderStatusEnum.java +++ b/yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderStatusEnum.java @@ -17,12 +17,11 @@ import java.util.Arrays; @Getter public enum TradeOrderStatusEnum implements IntArrayValuable { - UNPAID(0, "未付款"), - PAID(10, "已付款"), // 例如说,拼团订单,支付后,需要拼团成功后,才会处于待发货 - UNDELIVERED(20, "待发货"), - DELIVERED(30, "已发货"), - COMPLETED(40, "已完成"), - CANCELED(50, "已取消"); + UNPAID(0, "待支付"), + UNDELIVERED(10, "待发货"), + DELIVERED(20, "已发货"), + COMPLETED(30, "已完成"), + CANCELED(40, "已取消"); // TODO 芋艿: TAKE("待核验"):虚拟订单需要核验商品 @@ -55,16 +54,6 @@ public enum TradeOrderStatusEnum implements IntArrayValuable { return ObjectUtil.equal(UNPAID.getStatus(), status); } - /** - * 判断指定状态,是否正处于【已支付】状态 - * - * @param status 指定状态 - * @return 是否 - */ - public static boolean isPaid(Integer status) { - return ObjectUtil.equal(PAID.getStatus(), status); - } - /** * 判断指定状态,是否正处于【待发货】状态 * @@ -112,7 +101,7 @@ public enum TradeOrderStatusEnum implements IntArrayValuable { * @return 是否 */ public static boolean havePaid(Integer status) { - return ObjectUtils.equalsAny(status, PAID.getStatus(), UNDELIVERED.getStatus(), + return ObjectUtils.equalsAny(status, UNDELIVERED.getStatus(), DELIVERED.getStatus(), COMPLETED.getStatus()); } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java index cd9846aa8..74f0e4f67 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/aftersale/vo/TradeAfterSaleBaseVO.java @@ -1,6 +1,6 @@ package cn.iocoder.yudao.module.trade.controller.admin.aftersale.vo; -import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyRespVO; +import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -73,7 +73,7 @@ public class TradeAfterSaleBaseVO { private Long skuId; @ApiModelProperty(value = "规格值数组") - private List properties; + private List properties; @ApiModelProperty(value = "商品图片", example = "https://www.iocoder.cn/2.png") private String picUrl; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java deleted file mode 100644 index bea9c8c79..000000000 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyRespVO.java +++ /dev/null @@ -1,17 +0,0 @@ -package cn.iocoder.yudao.module.trade.controller.admin.base.product.property; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@ApiModel("管理后台 - 商品规格 Response VO") -@Data -public class ProductPropertyRespVO { - - @ApiModelProperty(value = "属性编号", required = true, example = "1") - private Long propertyId; - - @ApiModelProperty(value = "属性值编号", required = true, example = "2") - private Long valueId; - -} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java new file mode 100644 index 000000000..1a9a4c564 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/base/product/property/ProductPropertyValueDetailRespVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.trade.controller.admin.base.product.property; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@ApiModel("管理后台 - 商品规格 + 规格值的明细 Response VO") +@Data +public class ProductPropertyValueDetailRespVO { + + @ApiModelProperty(value = "属性的编号", required = true, example = "1") + private Long propertyId; + + @ApiModelProperty(value = "属性的名称", required = true, example = "颜色") + private String propertyName; + + @ApiModelProperty(value = "属性值的编号", required = true, example = "1024") + private Long valueId; + + @ApiModelProperty(value = "属性值的名称", required = true, example = "红色") + private String valueName; + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java index 47b6dace8..c45dc6bdd 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java @@ -1,18 +1,18 @@ package cn.iocoder.yudao.module.trade.controller.admin.order; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; +import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageItemRespVO; +import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO; +import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.service.order.TradeOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -29,6 +29,14 @@ public class TradeOrderController { @Resource private TradeOrderService tradeOrderService; + @GetMapping("/page") + @ApiOperation("获得交易订单分页") + @PreAuthorize("@ss.hasPermission('trade:order:query')") + public CommonResult> getOrderPage(TradeOrderPageReqVO reqVO) { + PageResult pageResult = tradeOrderService.getOrderPage(reqVO); + return success(null); + } + @PostMapping("/delivery") @ApiOperation("发货订单") @PreAuthorize("@ss.hasPermission('trade:order:delivery')") diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java new file mode 100755 index 000000000..5b7bdef39 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderBaseVO.java @@ -0,0 +1,142 @@ +package cn.iocoder.yudao.module.trade.controller.admin.order.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.Date; + +/** +* 交易订单 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class TradeOrderBaseVO { + + // ========== 订单基本信息 ========== + + @ApiModelProperty(value = "订单编号", required = true, example = "1024") + private Long id; + + @ApiModelProperty(value = "订单流水号", required = true, example = "1146347329394184195") + private String no; + + @ApiModelProperty(value = "创建时间", required = true, notes = "下单时间") + private Date createTime; + + @ApiModelProperty(value = "订单来源", required = true, example = "1", notes = "参见 TerminalEnum 枚举") + private Integer terminal; + + @ApiModelProperty(value = "用户编号", required = true, example = "2048") + private Long userId; + + @ApiModelProperty(value = "用户 IP", required = true, example = "127.0.0.1") + private String userIp; + + @ApiModelProperty(value = "用户备注", required = true, example = "你猜") + private String userRemark; + + @ApiModelProperty(value = "订单状态", required = true, example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + private Integer status; + + @ApiModelProperty(value = "购买的商品数量", required = true, example = "10") + private Integer productCount; + + @ApiModelProperty(value = "订单完成时间") + private LocalDateTime finishTime; + + @ApiModelProperty(value = "订单取消时间") + private LocalDateTime cancelTime; + + @ApiModelProperty(value = "取消类型", example = "10", notes = "参见 TradeOrderCancelTypeEnum 枚举") + private Integer cancelType; + + @ApiModelProperty(value = "商家备注", example = "你猜一下") + private String remark; + + // ========== 价格 + 支付基本信息 ========== + + @ApiModelProperty(value = "支付订单编号", required = true, example = "1024") + private Long payOrderId; + + @ApiModelProperty(value = "是否已支付", required = true, example = "true") + private Boolean payed; + + @ApiModelProperty(value = "付款时间") + private LocalDateTime payTime; + + @ApiModelProperty(value = "支付渠道", required = true, example = "wx_lite", notes = "参见 PayChannelEnum 枚举") + private String payChannelCode; + + @ApiModelProperty(value = "商品原价(总)", required = true, example = "1000", notes = "单位:分") + private Integer originalPrice; + + @ApiModelProperty(value = "订单原价(总)", required = true, example = "1000", notes = "单位:分") + private Integer orderPrice; + + @ApiModelProperty(value = "订单优惠(总)", required = true, example = "100", notes = "单位:分") + private Integer discountPrice; + + @ApiModelProperty(value = "运费金额", required = true, example = "100", notes = "单位:分") + private Integer deliveryPrice; + + @ApiModelProperty(value = "订单调价(总)", required = true, example = "100", notes = "单位:分") + private Integer adjustPrice; + + @ApiModelProperty(value = "应付金额(总)", required = true, example = "1000", notes = "单位:分") + private Integer payPrice; + + // ========== 收件 + 物流基本信息 ========== + + @ApiModelProperty(value = "配送模板编号", example = "1024") + private Long deliveryTemplateId; + + @ApiModelProperty(value = "发货物流公司编号", example = "1024") + private Long logisticsId; + + @ApiModelProperty(value = "发货物流单号", example = "1024") + private String logisticsNo; + + @ApiModelProperty(value = "发货状态", required = true, example = "1", notes = "参见 TradeOrderDeliveryStatusEnum 枚举") + private Integer deliveryStatus; + + @ApiModelProperty(value = "发货时间") + private LocalDateTime deliveryTime; + + @ApiModelProperty(value = "收货时间") + private LocalDateTime receiveTime; + + @ApiModelProperty(value = "收件人名称", required = true, example = "张三") + private String receiverName; + + @ApiModelProperty(value = "收件人手机", required = true, example = "13800138000") + private String receiverMobile; + + @ApiModelProperty(value = "收件人地区编号", required = true, example = "110000") + private Integer receiverAreaId; + + @ApiModelProperty(value = "收件人邮编", required = true, example = "100000") + private Integer receiverPostCode; + + @ApiModelProperty(value = "收件人详细地址", required = true, example = "中关村大街 1 号") + private String receiverDetailAddress; + + // ========== 售后基本信息 ========== + + @ApiModelProperty(value = "售后状态", example = "1", notes = "参见 TradeOrderAfterSaleStatusEnum 枚举") + private Integer afterSaleStatus; + + @ApiModelProperty(value = "退款金额", required = true, example = "100", notes = "单位:分") + private Integer refundPrice; + + // ========== 营销基本信息 ========== + + @ApiModelProperty(value = "优惠劵编号", example = "1024") + private Long couponId; + + @ApiModelProperty(value = "优惠劵减免金额", required = true, example = "100", notes = "单位:分") + private Integer couponPrice; + + @ApiModelProperty(value = "积分抵扣的金额", required = true, example = "100", notes = "单位:分") + private Integer pointPrice; +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java new file mode 100644 index 000000000..8e55b8ea7 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderItemBaseVO.java @@ -0,0 +1,70 @@ +package cn.iocoder.yudao.module.trade.controller.admin.order.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 交易订单项 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class TradeOrderItemBaseVO { + + // ========== 订单项基本信息 ========== + + @ApiModelProperty(value = "编号", required = true, example = "1") + private Long id; + + @ApiModelProperty(value = "用户编号", required = true, example = "1") + private Long userId; + + @ApiModelProperty(value = "订单编号", required = true, example = "1") + private Long orderId; + + // ========== 商品基本信息 ========== + + @ApiModelProperty(value = "商品 SPU 编号", required = true, example = "1") + private Long spuId; + + @ApiModelProperty(value = "商品 SPU 名称", required = true, example = "芋道源码") + private String spuName; + + @ApiModelProperty(value = "商品 SKU 编号", required = true, example = "1") + private Long skuId; + + @ApiModelProperty(value = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") + private String picUrl; + + @ApiModelProperty(value = "购买数量", required = true, example = "1") + private Integer count; + + // ========== 价格 + 支付基本信息 ========== + + @ApiModelProperty(value = "商品原价(总)", required = true, example = "100", notes = "单位:分") + private Integer originalPrice; + + @ApiModelProperty(value = "商品原价(单)", required = true, example = "100", notes = "单位:分") + private Integer originalUnitPrice; + + @ApiModelProperty(value = "商品优惠(总)", required = true, example = "100", notes = "单位:分") + private Integer discountPrice; + + @ApiModelProperty(value = "商品实付金额(总)", required = true, example = "100", notes = "单位:分") + private Integer payPrice; + + @ApiModelProperty(value = "子订单分摊金额(总)", required = true, example = "100", notes = "单位:分") + private Integer orderPartPrice; + + @ApiModelProperty(value = "分摊后子订单实付金额(总)", required = true, example = "100", notes = "单位:分") + private Integer orderDividePrice; + + // ========== 营销基本信息 ========== + + // TODO 芋艿:在捉摸一下 + + // ========== 售后基本信息 ========== + + @ApiModelProperty(value = "售后状态", required = true, example = "1", notes = "参见 TradeOrderItemAfterSaleStatusEnum 枚举类") + private Integer afterSaleStatus; + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java new file mode 100644 index 000000000..a15836829 --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageItemRespVO.java @@ -0,0 +1,29 @@ +package cn.iocoder.yudao.module.trade.controller.admin.order.vo; + +import cn.iocoder.yudao.module.trade.controller.admin.base.product.property.ProductPropertyValueDetailRespVO; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.List; + +@ApiModel("管理后台 - 交易订单的分页项 Response VO") +@Data +public class TradeOrderPageItemRespVO { + + /** + * 订单项列表 + */ + private List items; + + @ApiModel("管理后台 - 交易订单的分页项的订单项目") + @Data + public static class Item extends TradeOrderItemBaseVO { + + /** + * 规格值数组 + */ + private List properties; + + } + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java new file mode 100644 index 000000000..d1cea288b --- /dev/null +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/vo/TradeOrderPageReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.module.trade.controller.admin.order.vo; + +import cn.iocoder.yudao.framework.common.validation.InEnum; +import cn.iocoder.yudao.module.trade.enums.order.TradeOrderStatusEnum; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@ApiModel("管理后台 - 交易订单的分页 Request VO") +@Data +public class TradeOrderPageReqVO { + + @ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举") + @InEnum(value = TradeOrderStatusEnum.class, message = "订单状态必须是 {value}") + private Integer status; + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java index e116f5888..5e8a45518 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/base/property/AppProductPropertyValueDetailRespVO.java @@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -@ApiModel("用户 App - 规格 + 规格值 Response VO") +@ApiModel("用户 App - 商品规格 + 规格值的明细 Response VO") @Data public class AppProductPropertyValueDetailRespVO { 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 003892512..282040dc5 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 @@ -8,8 +8,8 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderGetCreateInfoRespVO; -import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderPageReqVO; -import cn.iocoder.yudao.module.trade.controller.app.order.vo.TradeOrderRespVO; +import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderPageReqVO; +import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderRespVO; import cn.iocoder.yudao.module.trade.service.order.TradeOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -65,14 +65,14 @@ public class AppTradeOrderController { @GetMapping("/get") @ApiOperation("获得交易订单") @ApiImplicitParam(name = "tradeOrderId", value = "交易订单编号", required = true, dataTypeClass = Long.class) - public CommonResult getTradeOrder(@RequestParam("tradeOrderId") Integer tradeOrderId) { + public CommonResult getTradeOrder(@RequestParam("tradeOrderId") Integer tradeOrderId) { // return success(tradeOrderService.getTradeOrder(tradeOrderId)); return null; } @GetMapping("/page") @ApiOperation("获得订单交易分页") - public CommonResult> pageTradeOrder(TradeOrderPageReqVO pageVO) { + public CommonResult> pageTradeOrder(AppTradeOrderPageReqVO pageVO) { // return success(tradeOrderService.pageTradeOrder(UserSecurityContextHolder.getUserId(), pageVO)); return null; } diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderItemRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderItemRespVO.java similarity index 96% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderItemRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderItemRespVO.java index 354d8386a..74191d980 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderItemRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderItemRespVO.java @@ -6,9 +6,10 @@ import lombok.Data; import java.time.LocalDateTime; +// TODO 芋艿:字段优化 @ApiModel("交易订单项 Response VO") @Data -public class TradeOrderItemRespVO { +public class AppTradeOrderItemRespVO { @ApiModelProperty(value = "id自增长", required = true) private Integer id; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderPageReqVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java similarity index 85% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderPageReqVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java index 5c8b6c872..bec40c1cb 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderPageReqVO.java @@ -6,10 +6,11 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; +// TODO 芋艿:字段优化 @ApiModel("交易订单分页 Request VO") @Data @EqualsAndHashCode(callSuper = true) -public class TradeOrderPageReqVO extends PageParam { +public class AppTradeOrderPageReqVO extends PageParam { @ApiModelProperty(value = "订单状态", example = "1", notes = "参见 TradeOrderStatusEnum 枚举") private Integer orderStatus; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderRespVO.java similarity index 95% rename from yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderRespVO.java rename to yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderRespVO.java index 583edbabc..de569cdde 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/TradeOrderRespVO.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderRespVO.java @@ -6,9 +6,10 @@ import io.swagger.annotations.*; import java.time.LocalDateTime; import java.util.*; +// TODO 芋艿:字段优化 @ApiModel("订单交易 Response VO") @Data -public class TradeOrderRespVO { +public class AppTradeOrderRespVO { @ApiModelProperty(value = "订单编号", required = true) private Integer id; @@ -66,7 +67,7 @@ public class TradeOrderRespVO { * * // TODO 芋艿,后续考虑怎么优化下,目前是内嵌了别的 dto */ - private List orderItems; + private List orderItems; } 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 421bbe355..4be21010d 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 @@ -47,7 +47,7 @@ public class TradeOrderDO extends BaseDO { */ private Integer type; // TODO order_promotion_type /** - * 订单来源终端 + * 订单来源 * * 枚举 {@link TerminalEnum} */ @@ -97,6 +97,10 @@ public class TradeOrderDO extends BaseDO { // ========== 价格 + 支付基本信息 ========== + // 价格文档 - 淘宝:https://open.taobao.com/docV3.htm?docId=108471&docType=1 + // 价格文档 - 京东到家:https://openo2o.jddj.com/api/getApiDetail/182/4d1494c5e7ac4679bfdaaed950c5bc7f.htm + // 价格文档 - 有赞:https://doc.youzanyun.com/detail/API/0/906 + /** * 支付订单编号 * @@ -115,17 +119,12 @@ public class TradeOrderDO extends BaseDO { */ private LocalDateTime payTime; /** - * 支付成功的支付渠道 + * 支付渠道 * * 对应 PayChannelEnum 枚举 */ private String payChannelCode; - // ========== 价格 + 支付基本信息 ========== - // 价格文档 - 淘宝:https://open.taobao.com/docV3.htm?docId=108471&docType=1 - // 价格文档 - 京东到家:https://openo2o.jddj.com/api/getApiDetail/182/4d1494c5e7ac4679bfdaaed950c5bc7f.htm - // 价格文档 - 有赞:https://doc.youzanyun.com/detail/API/0/906 - /** * 商品原价(总),单位:分 * @@ -222,7 +221,7 @@ public class TradeOrderDO extends BaseDO { */ private String receiverDetailAddress; - // ========== 退款基本信息 ========== + // ========== 售后基本信息 ========== /** * 收货状态 * 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 e05eb0d6c..611ea2f66 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 @@ -140,7 +140,7 @@ public class TradeOrderItemDO extends BaseDO { // TODO 芋艿:在捉摸一下 - // ========== 退款基本信息 ========== + // ========== 售后基本信息 ========== /** * 售后状态 * diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderService.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderService.java index 44db9963e..24d342a9e 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderService.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderService.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.trade.service.order; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; +import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO; @@ -58,6 +60,14 @@ public interface TradeOrderService { */ TradeOrderDO getOrder(Long userId, Long id); + /** + * 获得交易订单分页 + * + * @param reqVO 分页请求 + * @return 交易订单 + */ + PageResult getOrderPage(TradeOrderPageReqVO reqVO); + // =================== Order Item =================== /** 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 2beafda23..2bc1564cd 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 @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.core.KeyValue; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.TerminalEnum; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.member.api.address.AddressApi; @@ -25,6 +26,7 @@ import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponUseReqDTO; import cn.iocoder.yudao.module.promotion.api.price.PriceApi; import cn.iocoder.yudao.module.promotion.api.price.dto.PriceCalculateRespDTO; import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderDeliveryReqVO; +import cn.iocoder.yudao.module.trade.controller.admin.order.vo.TradeOrderPageReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO; import cn.iocoder.yudao.module.trade.controller.app.order.vo.AppTradeOrderCreateReqVO.Item; import cn.iocoder.yudao.module.trade.convert.order.TradeOrderConvert; @@ -419,6 +421,11 @@ public class TradeOrderServiceImpl implements TradeOrderService { return order; } + @Override + public PageResult getOrderPage(TradeOrderPageReqVO reqVO) { + return null; + } + // =================== Order Item =================== @Override