Browse Source

mall:售后分页接口的 mock

YunaiV 2 years ago
parent
commit
3672c217f8

+ 50 - 0
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java

@@ -1,8 +1,11 @@
 package cn.iocoder.yudao.module.trade.controller.app.aftersale;
 
 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO;
 import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleDeliveryReqVO;
+import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSalePageItemRespVO;
+import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO;
 import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -12,6 +15,8 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
+import java.util.Arrays;
 
 import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@@ -26,6 +31,51 @@ public class AppTradeAfterSaleController {
     @Resource
     private TradeAfterSaleService afterSaleService;
 
+    // TODO 芋艿:待实现
+    @GetMapping(value = "/page")
+    @Operation(summary = "获得售后分页")
+    public CommonResult<PageResult<AppTradeAfterSalePageItemRespVO>> getAfterSalePage() {
+        AppTradeAfterSalePageItemRespVO vo = new AppTradeAfterSalePageItemRespVO();
+        vo.setId(1L);
+        vo.setNo("1146347329394184195");
+        vo.setStatus(61);
+        vo.setWay(10);
+        vo.setType(10);
+        vo.setApplyReason("不想要了");
+        vo.setApplyDescription("这个商品我不喜欢,想退款");
+        vo.setApplyPicUrls(Arrays.asList("pic_url_1", "pic_url_2", "pic_url_3"));
+
+        // 设置订单相关信息
+        vo.setOrderId(2001L);
+        vo.setOrderNo("23456789009876");
+        vo.setOrderItemId(3001L);
+        vo.setSpuId(4001L);
+        vo.setSpuName("商品名");
+        vo.setSkuId(5001L);
+        vo.setProperties(Arrays.asList(
+                new AppProductPropertyValueDetailRespVO().setPropertyId(6001L).setPropertyName("颜色").setValueId(7001L).setValueName("红色"),
+                new AppProductPropertyValueDetailRespVO().setPropertyId(6002L).setPropertyName("尺寸").setValueId(7002L).setValueName("XL")));
+        vo.setPicUrl("https://cdn.pixabay.com/photo/2022/12/06/06/21/lavender-7638368_1280.jpg");
+        vo.setCount(2);
+
+        // 设置审批相关信息
+        vo.setAuditReason("审核通过");
+
+        // 设置退款相关信息
+        vo.setRefundPrice(1000);
+        vo.setRefundTime(LocalDateTime.now());
+
+        // 设置退货相关信息
+        vo.setLogisticsId(7001L);
+        vo.setLogisticsNo("LAGN101010101001");
+        vo.setDeliveryTime(LocalDateTime.now());
+        vo.setReceiveTime(LocalDateTime.now());
+        vo.setReceiveReason("收货正常");
+
+        return success(new PageResult<>(Arrays.asList(vo), 1L));
+//        return success(afterSaleService.getAfterSalePage(getLoginUserId()));
+    }
+
     @PostMapping(value = "/create")
     @Operation(summary = "申请售后")
     public CommonResult<Long> createAfterSale(@RequestBody AppTradeAfterSaleCreateReqVO createReqVO) {

+ 103 - 0
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSalePageItemRespVO.java

@@ -0,0 +1,103 @@
+package cn.iocoder.yudao.module.trade.controller.app.aftersale.vo;
+
+import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Schema(description = "用户 App - 交易售后的分页项 Request VO")
+@Data
+public class AppTradeAfterSalePageItemRespVO {
+
+    @Schema(description = "售后编号", required = true, example = "1024")
+    private Long id;
+
+    @Schema(description = "售后流水号", required = true, example = "1146347329394184195")
+    private String no;
+
+    @Schema(description = "售后状态", required = true, example = "1")
+    private Integer status;
+
+    @Schema(description = "售后方式", required = true, example = "1")
+    private Integer way;
+
+    @Schema(description = "售后类型", required = true, example = "1")
+    private Integer type;
+
+    @Schema(description = "申请原因", required = true, example = "1")
+    private String applyReason;
+
+    @Schema(description = "补充描述", required = true, example = "1")
+    private String applyDescription;
+
+    @Schema(description = "补充凭证图片", required = true, example = "1")
+    private List<String> applyPicUrls;
+
+    // ========== 交易订单相关 ==========
+
+    @Schema(description = "交易订单编号", required = true, example = "1")
+    private Long orderId;
+
+    @Schema(description = "交易订单流水号", required = true, example = "1")
+    private String orderNo;
+
+    @Schema(description = "交易订单项编号", required = true, example = "1")
+    private Long orderItemId;
+
+    @Schema(description = "商品 SPU 编号", required = true, example = "1")
+    private Long spuId;
+
+    @Schema(description = "商品 SPU 名称", required = true, example = "1")
+    private String spuName;
+
+    @Schema(description = "商品 SKU 编号", required = true, example = "1")
+    private Long skuId;
+
+    /**
+     * 属性数组
+     */
+    private List<AppProductPropertyValueDetailRespVO> properties;
+
+    @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/01.jpg")
+    private String picUrl;
+
+    @Schema(description = "退货商品数量", required = true, example = "1")
+    private Integer count;
+
+    // ========== 审批相关 ==========
+
+    /**
+     * 审批备注
+     *
+     * 注意,只有审批不通过才会填写
+     */
+    private String auditReason;
+
+    // ========== 退款相关 ==========
+
+    @Schema(description = "退款金额,单位:分", example = "100")
+    private Integer refundPrice;
+
+    @Schema(description = "退款时间")
+    private LocalDateTime refundTime;
+
+    // ========== 退货相关 ==========
+
+    @Schema(description = "退货物流公司编号", example = "1")
+    private Long logisticsId;
+
+    @Schema(description = "退货物流单号", example = "SF123456789")
+    private String logisticsNo;
+
+    @Schema(description = "退货时间")
+    private LocalDateTime deliveryTime;
+
+    @Schema(description = "收货时间")
+    private LocalDateTime receiveTime;
+
+    @Schema(description = "收货备注")
+    private String receiveReason;
+
+}