Commit 3672c217f84cb917d706f4f8ee371503cf39d636
1 parent
7bfb426a
mall:售后分页接口的 mock
Showing
2 changed files
with
153 additions
and
0 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java
| 1 | package cn.iocoder.yudao.module.trade.controller.app.aftersale; | 1 | package cn.iocoder.yudao.module.trade.controller.app.aftersale; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO; | 5 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleCreateReqVO; |
| 5 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleDeliveryReqVO; | 6 | import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSaleDeliveryReqVO; |
| 7 | +import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSalePageItemRespVO; | ||
| 8 | +import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; | ||
| 6 | import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; | 9 | import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; |
| 7 | import io.swagger.v3.oas.annotations.Operation; | 10 | import io.swagger.v3.oas.annotations.Operation; |
| 8 | import io.swagger.v3.oas.annotations.Parameter; | 11 | import io.swagger.v3.oas.annotations.Parameter; |
| @@ -12,6 +15,8 @@ import org.springframework.validation.annotation.Validated; | @@ -12,6 +15,8 @@ import org.springframework.validation.annotation.Validated; | ||
| 12 | import org.springframework.web.bind.annotation.*; | 15 | import org.springframework.web.bind.annotation.*; |
| 13 | 16 | ||
| 14 | import javax.annotation.Resource; | 17 | import javax.annotation.Resource; |
| 18 | +import java.time.LocalDateTime; | ||
| 19 | +import java.util.Arrays; | ||
| 15 | 20 | ||
| 16 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 21 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 17 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 22 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| @@ -26,6 +31,51 @@ public class AppTradeAfterSaleController { | @@ -26,6 +31,51 @@ public class AppTradeAfterSaleController { | ||
| 26 | @Resource | 31 | @Resource |
| 27 | private TradeAfterSaleService afterSaleService; | 32 | private TradeAfterSaleService afterSaleService; |
| 28 | 33 | ||
| 34 | + // TODO 芋艿:待实现 | ||
| 35 | + @GetMapping(value = "/page") | ||
| 36 | + @Operation(summary = "获得售后分页") | ||
| 37 | + public CommonResult<PageResult<AppTradeAfterSalePageItemRespVO>> getAfterSalePage() { | ||
| 38 | + AppTradeAfterSalePageItemRespVO vo = new AppTradeAfterSalePageItemRespVO(); | ||
| 39 | + vo.setId(1L); | ||
| 40 | + vo.setNo("1146347329394184195"); | ||
| 41 | + vo.setStatus(61); | ||
| 42 | + vo.setWay(10); | ||
| 43 | + vo.setType(10); | ||
| 44 | + vo.setApplyReason("不想要了"); | ||
| 45 | + vo.setApplyDescription("这个商品我不喜欢,想退款"); | ||
| 46 | + vo.setApplyPicUrls(Arrays.asList("pic_url_1", "pic_url_2", "pic_url_3")); | ||
| 47 | + | ||
| 48 | + // 设置订单相关信息 | ||
| 49 | + vo.setOrderId(2001L); | ||
| 50 | + vo.setOrderNo("23456789009876"); | ||
| 51 | + vo.setOrderItemId(3001L); | ||
| 52 | + vo.setSpuId(4001L); | ||
| 53 | + vo.setSpuName("商品名"); | ||
| 54 | + vo.setSkuId(5001L); | ||
| 55 | + vo.setProperties(Arrays.asList( | ||
| 56 | + new AppProductPropertyValueDetailRespVO().setPropertyId(6001L).setPropertyName("颜色").setValueId(7001L).setValueName("红色"), | ||
| 57 | + new AppProductPropertyValueDetailRespVO().setPropertyId(6002L).setPropertyName("尺寸").setValueId(7002L).setValueName("XL"))); | ||
| 58 | + vo.setPicUrl("https://cdn.pixabay.com/photo/2022/12/06/06/21/lavender-7638368_1280.jpg"); | ||
| 59 | + vo.setCount(2); | ||
| 60 | + | ||
| 61 | + // 设置审批相关信息 | ||
| 62 | + vo.setAuditReason("审核通过"); | ||
| 63 | + | ||
| 64 | + // 设置退款相关信息 | ||
| 65 | + vo.setRefundPrice(1000); | ||
| 66 | + vo.setRefundTime(LocalDateTime.now()); | ||
| 67 | + | ||
| 68 | + // 设置退货相关信息 | ||
| 69 | + vo.setLogisticsId(7001L); | ||
| 70 | + vo.setLogisticsNo("LAGN101010101001"); | ||
| 71 | + vo.setDeliveryTime(LocalDateTime.now()); | ||
| 72 | + vo.setReceiveTime(LocalDateTime.now()); | ||
| 73 | + vo.setReceiveReason("收货正常"); | ||
| 74 | + | ||
| 75 | + return success(new PageResult<>(Arrays.asList(vo), 1L)); | ||
| 76 | +// return success(afterSaleService.getAfterSalePage(getLoginUserId())); | ||
| 77 | + } | ||
| 78 | + | ||
| 29 | @PostMapping(value = "/create") | 79 | @PostMapping(value = "/create") |
| 30 | @Operation(summary = "申请售后") | 80 | @Operation(summary = "申请售后") |
| 31 | public CommonResult<Long> createAfterSale(@RequestBody AppTradeAfterSaleCreateReqVO createReqVO) { | 81 | public CommonResult<Long> createAfterSale(@RequestBody AppTradeAfterSaleCreateReqVO createReqVO) { |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/vo/AppTradeAfterSalePageItemRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.trade.controller.app.aftersale.vo; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; | ||
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +@Schema(description = "用户 App - 交易售后的分页项 Request VO") | ||
| 11 | +@Data | ||
| 12 | +public class AppTradeAfterSalePageItemRespVO { | ||
| 13 | + | ||
| 14 | + @Schema(description = "售后编号", required = true, example = "1024") | ||
| 15 | + private Long id; | ||
| 16 | + | ||
| 17 | + @Schema(description = "售后流水号", required = true, example = "1146347329394184195") | ||
| 18 | + private String no; | ||
| 19 | + | ||
| 20 | + @Schema(description = "售后状态", required = true, example = "1") | ||
| 21 | + private Integer status; | ||
| 22 | + | ||
| 23 | + @Schema(description = "售后方式", required = true, example = "1") | ||
| 24 | + private Integer way; | ||
| 25 | + | ||
| 26 | + @Schema(description = "售后类型", required = true, example = "1") | ||
| 27 | + private Integer type; | ||
| 28 | + | ||
| 29 | + @Schema(description = "申请原因", required = true, example = "1") | ||
| 30 | + private String applyReason; | ||
| 31 | + | ||
| 32 | + @Schema(description = "补充描述", required = true, example = "1") | ||
| 33 | + private String applyDescription; | ||
| 34 | + | ||
| 35 | + @Schema(description = "补充凭证图片", required = true, example = "1") | ||
| 36 | + private List<String> applyPicUrls; | ||
| 37 | + | ||
| 38 | + // ========== 交易订单相关 ========== | ||
| 39 | + | ||
| 40 | + @Schema(description = "交易订单编号", required = true, example = "1") | ||
| 41 | + private Long orderId; | ||
| 42 | + | ||
| 43 | + @Schema(description = "交易订单流水号", required = true, example = "1") | ||
| 44 | + private String orderNo; | ||
| 45 | + | ||
| 46 | + @Schema(description = "交易订单项编号", required = true, example = "1") | ||
| 47 | + private Long orderItemId; | ||
| 48 | + | ||
| 49 | + @Schema(description = "商品 SPU 编号", required = true, example = "1") | ||
| 50 | + private Long spuId; | ||
| 51 | + | ||
| 52 | + @Schema(description = "商品 SPU 名称", required = true, example = "1") | ||
| 53 | + private String spuName; | ||
| 54 | + | ||
| 55 | + @Schema(description = "商品 SKU 编号", required = true, example = "1") | ||
| 56 | + private Long skuId; | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 属性数组 | ||
| 60 | + */ | ||
| 61 | + private List<AppProductPropertyValueDetailRespVO> properties; | ||
| 62 | + | ||
| 63 | + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/01.jpg") | ||
| 64 | + private String picUrl; | ||
| 65 | + | ||
| 66 | + @Schema(description = "退货商品数量", required = true, example = "1") | ||
| 67 | + private Integer count; | ||
| 68 | + | ||
| 69 | + // ========== 审批相关 ========== | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * 审批备注 | ||
| 73 | + * | ||
| 74 | + * 注意,只有审批不通过才会填写 | ||
| 75 | + */ | ||
| 76 | + private String auditReason; | ||
| 77 | + | ||
| 78 | + // ========== 退款相关 ========== | ||
| 79 | + | ||
| 80 | + @Schema(description = "退款金额,单位:分", example = "100") | ||
| 81 | + private Integer refundPrice; | ||
| 82 | + | ||
| 83 | + @Schema(description = "退款时间") | ||
| 84 | + private LocalDateTime refundTime; | ||
| 85 | + | ||
| 86 | + // ========== 退货相关 ========== | ||
| 87 | + | ||
| 88 | + @Schema(description = "退货物流公司编号", example = "1") | ||
| 89 | + private Long logisticsId; | ||
| 90 | + | ||
| 91 | + @Schema(description = "退货物流单号", example = "SF123456789") | ||
| 92 | + private String logisticsNo; | ||
| 93 | + | ||
| 94 | + @Schema(description = "退货时间") | ||
| 95 | + private LocalDateTime deliveryTime; | ||
| 96 | + | ||
| 97 | + @Schema(description = "收货时间") | ||
| 98 | + private LocalDateTime receiveTime; | ||
| 99 | + | ||
| 100 | + @Schema(description = "收货备注") | ||
| 101 | + private String receiveReason; | ||
| 102 | + | ||
| 103 | +} |