diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/config/vo/TradeConfigBaseVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/config/vo/TradeConfigBaseVO.java index 259948314..5531a3ace 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/config/vo/TradeConfigBaseVO.java +++ b/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; */ @Data public class TradeConfigBaseVO { + + // ========== 售后相关 ========== + + @Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "售后的退款理由不能为空") + private List afterSaleRefundReasons; + + @Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED) + @NotEmpty(message = "售后的退货理由不能为空") + private List afterSaleReturnReasons; + + // ========== 配送相关 ========== + /** * 是否启用全场包邮 */ diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java index 62e18f5a6..eaf6a1b62 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/aftersale/AppTradeAfterSaleController.java +++ b/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 import cn.iocoder.yudao.module.trade.convert.aftersale.TradeAfterSaleConvert; import cn.iocoder.yudao.module.trade.enums.aftersale.AfterSaleOperateTypeEnum; import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleStatusEnum; -import cn.iocoder.yudao.module.trade.enums.aftersale.TradeAfterSaleWayEnum; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.annotations.AfterSaleLog; import cn.iocoder.yudao.module.trade.framework.aftersalelog.core.util.AfterSaleLogUtils; import cn.iocoder.yudao.module.trade.service.aftersale.TradeAfterSaleService; @@ -21,9 +20,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @@ -58,17 +54,6 @@ public class AppTradeAfterSaleController { return success(afterSaleService.getApplyingAfterSaleCount(getLoginUserId())); } - // TODO 芋艿:待实现 - @GetMapping(value = "/get-reason-list") - @Operation(summary = "获得售后原因") - @Parameter(name = "way", description = "售后类型", required = true, example = "10") - public CommonResult> getAfterSaleReasonList(@RequestParam("way") Integer way) { - if (Objects.equals(TradeAfterSaleWayEnum.REFUND.getWay(), way)) { - return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符")); - } - return success(Arrays.asList("不想要了", "商品质量问题", "商品描述不符", "商品错发漏发", "商品包装破损")); - } - @PostMapping(value = "/create") @Operation(summary = "申请售后") @AfterSaleLog(id = "#info.data", content = "'申请售后:售后编号['+#info.data+'],订单编号['+#createReqVO.orderItemId+'], '", operateType = AfterSaleOperateTypeEnum.MEMBER_CREATE) diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/vo/AppTradeConfigRespVO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/vo/AppTradeConfigRespVO.java index 0d590f834..a9515f609 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/config/vo/AppTradeConfigRespVO.java +++ b/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; @Data public class AppTradeConfigRespVO { + // ========== 售后相关 ========== + + @Schema(description = "售后的退款理由", requiredMode = Schema.RequiredMode.REQUIRED) + private List afterSaleRefundReasons; + + @Schema(description = "售后的退货理由", requiredMode = Schema.RequiredMode.REQUIRED) + private List afterSaleReturnReasons; + + // ========== 分销相关 ========== + @Schema(description = "分销海报地址数组", requiredMode = Schema.RequiredMode.REQUIRED) private List brokeragePosterUrls; diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/config/TradeConfigDO.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/config/TradeConfigDO.java index 01de52b5b..f5b20d4c5 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/config/TradeConfigDO.java +++ b/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 { @TableId private Long id; + // ========== 售后相关 ========== + + /** + * 售后的退款理由 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List afterSaleRefundReasons; + /** + * 售后的退货理由 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List afterSaleReturnReasons; + // ========== 配送相关 ========== /** diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java index ed1e87c94..cce494e07 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/aftersale/TradeAfterSaleServiceImpl.java +++ b/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 if (orderItem == null) { throw exception(ORDER_ITEM_NOT_FOUND); } - // 已申请售后,不允许再发起售后申请 if (!TradeOrderItemAfterSaleStatusEnum.isNone(orderItem.getAfterSaleStatus())) { throw exception(AFTER_SALE_CREATE_FAIL_ORDER_ITEM_APPLIED); } - // 申请的退款金额,不能超过商品的价格 if (createReqVO.getRefundPrice() > orderItem.getPayPrice()) { throw exception(AFTER_SALE_CREATE_FAIL_REFUND_PRICE_ERROR); diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index f9a13a786..2908a4166 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -9,7 +9,7 @@ spring: exclude: - com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源 - org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration # 排除积木报表带来的 MongoDB 的自动配置 -# - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置 + - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置 - de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置 - de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置 - de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置