Commit 666ba351a26950e30523e30b2d46438a18c9eca9
1 parent
3c643f81
trade:退款理由的维护
Showing
6 changed files
with
37 additions
and
18 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/config/vo/TradeConfigBaseVO.java
| @@ -19,6 +19,19 @@ import java.util.List; | @@ -19,6 +19,19 @@ import java.util.List; | ||
| 19 | */ | 19 | */ |
| 20 | @Data | 20 | @Data |
| 21 | public class TradeConfigBaseVO { | 21 | public class TradeConfigBaseVO { |
| 22 | + | ||
| 23 | + // ========== 售后相关 ========== | ||
| 24 | + | ||
| 25 | + @Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 26 | + @NotEmpty(message = "售后的退款理由不能为空") | ||
| 27 | + private List<String> afterSaleRefundReasons; | ||
| 28 | + | ||
| 29 | + @Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 30 | + @NotEmpty(message = "售后的退货理由不能为空") | ||
| 31 | + private List<String> afterSaleReturnReasons; | ||
| 32 | + | ||
| 33 | + // ========== 配送相关 ========== | ||
| 34 | + | ||
| 22 | /** | 35 | /** |
| 23 | * 是否启用全场包邮 | 36 | * 是否启用全场包邮 |
| 24 | */ | 37 | */ |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java
| @@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSa | @@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.trade.controller.app.aftersale.vo.AppTradeAfterSa | ||
| 9 | import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; | 9 | import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; |
| 10 | import cn.iocoder.yudao.module.trade.enums.aftersale.AfterSaleOperateTypeEnum; | 10 | import cn.iocoder.yudao.module.trade.enums.aftersale.AfterSaleOperateTypeEnum; |
| 11 | import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum; | 11 | import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum; |
| 12 | -import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum; | ||
| 13 | import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.annotations.AfterSaleLog; | 12 | import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.annotations.AfterSaleLog; |
| 14 | import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.util.AfterSaleLogUtils; | 13 | import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.util.AfterSaleLogUtils; |
| 15 | import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; | 14 | import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; |
| @@ -21,9 +20,6 @@ import org.springframework.validation.annotation.Validated; | @@ -21,9 +20,6 @@ import org.springframework.validation.annotation.Validated; | ||
| 21 | import org.springframework.web.bind.annotation.*; | 20 | import org.springframework.web.bind.annotation.*; |
| 22 | 21 | ||
| 23 | import javax.annotation.Resource; | 22 | import javax.annotation.Resource; |
| 24 | -import java.util.Arrays; | ||
| 25 | -import java.util.List; | ||
| 26 | -import java.util.Objects; | ||
| 27 | 23 | ||
| 28 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 24 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 29 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | 25 | import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; |
| @@ -58,17 +54,6 @@ public class AppTradeAfterSaleController { | @@ -58,17 +54,6 @@ public class AppTradeAfterSaleController { | ||
| 58 | return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId())); | 54 | return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId())); |
| 59 | } | 55 | } |
| 60 | 56 | ||
| 61 | - // TODO 芋艿:待实现 | ||
| 62 | - @GetMapping(value = "/get-reason-list") | ||
| 63 | - @Operation(summary = "获得售后原因") | ||
| 64 | - @Parameter(name = "way", description = "售后类型", required = true, example = "10") | ||
| 65 | - public CommonResult<List<String>> getAfterSaleReasonList(@RequestParam("way") Integer way) { | ||
| 66 | - if (Objects.equals(TradeAfterSaleWayEnum.REFUND.getWay(), way)) { | ||
| 67 | - return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符")); | ||
| 68 | - } | ||
| 69 | - return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符", "商品错发漏发", "商品包装破损")); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | @PostMapping(value = "/create") | 57 | @PostMapping(value = "/create") |
| 73 | @Operation(summary = "申请售后") | 58 | @Operation(summary = "申请售后") |
| 74 | @AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE) | 59 | @AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE) |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/vo/AppTradeConfigRespVO.java
| @@ -9,6 +9,16 @@ import java.util.List; | @@ -9,6 +9,16 @@ import java.util.List; | ||
| 9 | @Data | 9 | @Data |
| 10 | public class AppTradeConfigRespVO { | 10 | public class AppTradeConfigRespVO { |
| 11 | 11 | ||
| 12 | + // ========== 售后相关 ========== | ||
| 13 | + | ||
| 14 | + @Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 15 | + private List<String> afterSaleRefundReasons; | ||
| 16 | + | ||
| 17 | + @Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED) | ||
| 18 | + private List<String> afterSaleReturnReasons; | ||
| 19 | + | ||
| 20 | + // ========== 分销相关 ========== | ||
| 21 | + | ||
| 12 | @Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED) | 22 | @Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED) |
| 13 | private List<String> brokeragePosterUrls; | 23 | private List<String> brokeragePosterUrls; |
| 14 | 24 |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/config/TradeConfigDO.java
| @@ -35,6 +35,19 @@ public class TradeConfigDO extends BaseDO { | @@ -35,6 +35,19 @@ public class TradeConfigDO extends BaseDO { | ||
| 35 | @TableId | 35 | @TableId |
| 36 | private Long id; | 36 | private Long id; |
| 37 | 37 | ||
| 38 | + // ========== 售后相关 ========== | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 售后的退款理由 | ||
| 42 | + */ | ||
| 43 | + @TableField(typeHandler = JacksonTypeHandler.class) | ||
| 44 | + private List<String> afterSaleRefundReasons; | ||
| 45 | + /** | ||
| 46 | + * 售后的退货理由 | ||
| 47 | + */ | ||
| 48 | + @TableField(typeHandler = JacksonTypeHandler.class) | ||
| 49 | + private List<String> afterSaleReturnReasons; | ||
| 50 | + | ||
| 38 | // ========== 配送相关 ========== | 51 | // ========== 配送相关 ========== |
| 39 | 52 | ||
| 40 | /** | 53 | /** |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java
| @@ -125,12 +125,10 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa | @@ -125,12 +125,10 @@ public class TradeAfterSaleServiceImpl implements TradeAfterSaleService, AfterSa | ||
| 125 | if (orderItem == null) { | 125 | if (orderItem == null) { |
| 126 | throw exception(ORDER_ITEM_NOT_FOUND); | 126 | throw exception(ORDER_ITEM_NOT_FOUND); |
| 127 | } | 127 | } |
| 128 | - | ||
| 129 | // 已申请售后,不允许再发起售后申请 | 128 | // 已申请售后,不允许再发起售后申请 |
| 130 | if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) { | 129 | if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) { |
| 131 | throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED); | 130 | throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED); |
| 132 | } | 131 | } |
| 133 | - | ||
| 134 | // 申请的退款金额,不能超过商品的价格 | 132 | // 申请的退款金额,不能超过商品的价格 |
| 135 | if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) { | 133 | if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) { |
| 136 | throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR); | 134 | throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR); |
yudao-server/src/main/resources/application-local.yaml
| @@ -9,7 +9,7 @@ spring: | @@ -9,7 +9,7 @@ spring: | ||
| 9 | exclude: | 9 | exclude: |
| 10 | - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 | 10 | - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 |
| 11 | - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置 | 11 | - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置 |
| 12 | -# - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置 | 12 | + - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置 |
| 13 | - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置 | 13 | - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置 |
| 14 | - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置 | 14 | - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置 |
| 15 | - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置 | 15 | - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置 |